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 String getWebsite() { return website; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWebsite 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
getWebsite
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) { enforceNotIsolatedCaller("moveActivityTaskToBack"); synchronized(this) { final long origId = Binder.clearCallingIdentity(); try { int taskId = ActivityRecord.getTaskForActivityLocked(token, !nonRoot); final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); if (task != null) { return ActivityRecord.getStackLocked(token).moveTaskToBackLocked(taskId); } } finally { Binder.restoreCallingIdentity(origId); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveActivityTaskToBack File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
moveActivityTaskToBack
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void clear() { if (staticResourceHandlers != null) { staticResourceHandlers.clear(); staticResourceHandlers = null; } if (jarResourceHandlers != null) { jarResourceHandlers.clear(); jarResourceHandlers = null; } staticResourcesSet = false; externalStaticResourcesSet = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clear File: src/main/java/spark/staticfiles/StaticFilesConfiguration.java Repository: perwendel/spark The code follows secure coding practices.
[ "CWE-22" ]
CVE-2016-9177
MEDIUM
5
perwendel/spark
clear
src/main/java/spark/staticfiles/StaticFilesConfiguration.java
26b57d0596ee73c14c558463943ef0857e53b91f
0
Analyze the following code function for security vulnerabilities
private Uri persistSentMessageIfRequired(Context context, int messageType, int errorCode) { if (!mIsText || !SmsApplication.shouldWriteMessageForPackage(mAppInfo.packageName, context)) { return null; } Rlog.d(TAG, "Persist SMS into " + (messageType == Sms.MESSAGE_TYPE_FAILED ? "FAILED" : "SENT")); final ContentValues values = new ContentValues(); values.put(Sms.SUBSCRIPTION_ID, mSubId); values.put(Sms.ADDRESS, mDestAddress); values.put(Sms.BODY, mFullMessageText); values.put(Sms.DATE, System.currentTimeMillis()); // milliseconds values.put(Sms.SEEN, 1); values.put(Sms.READ, 1); final String creator = mAppInfo != null ? mAppInfo.packageName : null; if (!TextUtils.isEmpty(creator)) { values.put(Sms.CREATOR, creator); } if (mDeliveryIntent != null) { values.put(Sms.STATUS, Telephony.Sms.STATUS_PENDING); } if (errorCode != 0) { values.put(Sms.ERROR_CODE, errorCode); } final long identity = Binder.clearCallingIdentity(); final ContentResolver resolver = context.getContentResolver(); try { final Uri uri = resolver.insert(Telephony.Sms.Sent.CONTENT_URI, values); if (uri != null && messageType == Sms.MESSAGE_TYPE_FAILED) { // Since we can't persist a message directly into FAILED box, // we have to update the column after we persist it into SENT box. // The gap between the state change is tiny so I would not expect // it to cause any serious problem // TODO: we should add a "failed" URI for this in SmsProvider? final ContentValues updateValues = new ContentValues(1); updateValues.put(Sms.TYPE, Sms.MESSAGE_TYPE_FAILED); resolver.update(uri, updateValues, null/*where*/, null/*selectionArgs*/); } return uri; } catch (Exception e) { Rlog.e(TAG, "writeOutboxMessage: Failed to persist outbox message", e); return null; } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: persistSentMessageIfRequired 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
persistSentMessageIfRequired
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
@Editable(order=400, description="Specifies password of above manager DN") @NotEmpty @Password public String getManagerPassword() { return managerPassword; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManagerPassword File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-90" ]
CVE-2021-32651
MEDIUM
4.3
theonedev/onedev
getManagerPassword
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
4440f0c57e440488d7e653417b2547eaae8ad19c
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPerspectiveTransformSupported() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPerspectiveTransformSupported 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
isPerspectiveTransformSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean verifyIfNameHasMoreThan100Characters(String appointmentName) { if (appointmentName != null) { return (appointmentName.length() > 100) ? true : false; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyIfNameHasMoreThan100Characters File: api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36635
MEDIUM
5.4
openmrs/openmrs-module-appointmentscheduling
verifyIfNameHasMoreThan100Characters
api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
34213c3f6ea22df427573076fb62744694f601d8
0
Analyze the following code function for security vulnerabilities
void onUiSelectorInvocationFailure();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUiSelectorInvocationFailure File: services/credentials/java/com/android/server/credentials/CredentialManagerUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40076
MEDIUM
5.5
android
onUiSelectorInvocationFailure
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java
9b68987df85b681f9362a3cadca6496796d23bbc
0
Analyze the following code function for security vulnerabilities
public static String getTempPath(final String targetPath) { return FileDownloadUtils.formatString("%s.temp", targetPath); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTempPath File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
getTempPath
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
@Override public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, int allowMode, String name, String callerPackage) { return mUserController.handleIncomingUser(callingPid, callingUid, userId, allowAll, allowMode, name, callerPackage); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleIncomingUser 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
handleIncomingUser
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public boolean isSubjectEmpty() { return TextUtils.getTrimmedLength(mSubject.getText()) == 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSubjectEmpty File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
isSubjectEmpty
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void doUpgrade(String warName, File upgradeWarFile) { File currentRunWarFile = new File(new File(PathKit.getWebRootPath()).getParentFile() + warName); currentRunWarFile.delete(); FileUtils.moveOrCopyFile(upgradeWarFile.toString(), currentRunWarFile.toString(), true); updateProcessMsg("覆盖更新包 " + currentRunWarFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doUpgrade File: web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
doUpgrade
web/src/main/java/com/zrlog/web/plugin/WarUpdateVersionThread.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
protected Class<?> resolveClass(java.io.ObjectStreamClass descriptor) throws ClassNotFoundException, IOException { String className = descriptor.getName(); ClassFilter classFilter = new ClassFilter(); if(className != null && className.length() > 0 && !classFilter.isWhiteListed(className)) { throw new InvalidClassException("Unauthorized deserialization attempt", descriptor.getName()); } else { return super.resolveClass(descriptor); } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2018-18628 - Severity: HIGH - CVSS Score: 10.0 Description: Updated Code. Function: resolveClass File: pippo-session-parent/pippo-session/src/main/java/ro/pippo/session/FilteringObjectInputStream.java Repository: pippo-java/pippo Fixed Code: protected Class<?> resolveClass(ObjectStreamClass descriptor) throws ClassNotFoundException, IOException { String className = descriptor.getName(); if (isNullOrEmpty(className) && !isWhiteListed(className)) { throw new InvalidClassException("Unauthorized deserialization attempt", descriptor.getName()); } else { return super.resolveClass(descriptor); } }
[ "CWE-502" ]
CVE-2018-18628
HIGH
10
pippo-java/pippo
resolveClass
pippo-session-parent/pippo-session/src/main/java/ro/pippo/session/FilteringObjectInputStream.java
59eb2eee1b5ab4fea02edc73168577a10473098a
1
Analyze the following code function for security vulnerabilities
public ActivityOptions setLockTaskEnabled(boolean lockTaskMode) { mLockTaskMode = lockTaskMode; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockTaskEnabled File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
setLockTaskEnabled
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeStrongBinder(agent); mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); reply.recycle(); data.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: backupAgentCreated File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
backupAgentCreated
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public <T> void join(JoinBy from, JoinBy to, String operation, String joinType, Class<T> returnedClazz, CQLWrapper cr, Handler<AsyncResult<Results<T>>> replyHandler){ String filter = ""; if(cr != null){ filter = cr.toString(); } join(from, to, operation, joinType, filter, returnedClazz, true, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
join
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private static X509KeyManager createDefaultX509KeyManager() throws KeyManagementException { try { String algorithm = KeyManagerFactory.getDefaultAlgorithm(); KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm); kmf.init(null, null); KeyManager[] kms = kmf.getKeyManagers(); X509KeyManager result = findFirstX509KeyManager(kms); if (result == null) { throw new KeyManagementException("No X509KeyManager among default KeyManagers: " + Arrays.toString(kms)); } return result; } catch (NoSuchAlgorithmException e) { throw new KeyManagementException(e); } catch (KeyStoreException e) { throw new KeyManagementException(e); } catch (UnrecoverableKeyException e) { throw new KeyManagementException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDefaultX509KeyManager File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
createDefaultX509KeyManager
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
@Override public String[] getSupportedProtocols() { return SUPPORTED_PROTOCOLS.clone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSupportedProtocols 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
getSupportedProtocols
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Deprecated @UnsupportedAppUsage public int addAssetPathAsSharedLibrary(String path) { return addAssetPathInternal(path, false /*overlay*/, true /*appAsLib*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAssetPathAsSharedLibrary 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
addAssetPathAsSharedLibrary
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void setActivityController(IActivityController watcher) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityController File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setActivityController
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected String getFullUri(Class<?> resourceClass) { return this.testUtils.rest().createUri(resourceClass, null).toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFullUri File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
getFullUri
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
private void updateMaximumTimeToLockLocked(@UserIdInt int userId) { // Update the profile's timeout if (isManagedProfile(userId)) { updateProfileLockTimeoutLocked(userId); } mInjector.binderWithCleanCallingIdentity(() -> { // Update the device timeout final int parentId = getProfileParentId(userId); final long timeMs = getMaximumTimeToLockPolicyFromAdmins( getActiveAdminsForLockscreenPoliciesLocked(parentId)); final DevicePolicyData policy = getUserDataUnchecked(parentId); if (policy.mLastMaximumTimeToLock == timeMs) { return; } policy.mLastMaximumTimeToLock = timeMs; if (policy.mLastMaximumTimeToLock != Long.MAX_VALUE) { // Make sure KEEP_SCREEN_ON is disabled, since that // would allow bypassing of the maximum time to lock. mInjector.settingsGlobalPutInt(Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0); } getPowerManagerInternal().setMaximumScreenOffTimeoutFromDeviceAdmin( UserHandle.USER_SYSTEM, timeMs); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateMaximumTimeToLockLocked File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
updateMaximumTimeToLockLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void registeredForPush(String deviceId) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registeredForPush File: Ports/Android/src/com/codename1/impl/android/PushNotificationService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
registeredForPush
Ports/Android/src/com/codename1/impl/android/PushNotificationService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private final void enqueueUidChangeLocked(UidRecord uidRec, boolean gone) { if (uidRec.pendingChange == null) { if (mPendingUidChanges.size() == 0) { if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "*** Enqueueing dispatch uid changed!"); mUiHandler.obtainMessage(DISPATCH_UIDS_CHANGED_MSG).sendToTarget(); } final int NA = mAvailUidChanges.size(); if (NA > 0) { uidRec.pendingChange = mAvailUidChanges.remove(NA-1); if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "Retrieving available item: " + uidRec.pendingChange); } else { uidRec.pendingChange = new UidRecord.ChangeItem(); if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "Allocating new item: " + uidRec.pendingChange); } uidRec.pendingChange.uidRecord = uidRec; uidRec.pendingChange.uid = uidRec.uid; mPendingUidChanges.add(uidRec.pendingChange); } uidRec.pendingChange.gone = gone; uidRec.pendingChange.processState = uidRec.setProcState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueUidChangeLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
enqueueUidChangeLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public boolean isWysiwyg(XWikiContext context) { return "wysiwyg".equals(getEditorType(context)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWysiwyg File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-41046
MEDIUM
6.3
xwiki/xwiki-platform
isWysiwyg
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
edc52579eeaab1b4514785c134044671a1ecd839
0
Analyze the following code function for security vulnerabilities
public double readDouble() throws TException { return Double.longBitsToDouble(readI64()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readDouble File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readDouble
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_getTiers(Context cx, Scriptable thisObj, Object[] args, Function funObj) { NativeArray myn = new NativeArray(0); APIConsumer apiConsumer = getAPIConsumer(thisObj); Set<Tier> tiers; try { //If tenant domain is present in url we will use it to get available tiers if (args.length > 0 && args[0] != null) { tiers = apiConsumer.getTiers((String) args[0]); } else { tiers = apiConsumer.getTiers(); } List<Tier> tierList = APIUtil.sortTiers(tiers); int i = 0; for (Tier tier : tierList) { NativeObject row = new NativeObject(); row.put("tierName", row, tier.getName()); row.put("tierDisplayName", row, tier.getDisplayName()); row.put("tierDescription", row, tier.getDescription() != null ? tier.getDescription() : ""); row.put("defaultTier", row, i == 0); row.put("requestCount", row, tier.getRequestCount()); row.put("unitTime", row, tier.getUnitTime()); myn.put(i, myn, row); i++; } } catch (Exception e) { log.error("Error while getting available tiers", e); } return myn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_getTiers File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_getTiers
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
@Override public void requireStrongAuth(int strongAuthReason, int userId) { checkWritePermission(userId); mStrongAuth.requireStrongAuth(strongAuthReason, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requireStrongAuth File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
requireStrongAuth
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
protected void initialize() throws IOException { //name on a best-effort basis name = null; requestType = null; final HttpServletRequest request = (HttpServletRequest) getRequest(); final String contentType = request.getContentType(); if (contentType == null) { //don't know how to handle this content type return; } if (!"POST".equalsIgnoreCase(request.getMethod())) { //no payload return; } //Try look for name in payload on a best-effort basis... try { if (contentType.startsWith("text/x-gwt-rpc")) { //parse GWT-RPC method name name = parseGwtRpcMethodName(getBufferedInputStream(), getCharacterEncoding()); requestType = "GWT-RPC"; } else if (contentType.startsWith("application/soap+xml") //SOAP 1.2 || contentType.startsWith("text/xml") //SOAP 1.1 && request.getHeader("SOAPAction") != null) { //parse SOAP method name name = parseSoapMethodName(getBufferedInputStream(), getCharacterEncoding()); requestType = "SOAP"; } else { //don't know how to name this request based on payload //(don't parse if text/xml for XML-RPC, because it is obsolete) name = null; requestType = null; } } catch (final Exception e) { LOG.debug("Error trying to parse payload content for request name", e); //best-effort - couldn't figure it out name = null; requestType = null; } finally { //reset stream so application is unaffected resetBufferedInputStream(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java Repository: javamelody The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-15531
HIGH
7.5
javamelody
initialize
javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java
ef111822562d0b9365bd3e671a75b65bd0613353
0
Analyze the following code function for security vulnerabilities
private void setLastReportedConfiguration(Configuration global, Configuration override) { mLastReportedConfiguration.setConfiguration(global, override); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLastReportedConfiguration 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
setLastReportedConfiguration
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public Point getAppTaskThumbnailSize() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0); reply.readException(); Point size = Point.CREATOR.createFromParcel(reply); data.recycle(); reply.recycle(); return size; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppTaskThumbnailSize File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getAppTaskThumbnailSize
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { FragmentTransaction trans = fragmentManager.beginTransaction(); trans.remove(fragments[position]); trans.commit(); fragments[position] = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyItem File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
destroyItem
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private List<String> getAllRecordingIds(String path) { String[] format = getPlaybackFormats(path); return getAllRecordingIds(path, format); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllRecordingIds File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
getAllRecordingIds
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public String displayDocument(boolean restricted, XWikiContext context) throws XWikiException { return displayDocument(getOutputSyntax(), restricted, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
displayDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private double toDouble(K name, V value) { try { return valueConverter.convertToDouble(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert header value to double for header '" + name + '\''); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDouble 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
toDouble
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
NeededUriGrants checkGrantUriPermissionFromIntentLocked(int callingUid, String targetPkg, Intent intent, int mode, NeededUriGrants needed, int targetUserId) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Checking URI perm to data=" + (intent != null ? intent.getData() : null) + " clip=" + (intent != null ? intent.getClipData() : null) + " from " + intent + "; flags=0x" + Integer.toHexString(intent != null ? intent.getFlags() : 0)); if (targetPkg == null) { throw new NullPointerException("targetPkg"); } if (intent == null) { return null; } Uri data = intent.getData(); ClipData clip = intent.getClipData(); if (data == null && clip == null) { return null; } // Default userId for uris in the intent (if they don't specify it themselves) int contentUserHint = intent.getContentUserHint(); if (contentUserHint == UserHandle.USER_CURRENT) { contentUserHint = UserHandle.getUserId(callingUid); } final IPackageManager pm = AppGlobals.getPackageManager(); int targetUid; if (needed != null) { targetUid = needed.targetUid; } else { try { targetUid = pm.getPackageUid(targetPkg, targetUserId); } catch (RemoteException ex) { return null; } if (targetUid < 0) { if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION, "Can't grant URI permission no uid for: " + targetPkg + " on user " + targetUserId); return null; } } if (data != null) { GrantUri grantUri = GrantUri.resolve(contentUserHint, data); targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, mode, targetUid); if (targetUid > 0) { if (needed == null) { needed = new NeededUriGrants(targetPkg, targetUid, mode); } needed.add(grantUri); } } if (clip != null) { for (int i=0; i<clip.getItemCount(); i++) { Uri uri = clip.getItemAt(i).getUri(); if (uri != null) { GrantUri grantUri = GrantUri.resolve(contentUserHint, uri); targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, mode, targetUid); if (targetUid > 0) { if (needed == null) { needed = new NeededUriGrants(targetPkg, targetUid, mode); } needed.add(grantUri); } } else { Intent clipIntent = clip.getItemAt(i).getIntent(); if (clipIntent != null) { NeededUriGrants newNeeded = checkGrantUriPermissionFromIntentLocked( callingUid, targetPkg, clipIntent, mode, needed, targetUserId); if (newNeeded != null) { needed = newNeeded; } } } } } return needed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkGrantUriPermissionFromIntentLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
checkGrantUriPermissionFromIntentLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting boolean injectIsActivityEnabledAndExported( @NonNull ComponentName activity, @UserIdInt int userId) { final long start = getStatStartTime(); try { return queryActivities(new Intent(), activity.getPackageName(), activity, userId) .size() > 0; } finally { logDurationStat(Stats.IS_ACTIVITY_ENABLED, start); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectIsActivityEnabledAndExported 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
injectIsActivityEnabledAndExported
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
protected String scanLiteral() throws IOException { int quote = fCurrentEntity.read(); if (quote == '\'' || quote == '"') { StringBuffer str = new StringBuffer(); int c; while ((c = fCurrentEntity.read()) != -1) { if (c == quote) { break; } if (c == '\r' || c == '\n') { fCurrentEntity.rewind(); // NOTE: This collapses newlines to a single space. // [Q] Is this the right thing to do here? -Ac skipNewlines(); str.append(' '); } else if (c == '<') { fCurrentEntity.rewind(); break; } else { appendChar(str, c); } } if (c == -1) { if (fReportErrors) { fErrorReporter.reportError("HTML1007", null); } throw new EOFException(); } return str.toString(); } fCurrentEntity.rewind(); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scanLiteral File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
scanLiteral
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public void reload() { act.runOnUiThread(new Runnable() { public void run() { web.reload(); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reload 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
reload
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean appOpIsDefaultOrAllowed(@UserIdInt int userId, String op, String packageName) { try { final int uid = mContext.createContextAsUser(UserHandle.of(userId), /* flags= */ 0). getPackageManager().getPackageUid(packageName, /* flags= */ 0); int mode = mInjector.getAppOpsManager().unsafeCheckOpNoThrow( op, uid, packageName); return mode == MODE_ALLOWED || mode == MODE_DEFAULT; } catch (NameNotFoundException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appOpIsDefaultOrAllowed 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
appOpIsDefaultOrAllowed
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static ActivityOptions fromBundle(Bundle bOptions) { return bOptions != null ? new ActivityOptions(bOptions) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromBundle File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
fromBundle
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@Override public Post retrievePost(String postTitle){ Post post = null; Driver driver = new SQLServerDriver(); String connectionUrl = "jdbc:sqlserver://n8bu1j6855.database.windows.net:1433;database=VoyagerDB;user=VoyageLogin@n8bu1j6855;password={GroupP@ssword};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;"; try { Connection con = driver.connect(connectionUrl, new Properties()); PreparedStatement statement = con.prepareStatement("Select postTitle, postAuthorId, postTime, postContent from PostTable where postTitle = '" + postTitle + "'"); ResultSet rs = statement.executeQuery(); rs.next(); post = new Post(rs.getString("postTitle"), rs.getString("postContent"), this.getUserName(rs.getInt("postAuthorId"))); } catch (SQLException e) { e.printStackTrace(); } return post; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2014-125074 - Severity: MEDIUM - CVSS Score: 5.2 Description: fixed problems in register controller, and worked at preventing sql-injection in database access Function: retrievePost File: Voyager/src/models/DatabaseAccess.java Repository: Nayshlok/Voyager Fixed Code: @Override public Post retrievePost(String postTitle){ Post post = null; Driver driver = new SQLServerDriver(); try { Connection con = driver.connect(connectionUrl, new Properties()); PreparedStatement statement = con.prepareStatement("Select postTitle, postAuthorId, postTime, postContent from PostTable where postTitle = '" + postTitle + "'"); ResultSet rs = statement.executeQuery(); rs.next(); post = new Post(rs.getString("postTitle"), rs.getString("postContent"), this.getUserName(rs.getInt("postAuthorId"))); } catch (SQLException e) { e.printStackTrace(); } return post; }
[ "CWE-89" ]
CVE-2014-125074
MEDIUM
5.2
Nayshlok/Voyager
retrievePost
Voyager/src/models/DatabaseAccess.java
f1249f438cd8c39e7ef2f6c8f2ab76b239a02fae
1
Analyze the following code function for security vulnerabilities
public List<String> checkForBadges(Profile authUser, HttpServletRequest req) { List<String> badgelist = new ArrayList<String>(); if (authUser != null && !isAjaxRequest(req)) { long oneYear = authUser.getTimestamp() + (365 * 24 * 60 * 60 * 1000); addBadgeOnce(authUser, Profile.Badge.ENTHUSIAST, authUser.getVotes() >= CONF.enthusiastIfHasRep()); addBadgeOnce(authUser, Profile.Badge.FRESHMAN, authUser.getVotes() >= CONF.freshmanIfHasRep()); addBadgeOnce(authUser, Profile.Badge.SCHOLAR, authUser.getVotes() >= CONF.scholarIfHasRep()); addBadgeOnce(authUser, Profile.Badge.TEACHER, authUser.getVotes() >= CONF.teacherIfHasRep()); addBadgeOnce(authUser, Profile.Badge.PROFESSOR, authUser.getVotes() >= CONF.professorIfHasRep()); addBadgeOnce(authUser, Profile.Badge.GEEK, authUser.getVotes() >= CONF.geekIfHasRep()); addBadgeOnce(authUser, Profile.Badge.SENIOR, (System.currentTimeMillis() - authUser.getTimestamp()) >= oneYear); if (!StringUtils.isBlank(authUser.getNewbadges())) { badgelist.addAll(Arrays.asList(authUser.getNewbadges().split(","))); authUser.setNewbadges(null); authUser.update(); } } return badgelist; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkForBadges File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
checkForBadges
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public void onTransitionDisable(int indicationBits) { synchronized (mLock) { mNetworkHal.logCallback("onTransitionDisable"); int frameworkBits = 0; if ((indicationBits & TransitionDisableIndication.USE_WPA3_PERSONAL) != 0) { frameworkBits |= WifiMonitor.TDI_USE_WPA3_PERSONAL; } if ((indicationBits & TransitionDisableIndication.USE_SAE_PK) != 0) { frameworkBits |= WifiMonitor.TDI_USE_SAE_PK; } if ((indicationBits & TransitionDisableIndication.USE_WPA3_ENTERPRISE) != 0) { frameworkBits |= WifiMonitor.TDI_USE_WPA3_ENTERPRISE; } if ((indicationBits & TransitionDisableIndication.USE_ENHANCED_OPEN) != 0) { frameworkBits |= WifiMonitor.TDI_USE_ENHANCED_OPEN; } if (frameworkBits == 0) { return; } mWifiMonitor.broadcastTransitionDisableEvent( mIfaceName, mFrameworkNetworkId, frameworkBits); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTransitionDisable File: service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onTransitionDisable
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public static void appendColumns(StringBuilder s, String[] columns) { int n = columns.length; for (int i = 0; i < n; i++) { String column = columns[i]; if (column != null) { if (i > 0) { s.append(", "); } s.append(column); } } s.append(' '); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendColumns File: core/java/android/database/sqlite/SQLiteQueryBuilder.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
appendColumns
core/java/android/database/sqlite/SQLiteQueryBuilder.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public static ProfileAttribute fromDOM(Element profileAttributeElement) { ProfileAttribute profileAttribute = new ProfileAttribute(); String id = profileAttributeElement.getAttribute("name"); profileAttribute.setName(id); NodeList valueList = profileAttributeElement.getElementsByTagName("Value"); if (valueList.getLength() > 0) { String value = valueList.item(0).getTextContent(); profileAttribute.setValue(value); } NodeList descriptorList = profileAttributeElement.getElementsByTagName("Descriptor"); if (descriptorList.getLength() > 0) { Element descriptorElement = (Element) descriptorList.item(0); Descriptor descriptor = Descriptor.fromDOM(descriptorElement); profileAttribute.setDescriptor(descriptor); } return profileAttribute; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public String getPagerEmail(final String userID) throws IOException { return getContactInfo(userID, ContactType.pagerEmail.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPagerEmail 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
getPagerEmail
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
private void stopFreezingDisplayLocked() { if (!mDisplayFrozen) { return; } if (mWaitingForConfig || mAppsFreezingScreen > 0 || mWindowsFreezingScreen == WINDOWS_FREEZING_SCREENS_ACTIVE || mClientFreezingScreen || !mOpeningApps.isEmpty()) { if (DEBUG_ORIENTATION) Slog.d(TAG, "stopFreezingDisplayLocked: Returning mWaitingForConfig=" + mWaitingForConfig + ", mAppsFreezingScreen=" + mAppsFreezingScreen + ", mWindowsFreezingScreen=" + mWindowsFreezingScreen + ", mClientFreezingScreen=" + mClientFreezingScreen + ", mOpeningApps.size()=" + mOpeningApps.size()); return; } mDisplayFrozen = false; mLastDisplayFreezeDuration = (int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); StringBuilder sb = new StringBuilder(128); sb.append("Screen frozen for "); TimeUtils.formatDuration(mLastDisplayFreezeDuration, sb); if (mLastFinishedFreezeSource != null) { sb.append(" due to "); sb.append(mLastFinishedFreezeSource); } Slog.i(TAG, sb.toString()); mH.removeMessages(H.APP_FREEZE_TIMEOUT); mH.removeMessages(H.CLIENT_FREEZE_TIMEOUT); if (PROFILE_ORIENTATION) { Debug.stopMethodTracing(); } boolean updateRotation = false; final DisplayContent displayContent = getDefaultDisplayContentLocked(); final int displayId = displayContent.getDisplayId(); ScreenRotationAnimation screenRotationAnimation = mAnimator.getScreenRotationAnimationLocked(displayId); if (CUSTOM_SCREEN_ROTATION && screenRotationAnimation != null && screenRotationAnimation.hasScreenshot()) { if (DEBUG_ORIENTATION) Slog.i(TAG, "**** Dismissing screen rotation animation"); // TODO(multidisplay): rotation on main screen only. DisplayInfo displayInfo = displayContent.getDisplayInfo(); // Get rotation animation again, with new top window boolean isDimming = displayContent.isDimming(); if (!mPolicy.validateRotationAnimationLw(mExitAnimId, mEnterAnimId, isDimming)) { mExitAnimId = mEnterAnimId = 0; } if (screenRotationAnimation.dismiss(mFxSession, MAX_ANIMATION_DURATION, getTransitionAnimationScaleLocked(), displayInfo.logicalWidth, displayInfo.logicalHeight, mExitAnimId, mEnterAnimId)) { scheduleAnimationLocked(); } else { screenRotationAnimation.kill(); mAnimator.setScreenRotationAnimationLocked(displayId, null); updateRotation = true; } } else { if (screenRotationAnimation != null) { screenRotationAnimation.kill(); mAnimator.setScreenRotationAnimationLocked(displayId, null); } updateRotation = true; } mInputMonitor.thawInputDispatchingLw(); boolean configChanged; // While the display is frozen we don't re-compute the orientation // to avoid inconsistent states. However, something interesting // could have actually changed during that time so re-evaluate it // now to catch that. configChanged = updateOrientationFromAppTokensLocked(false); // A little kludge: a lot could have happened while the // display was frozen, so now that we are coming back we // do a gc so that any remote references the system // processes holds on others can be released if they are // no longer needed. mH.removeMessages(H.FORCE_GC); mH.sendEmptyMessageDelayed(H.FORCE_GC, 2000); mScreenFrozenLock.release(); if (updateRotation) { if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation"); configChanged |= updateRotationUncheckedLocked(false); } if (configChanged) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopFreezingDisplayLocked 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
stopFreezingDisplayLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public Token next() throws TreeReaderException { try { if (!parser.hasNext()) { throw new TreeReaderException("End of XML stream"); } } catch (XMLStreamException e) { throw new TreeReaderException(e); } int currentToken = -1; try { currentToken = parser.next(); } catch (XMLStreamException e) { throw new TreeReaderException(e); } return mapToToken(currentToken); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next File: main/src/com/google/refine/importers/XmlImporter.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20157
MEDIUM
5
OpenRefine
next
main/src/com/google/refine/importers/XmlImporter.java
6a0d7d56e4ffb420316ce7849fde881344fbf881
0
Analyze the following code function for security vulnerabilities
@Override public void unregisterStrongAuthTracker(IStrongAuthTracker tracker) { checkPasswordReadPermission(UserHandle.USER_ALL); mStrongAuth.unregisterStrongAuthTracker(tracker); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterStrongAuthTracker File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
unregisterStrongAuthTracker
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
public void setManagedProfileContactsAccessPolicy(@Nullable PackagePolicy policy) { throwIfParentInstance("setManagedProfileContactsAccessPolicy"); if (mService != null) { try { mService.setManagedProfileContactsAccessPolicy(policy); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setManagedProfileContactsAccessPolicy File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setManagedProfileContactsAccessPolicy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public LocationManager getLocationManager() { boolean permissionGranted = false; if (Build.VERSION.SDK_INT >= 29 && "true".equals(Display.getInstance().getProperty("android.requiresBackgroundLocationPermissionForAPI29", "false"))) { if (checkForPermission("android.permission.ACCESS_BACKGROUND_LOCATION", "This is required to get the location")) { permissionGranted = true; } } if (!permissionGranted && !checkForPermission( Manifest.permission.ACCESS_FINE_LOCATION, "This is required to get the location")) { return null; } boolean includesPlayServices = Display.getInstance().getProperty("IncludeGPlayServices", "false").equals("true"); if (includesPlayServices && hasAndroidMarket()) { try { Class clazz = Class.forName("com.codename1.location.AndroidLocationPlayServiceManager"); return (com.codename1.location.LocationManager)clazz.getMethod("getInstance").invoke(null); } catch (Exception e) { return AndroidLocationManager.getInstance(getContext()); } } else { return AndroidLocationManager.getInstance(getContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocationManager 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
getLocationManager
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
synchronized boolean readCertificates() { if (metaEntries.isEmpty()) { return false; } Iterator<String> it = metaEntries.keySet().iterator(); while (it.hasNext()) { String key = it.next(); if (key.endsWith(".DSA") || key.endsWith(".RSA") || key.endsWith(".EC")) { verifyCertificate(key); it.remove(); } } return true; }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-21253 - Severity: MEDIUM - CVSS Score: 5.5 Description: Limit the number of supported v1 and v2 signers The v1 and v2 APK Signature Schemes support multiple signers; this was intended to allow multiple entities to sign an APK. Previously, the platform had no limits placed on the number of signers supported in an APK, but this commit sets a hard limit of 10 supported signers for these signature schemes to ensure a large number of signers does not place undue burden on the platform. Bug: 266580022 Test: Manually verified the platform only allowed an APK with the maximum number of supported signers. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6f6ee8a55f37c2b8c0df041b2bd53ec928764597) Merged-In: I6aa86b615b203cdc69d58a593ccf8f18474ca091 Change-Id: I6aa86b615b203cdc69d58a593ccf8f18474ca091 Function: readCertificates File: core/java/android/util/jar/StrictJarVerifier.java Repository: android Fixed Code: synchronized boolean readCertificates() { if (metaEntries.isEmpty()) { return false; } int signerCount = 0; Iterator<String> it = metaEntries.keySet().iterator(); while (it.hasNext()) { String key = it.next(); if (key.endsWith(".DSA") || key.endsWith(".RSA") || key.endsWith(".EC")) { if (++signerCount > MAX_JAR_SIGNERS) { throw new SecurityException( "APK Signature Scheme v1 only supports a maximum of " + MAX_JAR_SIGNERS + " signers"); } verifyCertificate(key); it.remove(); } } return true; }
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
readCertificates
core/java/android/util/jar/StrictJarVerifier.java
84df68840b6f2407146e722ebd95a7d8bc6e3529
1
Analyze the following code function for security vulnerabilities
@Override public String createApplication(ServiceProvider application, String tenantDomain, String username) throws IdentityApplicationManagementException { // Invoking the listeners. Collection<ApplicationResourceManagementListener> listeners = ApplicationMgtListenerServiceComponent .getApplicationResourceMgtListeners(); for (ApplicationResourceManagementListener listener : listeners) { if (listener.isEnabled() && !listener.doPreCreateApplication(application, tenantDomain, username)) { throw buildServerException("Pre create application operation of listener: " + getName(listener) + " failed for application: " + application.getApplicationName() + " of tenantDomain: " + tenantDomain); } } doPreAddApplicationChecks(application, tenantDomain, username); ApplicationDAO applicationDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); String resourceId = doAddApplication(application, tenantDomain, username, applicationDAO::addApplication); for (ApplicationResourceManagementListener listener : listeners) { if (listener.isEnabled() && !listener.doPostCreateApplication(resourceId, application, tenantDomain, username)) { log.error("Post create application operation of listener:" + getName(listener) + " failed for " + "application: " + application.getApplicationName() + " of tenantDomain: " + tenantDomain); break; } } return resourceId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createApplication File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
createApplication
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@NonNull public final MagnificationController getMagnificationController() { synchronized (mLock) { if (mMagnificationController == null) { mMagnificationController = new MagnificationController(this, mLock); } return mMagnificationController; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMagnificationController File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
getMagnificationController
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public void setMostRecent(boolean mostRecent) { this.mostRecent = mostRecent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMostRecent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setMostRecent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") private boolean handleProcessStartedLocked(ProcessRecord pending, ProcessStartResult startResult, long expectedStartSeq) { // Indicates that this process start has been taken care of. if (mPendingStarts.get(expectedStartSeq) == null) { if (pending.pid == startResult.pid) { pending.usingWrapper = startResult.usingWrapper; // TODO: Update already existing clients of usingWrapper } return false; } return handleProcessStartedLocked(pending, startResult.pid, startResult.usingWrapper, expectedStartSeq, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleProcessStartedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
handleProcessStartedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Column(name = "ip", nullable = false, length = 64) public String getIp() { return this.ip; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-21333 - Severity: LOW - CVSS Score: 3.5 Description: https://github.com/sanluan/PublicCMS/issues/26 https://github.com/sanluan/PublicCMS/issues/27 Function: getIp File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java Repository: sanluan/PublicCMS Fixed Code: @Column(name = "ip", nullable = false, length = 130) public String getIp() { return this.ip; }
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getIp
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
b4d5956e65b14347b162424abb197a180229b3db
1
Analyze the following code function for security vulnerabilities
public Properties getConfiguration() { return (Properties) prop.clone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getConfiguration
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public boolean checkAccess(String action, XWikiDocument doc, XWikiContext context) throws XWikiException { // Handle the 'skin' action specially so that resources don`t require special (or even 'view') rights. String firstSpaceName = doc.getDocumentReference().getSpaceReferences().get(0).getName(); if (action.equals("skin") && SKIN_RESOURCE_SPACE_NAMES.contains(firstSpaceName)) { // We still need to call checkAuth to set the proper user. XWikiUser user = checkAuth(context); if (user != null) { context.setUser(user.getUser()); } // Always allow. return true; } return getRightService().checkAccess(action, doc, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAccess File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
checkAccess
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private boolean mutateSystemSetting(String name, String value, int runAsUserId, int operation) { if (!hasWriteSecureSettingsPermission()) { // If the caller doesn't hold WRITE_SECURE_SETTINGS, we verify whether this // operation is allowed for the calling package through appops. if (!Settings.checkAndNoteWriteSettingsOperation(getContext(), Binder.getCallingUid(), getCallingPackage(), true)) { return false; } } // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(runAsUserId); // Enforce what the calling package can mutate the system settings. enforceRestrictedSystemSettingsMutationForCallingPackage(operation, name, callingUserId); // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name); // Only the owning user id can change the setting. if (owningUserId != callingUserId) { return false; } // Invalidate any relevant cache files String cacheName = null; if (Settings.System.RINGTONE.equals(name)) { cacheName = Settings.System.RINGTONE_CACHE; } else if (Settings.System.NOTIFICATION_SOUND.equals(name)) { cacheName = Settings.System.NOTIFICATION_SOUND_CACHE; } else if (Settings.System.ALARM_ALERT.equals(name)) { cacheName = Settings.System.ALARM_ALERT_CACHE; } if (cacheName != null) { final File cacheFile = new File( getRingtoneCacheDir(UserHandle.getCallingUserId()), cacheName); cacheFile.delete(); } // Mutate the value. synchronized (mLock) { switch (operation) { case MUTATION_OPERATION_INSERT: { validateSystemSettingValue(name, value); return mSettingsRegistry.insertSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, value, getCallingPackage(), false); } case MUTATION_OPERATION_DELETE: { return mSettingsRegistry.deleteSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, false); } case MUTATION_OPERATION_UPDATE: { validateSystemSettingValue(name, value); return mSettingsRegistry.updateSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name, value, getCallingPackage(), false); } } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mutateSystemSetting 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
mutateSystemSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public void sendRstStream(int streamId, int statusCode) { if(!isOpen()) { //no point sending if the channel is closed return; } handleRstStream(streamId); if(UndertowLogger.REQUEST_IO_LOGGER.isDebugEnabled()) { UndertowLogger.REQUEST_IO_LOGGER.debugf(new ClosedChannelException(), "Sending rststream on channel %s stream %s", this, streamId); } Http2RstStreamSinkChannel channel = new Http2RstStreamSinkChannel(this, streamId, statusCode); flushChannelIgnoreFailure(channel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRstStream File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
sendRstStream
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override protected void onExpandingFinished() { super.onExpandingFinished(); mNotificationStackScroller.onExpansionStopped(); mHeadsUpManager.onExpandingFinished(); mIsExpanding = false; if (isFullyCollapsed()) { DejankUtils.postAfterTraversal(new Runnable() { @Override public void run() { setListening(false); } }); // Workaround b/22639032: Make sure we invalidate something because else RenderThread // thinks we are actually drawing a frame put in reality we don't, so RT doesn't go // ahead with rendering and we jank. postOnAnimation(new Runnable() { @Override public void run() { getParent().invalidateChild(NotificationPanelView.this, mDummyDirtyRect); } }); } else { setListening(true); } mQsExpandImmediate = false; mTwoFingerQsExpandPossible = false; mIsExpansionFromHeadsUp = false; mNotificationStackScroller.setTrackingHeadsUp(false); mExpandingFromHeadsUp = false; setPanelScrimMinFraction(0.0f); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onExpandingFinished File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onExpandingFinished
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private int increaseAssetConfigurationSeq() { mGlobalAssetsSeq = Math.max(++mGlobalAssetsSeq, 1); return mGlobalAssetsSeq; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: increaseAssetConfigurationSeq 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
increaseAssetConfigurationSeq
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public boolean isAlwaysOnVpnLockdownEnabled(@NonNull ComponentName admin) { throwIfParentInstance("isAlwaysOnVpnLockdownEnabled"); if (mService != null) { try { // Starting from Android R, the caller can pass the permission check in // DevicePolicyManagerService if it holds android.permission.MAINLINE_NETWORK_STACK. // Note that the android.permission.MAINLINE_NETWORK_STACK is a signature permission // which is used by the NetworkStack mainline module. return mService.isAlwaysOnVpnLockdownEnabled(admin); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAlwaysOnVpnLockdownEnabled File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isAlwaysOnVpnLockdownEnabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override boolean check(CRDTReplicationConfig c1, CRDTReplicationConfig c2) { return c1 == c2 || (c1 != null && c2 != null && nullSafeEqual(c1.getMaxConcurrentReplicationTargets(), c2.getMaxConcurrentReplicationTargets()) && nullSafeEqual(c1.getReplicationPeriodMillis(), c2.getReplicationPeriodMillis())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@GET @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_ATOM_XML}) @Path("whoami") public OnmsUser whoami(@Context final SecurityContext securityContext) { final String userName = securityContext.getUserPrincipal().getName(); final OnmsUser user = getOnmsUser(userName); // Don't expose the user's password if (user != null) { user.setPassword(null); user.setPasswordSalted(null); } return user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: whoami File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-0872
HIGH
8
OpenNMS/opennms
whoami
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java
34ab169a74b2bc489ab06d0dbf33fee1ed94c93c
0
Analyze the following code function for security vulnerabilities
@Override public void onUsingAlternativeUi(String activeCallId, boolean usingAlternativeUi, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUsingAlternativeUi File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onUsingAlternativeUi
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@NonNull private Map<Account, Integer> filterSharedAccounts(UserAccounts userAccounts, @NonNull Map<Account, Integer> unfiltered, int callingUid, @Nullable String callingPackage) { // first part is to filter shared accounts. // unfiltered type check is not necessary. if (getUserManager() == null || userAccounts == null || userAccounts.userId < 0 || callingUid == Process.SYSTEM_UID) { return unfiltered; } UserInfo user = getUserManager().getUserInfo(userAccounts.userId); if (user != null && user.isRestricted()) { String[] packages = mPackageManager.getPackagesForUid(callingUid); if (packages == null) { packages = new String[] {}; } // If any of the packages is a visible listed package, return the full set, // otherwise return non-shared accounts only. // This might be a temporary way to specify a visible list String visibleList = mContext.getResources().getString( com.android.internal.R.string.config_appsAuthorizedForSharedAccounts); for (String packageName : packages) { if (visibleList.contains(";" + packageName + ";")) { return unfiltered; } } Account[] sharedAccounts = getSharedAccountsAsUser(userAccounts.userId); if (ArrayUtils.isEmpty(sharedAccounts)) { return unfiltered; } String requiredAccountType = ""; try { // If there's an explicit callingPackage specified, check if that package // opted in to see restricted accounts. if (callingPackage != null) { PackageInfo pi = mPackageManager.getPackageInfo(callingPackage, 0); if (pi != null && pi.restrictedAccountType != null) { requiredAccountType = pi.restrictedAccountType; } } else { // Otherwise check if the callingUid has a package that has opted in for (String packageName : packages) { PackageInfo pi = mPackageManager.getPackageInfo(packageName, 0); if (pi != null && pi.restrictedAccountType != null) { requiredAccountType = pi.restrictedAccountType; break; } } } } catch (NameNotFoundException e) { Log.d(TAG, "Package not found " + e.getMessage()); } Map<Account, Integer> filtered = new LinkedHashMap<>(); for (Map.Entry<Account, Integer> entry : unfiltered.entrySet()) { Account account = entry.getKey(); if (account.type.equals(requiredAccountType)) { filtered.put(account, entry.getValue()); } else { boolean found = false; for (Account shared : sharedAccounts) { if (shared.equals(account)) { found = true; break; } } if (!found) { filtered.put(account, entry.getValue()); } } } return filtered; } else { return unfiltered; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterSharedAccounts 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
filterSharedAccounts
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void setUpNavigationTokens(HttpServletRequest request) { if (SecuritySettings.isWebSecurityByTokensEnabled()) { logger.debug("Create a navigation token for path {0}", getRequestPath(request)); HttpSession session = request.getSession(); TokenGenerator generator = TokenGeneratorProvider.getTokenGenerator(SynchronizerToken.class); Token token = generator.generate(); session.setAttribute(NAVIGATION_TOKEN_KEY, token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUpNavigationTokens File: core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
setUpNavigationTokens
core-rs/src/main/java/org/silverpeas/core/web/token/SynchronizerTokenService.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
private Document getDocument(final InputStream input) throws SAXException { try { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); // Not mandatory, but better than relying on the default implementation to prevent XXE factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); // get the dtd location final String dtdFile = "/games/strategy/engine/xml/" + DTD_FILE_NAME; final URL url = GameParser.class.getResource(dtdFile); if (url == null) { throw new RuntimeException(String.format("Map: %s, Could not find in classpath %s", mapName, dtdFile)); } final DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { @Override public void fatalError(final SAXParseException exception) { errorsSax.add(exception); } @Override public void error(final SAXParseException exception) { errorsSax.add(exception); } @Override public void warning(final SAXParseException exception) { errorsSax.add(exception); } }); final String dtdSystem = url.toExternalForm(); final String system = dtdSystem.substring(0, dtdSystem.length() - DTD_FILE_NAME.length()); return builder.parse(input, system); } catch (final IOException | ParserConfigurationException e) { throw new IllegalStateException("Error parsing: " + mapName, e); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000546 - Severity: MEDIUM - CVSS Score: 6.8 Description: Allow file access Co-Authored-By: RoiEXLab <8350879+RoiEXLab@users.noreply.github.com> Function: getDocument File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea Fixed Code: private Document getDocument(final InputStream input) throws SAXException { try { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); // Not mandatory, but better than relying on the default implementation to prevent XXE factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "file"); // get the dtd location final String dtdFile = "/games/strategy/engine/xml/" + DTD_FILE_NAME; final URL url = GameParser.class.getResource(dtdFile); if (url == null) { throw new RuntimeException(String.format("Map: %s, Could not find in classpath %s", mapName, dtdFile)); } final DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { @Override public void fatalError(final SAXParseException exception) { errorsSax.add(exception); } @Override public void error(final SAXParseException exception) { errorsSax.add(exception); } @Override public void warning(final SAXParseException exception) { errorsSax.add(exception); } }); final String dtdSystem = url.toExternalForm(); final String system = dtdSystem.substring(0, dtdSystem.length() - DTD_FILE_NAME.length()); return builder.parse(input, system); } catch (final IOException | ParserConfigurationException e) { throw new IllegalStateException("Error parsing: " + mapName, e); } }
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getDocument
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
1
Analyze the following code function for security vulnerabilities
public static String getPassword() { return System.getProperty(KieServerConstants.CFG_KIE_PASSWORD, "kieserver1!"); }
Vulnerability Classification: - CWE: CWE-260 - CVE: CVE-2016-7043 - Severity: MEDIUM - CVSS Score: 5.0 Description: [RHBMS-4312] Loading pasword from a keystore Function: getPassword File: kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java Repository: kiegroup/droolsjbpm-integration Fixed Code: public static String getPassword() { return KeyStoreHelperUtil.loadPassword(); }
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
getPassword
kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
1
Analyze the following code function for security vulnerabilities
@Override public IBinder peekService(Intent service, String resolvedType) { enforceNotIsolatedCaller("peekService"); // Refuse possible leaked file descriptors if (service != null && service.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } synchronized(this) { return mServices.peekServiceLocked(service, resolvedType); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peekService 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
peekService
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private final int _decode8Bits() throws IOException { if (_inputPtr >= _inputEnd) { loadMoreGuaranteed(); } return _inputBuffer[_inputPtr++] & 0xFF; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _decode8Bits File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_decode8Bits
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public void setHidden(boolean hidden) { this.doc.setHidden(hidden); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHidden 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
setHidden
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
@Override public void onClick(View v) { final int id = v.getId(); if (id == R.id.add_cc_bcc) { // Verify that cc/ bcc aren't showing. // Animate in cc/bcc. showCcBccViews(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClick File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
onClick
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public int getProcessLimit() { synchronized (this) { return mConstants.getOverrideMaxCachedProcesses(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessLimit File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
getProcessLimit
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
static public String getEncoding(ObjectNode firstFileRecord) { String encoding = JSONUtilities.getString(firstFileRecord, "encoding", null); if (encoding == null || encoding.isEmpty()) { encoding = JSONUtilities.getString(firstFileRecord, "declaredEncoding", null); } return encoding; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEncoding File: main/src/com/google/refine/importing/ImportingUtilities.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
getEncoding
main/src/com/google/refine/importing/ImportingUtilities.java
e243e73e4064de87a913946bd320fbbe246da656
0
Analyze the following code function for security vulnerabilities
public Writer write(Writer writer) throws JSONException { try { boolean b = false; int len = length(); writer.write('['); for (int i = 0; i < len; i += 1) { if (b) { writer.write(','); } Object v = this.myArrayList.get(i); if (v instanceof JSONObject) { ((JSONObject)v).write(writer); } else if (v instanceof JSONArray) { ((JSONArray)v).write(writer); } else { writer.write(JSONObject.valueToString(v, escapeForwardSlashAlways)); } b = true; } writer.write(']'); return writer; } catch (IOException e) { throw new JSONException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
write
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public void updateIssue(IssuesUpdateRequest request) { setUserConfig(); MultiValueMap<String, Object> param = buildUpdateParam(request); if (request.getTransitions() != null) { request.setPlatformStatus(request.getTransitions().getValue()); } handleIssueUpdate(request); this.handleZentaoBugStatus(param); zentaoClient.updateIssue(request.getPlatformId(), param); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateIssue File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
updateIssue
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public String getServletPath() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServletPath File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getServletPath
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override // NotificationDate.Environment public boolean shouldHideNotifications(String key) { return isLockscreenPublicMode(mCurrentUserId) && mNotificationData.getVisibilityOverride(key) == Notification.VISIBILITY_SECRET; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldHideNotifications File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
shouldHideNotifications
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setCurrentThumbnailPage(int currentThumbnailPage) { synchronized (this) { if (viewManager != null) { viewManager.setCurrentThumbnailPage(currentThumbnailPage); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCurrentThumbnailPage File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
setCurrentThumbnailPage
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
private PendingAssistExtras enqueueAssistContext(int requestType, Intent intent, String hint, int userHandle) { enforceCallingPermission(android.Manifest.permission.GET_TOP_ACTIVITY_INFO, "getAssistContextExtras()"); PendingAssistExtras pae; Bundle extras = new Bundle(); synchronized (this) { ActivityRecord activity = getFocusedStack().mResumedActivity; if (activity == null) { Slog.w(TAG, "getAssistContextExtras failed: no resumed activity"); return null; } extras.putString(Intent.EXTRA_ASSIST_PACKAGE, activity.packageName); if (activity.app == null || activity.app.thread == null) { Slog.w(TAG, "getAssistContextExtras failed: no process for " + activity); return null; } if (activity.app.pid == Binder.getCallingPid()) { Slog.w(TAG, "getAssistContextExtras failed: request process same as " + activity); return null; } pae = new PendingAssistExtras(activity, extras, intent, hint, userHandle); try { activity.app.thread.requestAssistContextExtras(activity.appToken, pae, requestType); mPendingAssistExtras.add(pae); mHandler.postDelayed(pae, PENDING_ASSIST_EXTRAS_TIMEOUT); } catch (RemoteException e) { Slog.w(TAG, "getAssistContextExtras failed: crash calling " + activity); return null; } return pae; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueAssistContext 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
enqueueAssistContext
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected void removeUnusedNode(PdfObject obj, boolean hits[]) { Stack state = new Stack(); state.push(obj); while (!state.empty()) { Object current = state.pop(); if (current == null) continue; ArrayList ar = null; PdfDictionary dic = null; PdfName[] keys = null; Object[] objs = null; int idx = 0; if (current instanceof PdfObject) { obj = (PdfObject)current; boolean continue_b= false; // ssteward: workaround for unreachable code warning from gcj switch (obj.type()) { case PdfObject.DICTIONARY: case PdfObject.STREAM: dic = (PdfDictionary)obj; keys = new PdfName[dic.size()]; dic.getKeys().toArray(keys); break; case PdfObject.ARRAY: ar = ((PdfArray)obj).getArrayList(); break; case PdfObject.INDIRECT: PRIndirectReference ref = (PRIndirectReference)obj; int num = ref.getNumber(); if (!hits[num]) { hits[num] = true; state.push(getPdfObjectRelease(ref)); } continue_b= true; default: continue_b= true; } if( continue_b ) continue; } else { objs = (Object[])current; if (objs[0] instanceof ArrayList) { ar = (ArrayList)objs[0]; idx = ((Integer)objs[1]).intValue(); } else { keys = (PdfName[])objs[0]; dic = (PdfDictionary)objs[1]; idx = ((Integer)objs[2]).intValue(); } } if (ar != null) { for (int k = idx; k < ar.size(); ++k) { PdfObject v = (PdfObject)ar.get(k); if (v.isIndirect()) { int num = ((PRIndirectReference)v).getNumber(); if (num >= xrefObj.size() || (!partial && xrefObj.get(num) == null)) { ar.set(k, PdfNull.PDFNULL); continue; } } if (objs == null) state.push(new Object[]{ar, new Integer(k + 1)}); else { objs[1] = new Integer(k + 1); state.push(objs); } state.push(v); break; } } else { for (int k = idx; k < keys.length; ++k) { PdfName key = keys[k]; PdfObject v = dic.get(key); if (v.isIndirect()) { int num = ((PRIndirectReference)v).getNumber(); if (num >= xrefObj.size() || (!partial && xrefObj.get(num) == null)) { dic.put(key, PdfNull.PDFNULL); continue; } } if (objs == null) state.push(new Object[]{keys, dic, new Integer(k + 1)}); else { objs[2] = new Integer(k + 1); state.push(objs); } state.push(v); break; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUnusedNode File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
removeUnusedNode
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@CLIResolver public static AbstractProject resolveForCLI( @Argument(required=true,metaVar="NAME",usage="Job name") String name) throws CmdLineException { AbstractProject item = Jenkins.getInstance().getItemByFullName(name, AbstractProject.class); if (item==null) throw new CmdLineException(null,Messages.AbstractItem_NoSuchJobExists(name,AbstractProject.findNearest(name).getFullName())); return item; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveForCLI File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
resolveForCLI
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
protected abstract void setBcdToZero();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBcdToZero File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
setBcdToZero
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
protected void setOCSubjectDataAuditLogs(StudyBean study, OdmClinicalDataBean data, String studySubjectOids, HashMap<String, String> subOidPoses) { this.setOCSubjectDataAuditsTypesExpected(); logger.debug("Begin to execute GetOCSubjectDataAuditsSql"); logger.debug("getOCSubjectDataAuditsSql= " + this.getOCSubjectDataAuditsSql(studySubjectOids)); ArrayList rows = select(this.getOCSubjectDataAuditsSql(studySubjectOids)); Iterator iter = rows.iterator(); while (iter.hasNext()) { HashMap row = (HashMap) iter.next(); String studySubjectLabel = (String) row.get("study_subject_oid"); Integer auditId = (Integer) row.get("audit_id"); String type = (String) row.get("name"); Integer userId = (Integer) row.get("user_id"); Date auditDate = (Date) row.get("audit_date"); String auditReason = (String) row.get("reason_for_change"); String oldValue = (String) row.get("old_value"); String newValue = (String) row.get("new_value"); Integer typeId = (Integer) row.get("audit_log_event_type_id"); if (subOidPoses.containsKey(studySubjectLabel)) { ExportSubjectDataBean sub = data.getExportSubjectData().get(Integer.parseInt(subOidPoses.get(studySubjectLabel))); AuditLogBean auditLog = new AuditLogBean(); auditLog.setOid("AL_" + auditId); auditLog.setUserId("USR_" + userId); logger.debug("datatime=" + auditDate + " or " + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(auditDate)); auditLog.setDatetimeStamp(auditDate); auditLog.setType(type); auditLog.setReasonForChange(auditReason); if (typeId == 3 || typeId == 6) { if ("0".equals(newValue)) { auditLog.setOldValue(Status.INVALID.getName()); } else { auditLog.setNewValue(Status.getFromMap(Integer.parseInt(newValue)).getName()); } if ("0".equals(oldValue)) { auditLog.setOldValue(Status.INVALID.getName()); } else { auditLog.setOldValue(Status.getFromMap(Integer.parseInt(oldValue)).getName()); } } else { auditLog.setNewValue(newValue); auditLog.setOldValue(oldValue); } AuditLogsBean logs = sub.getAuditLogs(); if (logs.getEntityID() == null || logs.getEntityID().length() <= 0) { logs.setEntityID(sub.getSubjectOID()); } logs.getAuditLogs().add(auditLog); sub.setAuditLogs(logs); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOCSubjectDataAuditLogs File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
setOCSubjectDataAuditLogs
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderAccept File: samples/openapi3/client/petstore/java/jersey2-java8/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
selectHeaderAccept
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private Cursor queryRequestHeaders(SQLiteDatabase db, Uri uri) { String where = Downloads.Impl.RequestHeaders.COLUMN_DOWNLOAD_ID + "=" + getDownloadIdFromUri(uri); String[] projection = new String[] {Downloads.Impl.RequestHeaders.COLUMN_HEADER, Downloads.Impl.RequestHeaders.COLUMN_VALUE}; return db.query(Downloads.Impl.RequestHeaders.HEADERS_DB_TABLE, projection, where, null, null, null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryRequestHeaders File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
queryRequestHeaders
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
private static String[] splitInitialLine(AppendableCharSequence sb) { int aStart; int aEnd; int bStart; int bEnd; int cStart; int cEnd; aStart = findNonSPLenient(sb, 0); aEnd = findSPLenient(sb, aStart); bStart = findNonSPLenient(sb, aEnd); bEnd = findSPLenient(sb, bStart); cStart = findNonSPLenient(sb, bEnd); cEnd = findEndOfString(sb); return new String[] { sb.subStringUnsafe(aStart, aEnd), sb.subStringUnsafe(bStart, bEnd), cStart < cEnd? sb.subStringUnsafe(cStart, cEnd) : "" }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitInitialLine File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
splitInitialLine
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
public String evaluateVelocity(String content, String namespace, VelocityContext vcontext) { try { return getVelocityEvaluator().evaluateVelocity(content, namespace, vcontext); } catch (XWikiException xe) { LOGGER.error("Error while parsing velocity template namespace [{}] with content:\n[{}]", namespace, content, xe.getCause()); return Util.getHTMLExceptionMessage(xe, null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: evaluateVelocity File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
evaluateVelocity
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public boolean impliesClusterPermissionPermission(String action) { return roles.stream().filter(r -> r.impliesClusterPermission(action)).count() > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: impliesClusterPermissionPermission File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
impliesClusterPermissionPermission
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
@RequestMapping("/module/htmlformentry/htmlFormFromFile.form") public void handleRequest(Model model, @RequestParam(value = "filePath", required = false) String filePath, @RequestParam(value = "patientId", required = false) Integer pId, @RequestParam(value = "isFileUpload", required = false) boolean isFileUpload, HttpServletRequest request) throws Exception { Context.requirePrivilege("Manage Forms"); if (log.isDebugEnabled()) log.debug("In reference data..."); model.addAttribute("previewHtml", ""); String message = ""; File f = null; try { if (isFileUpload) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile multipartFile = multipartRequest.getFile("htmlFormFile"); if (multipartFile != null) { //use the same file for the logged in user f = new File(SystemUtils.JAVA_IO_TMPDIR, TEMP_HTML_FORM_FILE_PREFIX + Context.getAuthenticatedUser().getSystemId()); if (!f.exists()) f.createNewFile(); filePath = f.getAbsolutePath(); FileOutputStream fileOut = new FileOutputStream(f); IOUtils.copy(multipartFile.getInputStream(), fileOut); fileOut.close(); } } else { if (StringUtils.hasText(filePath)) { f = new File(filePath); } else { message = "You must specify a file path to preview from file"; } } if (f != null && f.exists() && f.canRead()) { model.addAttribute("filePath", filePath); StringWriter writer = new StringWriter(); IOUtils.copy(new FileInputStream(f), writer, "UTF-8"); String xml = writer.toString(); Patient p = null; if (pId != null) { p = Context.getPatientService().getPatient(pId); } else { p = HtmlFormEntryUtil.getFakePerson(); } HtmlForm fakeForm = new HtmlForm(); fakeForm.setXmlData(xml); FormEntrySession fes = new FormEntrySession(p, null, Mode.ENTER, fakeForm, request.getSession()); String html = fes.getHtmlToDisplay(); if (fes.getFieldAccessorJavascript() != null) { html += "<script>" + fes.getFieldAccessorJavascript() + "</script>"; } model.addAttribute("previewHtml", html); //clear the error message message = ""; } else { message = "Please specify a valid file path or select a valid file."; } } catch (Exception e) { log.error("An error occurred while loading the html.", e); message = "An error occurred while loading the html. " + e.getMessage(); } model.addAttribute("message", message); model.addAttribute("isFileUpload", isFileUpload); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-24621 - Severity: MEDIUM - CVSS Score: 6.5 Description: HTML-730: Do not allow loading arbitrary files Function: handleRequest File: omod/src/main/java/org/openmrs/module/htmlformentry/web/controller/HtmlFormFromFileController.java Repository: openmrs/openmrs-module-htmlformentry Fixed Code: @RequestMapping("/module/htmlformentry/htmlFormFromFile.form") public void handleRequest(Model model, @RequestParam(value = "filePath", required = false) String filePath, @RequestParam(value = "patientId", required = false) Integer pId, @RequestParam(value = "isFileUpload", required = false) boolean isFileUpload, HttpServletRequest request) throws Exception { Context.requirePrivilege("Manage Forms"); if (log.isDebugEnabled()) log.debug("In reference data..."); model.addAttribute("previewHtml", ""); String message; File f = null; try { if (isFileUpload) { MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile multipartFile = multipartRequest.getFile("htmlFormFile"); if (multipartFile != null) { // use an unpredictable file name f = File.createTempFile(TEMP_HTML_FORM_FILE_PREFIX, ".tmp"); f.deleteOnExit(); filePath = f.getAbsolutePath(); FileOutputStream fileOut = new FileOutputStream(f); IOUtils.copy(multipartFile.getInputStream(), fileOut); fileOut.close(); } } else { if (StringUtils.hasText(filePath)) { f = new File(filePath); // prevent reading a file via an absolute path or path traversal if (f.isAbsolute() || !FilenameUtils.normalize(filePath).equals(filePath)) { f = null; } } } if (f != null && f.exists() && f.canRead()) { model.addAttribute("filePath", filePath); StringWriter writer = new StringWriter(); IOUtils.copy(new FileInputStream(f), writer, "UTF-8"); String xml = writer.toString(); // validate file is actually xml HtmlFormEntryUtil.stringToDocument(xml); Patient p; if (pId != null) { p = Context.getPatientService().getPatient(pId); } else { p = HtmlFormEntryUtil.getFakePerson(); } HtmlForm fakeForm = new HtmlForm(); fakeForm.setXmlData(xml); FormEntrySession fes = new FormEntrySession(p, null, Mode.ENTER, fakeForm, request.getSession()); String html = fes.getHtmlToDisplay(); if (fes.getFieldAccessorJavascript() != null) { html += "<script>" + fes.getFieldAccessorJavascript() + "</script>"; } model.addAttribute("previewHtml", html); //clear the error message message = ""; } else { message = "Please specify a valid file path or select a valid file."; } } catch (Exception e) { log.error("An error occurred while loading the html.", e); message = "An error occurred while loading the html. " + e.getMessage(); } model.addAttribute("message", message); model.addAttribute("isFileUpload", isFileUpload); }
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-htmlformentry
handleRequest
omod/src/main/java/org/openmrs/module/htmlformentry/web/controller/HtmlFormFromFileController.java
458597984050461f1c88e4e3a403bf2b060f0844
1
Analyze the following code function for security vulnerabilities
public String getView() { return view == null ? null : view.getValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getView File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
getView
config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
private static int deleteDataRows(SQLiteDatabase db, String table, String selection, String[] selectionArgs) { Cursor cursor = db.query(table, new String[] { "_data" }, selection, selectionArgs, null, null, null); if (cursor == null) { // FIXME: This might be an error, ignore it may cause // unpredictable result. return 0; } try { if (cursor.getCount() == 0) { return 0; } while (cursor.moveToNext()) { try { // Delete the associated files saved on file-system. String path = cursor.getString(0); if (path != null) { new File(path).delete(); } } catch (Throwable ex) { Log.e(TAG, ex.getMessage(), ex); } } } finally { cursor.close(); } return db.delete(table, selection, selectionArgs); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDataRows File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-22" ]
CVE-2023-21268
MEDIUM
5.5
android
deleteDataRows
src/com/android/providers/telephony/MmsProvider.java
ca4c9a19635119d95900793e7a41b820cd1d94d9
0
Analyze the following code function for security vulnerabilities
@Override protected void doStop() { dnsClient.stop(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doStop File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
doStop
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
@Override public void onNextAlarmChanged(AlarmManager.AlarmClockInfo nextAlarm) { mNextAlarm = nextAlarm; if (nextAlarm != null) { String alarmString = KeyguardStatusView.formatNextAlarm(getContext(), nextAlarm); mAlarmStatus.setText(alarmString); mAlarmStatus.setContentDescription(mContext.getString( R.string.accessibility_quick_settings_alarm, alarmString)); mAlarmStatusCollapsed.setContentDescription(mContext.getString( R.string.accessibility_quick_settings_alarm, alarmString)); } if (mAlarmShowing != (nextAlarm != null)) { mAlarmShowing = nextAlarm != null; updateEverything(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNextAlarmChanged File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3886
HIGH
7.2
android
onNextAlarmChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
0
Analyze the following code function for security vulnerabilities
public String displayDocument(Syntax targetSyntax, XWikiContext context) throws XWikiException { return getRenderedContent(targetSyntax, true, false, context, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
displayDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public static CharSequence getSentSummary(Context context, NotificationsSentState state, boolean sortByRecency) { if (state == null) { return null; } if (sortByRecency) { if (state.lastSent == 0) { return context.getString(R.string.notifications_sent_never); } return StringUtil.formatRelativeTime( context, System.currentTimeMillis() - state.lastSent, true); } else { if (state.avgSentDaily > 0) { return context.getResources().getQuantityString(R.plurals.notifications_sent_daily, state.avgSentDaily, state.avgSentDaily); } return context.getResources().getQuantityString(R.plurals.notifications_sent_weekly, state.avgSentWeekly, state.avgSentWeekly); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSentSummary File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getSentSummary
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0