instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public void update(org.xwiki.rest.model.jaxb.Object obj) throws Exception
{
update(obj, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
update
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
void grantUriPermissionLocked(int callingUid, String targetPkg, GrantUri grantUri,
final int modeFlags, UriPermissionOwner owner, int targetUserId) {
if (targetPkg == null) {
throw new NullPointerException("targetPkg");
}
int targetUid;
final IPackageManager pm = AppGlobals.getPackageManager();
try {
targetUid = pm.getPackageUid(targetPkg, targetUserId);
} catch (RemoteException ex) {
return;
}
targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, modeFlags,
targetUid);
if (targetUid < 0) {
return;
}
grantUriPermissionUncheckedLocked(targetUid, targetPkg, grantUri, modeFlags,
owner);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: grantUriPermissionLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
grantUriPermissionLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
final StandardTemplateParams fillTextsFrom(Builder b) {
Bundle extras = b.mN.extras;
this.title = b.processLegacyText(extras.getCharSequence(EXTRA_TITLE));
this.text = b.processLegacyText(extras.getCharSequence(EXTRA_TEXT));
this.summaryText = extras.getCharSequence(EXTRA_SUB_TEXT);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillTextsFrom
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
fillTextsFrom
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public ActivityImpl[] insertTasksAfter(String procDefId, String procInsId, String targetTaskDefinitionKey, Map<String, Object> variables, String... assignees) {
List<String> assigneeList = new ArrayList<String>();
assigneeList.add(Authentication.getAuthenticatedUserId());
assigneeList.addAll((List<String>)CollectionUtils.arrayToList(assignees));
String[] newAssignees = assigneeList.toArray(new String[0]);
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity)repositoryService.getProcessDefinition(procDefId);
ActivityImpl prototypeActivity = ProcessDefUtils.getActivity(processEngine, processDefinition.getId(), targetTaskDefinitionKey);
return cloneAndMakeChain(processDefinition, procInsId, targetTaskDefinitionKey, prototypeActivity.getOutgoingTransitions().get(0).getDestination().getId(), variables, newAssignees);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: insertTasksAfter
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-34601
|
CRITICAL
| 9.8
|
thinkgem/jeesite
|
insertTasksAfter
|
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
|
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isCurrentUserPage()
{
return this.doc.isCurrentUserPage(getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCurrentUserPage
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
isCurrentUserPage
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
void finishUserStop(UserStartedState uss) {
final int userId = uss.mHandle.getIdentifier();
boolean stopped;
ArrayList<IStopUserCallback> callbacks;
synchronized (this) {
callbacks = new ArrayList<IStopUserCallback>(uss.mStopCallbacks);
if (mStartedUsers.get(userId) != uss) {
stopped = false;
} else if (uss.mState != UserStartedState.STATE_SHUTDOWN) {
stopped = false;
} else {
stopped = true;
// User can no longer run.
mStartedUsers.remove(userId);
mUserLru.remove(Integer.valueOf(userId));
updateStartedUserArrayLocked();
// Clean up all state and processes associated with the user.
// Kill all the processes for the user.
forceStopUserLocked(userId, "finish user");
}
// Explicitly remove the old information in mRecentTasks.
removeRecentTasksForUserLocked(userId);
}
for (int i=0; i<callbacks.size(); i++) {
try {
if (stopped) callbacks.get(i).userStopped(userId);
else callbacks.get(i).userStopAborted(userId);
} catch (RemoteException e) {
}
}
if (stopped) {
mSystemServiceManager.cleanupUser(userId);
synchronized (this) {
mStackSupervisor.removeUserLocked(userId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishUserStop
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
finishUserStop
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
private <T> T getSessionAttribute(String name)
{
HttpSession session = getHttpSession();
if (session != null) {
return (T) session.getAttribute(name);
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionAttribute
File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
Repository: xwiki-contrib/oidc
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39387
|
HIGH
| 7.5
|
xwiki-contrib/oidc
|
getSessionAttribute
|
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
|
0247af1417925b9734ab106ad7cd934ee870ac89
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String transform(Source xml, Source xslt)
{
if (xml != null && xslt != null) {
try {
StringWriter output = new StringWriter();
Result result = new StreamResult(output);
javax.xml.transform.TransformerFactory.newInstance().newTransformer(xslt).transform(xml, result);
return output.toString();
} catch (Exception ex) {
LOGGER.warn("Failed to apply XSLT transformation: [{}]", ex.getMessage());
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: transform
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
Repository: xwiki/xwiki-commons
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-24898
|
MEDIUM
| 4
|
xwiki/xwiki-commons
|
transform
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
|
947e8921ebd95462d5a7928f397dd1b64f77c7d5
| 0
|
Analyze the following code function for security vulnerabilities
|
void notifyPinnedActivityRestartAttemptLocked() {
mHandler.removeMessages(NOTIFY_PINNED_ACTIVITY_RESTART_ATTEMPT_LISTENERS_MSG);
mHandler.obtainMessage(NOTIFY_PINNED_ACTIVITY_RESTART_ATTEMPT_LISTENERS_MSG).sendToTarget();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyPinnedActivityRestartAttemptLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
notifyPinnedActivityRestartAttemptLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
static int rmqDeliveryMode(int deliveryMode) {
return (deliveryMode == javax.jms.DeliveryMode.PERSISTENT ? 2 : 1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rmqDeliveryMode
File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-36282
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-jms-client
|
rmqDeliveryMode
|
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
private static int getSyncDisabledMode(Bundle args) {
final int mode = (args != null)
? args.getInt(Settings.CALL_METHOD_SYNC_DISABLED_MODE_KEY) : -1;
if (mode == SYNC_DISABLED_MODE_NONE || mode == SYNC_DISABLED_MODE_UNTIL_REBOOT
|| mode == SYNC_DISABLED_MODE_PERSISTENT) {
return mode;
}
throw new IllegalArgumentException("Invalid sync disabled mode: " + mode);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSyncDisabledMode
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
getSyncDisabledMode
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addDateHeader(String name, long value)
{
this.response.addDateHeader(name, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addDateHeader
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-601"
] |
CVE-2022-23618
|
MEDIUM
| 5.8
|
xwiki/xwiki-platform
|
addDateHeader
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
|
5251c02080466bf9fb55288f04a37671108f8096
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getMicroblogName(final String name) throws FileNotFoundException, IOException {
return getContactInfo(name, ContactType.microblog.toString());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMicroblogName
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
getMicroblogName
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setParamPreActionDone(String paramPreActionDone) {
m_paramPreActionDone = paramPreActionDone;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setParamPreActionDone
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
setParamPreActionDone
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
private JsonNode parseFloat(int nextState) throws IOException {
String text = lexer.yytext().replace("_", "");
pollExpected(TomlToken.FLOAT, nextState);
if (text.endsWith("nan")) {
return factory.numberNode(Double.NaN);
} else if (text.endsWith("inf")) {
return factory.numberNode(text.startsWith("-") ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);
} else {
try {
tomlFactory.streamReadConstraints().validateFPLength(text.length());
BigDecimal dec = NumberInput.parseBigDecimal(
text, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER));
return factory.numberNode(dec);
} catch (NumberFormatException | StreamConstraintsException e) {
final String reportNum = text.length() <= MAX_CHARS_TO_REPORT ?
text :
text.substring(0, MAX_CHARS_TO_REPORT) + " [truncated]";
throw errorContext.atPosition(lexer).invalidNumber(e, reportNum);
}
}
}
|
Vulnerability Classification:
- CWE: CWE-787
- CVE: CVE-2023-3894
- Severity: HIGH
- CVSS Score: 7.5
Description: validate nesting depth goes back tp zero
Function: parseFloat
File: toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
Repository: FasterXML/jackson-dataformats-text
Fixed Code:
private JsonNode parseFloat(int nextState) throws IOException {
final String text = lexer.yytext().replace("_", "");
pollExpected(TomlToken.FLOAT, nextState);
if (text.endsWith("nan")) {
return factory.numberNode(Double.NaN);
} else if (text.endsWith("inf")) {
return factory.numberNode(text.startsWith("-") ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);
} else {
try {
tomlFactory.streamReadConstraints().validateFPLength(text.length());
BigDecimal dec = NumberInput.parseBigDecimal(
text, tomlFactory.isEnabled(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER));
return factory.numberNode(dec);
} catch (NumberFormatException | StreamConstraintsException e) {
final String reportNum = text.length() <= MAX_CHARS_TO_REPORT ?
text :
text.substring(0, MAX_CHARS_TO_REPORT) + " [truncated]";
throw errorContext.atPosition(lexer).invalidNumber(e, reportNum);
}
}
}
|
[
"CWE-787"
] |
CVE-2023-3894
|
HIGH
| 7.5
|
FasterXML/jackson-dataformats-text
|
parseFloat
|
toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
|
6f2f87f94d53fe440afd353b74c07ffa97d9888f
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void moveTaskToBack(int taskId) {
enforceCallingPermission(android.Manifest.permission.REORDER_TASKS,
"moveTaskToBack()");
synchronized(this) {
TaskRecord tr = mStackSupervisor.anyTaskForIdLocked(taskId);
if (tr != null) {
if (tr == mStackSupervisor.mLockTaskModeTask) {
mStackSupervisor.showLockTaskToast();
return;
}
if (DEBUG_STACK) Slog.d(TAG, "moveTaskToBack: moving task=" + tr);
ActivityStack stack = tr.stack;
if (stack.mResumedActivity != null && stack.mResumedActivity.task == tr) {
if (!checkAppSwitchAllowedLocked(Binder.getCallingPid(),
Binder.getCallingUid(), -1, -1, "Task to back")) {
return;
}
}
final long origId = Binder.clearCallingIdentity();
try {
stack.moveTaskToBackLocked(taskId);
} finally {
Binder.restoreCallingIdentity(origId);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTaskToBack
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
moveTaskToBack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setForcedDisplayScalingMode(int displayId, int mode) {
if (mContext.checkCallingOrSelfPermission(
android.Manifest.permission.WRITE_SECURE_SETTINGS) !=
PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Must hold permission " +
android.Manifest.permission.WRITE_SECURE_SETTINGS);
}
if (displayId != Display.DEFAULT_DISPLAY) {
throw new IllegalArgumentException("Can only set the default display");
}
final long ident = Binder.clearCallingIdentity();
try {
synchronized(mWindowMap) {
final DisplayContent displayContent = getDisplayContentLocked(displayId);
if (displayContent != null) {
if (mode < 0 || mode > 1) {
mode = 0;
}
setForcedDisplayScalingModeLocked(displayContent, mode);
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.DISPLAY_SCALING_FORCE, mode);
}
}
} finally {
Binder.restoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setForcedDisplayScalingMode
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
setForcedDisplayScalingMode
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void copyAccountToUser(final IAccountManagerResponse response, final Account account,
final int userFrom, int userTo) {
int callingUid = Binder.getCallingUid();
if (isCrossUser(callingUid, UserHandle.USER_ALL)) {
throw new SecurityException("Calling copyAccountToUser requires "
+ android.Manifest.permission.INTERACT_ACROSS_USERS_FULL);
}
final UserAccounts fromAccounts = getUserAccounts(userFrom);
final UserAccounts toAccounts = getUserAccounts(userTo);
if (fromAccounts == null || toAccounts == null) {
if (response != null) {
Bundle result = new Bundle();
result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
try {
response.onResult(result);
} catch (RemoteException e) {
Slog.w(TAG, "Failed to report error back to the client." + e);
}
}
return;
}
Slog.d(TAG, "Copying account " + account.toSafeString()
+ " from user " + userFrom + " to user " + userTo);
final long identityToken = clearCallingIdentity();
try {
new Session(fromAccounts, response, account.type, false,
false /* stripAuthTokenFromResult */, account.name,
false /* authDetailsRequired */) {
@Override
protected String toDebugString(long now) {
return super.toDebugString(now) + ", getAccountCredentialsForClone"
+ ", " + account.type;
}
@Override
public void run() throws RemoteException {
mAuthenticator.getAccountCredentialsForCloning(this, account);
}
@Override
public void onResult(Bundle result) {
Bundle.setDefusable(result, true);
if (result != null
&& result.getBoolean(AccountManager.KEY_BOOLEAN_RESULT, false)) {
// Create a Session for the target user and pass in the bundle
completeCloningAccount(response, result, account, toAccounts, userFrom);
} else {
super.onResult(result);
}
}
}.bind();
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyAccountToUser
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
copyAccountToUser
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isOpenNativeNavigationAppSupported(){
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOpenNativeNavigationAppSupported
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
isOpenNativeNavigationAppSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
void setDropInputMode(@DropInputMode int mode) {
if (mLastDropInputMode != mode) {
mLastDropInputMode = mode;
mWmService.mTransactionFactory.get()
.setDropInputMode(getSurfaceControl(), mode)
.apply();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDropInputMode
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
setDropInputMode
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private File getRingtoneCacheDir(int userId) {
final File cacheDir = new File(Environment.getDataSystemDeDirectory(userId), "ringtones");
cacheDir.mkdir();
SELinux.restorecon(cacheDir);
return cacheDir;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRingtoneCacheDir
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
getRingtoneCacheDir
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getFullName() {
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFullName
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getFullName
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private PlayerId getPlayerId(final Element element, final String attribute, final boolean mustFind)
throws GameParseException {
return getValidatedObject(element, attribute, mustFind, data.getPlayerList()::getPlayerId, "player");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPlayerId
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
getPlayerId
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public FrameHandler create(Address addr, String connectionName) throws IOException {
int portNumber = ConnectionFactory.portOrDefault(addr.getPort(), ssl);
SSLEngine sslEngine = null;
SocketChannel channel = null;
try {
if (ssl) {
SSLContext sslContext = sslContextFactory.create(connectionName);
sslEngine = sslContext.createSSLEngine(addr.getHost(), portNumber);
sslEngine.setUseClientMode(true);
if (nioParams.getSslEngineConfigurator() != null) {
nioParams.getSslEngineConfigurator().configure(sslEngine);
}
}
SocketAddress address = addr.toInetSocketAddress(portNumber);
// No Sonar: the channel is closed in case of error and it cannot
// be closed here because it's part of the state of the connection
// to be returned.
channel = SocketChannel.open(); //NOSONAR
channel.configureBlocking(true);
if(nioParams.getSocketChannelConfigurator() != null) {
nioParams.getSocketChannelConfigurator().configure(channel);
}
channel.socket().connect(address, this.connectionTimeout);
if (ssl) {
int initialSoTimeout = channel.socket().getSoTimeout();
channel.socket().setSoTimeout(this.connectionTimeout);
sslEngine.beginHandshake();
try {
ReadableByteChannel wrappedReadChannel = Channels.newChannel(
channel.socket().getInputStream());
WritableByteChannel wrappedWriteChannel = Channels.newChannel(
channel.socket().getOutputStream());
boolean handshake = SslEngineHelper.doHandshake(
wrappedWriteChannel, wrappedReadChannel, sslEngine);
if (!handshake) {
LOGGER.error("TLS connection failed");
throw new SSLException("TLS handshake failed");
}
channel.socket().setSoTimeout(initialSoTimeout);
} catch (SSLHandshakeException e) {
LOGGER.error("TLS connection failed: {}", e.getMessage());
throw e;
}
TlsUtils.logPeerCertificateInfo(sslEngine.getSession());
}
channel.configureBlocking(false);
// lock
stateLock.lock();
NioLoopContext nioLoopContext = null;
try {
long modulo = globalConnectionCount.getAndIncrement() % nioParams.getNbIoThreads();
nioLoopContext = nioLoopContexts.get((int) modulo);
nioLoopContext.initStateIfNecessary();
SocketChannelFrameHandlerState state = new SocketChannelFrameHandlerState(
channel,
nioLoopContext,
nioParams,
sslEngine
);
state.startReading();
SocketChannelFrameHandler frameHandler = new SocketChannelFrameHandler(state);
return frameHandler;
} finally {
stateLock.unlock();
}
} catch(IOException e) {
try {
if(sslEngine != null && channel != null) {
SslEngineHelper.close(channel, sslEngine);
}
if (channel != null) {
channel.close();
}
} catch(IOException closingException) {
// ignore
}
throw e;
}
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-46120
- Severity: HIGH
- CVSS Score: 7.5
Description: Add max inbound message size to ConnectionFactory
To avoid OOM with a very large message.
The default value is 64 MiB.
Fixes #1062
(cherry picked from commit 9ed45fde52224ec74fc523321efdf9a157d5cfca)
Function: create
File: src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java
Repository: rabbitmq/rabbitmq-java-client
Fixed Code:
@Override
public FrameHandler create(Address addr, String connectionName) throws IOException {
int portNumber = ConnectionFactory.portOrDefault(addr.getPort(), ssl);
SSLEngine sslEngine = null;
SocketChannel channel = null;
try {
if (ssl) {
SSLContext sslContext = sslContextFactory.create(connectionName);
sslEngine = sslContext.createSSLEngine(addr.getHost(), portNumber);
sslEngine.setUseClientMode(true);
if (nioParams.getSslEngineConfigurator() != null) {
nioParams.getSslEngineConfigurator().configure(sslEngine);
}
}
SocketAddress address = addr.toInetSocketAddress(portNumber);
// No Sonar: the channel is closed in case of error and it cannot
// be closed here because it's part of the state of the connection
// to be returned.
channel = SocketChannel.open(); //NOSONAR
channel.configureBlocking(true);
if(nioParams.getSocketChannelConfigurator() != null) {
nioParams.getSocketChannelConfigurator().configure(channel);
}
channel.socket().connect(address, this.connectionTimeout);
if (ssl) {
int initialSoTimeout = channel.socket().getSoTimeout();
channel.socket().setSoTimeout(this.connectionTimeout);
sslEngine.beginHandshake();
try {
ReadableByteChannel wrappedReadChannel = Channels.newChannel(
channel.socket().getInputStream());
WritableByteChannel wrappedWriteChannel = Channels.newChannel(
channel.socket().getOutputStream());
boolean handshake = SslEngineHelper.doHandshake(
wrappedWriteChannel, wrappedReadChannel, sslEngine);
if (!handshake) {
LOGGER.error("TLS connection failed");
throw new SSLException("TLS handshake failed");
}
channel.socket().setSoTimeout(initialSoTimeout);
} catch (SSLHandshakeException e) {
LOGGER.error("TLS connection failed: {}", e.getMessage());
throw e;
}
TlsUtils.logPeerCertificateInfo(sslEngine.getSession());
}
channel.configureBlocking(false);
// lock
stateLock.lock();
NioLoopContext nioLoopContext = null;
try {
long modulo = globalConnectionCount.getAndIncrement() % nioParams.getNbIoThreads();
nioLoopContext = nioLoopContexts.get((int) modulo);
nioLoopContext.initStateIfNecessary();
SocketChannelFrameHandlerState state = new SocketChannelFrameHandlerState(
channel,
nioLoopContext,
nioParams,
sslEngine,
this.maxInboundMessageBodySize
);
state.startReading();
SocketChannelFrameHandler frameHandler = new SocketChannelFrameHandler(state);
return frameHandler;
} finally {
stateLock.unlock();
}
} catch(IOException e) {
try {
if(sslEngine != null && channel != null) {
SslEngineHelper.close(channel, sslEngine);
}
if (channel != null) {
channel.close();
}
} catch(IOException closingException) {
// ignore
}
throw e;
}
}
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
create
|
src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 1
|
Analyze the following code function for security vulnerabilities
|
public void switchToAccount(Account account, boolean init, String fingerprint) {
Intent intent = new Intent(this, EditAccountActivity.class);
intent.putExtra("jid", account.getJid().asBareJid().toString());
intent.putExtra("init", init);
if (init) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
}
if (fingerprint != null) {
intent.putExtra("fingerprint", fingerprint);
}
startActivity(intent);
if (init) {
overridePendingTransition(0, 0);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: switchToAccount
File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
switchToAccount
|
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getLocality() {
return locality;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocality
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getLocality
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.clear();
try {
Form currentForm = Display.getInstance().getCurrent();
if (currentForm == null || Toolbar.isGlobalToolbar()) {
return false;
}
int numCommands = currentForm.getCommandCount();
// If there are no commands, there's nothing to put in the menu
if (numCommands == 0) {
return false;
}
// Build menu items from commands
for (int n = 0; n < numCommands; n++) {
Command command = currentForm.getCommand(n);
if (command != null) {
String txt = currentForm.getUIManager().localize(command.getCommandName(), command.getCommandName());
MenuItem item = menu.add(Menu.NONE, n, Menu.NONE, txt);
Image icon = command.getIcon();
if (icon != null) {
Bitmap b = (Bitmap) icon.getImage();
// Using BitmapDrawable with resources, to use device density (from 1.6 and above).
BitmapDrawable d = new BitmapDrawable(getResources(), b);
item.setIcon(d);
}
if (!command.isEnabled()) {
item.setEnabled(false);
}
if (android.os.Build.VERSION.SDK_INT >= 11 && command.getClientProperty("android:showAsAction") != null) {
String androidShowAsAction = command.getClientProperty("android:showAsAction").toString();
// From https://developer.android.com/guide/topics/resources/menu-resource.html
// "ifRoom" | "never" | "withText" | "always" | "collapseActionView"
if (androidShowAsAction.equalsIgnoreCase("ifRoom")) {
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
} else if (androidShowAsAction.equalsIgnoreCase("never")) {
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
} else if (androidShowAsAction.equalsIgnoreCase("withText")) {
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
} else if (androidShowAsAction.equalsIgnoreCase("always")) {
item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
} else if (android.os.Build.VERSION.SDK_INT >= 14 && androidShowAsAction.equalsIgnoreCase("collapseActionView")) {
item.setShowAsAction(8); //MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
}
}
}
}
} catch (Throwable t) {
}
return nativeMenu;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPrepareOptionsMenu
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onPrepareOptionsMenu
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@ManagedAttribute("The secret of this Oort")
public String getSecret() {
return _secret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSecret
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
getSecret
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
public final DataStore<StoredCredential> getCredentialDataStore() {
return credentialDataStore;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCredentialDataStore
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-7692
|
MEDIUM
| 6.4
|
googleapis/google-oauth-java-client
|
getCredentialDataStore
|
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
|
13433cd7dd06267fc261f0b1d4764f8e3432c824
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, ?> toQueryParameters(String className, Integer objectNumber, Map<String, ?> properties)
{
Map<String, Object> queryParameters = new HashMap<String, Object>();
if (className != null) {
queryParameters.put("classname", className);
}
for (Map.Entry<String, ?> entry : properties.entrySet()) {
queryParameters.put(toQueryParameterKey(className, objectNumber, entry.getKey()), entry.getValue());
}
return queryParameters;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toQueryParameters
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
toQueryParameters
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract void setUrl(String url);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUrl
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
setUrl
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void injectParameterToQuery(int parameterId, Query<?> query, Object parameterValue)
{
query.setParameter(parameterId, parameterValue);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectParameterToQuery
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
injectParameterToQuery
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public void delete() {
client().delete(this);
client().delete(getUser());
ScooldUtils.getInstance().unsubscribeFromAllNotifications(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
delete
|
src/main/java/com/erudika/scoold/core/Profile.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void cancleCookie(String contextPath, HttpServletResponse response, String name, String domain) {
Cookie cookie = new Cookie(name, null);
cookie.setMaxAge(0);
cookie.setPath(CommonUtils.empty(contextPath) ? Constants.SEPARATOR : contextPath);
if (CommonUtils.notEmpty(domain)) {
cookie.setDomain(domain);
}
response.addCookie(cookie);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancleCookie
File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
cancleCookie
|
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
public void exposeInJavaScript(final Object o, final String name) {
act.runOnUiThread(new Runnable() {
public void run() {
web.addJavascriptInterface(o, name);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exposeInJavaScript
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
exposeInJavaScript
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public static SFile createTempFile(String prefix, String suffix) throws IOException {
return new SFile(File.createTempFile(prefix, suffix));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createTempFile
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
createTempFile
|
src/net/sourceforge/plantuml/security/SFile.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public ActivityTaskManagerInternal getAtmInternal() {
return mInternal;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAtmInternal
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
getAtmInternal
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getRequiredInstallerLPr() {
Intent installerIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
installerIntent.addCategory(Intent.CATEGORY_DEFAULT);
installerIntent.setDataAndType(Uri.fromFile(new File("foo.apk")), PACKAGE_MIME_TYPE);
final List<ResolveInfo> installers = queryIntentActivities(installerIntent,
PACKAGE_MIME_TYPE, 0, 0);
String requiredInstaller = null;
final int N = installers.size();
for (int i = 0; i < N; i++) {
final ResolveInfo info = installers.get(i);
final String packageName = info.activityInfo.packageName;
if (!info.activityInfo.applicationInfo.isSystemApp()) {
continue;
}
if (requiredInstaller != null) {
throw new RuntimeException("There must be one required installer");
}
requiredInstaller = packageName;
}
if (requiredInstaller == null) {
throw new RuntimeException("There must be one required installer");
}
return requiredInstaller;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequiredInstallerLPr
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
getRequiredInstallerLPr
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void initSTSConfiguration() {
// if the sts configuration is present in the picketlink.xml then load it.
if (this.picketLinkConfiguration != null && this.picketLinkConfiguration.getStsType() != null) {
PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
sts.initialize(new PicketLinkSTSConfiguration(this.picketLinkConfiguration.getStsType()));
} else {
// Try to load from /WEB-INF/picketlink-sts.xml.
// Ensure that the Core STS has the SAML20 Token Provider
PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
// Let us look for a file
String configPath = getContext().getServletContext().getRealPath("/WEB-INF/picketlink-sts.xml");
File stsTokenConfigFile = configPath != null ? new File(configPath) : null;
if (stsTokenConfigFile == null || stsTokenConfigFile.exists() == false) {
logger.samlIDPInstallingDefaultSTSConfig();
sts.installDefaultConfiguration();
} else {
sts.installDefaultConfiguration(stsTokenConfigFile.toURI().toString());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initSTSConfiguration
File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
Repository: picketlink/picketlink-bindings
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3158
|
MEDIUM
| 4
|
picketlink/picketlink-bindings
|
initSTSConfiguration
|
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
|
341a37aefd69e67b6b5f6d775499730d6ccaff0d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void show() {
if (mContentViewCore != null) mContentViewCore.onShow();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: show
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
show
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setLaunchCookie(IBinder launchCookie) {
mLaunchCookie = launchCookie;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLaunchCookie
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
setLaunchCookie
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final String getViewPage(Class<?> clazz, String pageName) {
// We didn't find the configuration page.
// Either this is non-fatal, in which case it doesn't matter what string we return so long as
// it doesn't exist.
// Or this error is fatal, in which case we want the developer to see what page he's missing.
// so we put the page name.
return getViewPage(clazz,pageName,pageName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getViewPage
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getViewPage
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
void validate(V value);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validate
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
validate
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
CrossProfileApps getCrossProfileApps(@UserIdInt int userId) {
return mContext.createContextAsUser(UserHandle.of(userId), /* flags= */ 0)
.getSystemService(CrossProfileApps.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCrossProfileApps
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getCrossProfileApps
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getAboutInfo() {
final StringBuilder sb = new StringBuilder();
sb.append(getEnvironmentInfo());
sb.append(String.format("%n"));
sb.append(getGeoToolsJarInfo());
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAboutInfo
File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
getAboutInfo
|
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setShowCondition(ShowCondition showCondition) {
this.showCondition = showCondition;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setShowCondition
File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2021-21248
|
MEDIUM
| 6.5
|
theonedev/onedev
|
setShowCondition
|
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
|
39d95ab8122c5d9ed18e69dc024870cae08d2d60
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void readRestrictions(XmlPullParser parser, Bundle restrictions)
throws IOException {
for (String key : USER_RESTRICTIONS) {
final String value = parser.getAttributeValue(null, key);
if (value != null) {
restrictions.putBoolean(key, Boolean.parseBoolean(value));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readRestrictions
File: services/core/java/com/android/server/pm/UserRestrictionsUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
readRestrictions
|
services/core/java/com/android/server/pm/UserRestrictionsUtils.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
void onLockTaskPackagesUpdatedLocked() {
boolean didSomething = false;
for (int taskNdx = mLockTaskModeTasks.size() - 1; taskNdx >= 0; --taskNdx) {
final TaskRecord lockedTask = mLockTaskModeTasks.get(taskNdx);
final boolean wasWhitelisted =
(lockedTask.mLockTaskAuth == LOCK_TASK_AUTH_LAUNCHABLE) ||
(lockedTask.mLockTaskAuth == LOCK_TASK_AUTH_WHITELISTED);
lockedTask.setLockTaskAuth();
final boolean isWhitelisted =
(lockedTask.mLockTaskAuth == LOCK_TASK_AUTH_LAUNCHABLE) ||
(lockedTask.mLockTaskAuth == LOCK_TASK_AUTH_WHITELISTED);
if (wasWhitelisted && !isWhitelisted) {
// Lost whitelisting authorization. End it now.
if (DEBUG_LOCKTASK) Slog.d(TAG_LOCKTASK, "onLockTaskPackagesUpdated: removing " +
lockedTask + " mLockTaskAuth=" + lockedTask.lockTaskAuthToString());
removeLockedTaskLocked(lockedTask);
lockedTask.performClearTaskLocked();
didSomething = true;
}
}
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
stack.onLockTaskPackagesUpdatedLocked();
}
}
final ActivityRecord r = topRunningActivityLocked();
final TaskRecord task = r != null ? r.task : null;
if (mLockTaskModeTasks.isEmpty() && task != null
&& task.mLockTaskAuth == LOCK_TASK_AUTH_LAUNCHABLE) {
// This task must have just been authorized.
if (DEBUG_LOCKTASK) Slog.d(TAG_LOCKTASK,
"onLockTaskPackagesUpdated: starting new locktask task=" + task);
setLockTaskModeLocked(task, ActivityManager.LOCK_TASK_MODE_LOCKED, "package updated",
false);
didSomething = true;
}
if (didSomething) {
resumeTopActivitiesLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onLockTaskPackagesUpdatedLocked
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
onLockTaskPackagesUpdatedLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void internalExpireMessagesForAllSubscriptionsForNonPartitionedTopic(AsyncResponse asyncResponse,
int expireTimeInSeconds,
boolean authoritative) {
// validate ownership and redirect if current broker is not owner
PersistentTopic topic;
try {
validateTopicOwnership(topicName, authoritative);
validateTopicOperation(topicName, TopicOperation.EXPIRE_MESSAGES);
topic = (PersistentTopic) getTopicReference(topicName);
} catch (WebApplicationException wae) {
if (log.isDebugEnabled()) {
log.debug("[{}] Failed to expire messages for all subscription on topic {},"
+ " redirecting to other brokers.",
clientAppId(), topicName, wae);
}
resumeAsyncResponseExceptionally(asyncResponse, wae);
return;
} catch (Exception e) {
log.error("[{}] Failed to expire messages for all subscription on topic {}",
clientAppId(), topicName, e);
resumeAsyncResponseExceptionally(asyncResponse, e);
return;
}
final AtomicReference<Throwable> exception = new AtomicReference<>();
topic.getReplicators().forEach((subName, replicator) -> {
try {
internalExpireMessagesByTimestampForSinglePartition(subName, expireTimeInSeconds, authoritative);
} catch (Throwable t) {
exception.set(t);
}
});
topic.getSubscriptions().forEach((subName, subscriber) -> {
try {
internalExpireMessagesByTimestampForSinglePartition(subName, expireTimeInSeconds, authoritative);
} catch (Throwable t) {
exception.set(t);
}
});
if (exception.get() != null) {
if (exception.get() instanceof WebApplicationException) {
WebApplicationException wae = (WebApplicationException) exception.get();
asyncResponse.resume(wae);
return;
} else {
asyncResponse.resume(new RestException(exception.get()));
return;
}
}
asyncResponse.resume(Response.noContent().build());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalExpireMessagesForAllSubscriptionsForNonPartitionedTopic
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalExpireMessagesForAllSubscriptionsForNonPartitionedTopic
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void execute() throws MojoExecutionException {
File inputSpecFile = new File(inputSpec);
addCompileSourceRootIfConfigured();
try {
if (Boolean.TRUE.equals(skip)) {
getLog().info("Code generation is skipped.");
return;
}
if (buildContext != null && inputSpec != null ) {
if (buildContext.isIncremental() &&
inputSpecFile.exists() &&
!buildContext.hasDelta(inputSpecFile)) {
getLog().info(
"Code generation is skipped in delta-build because source-json was not modified.");
return;
}
}
if (Boolean.TRUE.equals(skipIfSpecIsUnchanged) && inputSpecFile.exists()) {
File storedInputSpecHashFile = getHashFile(inputSpecFile);
if (storedInputSpecHashFile.exists()) {
String inputSpecHash = null;
try {
inputSpecHash = calculateInputSpecHash(inputSpecFile);
} catch (IOException ex) {
ex.printStackTrace();
}
@SuppressWarnings("UnstableApiUsage")
String storedInputSpecHash = Files.asCharSource(storedInputSpecHashFile, StandardCharsets.UTF_8).read();
if (storedInputSpecHash.equals(inputSpecHash)) {
getLog().info(
"Code generation is skipped because input was unchanged");
return;
}
}
}
// attempt to read from config file
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configurationFile);
// if a config file wasn't specified or we were unable to read it
if (configurator == null) {
configurator = new CodegenConfigurator();
}
configurator.setVerbose(verbose);
if (skipOverwrite != null) {
configurator.setSkipOverwrite(skipOverwrite);
}
if (removeOperationIdPrefix != null) {
configurator.setRemoveOperationIdPrefix(removeOperationIdPrefix);
}
if (skipOperationExample != null) {
configurator.setSkipOperationExample(skipOperationExample);
}
if (isNotEmpty(inputSpec)) {
configurator.setInputSpec(inputSpec);
}
if (isNotEmpty(gitHost)) {
configurator.setGitHost(gitHost);
}
if (isNotEmpty(gitUserId)) {
configurator.setGitUserId(gitUserId);
}
if (isNotEmpty(gitRepoId)) {
configurator.setGitRepoId(gitRepoId);
}
if (isNotEmpty(ignoreFileOverride)) {
configurator.setIgnoreFileOverride(ignoreFileOverride);
}
if (isNotEmpty(httpUserAgent)) {
configurator.setHttpUserAgent(httpUserAgent);
}
if (skipValidateSpec != null) {
configurator.setValidateSpec(!skipValidateSpec);
}
if (strictSpec != null) {
configurator.setStrictSpecBehavior(strictSpec);
}
if (logToStderr != null) {
configurator.setLogToStderr(logToStderr);
}
if (enablePostProcessFile != null) {
configurator.setEnablePostProcessFile(enablePostProcessFile);
}
if (generateAliasAsModel != null) {
configurator.setGenerateAliasAsModel(generateAliasAsModel);
}
if (isNotEmpty(generatorName)) {
configurator.setGeneratorName(generatorName);
} else {
LOGGER.error("A generator name (generatorName) is required.");
throw new MojoExecutionException("The generator requires 'generatorName'. Refer to documentation for a list of options.");
}
configurator.setOutputDir(output.getAbsolutePath());
if (isNotEmpty(auth)) {
configurator.setAuth(auth);
}
if (isNotEmpty(apiPackage)) {
configurator.setApiPackage(apiPackage);
}
if (isNotEmpty(modelPackage)) {
configurator.setModelPackage(modelPackage);
}
if (isNotEmpty(invokerPackage)) {
configurator.setInvokerPackage(invokerPackage);
}
if (isNotEmpty(packageName)) {
configurator.setPackageName(packageName);
}
if (isNotEmpty(groupId)) {
configurator.setGroupId(groupId);
}
if (isNotEmpty(artifactId)) {
configurator.setArtifactId(artifactId);
}
if (isNotEmpty(artifactVersion)) {
configurator.setArtifactVersion(artifactVersion);
}
if (isNotEmpty(library)) {
configurator.setLibrary(library);
}
if (isNotEmpty(modelNamePrefix)) {
configurator.setModelNamePrefix(modelNamePrefix);
}
if (isNotEmpty(modelNameSuffix)) {
configurator.setModelNameSuffix(modelNameSuffix);
}
if (null != templateDirectory) {
configurator.setTemplateDir(templateDirectory.getAbsolutePath());
}
if (StringUtils.isNotEmpty(templateResourcePath)) {
if (null != templateDirectory) {
LOGGER.warn("Both templateDirectory and templateResourcePath were configured. templateResourcePath overwrites templateDirectory.");
}
configurator.setTemplateDir(templateResourcePath);
}
if (null != engine) {
configurator.setTemplatingEngineName(engine);
}
// Set generation options
if (null != generateApis && generateApis) {
GlobalSettings.setProperty(CodegenConstants.APIS, apisToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.APIS);
}
if (null != generateModels && generateModels) {
GlobalSettings.setProperty(CodegenConstants.MODELS, modelsToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.MODELS);
}
if (null != generateSupportingFiles && generateSupportingFiles) {
GlobalSettings.setProperty(CodegenConstants.SUPPORTING_FILES, supportingFilesToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.SUPPORTING_FILES);
}
GlobalSettings.setProperty(CodegenConstants.MODEL_TESTS, generateModelTests.toString());
GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString());
GlobalSettings.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString());
if (configOptions != null) {
// Retained for backwards-compataibility with configOptions -> instantiation-types
if (instantiationTypes == null && configOptions.containsKey("instantiation-types")) {
applyInstantiationTypesKvp(configOptions.get("instantiation-types").toString(),
configurator);
}
// Retained for backwards-compatibility with configOptions -> import-mappings
if (importMappings == null && configOptions.containsKey("import-mappings")) {
applyImportMappingsKvp(configOptions.get("import-mappings").toString(),
configurator);
}
// Retained for backwards-compataibility with configOptions -> type-mappings
if (typeMappings == null && configOptions.containsKey("type-mappings")) {
applyTypeMappingsKvp(configOptions.get("type-mappings").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> language-specific-primitives
if (languageSpecificPrimitives == null && configOptions.containsKey("language-specific-primitives")) {
applyLanguageSpecificPrimitivesCsv(configOptions
.get("language-specific-primitives").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> additional-properties
if (additionalProperties == null && configOptions.containsKey("additional-properties")) {
applyAdditionalPropertiesKvp(configOptions.get("additional-properties").toString(),
configurator);
}
if (serverVariableOverrides == null && configOptions.containsKey("server-variables")) {
applyServerVariablesKvp(configOptions.get("server-variables").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> reserved-words-mappings
if (reservedWordsMappings == null && configOptions.containsKey("reserved-words-mappings")) {
applyReservedWordsMappingsKvp(configOptions.get("reserved-words-mappings")
.toString(), configurator);
}
}
// Apply Instantiation Types
if (instantiationTypes != null && (configOptions == null || !configOptions.containsKey("instantiation-types"))) {
applyInstantiationTypesKvpList(instantiationTypes, configurator);
}
// Apply Import Mappings
if (importMappings != null && (configOptions == null || !configOptions.containsKey("import-mappings"))) {
applyImportMappingsKvpList(importMappings, configurator);
}
// Apply Type Mappings
if (typeMappings != null && (configOptions == null || !configOptions.containsKey("type-mappings"))) {
applyTypeMappingsKvpList(typeMappings, configurator);
}
// Apply Language Specific Primitives
if (languageSpecificPrimitives != null
&& (configOptions == null || !configOptions.containsKey("language-specific-primitives"))) {
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
}
// Apply Additional Properties
if (additionalProperties != null && (configOptions == null || !configOptions.containsKey("additional-properties"))) {
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
}
if (serverVariableOverrides != null && (configOptions == null || !configOptions.containsKey("server-variables"))) {
applyServerVariablesKvpList(serverVariableOverrides, configurator);
}
// Apply Reserved Words Mappings
if (reservedWordsMappings != null && (configOptions == null || !configOptions.containsKey("reserved-words-mappings"))) {
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
}
if (globalProperties == null) {
globalProperties = new HashMap<>();
}
if (environmentVariables != null && environmentVariables.size() > 0) {
globalProperties.putAll(environmentVariables);
getLog().warn("environmentVariables is deprecated and will be removed in version 5.1. Use globalProperties instead.");
}
for (String key : globalProperties.keySet()) {
String value = globalProperties.get(key);
if (value != null) {
configurator.addGlobalProperty(key, value);
}
}
final ClientOptInput input = configurator.toClientOptInput();
final CodegenConfig config = input.getConfig();
if (configOptions != null) {
for (CliOption langCliOption : config.cliOptions()) {
if (configOptions.containsKey(langCliOption.getOpt())) {
input.getConfig().additionalProperties()
.put(langCliOption.getOpt(), configOptions.get(langCliOption.getOpt()));
}
}
}
if (configHelp) {
for (CliOption langCliOption : config.cliOptions()) {
System.out.println("\t" + langCliOption.getOpt());
System.out.println("\t "
+ langCliOption.getOptionHelp().replaceAll("\n", "\n\t "));
System.out.println();
}
return;
}
adjustAdditionalProperties(config);
new DefaultGenerator().opts(input).generate();
if (buildContext != null) {
buildContext.refresh(new File(getCompileSourceRoot()));
}
// Store a checksum of the input spec
File storedInputSpecHashFile = getHashFile(inputSpecFile);
String inputSpecHash = calculateInputSpecHash(inputSpecFile);
if (storedInputSpecHashFile.getParent() != null && !new File(storedInputSpecHashFile.getParent()).exists()) {
File parent = new File(storedInputSpecHashFile.getParent());
parent.mkdirs();
}
Files.asCharSink(storedInputSpecHashFile, StandardCharsets.UTF_8).write(inputSpecHash);
} catch (Exception e) {
// Maven logs exceptions thrown by plugins only if invoked with -e
// I find it annoying to jump through hoops to get basic diagnostic information,
// so let's log it in any case:
if (buildContext != null) {
buildContext.addMessage(inputSpecFile, 0, 0, "unexpected error in Open-API generation", BuildContext.SEVERITY_WARNING, e);
}
getLog().error(e);
throw new MojoExecutionException(
"Code generation failed. See above for the full exception.");
}
}
|
Vulnerability Classification:
- CWE: CWE-552
- CVE: CVE-2021-21429
- Severity: LOW
- CVSS Score: 2.1
Description: error check when creating a folder
Function: execute
File: modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
Repository: OpenAPITools/openapi-generator
Fixed Code:
@Override
public void execute() throws MojoExecutionException {
File inputSpecFile = new File(inputSpec);
addCompileSourceRootIfConfigured();
try {
if (Boolean.TRUE.equals(skip)) {
getLog().info("Code generation is skipped.");
return;
}
if (buildContext != null && inputSpec != null ) {
if (buildContext.isIncremental() &&
inputSpecFile.exists() &&
!buildContext.hasDelta(inputSpecFile)) {
getLog().info(
"Code generation is skipped in delta-build because source-json was not modified.");
return;
}
}
if (Boolean.TRUE.equals(skipIfSpecIsUnchanged) && inputSpecFile.exists()) {
File storedInputSpecHashFile = getHashFile(inputSpecFile);
if (storedInputSpecHashFile.exists()) {
String inputSpecHash = null;
try {
inputSpecHash = calculateInputSpecHash(inputSpecFile);
} catch (IOException ex) {
ex.printStackTrace();
}
@SuppressWarnings("UnstableApiUsage")
String storedInputSpecHash = Files.asCharSource(storedInputSpecHashFile, StandardCharsets.UTF_8).read();
if (storedInputSpecHash.equals(inputSpecHash)) {
getLog().info(
"Code generation is skipped because input was unchanged");
return;
}
}
}
// attempt to read from config file
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configurationFile);
// if a config file wasn't specified or we were unable to read it
if (configurator == null) {
configurator = new CodegenConfigurator();
}
configurator.setVerbose(verbose);
if (skipOverwrite != null) {
configurator.setSkipOverwrite(skipOverwrite);
}
if (removeOperationIdPrefix != null) {
configurator.setRemoveOperationIdPrefix(removeOperationIdPrefix);
}
if (skipOperationExample != null) {
configurator.setSkipOperationExample(skipOperationExample);
}
if (isNotEmpty(inputSpec)) {
configurator.setInputSpec(inputSpec);
}
if (isNotEmpty(gitHost)) {
configurator.setGitHost(gitHost);
}
if (isNotEmpty(gitUserId)) {
configurator.setGitUserId(gitUserId);
}
if (isNotEmpty(gitRepoId)) {
configurator.setGitRepoId(gitRepoId);
}
if (isNotEmpty(ignoreFileOverride)) {
configurator.setIgnoreFileOverride(ignoreFileOverride);
}
if (isNotEmpty(httpUserAgent)) {
configurator.setHttpUserAgent(httpUserAgent);
}
if (skipValidateSpec != null) {
configurator.setValidateSpec(!skipValidateSpec);
}
if (strictSpec != null) {
configurator.setStrictSpecBehavior(strictSpec);
}
if (logToStderr != null) {
configurator.setLogToStderr(logToStderr);
}
if (enablePostProcessFile != null) {
configurator.setEnablePostProcessFile(enablePostProcessFile);
}
if (generateAliasAsModel != null) {
configurator.setGenerateAliasAsModel(generateAliasAsModel);
}
if (isNotEmpty(generatorName)) {
configurator.setGeneratorName(generatorName);
} else {
LOGGER.error("A generator name (generatorName) is required.");
throw new MojoExecutionException("The generator requires 'generatorName'. Refer to documentation for a list of options.");
}
configurator.setOutputDir(output.getAbsolutePath());
if (isNotEmpty(auth)) {
configurator.setAuth(auth);
}
if (isNotEmpty(apiPackage)) {
configurator.setApiPackage(apiPackage);
}
if (isNotEmpty(modelPackage)) {
configurator.setModelPackage(modelPackage);
}
if (isNotEmpty(invokerPackage)) {
configurator.setInvokerPackage(invokerPackage);
}
if (isNotEmpty(packageName)) {
configurator.setPackageName(packageName);
}
if (isNotEmpty(groupId)) {
configurator.setGroupId(groupId);
}
if (isNotEmpty(artifactId)) {
configurator.setArtifactId(artifactId);
}
if (isNotEmpty(artifactVersion)) {
configurator.setArtifactVersion(artifactVersion);
}
if (isNotEmpty(library)) {
configurator.setLibrary(library);
}
if (isNotEmpty(modelNamePrefix)) {
configurator.setModelNamePrefix(modelNamePrefix);
}
if (isNotEmpty(modelNameSuffix)) {
configurator.setModelNameSuffix(modelNameSuffix);
}
if (null != templateDirectory) {
configurator.setTemplateDir(templateDirectory.getAbsolutePath());
}
if (StringUtils.isNotEmpty(templateResourcePath)) {
if (null != templateDirectory) {
LOGGER.warn("Both templateDirectory and templateResourcePath were configured. templateResourcePath overwrites templateDirectory.");
}
configurator.setTemplateDir(templateResourcePath);
}
if (null != engine) {
configurator.setTemplatingEngineName(engine);
}
// Set generation options
if (null != generateApis && generateApis) {
GlobalSettings.setProperty(CodegenConstants.APIS, apisToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.APIS);
}
if (null != generateModels && generateModels) {
GlobalSettings.setProperty(CodegenConstants.MODELS, modelsToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.MODELS);
}
if (null != generateSupportingFiles && generateSupportingFiles) {
GlobalSettings.setProperty(CodegenConstants.SUPPORTING_FILES, supportingFilesToGenerate);
} else {
GlobalSettings.clearProperty(CodegenConstants.SUPPORTING_FILES);
}
GlobalSettings.setProperty(CodegenConstants.MODEL_TESTS, generateModelTests.toString());
GlobalSettings.setProperty(CodegenConstants.MODEL_DOCS, generateModelDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.API_TESTS, generateApiTests.toString());
GlobalSettings.setProperty(CodegenConstants.API_DOCS, generateApiDocumentation.toString());
GlobalSettings.setProperty(CodegenConstants.WITH_XML, withXml.toString());
if (configOptions != null) {
// Retained for backwards-compataibility with configOptions -> instantiation-types
if (instantiationTypes == null && configOptions.containsKey("instantiation-types")) {
applyInstantiationTypesKvp(configOptions.get("instantiation-types").toString(),
configurator);
}
// Retained for backwards-compatibility with configOptions -> import-mappings
if (importMappings == null && configOptions.containsKey("import-mappings")) {
applyImportMappingsKvp(configOptions.get("import-mappings").toString(),
configurator);
}
// Retained for backwards-compataibility with configOptions -> type-mappings
if (typeMappings == null && configOptions.containsKey("type-mappings")) {
applyTypeMappingsKvp(configOptions.get("type-mappings").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> language-specific-primitives
if (languageSpecificPrimitives == null && configOptions.containsKey("language-specific-primitives")) {
applyLanguageSpecificPrimitivesCsv(configOptions
.get("language-specific-primitives").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> additional-properties
if (additionalProperties == null && configOptions.containsKey("additional-properties")) {
applyAdditionalPropertiesKvp(configOptions.get("additional-properties").toString(),
configurator);
}
if (serverVariableOverrides == null && configOptions.containsKey("server-variables")) {
applyServerVariablesKvp(configOptions.get("server-variables").toString(), configurator);
}
// Retained for backwards-compataibility with configOptions -> reserved-words-mappings
if (reservedWordsMappings == null && configOptions.containsKey("reserved-words-mappings")) {
applyReservedWordsMappingsKvp(configOptions.get("reserved-words-mappings")
.toString(), configurator);
}
}
// Apply Instantiation Types
if (instantiationTypes != null && (configOptions == null || !configOptions.containsKey("instantiation-types"))) {
applyInstantiationTypesKvpList(instantiationTypes, configurator);
}
// Apply Import Mappings
if (importMappings != null && (configOptions == null || !configOptions.containsKey("import-mappings"))) {
applyImportMappingsKvpList(importMappings, configurator);
}
// Apply Type Mappings
if (typeMappings != null && (configOptions == null || !configOptions.containsKey("type-mappings"))) {
applyTypeMappingsKvpList(typeMappings, configurator);
}
// Apply Language Specific Primitives
if (languageSpecificPrimitives != null
&& (configOptions == null || !configOptions.containsKey("language-specific-primitives"))) {
applyLanguageSpecificPrimitivesCsvList(languageSpecificPrimitives, configurator);
}
// Apply Additional Properties
if (additionalProperties != null && (configOptions == null || !configOptions.containsKey("additional-properties"))) {
applyAdditionalPropertiesKvpList(additionalProperties, configurator);
}
if (serverVariableOverrides != null && (configOptions == null || !configOptions.containsKey("server-variables"))) {
applyServerVariablesKvpList(serverVariableOverrides, configurator);
}
// Apply Reserved Words Mappings
if (reservedWordsMappings != null && (configOptions == null || !configOptions.containsKey("reserved-words-mappings"))) {
applyReservedWordsMappingsKvpList(reservedWordsMappings, configurator);
}
if (globalProperties == null) {
globalProperties = new HashMap<>();
}
if (environmentVariables != null && environmentVariables.size() > 0) {
globalProperties.putAll(environmentVariables);
getLog().warn("environmentVariables is deprecated and will be removed in version 5.1. Use globalProperties instead.");
}
for (String key : globalProperties.keySet()) {
String value = globalProperties.get(key);
if (value != null) {
configurator.addGlobalProperty(key, value);
}
}
final ClientOptInput input = configurator.toClientOptInput();
final CodegenConfig config = input.getConfig();
if (configOptions != null) {
for (CliOption langCliOption : config.cliOptions()) {
if (configOptions.containsKey(langCliOption.getOpt())) {
input.getConfig().additionalProperties()
.put(langCliOption.getOpt(), configOptions.get(langCliOption.getOpt()));
}
}
}
if (configHelp) {
for (CliOption langCliOption : config.cliOptions()) {
System.out.println("\t" + langCliOption.getOpt());
System.out.println("\t "
+ langCliOption.getOptionHelp().replaceAll("\n", "\n\t "));
System.out.println();
}
return;
}
adjustAdditionalProperties(config);
new DefaultGenerator().opts(input).generate();
if (buildContext != null) {
buildContext.refresh(new File(getCompileSourceRoot()));
}
// Store a checksum of the input spec
File storedInputSpecHashFile = getHashFile(inputSpecFile);
String inputSpecHash = calculateInputSpecHash(inputSpecFile);
if (storedInputSpecHashFile.getParent() != null && !new File(storedInputSpecHashFile.getParent()).exists()) {
File parent = new File(storedInputSpecHashFile.getParent());
if (!parent.mkdirs()) {
throw new RuntimeException("Failed to create the folder " + parent.getAbsolutePath() +
" to store the checksum of the input spec.");
}
}
Files.asCharSink(storedInputSpecHashFile, StandardCharsets.UTF_8).write(inputSpecHash);
} catch (Exception e) {
// Maven logs exceptions thrown by plugins only if invoked with -e
// I find it annoying to jump through hoops to get basic diagnostic information,
// so let's log it in any case:
if (buildContext != null) {
buildContext.addMessage(inputSpecFile, 0, 0, "unexpected error in Open-API generation", BuildContext.SEVERITY_WARNING, e);
}
getLog().error(e);
throw new MojoExecutionException(
"Code generation failed. See above for the full exception.");
}
}
|
[
"CWE-552"
] |
CVE-2021-21429
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
execute
|
modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java
|
6445ea6511a6ddab64c86ae263937dc90650c98c
| 1
|
Analyze the following code function for security vulnerabilities
|
public void loadUrlSyncAndExpectError(final AwContents awContents,
CallbackHelper onPageFinishedHelper,
CallbackHelper onReceivedErrorHelper,
final String url) throws Exception {
int onErrorCallCount = onReceivedErrorHelper.getCallCount();
int onFinishedCallCount = onPageFinishedHelper.getCallCount();
loadUrlAsync(awContents, url);
onReceivedErrorHelper.waitForCallback(onErrorCallCount, 1, WAIT_TIMEOUT_MS,
TimeUnit.MILLISECONDS);
onPageFinishedHelper.waitForCallback(onFinishedCallCount, 1, WAIT_TIMEOUT_MS,
TimeUnit.MILLISECONDS);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadUrlSyncAndExpectError
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
loadUrlSyncAndExpectError
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean profileControl(String process, int userId, boolean start,
ProfilerInfo profilerInfo, int profileType) throws RemoteException {
// note: hijacking SET_ACTIVITY_WATCHER, but should be changed to
// its own permission.
if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires permission "
+ android.Manifest.permission.SET_ACTIVITY_WATCHER);
}
if (start && (profilerInfo == null || profilerInfo.profileFd == null)) {
throw new IllegalArgumentException("null profile info or fd");
}
ProcessRecord proc = null;
synchronized (mProcLock) {
if (process != null) {
proc = findProcessLOSP(process, userId, "profileControl");
}
if (start && (proc == null || proc.getThread() == null)) {
throw new IllegalArgumentException("Unknown process: " + process);
}
}
synchronized (mAppProfiler.mProfilerLock) {
return mAppProfiler.profileControlLPf(proc, start, profilerInfo, profileType);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: profileControl
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
profileControl
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> Queue<T> newSpscQueue() {
return hasUnsafe() ? new SpscLinkedQueue<T>() : new SpscLinkedAtomicQueue<T>();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newSpscQueue
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
newSpscQueue
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(this.data, this.offset, this.length);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInputStream
File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-4152
|
MEDIUM
| 6.8
|
spring-projects/spring-framework
|
getInputStream
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public String getServiceKey() {
return serviceKey;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServiceKey
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
getServiceKey
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException {
if (builder == null) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
// -- Prevent against XXE @see https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
// If you can't completely disable DTDs, then at least do the following:
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities
// JDK7+ - http://xml.org/sax/features/external-general-entities
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities
// JDK7+ - http://xml.org/sax/features/external-parameter-entities
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
// Disable external DTDs as well
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
// and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks" (see reference below)
dbf.setXIncludeAware(false);
dbf.setExpandEntityReferences(false);
builder = dbf.newDocumentBuilder();
builder.setErrorHandler(new XmlParserErrorHandler());
}
return builder;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDocumentBuilder
File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
Repository: ff4j
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-44262
|
CRITICAL
| 9.8
|
ff4j
|
getDocumentBuilder
|
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
|
991df72725f78adbc413d9b0fbb676201f1882e0
| 0
|
Analyze the following code function for security vulnerabilities
|
private InputSource resolveSchema(final String publicId,
final String systemId) throws SAXException,
IOException {
// Schema files must end with xsd
if ( !systemId.toLowerCase().endsWith( "xsd" ) ) {
return null;
}
// try the actual location given by systemId
try {
if ( getTimeout() >= 0 ) {
final URL url = new URL( systemId );
URLConnection conn = url.openConnection();
conn.setConnectTimeout( getTimeout() );
return new InputSource( conn.getInputStream() );
}
} catch ( final Exception e ) {
}
// Try and get the index for the filename, else return null
String xsd;
int index = systemId.lastIndexOf( "/" );
if ( index == -1 ) {
index = systemId.lastIndexOf( "\\" );
}
if ( index != -1 ) {
xsd = systemId.substring( index + 1 );
} else {
xsd = systemId;
}
// Try looking at root of classpath
{
InputStream is = ExtensibleXmlParser.class.getResourceAsStream( "/" + xsd );
if ( is != null ) {
return new InputSource( is );
}
}
// Try looking in /META-INF
{
final InputStream is = ExtensibleXmlParser.class.getResourceAsStream( "/META-INF/" + xsd );
if ( is != null ) {
return new InputSource( is );
}
}
// Try looking in META-INF
{
final InputStream is = ExtensibleXmlParser.class.getResourceAsStream( "META-INF/" + xsd );
if ( is != null ) {
return new InputSource( is );
}
}
// Try current working directory
{
final File file = new File( xsd );
if ( file.exists() ) {
return new InputSource( new BufferedInputStream( new FileInputStream( file ) ) );
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveSchema
File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
Repository: apache/incubator-kie-drools
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2014-8125
|
HIGH
| 7.5
|
apache/incubator-kie-drools
|
resolveSchema
|
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
|
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<Parameter> getParameters() {
if (condition != null) {
return condition.getParameters();
} else {
return Collections.emptyList();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParameters
File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
Repository: xjodoin/torpedoquery
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2019-11343
|
HIGH
| 7.5
|
xjodoin/torpedoquery
|
getParameters
|
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
|
3c20b874fba9cc2a78b9ace10208de1602b56c3f
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean usesStandardHeader() {
if (mN.mUsesStandardHeader) {
return true;
}
if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.N) {
if (mN.contentView == null && mN.bigContentView == null) {
return true;
}
}
boolean contentViewUsesHeader = mN.contentView == null
|| STANDARD_LAYOUTS.contains(mN.contentView.getLayoutId());
boolean bigContentViewUsesHeader = mN.bigContentView == null
|| STANDARD_LAYOUTS.contains(mN.bigContentView.getLayoutId());
return contentViewUsesHeader && bigContentViewUsesHeader;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: usesStandardHeader
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
usesStandardHeader
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void execute(String url, ActionListener response) {
if (response != null) {
callback = new EventDispatcher();
callback.addListener(response);
}
try {
Intent intent = createIntentForURL(url);
if(intent == null) {
return;
}
if(response != null && getActivity() != null){
getActivity().startActivityForResult(intent, IntentResultListener.URI_SCHEME);
}else {
getContext().startActivity(intent);
}
return;
} catch (Exception ex) {
com.codename1.io.Log.e(ex);
}
try {
if(editInProgress()) {
stopEditing(true);
}
getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
} catch (Exception e) {
e.printStackTrace();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
execute
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void newBlobContent(@Nullable AjaxRequestTarget target) {
PrioritizedComponentRenderer mostPrioritizedRenderer = null;
for (BlobRendererContribution contribution: OneDev.getExtensions(BlobRendererContribution.class)) {
PrioritizedComponentRenderer renderer = contribution.getRenderer(this);
if (renderer != null) {
if (mostPrioritizedRenderer == null || mostPrioritizedRenderer.getPriority() > renderer.getPriority())
mostPrioritizedRenderer = renderer;
}
}
Component blobContent = Preconditions.checkNotNull(mostPrioritizedRenderer).render(BLOB_CONTENT_ID);
if (target != null) {
replace(blobContent);
target.add(blobContent);
} else {
add(blobContent);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newBlobContent
File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2021-21245
|
HIGH
| 7.5
|
theonedev/onedev
|
newBlobContent
|
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
|
0c060153fb97c0288a1917efdb17cc426934dacb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Contact getContactById(String id, boolean includesFullName, boolean includesPicture,
boolean includesNumbers, boolean includesEmail, boolean includeAddress){
if(!checkForPermission(Manifest.permission.READ_CONTACTS, "This is required to get the contacts")){
return null;
}
return AndroidContactsManager.getInstance().getContact(getContext(), id, includesFullName, includesPicture,
includesNumbers, includesEmail, includeAddress);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContactById
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
getContactById
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
void clearAllDrawn() {
allDrawn = false;
mLastAllDrawn = false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearAllDrawn
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
clearAllDrawn
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean sdpSearch(BluetoothDevice device,ParcelUuid uuid) {
enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if(mSdpManager != null) {
mSdpManager.sdpSearch(device,uuid);
return true;
} else {
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sdpSearch
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
sdpSearch
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isIncomingCallPermitted(PhoneAccountHandle phoneAccountHandle,
String callingPackage) {
Log.startSession("TSI.iICP");
try {
enforceCallingPackage(callingPackage, "isIncomingCallPermitted");
enforcePhoneAccountHandleMatchesCaller(phoneAccountHandle, callingPackage);
enforcePermission(android.Manifest.permission.MANAGE_OWN_CALLS);
enforceUserHandleMatchesCaller(phoneAccountHandle);
synchronized (mLock) {
long token = Binder.clearCallingIdentity();
try {
return mCallsManager.isIncomingCallPermitted(phoneAccountHandle);
} finally {
Binder.restoreCallingIdentity(token);
}
}
} finally {
Log.endSession();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIncomingCallPermitted
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
isIncomingCallPermitted
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty("attributes")
public List<ProfileAttribute> getAttrs() {
return attrs;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttrs
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getAttrs
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cropRegionToRootTaskBoundsIfNeeded(Region region) {
final Task task = getTask();
if (task == null || !task.cropWindowsToRootTaskBounds()) {
return;
}
final Task rootTask = task.getRootTask();
if (rootTask == null || rootTask.mCreatedByOrganizer) {
return;
}
rootTask.getDimBounds(mTmpRect);
adjustRegionInFreefromWindowMode(mTmpRect);
region.op(mTmpRect, Region.Op.INTERSECT);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cropRegionToRootTaskBoundsIfNeeded
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
cropRegionToRootTaskBoundsIfNeeded
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public SparseArray<String> getAssignedPackageIdentifiers(boolean includeOverlays,
boolean includeLoaders) {
synchronized (this) {
ensureValidLocked();
return nativeGetAssignedPackageIdentifiers(mObject, includeOverlays, includeLoaders);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAssignedPackageIdentifiers
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getAssignedPackageIdentifiers
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void start(ChannelSession channel, Environment env) throws IOException {
SshAuthenticator authenticator = OneDev.getInstance(SshAuthenticator.class);
ThreadContext.bind(SecurityUtils.asSubject(authenticator.getPublicKeyOwnerId(session)));
File gitDir;
Map<String, String> gitEnvs;
SessionManager sessionManager = OneDev.getInstance(SessionManager.class);
sessionManager.openSession();
try {
ProjectManager projectManager = OneDev.getInstance(ProjectManager.class);
String projectPath = StringUtils.substringAfter(command, "'/");
projectPath = StringUtils.substringBefore(projectPath, "'");
Project project = projectManager.findByPath(projectPath);
if (project == null && projectPath.startsWith("projects/")) {
projectPath = projectPath.substring("projects/".length());
project = projectManager.findByPath(projectPath);
}
if (project == null) {
onExit(-1, "Unable to find project '" + projectPath + "'");
return;
}
String errorMessage = checkPermission(project);
if (errorMessage != null) {
onExit(-1, errorMessage);
return;
}
gitDir = project.getGitDir();
gitEnvs = buildGitEnvs(project);
} finally {
sessionManager.closeSession();
}
InetSocketAddress address = (InetSocketAddress) session.getRemoteAddress();
String groupId = "git-over-ssh-" + gitDir.getAbsolutePath()
+ "-" + address.getAddress().getHostAddress();
WorkExecutor workExecutor = OneDev.getInstance(WorkExecutor.class);
future = workExecutor.submit(groupId, new PrioritizedRunnable(PRIORITY) {
@Override
public void run() {
try {
ExecutionResult result = execute(gitDir, gitEnvs);
onExit(result.getReturnCode(), null);
} catch (Exception e) {
logger.error("Error executing git command", e);
onExit(-1, e.getMessage());
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: start
File: server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
start
|
server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
private EnforcingAdmin enforcePermissionAndGetEnforcingAdmin(@Nullable ComponentName admin,
String permission, String callerPackageName, int targetUserId) {
enforcePermission(permission, callerPackageName, targetUserId);
return getEnforcingAdminForCaller(admin, callerPackageName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforcePermissionAndGetEnforcingAdmin
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
enforcePermissionAndGetEnforcingAdmin
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
long challenge, int userId) throws RemoteException {
checkPasswordReadPermission(userId);
CredentialHash storedHash = mStorage.readPasswordHash(userId);
return doVerifyPassword(password, storedHash, hasChallenge, challenge, userId);
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-3908
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Fix vulnerability in LockSettings service
Fixes bug 30003944
Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
(cherry picked from commit 2d71384a139ae27cbc7b57f06662bf6ee2010f2b)
Function: doVerifyPassword
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
Fixed Code:
private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
long challenge, int userId) throws RemoteException {
checkPasswordReadPermission(userId);
if (TextUtils.isEmpty(password)) {
throw new IllegalArgumentException("Password can't be null or empty");
}
CredentialHash storedHash = mStorage.readPasswordHash(userId);
return doVerifyPassword(password, storedHash, hasChallenge, challenge, userId);
}
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
doVerifyPassword
|
services/core/java/com/android/server/LockSettingsService.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 1
|
Analyze the following code function for security vulnerabilities
|
private void migrateScreenCapturePolicyLocked() {
Binder.withCleanCallingIdentity(() -> {
if (mPolicyCache.getScreenCaptureDisallowedUser() == UserHandle.USER_NULL) {
return;
}
ActiveAdmin admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked();
if (admin != null
&& ((isDeviceOwner(admin) && admin.disableScreenCapture)
|| (admin.getParentActiveAdmin() != null
&& admin.getParentActiveAdmin().disableScreenCapture))) {
EnforcingAdmin enforcingAdmin = EnforcingAdmin.createEnterpriseEnforcingAdmin(
admin.info.getComponent(),
admin.getUserHandle().getIdentifier(),
admin);
mDevicePolicyEngine.setGlobalPolicy(
PolicyDefinition.SCREEN_CAPTURE_DISABLED,
enforcingAdmin,
new BooleanPolicyValue(true));
}
List<UserInfo> users = mUserManager.getUsers();
for (UserInfo userInfo : users) {
ActiveAdmin profileOwner = getProfileOwnerLocked(userInfo.id);
if (profileOwner != null && profileOwner.disableScreenCapture) {
EnforcingAdmin enforcingAdmin = EnforcingAdmin.createEnterpriseEnforcingAdmin(
profileOwner.info.getComponent(),
profileOwner.getUserHandle().getIdentifier(),
profileOwner);
mDevicePolicyEngine.setLocalPolicy(
PolicyDefinition.SCREEN_CAPTURE_DISABLED,
enforcingAdmin,
new BooleanPolicyValue(true),
profileOwner.getUserHandle().getIdentifier());
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrateScreenCapturePolicyLocked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
migrateScreenCapturePolicyLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getConfig(String msg) {
return Config.getStr("filemanager." + msg);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConfig
File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java
Repository: jflyfox/jfinal_cms
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2021-37262
|
MEDIUM
| 5
|
jflyfox/jfinal_cms
|
getConfig
|
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
|
e7fd0fe9362464c4d2bd308318eecc89a847b116
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void revokeRuntimePermission(String packageName, String permissionName, int userId,
String reason) {
mPermissionManagerServiceImpl.revokeRuntimePermission(packageName, permissionName, userId,
reason);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: revokeRuntimePermission
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
revokeRuntimePermission
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTextPage(final User user) throws IOException {
return getContactServiceProvider(user, ContactType.textPage.toString());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTextPage
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
getTextPage
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setAnimationScales(float[] scales) {
if (!checkCallingPermission(android.Manifest.permission.SET_ANIMATION_SCALE,
"setAnimationScale()")) {
throw new SecurityException("Requires SET_ANIMATION_SCALE permission");
}
if (scales != null) {
if (scales.length >= 1) {
mWindowAnimationScaleSetting = fixScale(scales[0]);
}
if (scales.length >= 2) {
mTransitionAnimationScaleSetting = fixScale(scales[1]);
}
if (scales.length >= 3) {
mAnimatorDurationScaleSetting = fixScale(scales[2]);
dispatchNewAnimatorScaleLocked(null);
}
}
// Persist setting
mH.sendEmptyMessage(H.PERSIST_ANIMATION_SCALE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAnimationScales
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
setAnimationScales
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDefaultCredentials(String username, String password)
{
setDefaultCredentials(new UsernamePasswordCredentials(username, password));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDefaultCredentials
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
setDefaultCredentials
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkCallerIsPhoneOrCarrierApp() {
int uid = Binder.getCallingUid();
int appId = UserHandle.getAppId(uid);
if (appId == Process.PHONE_UID || uid == 0) {
return;
}
try {
PackageManager pm = mContext.getPackageManager();
ApplicationInfo ai = pm.getApplicationInfo(getCarrierAppPackageName(), 0);
if (!UserHandle.isSameApp(ai.uid, Binder.getCallingUid())) {
throw new SecurityException("Caller is not phone or carrier app!");
}
} catch (PackageManager.NameNotFoundException re) {
throw new SecurityException("Caller is not phone or carrier app!");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkCallerIsPhoneOrCarrierApp
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
checkCallerIsPhoneOrCarrierApp
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected Contentlet find(String inode) throws ElasticsearchException, DotStateException, DotDataException, DotSecurityException {
Contentlet con = cc.get(inode);
if (con != null && InodeUtils.isSet(con.getInode())) {
if(CACHE_404_CONTENTLET.equals(con.getInode())){
return null;
}
return con;
}
/*try {
Client client = new ESClient().getClient();
QueryBuilder builder = QueryBuilders.boolQuery().must(QueryBuilders.fieldQuery("inode", inode));
SearchResponse response = client.prepareSearch().setQuery(builder).execute().actionGet();
SearchHits hits = response.hits();
Contentlet contentlet = loadInode(hits.getAt(0));
return contentlet;
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage());
}*/
com.dotmarketing.portlets.contentlet.business.Contentlet fatty = null;
try{
fatty = (com.dotmarketing.portlets.contentlet.business.Contentlet)HibernateUtil.load(com.dotmarketing.portlets.contentlet.business.Contentlet.class, inode);
} catch (DotHibernateException e) {
if(!(e.getCause() instanceof ObjectNotFoundException))
throw e;
}
if(fatty == null){
cc.add(inode, cache404Content);
return null;
}else{
Contentlet c = convertFatContentletToContentlet(fatty);
cc.add(c.getInode(), c);
return c;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: find
File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
find
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeCallback(KeyguardUpdateMonitorCallback callback) {
if (DEBUG) Log.v(TAG, "*** unregister callback for " + callback);
for (int i = mCallbacks.size() - 1; i >= 0; i--) {
if (mCallbacks.get(i).get() == callback) {
mCallbacks.remove(i);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeCallback
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
removeCallback
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getMaxWallpaperLayer() {
return windowTypeToLayerLw(TYPE_STATUS_BAR);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxWallpaperLayer
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
getMaxWallpaperLayer
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
private static File buildUniqueFileWithExtension(File parent, String name, String ext)
throws FileNotFoundException {
final Iterator<String> names = buildUniqueNameIterator(parent, name);
while (names.hasNext()) {
File file = buildFile(parent, names.next(), ext);
if (!file.exists()) {
return file;
}
}
throw new FileNotFoundException("Failed to create unique file");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildUniqueFileWithExtension
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
buildUniqueFileWithExtension
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void injectCustomMappings(XWikiContext context) throws XWikiException
{
injectCustomMappingsInSessionFactory(context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectCustomMappings
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
injectCustomMappings
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public synchronized boolean isOutboundDone() {
return isOutboundDone;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOutboundDone
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
isOutboundDone
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerHttpResponse sendFile(String path, long offset, long length) {
response.sendFile(path, offset, length);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendFile
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
sendFile
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean connect(String param, int param1, int connectTimeout) {
try {
socketInstance = new java.net.Socket();
socketInstance.connect(new InetSocketAddress(param, param1), connectTimeout);
return true;
} catch(Exception err) {
err.printStackTrace();
errorMessage = err.toString();
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connect
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
connect
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setOperate(String operate) {
this.operate = operate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOperate
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
setOperate
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public static CallStyle forIncomingCall(@NonNull Person person,
@NonNull PendingIntent declineIntent, @NonNull PendingIntent answerIntent) {
return new CallStyle(CALL_TYPE_INCOMING, person,
null /* hangUpIntent */,
requireNonNull(declineIntent, "declineIntent is required"),
requireNonNull(answerIntent, "answerIntent is required")
);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forIncomingCall
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
forIncomingCall
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiScenarioWithBLOBs getApiScenario(String id) {
return apiScenarioMapper.selectByPrimaryKey(id);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApiScenario
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
getApiScenario
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setTempFolderPath(String tempFolderPath) {
this.tempFolderPath = tempFolderPath;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTempFolderPath
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setTempFolderPath
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable Timestamp getTimestamp(
String c, java.util.@Nullable Calendar cal) throws SQLException {
return getTimestamp(findColumn(c), cal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTimestamp
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getTimestamp
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object forward(String path) {
ServerWebExchange exchange = SaReactorSyncHolder.getContext();
WebFilterChain chain = exchange.getAttribute(SaReactorHolder.CHAIN_KEY);
ServerHttpRequest newRequest = request.mutate().path(path).build();
ServerWebExchange newExchange = exchange.mutate().request(newRequest).build();
return chain.filter(newExchange);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forward
File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
forward
|
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean setUnlockMethod(String unlockMethod) {
EventLog.writeEvent(EventLogTags.LOCK_SCREEN_TYPE, unlockMethod);
ScreenLockType lock = ScreenLockType.fromKey(unlockMethod);
if (lock != null) {
switch (lock) {
case NONE:
case SWIPE:
updateUnlockMethodAndFinish(
lock.defaultQuality,
lock == ScreenLockType.NONE,
false /* chooseLockSkipped */);
return true;
case PATTERN:
case PIN:
case PASSWORD:
case MANAGED:
maybeEnableEncryption(lock.defaultQuality, false);
return true;
}
}
Log.e(TAG, "Encountered unknown unlock method to set: " + unlockMethod);
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUnlockMethod
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
setUnlockMethod
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getBrowserTitle(PeerComponent browserPeer) {
return ((AndroidImplementation.AndroidBrowserComponent) browserPeer).getTitle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBrowserTitle
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
getBrowserTitle
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private DocumentBuilder getAvailableDocumentBuilder() throws ParserConfigurationException
{
ExecutionContext econtext = this.execution.getContext();
if (econtext != null) {
DocumentBuilder documentBuilder = (DocumentBuilder) econtext.getProperty(DocumentBuilder.class.getName());
if (documentBuilder == null) {
documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
econtext.setProperty(DocumentBuilder.class.getName(), documentBuilder);
}
return documentBuilder;
}
return DocumentBuilderFactory.newInstance().newDocumentBuilder();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAvailableDocumentBuilder
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
Repository: xwiki/xwiki-commons
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29201
|
CRITICAL
| 9
|
xwiki/xwiki-commons
|
getAvailableDocumentBuilder
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
|
b11eae9d82cb53f32962056b5faa73f3720c6182
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void popPrinter()
{
super.popPrinter();
getXHTMLWikiPrinter().setWikiPrinter(getPrinter());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: popPrinter
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
popPrinter
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
long getStatStartTime() {
return mStatLogger.getTime();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatStartTime
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
getStatStartTime
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isValidCompressedBuffer(byte[] input)
throws IOException
{
return isValidCompressedBuffer(input, 0, input.length);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isValidCompressedBuffer
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
isValidCompressedBuffer
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getExecutable()
{
if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
{
return super.getExecutable();
}
return unifyQuotes( super.getExecutable() );
}
|
Vulnerability Classification:
- CWE: CWE-116
- CVE: CVE-2022-29599
- Severity: HIGH
- CVSS Score: 7.5
Description: [MSHARED-297] - BourneShell unconditionally single quotes executable and arguments
Function: getExecutable
File: src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
Repository: apache/maven-shared-utils
Fixed Code:
public String getExecutable()
{
if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
{
return super.getExecutable();
}
return quoteOneItem( super.getExecutable(), true );
}
|
[
"CWE-116"
] |
CVE-2022-29599
|
HIGH
| 7.5
|
apache/maven-shared-utils
|
getExecutable
|
src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
|
2735facbbbc2e13546328cb02dbb401b3776eea3
| 1
|
Analyze the following code function for security vulnerabilities
|
private Context getContextForUser(UserHandle user) {
try {
return mContext.createPackageContextAsUser(mContext.getPackageName(), 0, user);
} catch (NameNotFoundException e) {
// Default to mContext, not finding the package system is running as is unlikely.
return mContext;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContextForUser
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
getContextForUser
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.