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
private @UserIdInt int getMainUserId() { int mainUserId = mUserManagerInternal.getMainUserId(); if (mainUserId == UserHandle.USER_NULL) { Slogf.d(LOG_TAG, "getMainUserId(): no main user, returning USER_SYSTEM"); return UserHandle.USER_SYSTEM; } return mainUserId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMainUserId 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
getMainUserId
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static void putByte(long address, byte value) { PlatformDependent0.putByte(address, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putByte File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
putByte
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private Bundle getAllExtras() { final Bundle saveExtras = (Bundle) mUserExtras.clone(); saveExtras.putAll(mN.extras); return saveExtras; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllExtras File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getAllExtras
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean shouldMigrateToDevicePolicyEngine() { return mInjector.binderWithCleanCallingIdentity(() -> (isPermissionCheckFlagEnabled() || isPolicyEngineForFinanceFlagEnabled()) && !mOwners.isMigratedToPolicyEngine()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldMigrateToDevicePolicyEngine 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
shouldMigrateToDevicePolicyEngine
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { // common case first if (p.isExpectedStartObjectToken()) { if (_vanillaProcessing) { return vanillaDeserialize(p, ctxt, p.nextToken()); } // 23-Sep-2015, tatu: This is wrong at some many levels, but for now... it is // what it is, including "expected behavior". p.nextToken(); if (_objectIdReader != null) { return deserializeWithObjectId(p, ctxt); } return deserializeFromObject(p, ctxt); } return _deserializeOther(p, ctxt, p.currentToken()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deserialize File: src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42004
HIGH
7.5
FasterXML/jackson-databind
deserialize
src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
063183589218fec19a9293ed2f17ec53ea80ba88
0
Analyze the following code function for security vulnerabilities
protected final <T extends Describable<T>> List<T> buildDescribable(StaplerRequest req, List<? extends Descriptor<T>> descriptors, String prefix) throws FormException, ServletException { return buildDescribable(req,descriptors); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildDescribable 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
buildDescribable
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private static Bundle readBundleEntry(XmlPullParser parser, ArrayList<String> values) throws IOException, XmlPullParserException { Bundle childBundle = new Bundle(); final int outerDepth = parser.getDepth(); while (XmlUtils.nextElementWithin(parser, outerDepth)) { readEntry(childBundle, values, parser); } return childBundle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readBundleEntry File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
readBundleEntry
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public HttpRequest query(final String name1, final Object value1, final Object... parameters) { query(name1, value1 == null ? null : value1.toString()); for (int i = 0; i < parameters.length; i += 2) { final String name = parameters[i].toString(); final String value = parameters[i + 1].toString(); query.add(name, value); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: query File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
query
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
public static String executeGroovy(String script, VirtualChannel channel) throws IOException, InterruptedException { return channel.call(new Script(script)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeGroovy File: core/src/main/java/hudson/util/RemotingDiagnostics.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-2068
LOW
3.5
jenkinsci/jenkins
executeGroovy
core/src/main/java/hudson/util/RemotingDiagnostics.java
0530a6645aac10fec005614211660e98db44b5eb
0
Analyze the following code function for security vulnerabilities
@Override public int stopUser(final int userId, boolean force, final IStopUserCallback callback) { return mUserController.stopUser(userId, force, /* allowDelayedLocking= */ false, /* callback= */ callback, /* keyEvictedCallback= */ null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopUser 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
stopUser
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting boolean shouldPauseActivity(ActivityRecord activeActivity) { return shouldMakeActive(activeActivity) && !isFocusable() && !isState(PAUSING, PAUSED) // We will only allow pausing if results is null, otherwise it will cause this // activity to resume before getting result && (results == null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldPauseActivity 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
shouldPauseActivity
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Unstable public boolean isRestricted() { return this.doc.isRestricted(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRestricted 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-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
isRestricted
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public void setProperty(String className, String fieldName, BaseProperty value) { setProperty(getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), fieldName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProperty 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-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
setProperty
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@Override protected void connectInternal() throws SmackException, IOException, XMPPException, InterruptedException { closingStreamReceived.init(); // Establishes the TCP connection to the server and does setup the reader and writer. Throws an exception if // there is an error establishing the connection connectUsingConfiguration(); // We connected successfully to the servers TCP port initConnection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectInternal File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
connectInternal
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public static boolean hasSignature(String apkFile) throws IOException { try (RandomAccessFile apk = new RandomAccessFile(apkFile, "r")) { findSignature(apk); return true; } catch (SignatureNotFoundException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSignature File: core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
hasSignature
core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
84df68840b6f2407146e722ebd95a7d8bc6e3529
0
Analyze the following code function for security vulnerabilities
public static NativeArray jsFunction_removeAPIRating(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { NativeArray myn = new NativeArray(0); if (args != null && args.length != 0) { String providerName = APIUtil.replaceEmailDomain((String) args[0]); String apiName = (String) args[1]; String version = (String) args[2]; float rating = 0; APIIdentifier apiId; APIConsumer apiConsumer = getAPIConsumer(thisObj); boolean isTenantFlowStarted = false; try { apiId = new APIIdentifier(providerName, apiName, version); String user = getUsernameFromObject(thisObj); String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(user)); if (tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { isTenantFlowStarted = true; PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); } apiConsumer.removeAPIRating(apiId, user); rating = apiConsumer.getAPI(apiId).getRating(); } catch (APIManagementException e) { throw new APIManagementException("Error while remove User Rating of the API " + apiName + e); } catch (Exception e) { throw new APIManagementException("Error while remove User Rating of the API " + apiName + e); } finally { if (isTenantFlowStarted) { PrivilegedCarbonContext.endTenantFlow(); } } NativeObject row = new NativeObject(); row.put("newRating", row, Float.toString(rating)); myn.put(0, myn, row); }// end of the if return myn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_removeAPIRating 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_removeAPIRating
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
private boolean isInPictureInPictureMode(ActivityRecord r) { if (r == null || r.getStack() == null || !r.inPinnedWindowingMode() || r.getStack().isInStackLocked(r) == null) { return false; } // If we are animating to fullscreen then we have already dispatched the PIP mode // changed, so we should reflect that check here as well. final PinnedActivityStack stack = r.getStack(); final PinnedStackWindowController windowController = stack.getWindowContainerController(); return !windowController.isAnimatingBoundsToFullscreen(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInPictureInPictureMode 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
isInPictureInPictureMode
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
void removeCall(Call call) { removeCall(call, new DisconnectCause(DisconnectCause.ERROR)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeCall File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
removeCall
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public SerializationConfig setSerializerConfigs(Collection<SerializerConfig> serializerConfigs) { this.serializerConfigs = serializerConfigs; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSerializerConfigs File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
setSerializerConfigs
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).useAuthorizationCodeFlow(code); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthAuthorizationCodeFlow File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setOauthAuthorizationCodeFlow
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void createAdminUser() { // Note that we cannot use ADMIN_CREDENTIALS.getPassword() since that password is less than 6 characters, and // we now have a check in XWiki on password length by default. We're keeping the default admin password in // ADMIN_CREDENTIALS.getPassword() to not break XS tests (since in XS the Admin user exists and has password // with value ADMIN_CREDENTIALS.getPassword()). createUser(ADMIN_CREDENTIALS.getUserName(), "administrator", null); addObject("XWiki", "XWikiAdminGroup", "XWiki.XWikiGroups", "member", "XWiki.Admin"); login(ADMIN_CREDENTIALS.getUserName(), "administrator"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAdminUser File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
createAdminUser
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public NewBeeMallUserVO updateUserInfo(MallUser mallUser, HttpSession httpSession) { NewBeeMallUserVO userTemp = (NewBeeMallUserVO) httpSession.getAttribute(Constants.MALL_USER_SESSION_KEY); MallUser userFromDB = mallUserMapper.selectByPrimaryKey(userTemp.getUserId()); if (userFromDB != null) { if (!StringUtils.isEmpty(mallUser.getNickName())) { userFromDB.setNickName(NewBeeMallUtils.cleanString(mallUser.getNickName())); } if (!StringUtils.isEmpty(mallUser.getAddress())) { userFromDB.setAddress(NewBeeMallUtils.cleanString(mallUser.getAddress())); } if (!StringUtils.isEmpty(mallUser.getIntroduceSign())) { userFromDB.setIntroduceSign(NewBeeMallUtils.cleanString(mallUser.getIntroduceSign())); } if (mallUserMapper.updateByPrimaryKeySelective(userFromDB) > 0) { NewBeeMallUserVO newBeeMallUserVO = new NewBeeMallUserVO(); userFromDB = mallUserMapper.selectByPrimaryKey(mallUser.getUserId()); BeanUtil.copyProperties(userFromDB, newBeeMallUserVO); httpSession.setAttribute(Constants.MALL_USER_SESSION_KEY, newBeeMallUserVO); return newBeeMallUserVO; } } return null; }
Vulnerability Classification: - CWE: CWE-639 - CVE: CVE-2023-30216 - Severity: MEDIUM - CVSS Score: 5.4 Description: :bug: Fixing a bug ##https://github.com/newbee-ltd/newbee-mall/issues/75 ##https://github.com/newbee-ltd/newbee-mall/issues/76 Function: updateUserInfo File: src/main/java/ltd/newbee/mall/service/impl/NewBeeMallUserServiceImpl.java Repository: newbee-ltd/newbee-mall Fixed Code: @Override public NewBeeMallUserVO updateUserInfo(MallUser mallUser, HttpSession httpSession) { NewBeeMallUserVO userTemp = (NewBeeMallUserVO) httpSession.getAttribute(Constants.MALL_USER_SESSION_KEY); MallUser userFromDB = mallUserMapper.selectByPrimaryKey(userTemp.getUserId()); if (userFromDB != null) { if (!StringUtils.isEmpty(mallUser.getNickName())) { userFromDB.setNickName(NewBeeMallUtils.cleanString(mallUser.getNickName())); } if (!StringUtils.isEmpty(mallUser.getAddress())) { userFromDB.setAddress(NewBeeMallUtils.cleanString(mallUser.getAddress())); } if (!StringUtils.isEmpty(mallUser.getIntroduceSign())) { userFromDB.setIntroduceSign(NewBeeMallUtils.cleanString(mallUser.getIntroduceSign())); } if (mallUserMapper.updateByPrimaryKeySelective(userFromDB) > 0) { NewBeeMallUserVO newBeeMallUserVO = new NewBeeMallUserVO(); BeanUtil.copyProperties(userFromDB, newBeeMallUserVO); httpSession.setAttribute(Constants.MALL_USER_SESSION_KEY, newBeeMallUserVO); return newBeeMallUserVO; } } return null; }
[ "CWE-639" ]
CVE-2023-30216
MEDIUM
5.4
newbee-ltd/newbee-mall
updateUserInfo
src/main/java/ltd/newbee/mall/service/impl/NewBeeMallUserServiceImpl.java
4f8948579ddd6843a2e313fdd55aafc809246f63
1
Analyze the following code function for security vulnerabilities
public String reIndexRecordAction() throws IndexUnreachableException, DAOException, RecordNotFoundException { if (viewManager != null) { if (IndexerTools.reIndexRecord(viewManager.getPi())) { Messages.info("reIndexRecordSuccess"); } else { Messages.error("reIndexRecordFailure"); } } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reIndexRecordAction 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
reIndexRecordAction
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
private int getPermissionGrantStateForUser( String packageName, String permission, CallerIdentity caller, int userId) throws RemoteException { int granted; if (getTargetSdk(caller.getPackageName(), caller.getUserId()) < android.os.Build.VERSION_CODES.Q) { // The per-Q behavior was to not check the app-ops state. granted = mIPackageManager.checkPermission(permission, packageName, userId); } else { try (var snapshot = mInjector.getPackageManagerLocal().withUnfilteredSnapshot()) { var packageState = snapshot.getPackageStates().get(packageName); if (packageState == null) { Slog.w(LOG_TAG, "Can't get permission state for missing package " + packageName); return DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT; } else if (!packageState.getUserStateOrDefault(userId).isInstalled()) { Slog.w(LOG_TAG, "Can't get permission state for uninstalled package " + packageName); return DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT; } else { if (PermissionChecker.checkPermissionForPreflight(mContext, permission, PermissionChecker.PID_UNKNOWN, UserHandle.getUid(userId, packageState.getAppId()), packageName) != PermissionChecker.PERMISSION_GRANTED) { granted = PackageManager.PERMISSION_DENIED; } else { granted = PackageManager.PERMISSION_GRANTED; } } } } int permFlags = mInjector.getPackageManager().getPermissionFlags( permission, packageName, UserHandle.of(userId)); if ((permFlags & PackageManager.FLAG_PERMISSION_POLICY_FIXED) != PackageManager.FLAG_PERMISSION_POLICY_FIXED) { // Not controlled by policy return DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT; } else { // Policy controlled so return result based on permission grant state return granted == PackageManager.PERMISSION_GRANTED ? DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED : DevicePolicyManager.PERMISSION_GRANT_STATE_DENIED; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionGrantStateForUser 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
getPermissionGrantStateForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void onCanceled();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCanceled File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
onCanceled
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public void registerConverter(SingleValueConverter converter, int priority) { if (converterRegistry != null) { converterRegistry.registerConverter(new SingleValueConverterWrapper(converter), priority); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerConverter File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
registerConverter
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private void logForDuration(final String message, Object o1, Object o2, long delta) { if (delta > LONG_DURATION_WARNING_MS) { log.warn(String.format("SLOW: %s", message), o1, o2, delta); } else { log.info(message, o1, o2, delta); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logForDuration File: rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java Repository: RIPE-NCC/rpki-validator-3 The code follows secure coding practices.
[ "CWE-295" ]
CVE-2020-16162
MEDIUM
5
RIPE-NCC/rpki-validator-3
logForDuration
rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
3cbf34fed7c0ca00574644a5b5b06f1b54a3f5dc
0
Analyze the following code function for security vulnerabilities
public void ReInit(SimpleCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ReInit File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
ReInit
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
void startDockOrHome() { awakenDreams(); Intent dock = createHomeDockIntent(); if (dock != null) { try { startActivityAsUser(dock, UserHandle.CURRENT); return; } catch (ActivityNotFoundException e) { } } startActivityAsUser(mHomeIntent, UserHandle.CURRENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startDockOrHome File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
startDockOrHome
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Column(name = "user_id", nullable = false) public long getUserId() { return this.userId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserId File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getUserId
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/trade/TradeOrder.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public Boolean getBooleanAndRemove(K name) { V v = getAndRemove(name); try { return v != null ? toBoolean(name, v) : null; } catch (RuntimeException ignore) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBooleanAndRemove 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
getBooleanAndRemove
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
private JournaledFile makeJournaledFile(@UserIdInt int userId) { return makeJournaledFile(userId, DEVICE_POLICIES_XML); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeJournaledFile 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
makeJournaledFile
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void initP12( @UnderInitialization(WrappedFactory.class) LibPQFactory this, String sslkeyfile, Properties info) throws PSQLException { km = new PKCS12KeyManager(sslkeyfile, getCallbackHandler(info)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initP12 File: pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-665" ]
CVE-2022-21724
HIGH
7.5
pgjdbc
initP12
pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java
f4d0ed69c0b3aae8531d83d6af4c57f22312c813
0
Analyze the following code function for security vulnerabilities
private Set<PosixFilePermission> toPermissions(final Integer perm) { final int mode = perm; final Set<PosixFilePermission> permissions = new HashSet<>(); for (final int mask : toPermMapping.keySet()) { if (mask == (mode & mask)) { permissions.add(toPermMapping.get(mask)); } } return permissions; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toPermissions File: src/main/java/cloudsync/connector/LocalFilesystemConnector.java Repository: HolgerHees/cloudsync The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4773
LOW
3.3
HolgerHees/cloudsync
toPermissions
src/main/java/cloudsync/connector/LocalFilesystemConnector.java
3ad796833398af257c28e0ebeade68518e0e612a
0
Analyze the following code function for security vulnerabilities
String extractString(byte[] data, int offset, int maxChars) throws IOException { final int end = offset + maxChars; int eos = offset; // tar string fields terminate early with a NUL while (eos < end && data[eos] != 0) eos++; return new String(data, offset, eos-offset, "US-ASCII"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractString File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
extractString
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public static long[] unshuffleLongArray(byte[] input) throws IOException { long[] output = new long[input.length / 8]; int numProcessed = impl.unshuffle(input, 0, 8, input.length, output, 0); assert(numProcessed == input.length); return output; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unshuffleLongArray File: src/main/java/org/xerial/snappy/BitShuffle.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34453
HIGH
7.5
xerial/snappy-java
unshuffleLongArray
src/main/java/org/xerial/snappy/BitShuffle.java
820e2e074c58748b41dbd547f4edba9e108ad905
0
Analyze the following code function for security vulnerabilities
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!(getActivity() instanceof ChooseLockPattern)) { throw new SecurityException("Fragment contained in wrong activity"); } Intent intent = getActivity().getIntent(); // Only take this argument into account if it belongs to the current profile. mUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras()); mIsManagedProfile = UserManager.get(getActivity()).isManagedProfile(mUserId); mLockPatternUtils = new LockPatternUtils(getActivity()); if (intent.getBooleanExtra( ChooseLockSettingsHelper.EXTRA_KEY_FOR_CHANGE_CRED_REQUIRED_FOR_BOOT, false)) { SaveAndFinishWorker w = new SaveAndFinishWorker(); final boolean required = getActivity().getIntent().getBooleanExtra( EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true); LockscreenCredential current = intent.getParcelableExtra( ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD); w.setBlocking(true); w.setListener(this); w.start(mLockPatternUtils, required, false /* requestGatekeeperPassword */, current, current, mUserId); } mForFingerprint = intent.getBooleanExtra( ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, false); mForFace = intent.getBooleanExtra( ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, false); mForBiometrics = intent.getBooleanExtra( ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
onCreate
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public String getURL(String action, XWikiContext context) { return getURL(action, false, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL 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
getURL
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 void doFileUpload(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws IOException { String fieldName =null; AjaxFileUploadListener listener = null; try { String fileName = ""; listener = new AjaxFileUploadListener(request.getContentLength()); FileItemFactory factory = new MonitoredDiskFileItemFactory(listener); fieldName = request.getParameter("fieldName"); Enumeration params = request.getParameterNames(); session.setAttribute("FILE_UPLOAD_STATS_" + fieldName, listener.getFileUploadStats()); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); boolean hasError = false; isEmptyFile = false; String userId = null; // if we want front end access, this validation would need to be altered if(UtilMethods.isSet(session.getAttribute("USER_ID"))) { userId = (String) session.getAttribute("USER_ID"); User user = UserLocalManagerUtil.getUserById(userId); if(!UtilMethods.isSet(user) || !UtilMethods.isSet(user.getUserId())) { throw new Exception("Could not upload File. Invalid User"); } } else { throw new Exception("Could not upload File. Invalid User"); } for (Iterator i = items.iterator(); i.hasNext();) { FileItem fileItem = (FileItem) i.next(); if (!fileItem.isFormField()) { // ************************************************* // This is where you would process the uploaded file // ************************************************* if(fileItem.getSize() == 0) isEmptyFile = true; if (fileItem.getName().contains(File.separator)) { fileName = fileItem.getName().substring( fileItem.getName().lastIndexOf(File.separator) + 1); } else { fileName = fileItem.getName(); } fileName = ContentletUtil.sanitizeFileName(fileName); File tempUserFolder = new File(APILocator.getFileAssetAPI().getRealAssetPathTmpBinary() + File.separator + userId + File.separator + fieldName); if(!isValidPath(tempUserFolder.getCanonicalPath())) { throw new IOException("Invalid fileName or Path"); } if (!tempUserFolder.exists()) tempUserFolder.mkdirs(); File dest=new File(tempUserFolder.getAbsolutePath() + File.separator + fileName); if(dest.exists()) dest.delete(); fileItem.write(dest); fileItem.delete(); } } if(isEmptyFile) fileName = ""; if (!hasError) { sendCompleteResponse(response, null); } else { sendCompleteResponse(response, "Could not process uploaded file. Please see log for details."); } } catch (Exception e) { listener.error("error"); session.setAttribute("FILE_UPLOAD_STATS_" + fieldName, listener.getFileUploadStats()); sendCompleteResponse(response, e.getMessage()); e.printStackTrace(); } }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2017-11466 - Severity: HIGH - CVSS Score: 9.0 Description: #12131 fixes arbitrary upload (#12134) * #12131 fixes arbitrary upload * #12131 fixes jenkins feedback Function: doFileUpload File: dotCMS/src/main/java/com/dotmarketing/servlets/AjaxFileUploadServlet.java Repository: dotCMS/core Fixed Code: private void doFileUpload(HttpSession session, HttpServletRequest request, HttpServletResponse response) throws IOException { String fieldName =null; AjaxFileUploadListener listener = null; try { String fileName = ""; listener = new AjaxFileUploadListener(request.getContentLength()); FileItemFactory factory = new MonitoredDiskFileItemFactory(listener); fieldName = request.getParameter("fieldName"); Enumeration params = request.getParameterNames(); session.setAttribute("FILE_UPLOAD_STATS_" + fieldName, listener.getFileUploadStats()); ServletFileUpload upload = new ServletFileUpload(factory); List items = upload.parseRequest(request); boolean hasError = false; isEmptyFile = false; String userId = null; // if we want front end access, this validation would need to be altered if(UtilMethods.isSet(session.getAttribute("USER_ID"))) { userId = (String) session.getAttribute("USER_ID"); User user = UserLocalManagerUtil.getUserById(userId); if(!UtilMethods.isSet(user) || !UtilMethods.isSet(user.getUserId())) { throw new Exception("Could not upload File. Invalid User"); } } else { throw new Exception("Could not upload File. Invalid User"); } for (Iterator i = items.iterator(); i.hasNext();) { FileItem fileItem = (FileItem) i.next(); if (!fileItem.isFormField()) { // ************************************************* // This is where you would process the uploaded file // ************************************************* if(fileItem.getSize() == 0) isEmptyFile = true; if (fileItem.getName().contains(File.separator)) { fileName = fileItem.getName().substring( fileItem.getName().lastIndexOf(File.separator) + 1); } else { fileName = fileItem.getName(); } fileName = ContentletUtil.sanitizeFileName(fileName); fieldName = ContentletUtil.sanitizeFileName(fieldName); File tempUserFolder = new File(APILocator.getFileAssetAPI().getRealAssetPathTmpBinary() + File.separator + userId + File.separator + fieldName); if(!isValidPath(tempUserFolder.getCanonicalPath())) { throw new IOException("Invalid fileName or Path"); } if (!tempUserFolder.exists()) tempUserFolder.mkdirs(); File dest=new File(tempUserFolder.getAbsolutePath() + File.separator + fileName); if(dest.exists()) dest.delete(); fileItem.write(dest); fileItem.delete(); } } if(isEmptyFile) fileName = ""; if (!hasError) { sendCompleteResponse(response, null); } else { sendCompleteResponse(response, "Could not process uploaded file. Please see log for details."); } } catch (Exception e) { listener.error("error"); session.setAttribute("FILE_UPLOAD_STATS_" + fieldName, listener.getFileUploadStats()); sendCompleteResponse(response, e.getMessage()); e.printStackTrace(); } }
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
doFileUpload
dotCMS/src/main/java/com/dotmarketing/servlets/AjaxFileUploadServlet.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
1
Analyze the following code function for security vulnerabilities
@Override public boolean switchUser(final int targetUserId) { return mUserController.switchUser(targetUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser 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
switchUser
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public boolean onCreate() { if (mSystemFacade == null) { mSystemFacade = new RealSystemFacade(getContext()); } mHandler = new Handler(); mOpenHelper = new DatabaseHelper(getContext()); // Initialize the system uid mSystemUid = Process.SYSTEM_UID; // Initialize the default container uid. Package name hardcoded // for now. ApplicationInfo appInfo = null; try { appInfo = getContext().getPackageManager(). getApplicationInfo("com.android.defcontainer", 0); } catch (NameNotFoundException e) { Log.wtf(Constants.TAG, "Could not get ApplicationInfo for com.android.defconatiner", e); } if (appInfo != null) { mDefContainerUid = appInfo.uid; } // start the DownloadService class. don't wait for the 1st download to be issued. // saves us by getting some initialization code in DownloadService out of the way. Context context = getContext(); context.startService(new Intent(context, DownloadService.class)); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate 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
onCreate
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
private void setConnectChoiceInternal(WifiConfiguration config, String key, int rssi) { config.getNetworkSelectionStatus().setConnectChoice(key); config.getNetworkSelectionStatus().setConnectChoiceRssi(rssi); localLog("Add connect choice key: " + key + " rssi: " + rssi + " to " + WifiNetworkSelector.toNetworkString(config)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConnectChoiceInternal File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
setConnectChoiceInternal
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public char getQuoteChar () { return m_cQuote; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getQuoteChar File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
getQuoteChar
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
public static Path getResourceCachePath(String resourceURI) throws IOException { URI uri = URI.create(resourceURI); return getResourceCachePath(uri); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceCachePath File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
getResourceCachePath
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/uriresolver/CacheResourcesManager.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
@Override public void cometLeft(Event event) { String oortURL = event.getCometURL(); if (_logger.isDebugEnabled()) { _logger.debug("Comet left: {}", oortURL); } removePresences(oortURL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cometLeft File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
cometLeft
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
public boolean checkVoldPassword(int userId) { try { return getLockSettings().checkVoldPassword(userId); } catch (RemoteException re) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkVoldPassword File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
checkVoldPassword
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public boolean isValidating() { return readerfac.isValidating(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidating File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
isValidating
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
public static long executeInsert(@NonNull SQLiteDatabase db, @NonNull String sql, @Nullable Object[] bindArgs) throws SQLException { try (SQLiteStatement st = db.compileStatement(sql)) { bindArgs(st, bindArgs); return st.executeInsert(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeInsert File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
executeInsert
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
private boolean isTrackingGeneration(Bundle args) { return args != null && args.containsKey(Settings.CALL_METHOD_TRACK_GENERATION_KEY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTrackingGeneration 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
isTrackingGeneration
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@ResponseBody @RequestMapping(value = "/resendRegistrationCode", method = RequestMethod.POST, produces = APPLICATION_JSON_VALUE) public DeliverRegistrationCodeResult resendRegistrationCode( HttpSession session) throws WebApplicationException { return deliverRegistrationCode((String) session.getAttribute("userDN")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resendRegistrationCode File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java Repository: pingidentity/ssam The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-25084
MEDIUM
4
pingidentity/ssam
resendRegistrationCode
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
0
Analyze the following code function for security vulnerabilities
protected static Object readPrimitive(ObjectInput in) throws IOException, ClassNotFoundException { byte b = in.readByte(); switch (b) { case -1: return null; case 1: return in.readBoolean(); case 2: return in.readByte(); case 3: return in.readShort(); case 4: return in.readInt(); case 5: return in.readLong(); case 6: return in.readFloat(); case 7: return in.readDouble(); case 8: return in.readUTF(); case 9: return in.readChar(); case 10: { int length = in.readInt(); byte[] buf = new byte[length]; in.read(buf); return buf; } default: return in.readObject(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readPrimitive File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
readPrimitive
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
private Set<String> getActiveAdminPackagesLocked(int userId) { final DevicePolicyData policy = getUserData(userId); Set<String> adminPkgs = null; for (int i = policy.mAdminList.size() - 1; i >= 0; --i) { final String pkgName = policy.mAdminList.get(i).info.getPackageName(); if (adminPkgs == null) { adminPkgs = new ArraySet<>(); } adminPkgs.add(pkgName); } return adminPkgs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveAdminPackagesLocked 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
getActiveAdminPackagesLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setReferrer(String referrer) { this.referrer = referrer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReferrer File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
setReferrer
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
@Override public void run() { synchronized (this) { if (localLOGV) Log.v(TAG, "mScreenLockTimeout activating keyguard"); if (mKeyguardDelegate != null) { mKeyguardDelegate.doKeyguardTimeout(options); } mLockScreenTimerActive = false; options = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
run
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void removeLongLivedShortcuts(String packageName, List shortcutIds, @UserIdInt int userId) { verifyCaller(packageName, userId); Objects.requireNonNull(shortcutIds, "shortcutIds must be provided"); List<ShortcutInfo> changedShortcuts = null; List<ShortcutInfo> removedShortcuts = null; final ShortcutPackage ps; synchronized (mLock) { throwIfUserLockedL(userId); ps = getPackageShortcutsForPublisherLocked(packageName, userId); ps.ensureImmutableShortcutsNotIncludedWithIds((List<String>) shortcutIds, /*ignoreInvisible=*/ true); for (int i = shortcutIds.size() - 1; i >= 0; i--) { final String id = Preconditions.checkStringNotEmpty((String) shortcutIds.get(i)); if (!ps.isShortcutExistsAndVisibleToPublisher(id)) { continue; } ShortcutInfo removed = ps.deleteLongLivedWithId(id, /*ignoreInvisible=*/ true); if (removed != null) { if (removedShortcuts == null) { removedShortcuts = new ArrayList<>(1); } removedShortcuts.add(removed); } else { if (changedShortcuts == null) { changedShortcuts = new ArrayList<>(1); } changedShortcuts.add(ps.findShortcutById(id)); } } // We may have removed dynamic shortcuts which may have left a gap, so adjust the ranks. ps.adjustRanks(); } packageShortcutsChanged(ps, changedShortcuts, removedShortcuts); verifyStates(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeLongLivedShortcuts 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
removeLongLivedShortcuts
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public Map<String, Object> findByTag(int page, int pageSize, String tag) { Map<String, Object> data = new HashMap<>(); String sql = "select l.*,t.typeName,t.alias as typeAlias,(select count(commentId) from " + Comment.TABLE_NAME + " where logId=l.logId) commentSize,u.userName from " + TABLE_NAME + " l inner join user u,type t where rubbish=? and privacy=? and u.userId=l.userId and t.typeId=l.typeId and (l.keywords like ? or l.keywords like ? or l.keywords like ? or l.keywords= ?) order by l.logId desc limit ?,?"; data.put("rows", find(sql, rubbish, privacy, tag + ",%", "%," + tag + ",%", "%," + tag, tag, ParseUtil.getFirstRecord(page, pageSize), pageSize)); ModelUtil.fillPageData(this, page, pageSize, "from " + TABLE_NAME + " l inner join user u,type t where rubbish=? and privacy=? and u.userId=l.userId and t.typeId=l.typeId and (l.keywords like ? or l.keywords like ? or l.keywords like ? or l.keywords= ?)", data, new Object[]{rubbish, privacy, tag + ",%", "%," + tag + ",%", "%," + tag, tag}); return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByTag File: data/src/main/java/com/zrlog/model/Log.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-17420
MEDIUM
6.5
94fzb/zrlog
findByTag
data/src/main/java/com/zrlog/model/Log.java
157b8fbbb64eb22ddb52e7c5754e88180b7c3d4f
0
Analyze the following code function for security vulnerabilities
private boolean offerLongPressToEmbedder() { return mContainerView.performLongClick(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: offerLongPressToEmbedder File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
offerLongPressToEmbedder
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public void mayProceed() throws InsufficientPermissionException { if (ub.isSysAdmin()) { return; } if (currentRole.getRole().equals(Role.STUDYDIRECTOR) || currentRole.getRole().equals(Role.COORDINATOR)) { return; } addPageMessage(respage.getString("no_have_correct_privilege_current_study") + respage.getString("change_study_contact_sysadmin")); throw new InsufficientPermissionException(Page.MANAGE_STUDY_SERVLET, resexception.getString("not_study_director"), "1"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mayProceed File: web/src/main/java/org/akaza/openclinica/control/admin/DownloadVersionSpreadSheetServlet.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
mayProceed
web/src/main/java/org/akaza/openclinica/control/admin/DownloadVersionSpreadSheetServlet.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
@Override public int read(byte[] b, int byteOffset, int byteLength) throws IOException { int writtenBytes = 0; for (; writtenBytes < byteLength; ) { if (uncompressedCursor >= uncompressedLimit) { if (hasNextChunk()) { continue; } else { return writtenBytes == 0 ? -1 : writtenBytes; } } int bytesToWrite = Math.min(uncompressedLimit - uncompressedCursor, byteLength - writtenBytes); System.arraycopy(uncompressed, uncompressedCursor, b, byteOffset + writtenBytes, bytesToWrite); writtenBytes += bytesToWrite; uncompressedCursor += bytesToWrite; } return writtenBytes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/java/org/xerial/snappy/SnappyInputStream.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-34455
HIGH
7.5
xerial/snappy-java
read
src/main/java/org/xerial/snappy/SnappyInputStream.java
3bf67857fcf70d9eea56eed4af7c925671e8eaea
0
Analyze the following code function for security vulnerabilities
public static XMLEvent getNextEvent(XMLEventReader xmlEventReader) throws ParsingException { try { return xmlEventReader.nextEvent(); } catch (XMLStreamException e) { throw logger.parserException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextEvent File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
getNextEvent
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
private boolean checkPermissionAndNote(String opPackageName, int callingUid, String... permissions) { for (String perm : permissions) { if (mContext.checkCallingOrSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, " caller uid " + callingUid + " has " + perm); } final int opCode = AppOpsManager.permissionToOpCode(perm); if (opCode == AppOpsManager.OP_NONE || mAppOpsManager.noteOpNoThrow( opCode, callingUid, opPackageName) == AppOpsManager.MODE_ALLOWED) { return true; } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermissionAndNote 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
checkPermissionAndNote
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void setClassName(String className) { this.className = className; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClassName File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setClassName
base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private static void validateHeaderNameElement(byte value) { switch (value) { case 0x00: case '\t': case '\n': case 0x0b: case '\f': case '\r': case ' ': case ',': case ':': case ';': case '=': throw new IllegalArgumentException( "a header name cannot contain the following prohibited characters: =,;: \\t\\r\\n\\v\\f: " + value); default: // Check to see if the character is not an ASCII character, or invalid if (value < 0) { throw new IllegalArgumentException("a header name cannot contain non-ASCII character: " + value); } } }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2021-43797 - Severity: MEDIUM - CVSS Score: 4.3 Description: Merge pull request from GHSA-wx5j-54mm-rqqq Motivation: We should validate that only OWS is allowed before / after a header name and otherwise throw. At the moment we just "strip" everything except OWS. Modifications: - Adjust code to correctly validate - Add unit tests Result: More strict and correct behaviour Function: validateHeaderNameElement File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty Fixed Code: private static void validateHeaderNameElement(byte value) { switch (value) { case 0x1c: case 0x1d: case 0x1e: case 0x1f: case 0x00: case '\t': case '\n': case 0x0b: case '\f': case '\r': case ' ': case ',': case ':': case ';': case '=': throw new IllegalArgumentException( "a header name cannot contain the following prohibited characters: =,;: \\t\\r\\n\\v\\f: " + value); default: // Check to see if the character is not an ASCII character, or invalid if (value < 0) { throw new IllegalArgumentException("a header name cannot contain non-ASCII character: " + value); } } }
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
validateHeaderNameElement
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
1
Analyze the following code function for security vulnerabilities
public long getFileLastModified(String file) { file = removeFilePrefix(file); return new File(file).lastModified(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileLastModified 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
getFileLastModified
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
final void sendOnBackupPackage(String name) { if (mObserver != null) { try { // TODO: use a more user-friendly name string mObserver.onBackupPackage(name); } catch (RemoteException e) { Slog.w(TAG, "full backup observer went away: backupPackage"); mObserver = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendOnBackupPackage File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
sendOnBackupPackage
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private String charToString (char [] tmpPassword, Callback cbk ) { if (tmpPassword == null) { // treat a NULL password as an empty password tmpPassword = new char[0]; } char[] pwd = new char[tmpPassword.length]; System.arraycopy(tmpPassword, 0, pwd, 0, tmpPassword.length); ((PasswordCallback)cbk).clearPassword(); return new String(pwd); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: charToString File: openam-authentication/openam-auth-nt/src/main/java/com/sun/identity/authentication/modules/nt/NT.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-34298
MEDIUM
5
OpenIdentityPlatform/OpenAM
charToString
openam-authentication/openam-auth-nt/src/main/java/com/sun/identity/authentication/modules/nt/NT.java
3b242fbd6bdc1e2fa2f07842213a6301a0a0b468
0
Analyze the following code function for security vulnerabilities
private @UserIdInt int getNetworkLoggingAffectedUser() { synchronized (getLockObject()) { if (mOwners.hasDeviceOwner()) { return mOwners.getDeviceOwnerUserId(); } else { return mInjector.binderWithCleanCallingIdentity( () -> getManagedUserId()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNetworkLoggingAffectedUser 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
getNetworkLoggingAffectedUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static Iterable<Integer> codePointIterator(final String string) { return new Iterable<Integer>() { @Override public Iterator<Integer> iterator() { return new Iterator<Integer>() { private int nextIndex = 0; private int length = string.length(); @Override public boolean hasNext() { return this.nextIndex < this.length; } @Override public Integer next() { int result = string.codePointAt(this.nextIndex); this.nextIndex += Character.charCount(result); return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: codePointIterator File: src/main/java/org/json/XML.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45688
HIGH
7.5
stleary/JSON-java
codePointIterator
src/main/java/org/json/XML.java
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
0
Analyze the following code function for security vulnerabilities
void setRequestedSize(int requestedWidth, int requestedHeight) { if ((mRequestedWidth != requestedWidth || mRequestedHeight != requestedHeight)) { mLayoutNeeded = true; mRequestedWidth = requestedWidth; mRequestedHeight = requestedHeight; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestedSize File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
setRequestedSize
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public <T> T get(EntityReference reference, boolean failIfNotFound) throws Exception { Class<?> resource = getResourceAPI(reference); return get(resource, reference, failIfNotFound); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
get
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
protected void openConversationForBookmark() { openConversationForBookmark(conference_context_id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openConversationForBookmark 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
openConversationForBookmark
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private void scheduleNotifyProviderChangedLocked(Widget widget) { if (widget == null || widget.provider == null || widget.provider.zombie || widget.host.callbacks == null || widget.host.zombie) { return; } SomeArgs args = SomeArgs.obtain(); args.arg1 = widget.host; args.arg2 = widget.host.callbacks; args.arg3 = widget.provider.info; args.argi1 = widget.appWidgetId; mCallbackHandler.obtainMessage( CallbackHandler.MSG_NOTIFY_PROVIDER_CHANGED, args).sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleNotifyProviderChangedLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
scheduleNotifyProviderChangedLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private boolean isCallerSystemSupervisionRoleHolder(CallerIdentity caller) { return doesCallerHoldRole(caller, RoleManager.ROLE_SYSTEM_SUPERVISION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCallerSystemSupervisionRoleHolder 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
isCallerSystemSupervisionRoleHolder
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String getStringValue(DocumentReference classReference, String fieldName) { BaseObject obj = getXObject(classReference); if (obj == null) { return ""; } String result = obj.getStringValue(fieldName); if (result.equals(" ")) { return ""; } else { return result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStringValue 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
getStringValue
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 List<PeerConnectionWrapper> getPeerConnectionWrapperListForSessionId(String sessionId) { List<PeerConnectionWrapper> internalList = new ArrayList<>(); for (PeerConnectionWrapper peerConnectionWrapper : peerConnectionWrapperList) { if (peerConnectionWrapper.getSessionId().equals(sessionId)) { internalList.add(peerConnectionWrapper); } } return internalList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPeerConnectionWrapperListForSessionId File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
getPeerConnectionWrapperListForSessionId
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public void gotoPage(EntityReference reference, String action, Map<String, ?> queryParameters) { gotoPage(reference, action, toQueryString(queryParameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gotoPage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
gotoPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public void resizeStack(int stackId, Rect bounds, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate, int animationDuration) { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "resizeStack()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { if (animate) { if (stackId == PINNED_STACK_ID) { mWindowManager.animateResizePinnedStack(bounds, animationDuration); } else { throw new IllegalArgumentException("Stack: " + stackId + " doesn't support animated resize."); } } else { mStackSupervisor.resizeStackLocked(stackId, bounds, null /* tempTaskBounds */, null /* tempTaskInsetBounds */, preserveWindows, allowResizeInDockedMode, !DEFER_RESUME); } } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeStack File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
resizeStack
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private @ColorInt int getStandardActionColor(Notification.StandardTemplateParams p) { return mTintActionButtons || isBackgroundColorized(p) ? getPrimaryAccentColor(p) : getSecondaryTextColor(p); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStandardActionColor File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getStandardActionColor
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static String[] getIntentFilterActions(IntentFilter filter) { if (filter == null) { return null; } final int actionsCount = filter.countActions(); final String[] actions = new String[actionsCount]; for (int i = 0; i < actionsCount; i++) { actions[i] = filter.getAction(i); } return actions; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentFilterActions 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
getIntentFilterActions
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { int uriType = URI_MATCHER.match(uri); SQLiteDatabase sqlDB = databaseManager.getWriteDb(); int rowsUpdated = 0; switch (uriType) { case SEARCHES: rowsUpdated = sqlDB.update(HistorySearchSchema.TABLENAME, values, selection, selectionArgs); break; case SEARCH_ID: String id = uri.getLastPathSegment(); if (TextUtils.isEmpty(selection)) { rowsUpdated = sqlDB.update(HistorySearchSchema.TABLENAME, values, HistorySearchSchema.COLUMN_ID + "=" + id, null); } else { rowsUpdated = sqlDB.update(HistorySearchSchema.TABLENAME, values, HistorySearchSchema.COLUMN_ID + "=" + id + " and " + selection, selectionArgs); } break; default: throw new IllegalArgumentException("Unknown URI: " + uri); } getContext().getContentResolver().notifyChange(uri, null); return rowsUpdated; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/search/HistorySearchProvider.java Repository: Alfresco/alfresco-android-app The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15566
HIGH
7.5
Alfresco/alfresco-android-app
update
alfresco-mobile-android/src/main/java/org/alfresco/mobile/android/application/providers/search/HistorySearchProvider.java
32faa4355f82783326d16b0252e81e1231e12c9c
0
Analyze the following code function for security vulnerabilities
public ActivityOptions getActivityOptions(IBinder token) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityOptions File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getActivityOptions
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public IIntentSender getIntentSender(int type, String packageName, IBinder token, String resultWho, int requestCode, Intent[] intents, String[] resolvedTypes, int flags, Bundle bOptions, int userId) { enforceNotIsolatedCaller("getIntentSender"); // Refuse possible leaked file descriptors if (intents != null) { if (intents.length < 1) { throw new IllegalArgumentException("Intents array length must be >= 1"); } for (int i=0; i<intents.length; i++) { Intent intent = intents[i]; if (intent != null) { if (intent.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in Intent"); } if (type == ActivityManager.INTENT_SENDER_BROADCAST && (intent.getFlags()&Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0) { throw new IllegalArgumentException( "Can't use FLAG_RECEIVER_BOOT_UPGRADE here"); } intents[i] = new Intent(intent); } } if (resolvedTypes != null && resolvedTypes.length != intents.length) { throw new IllegalArgumentException( "Intent array length does not match resolvedTypes length"); } } if (bOptions != null) { if (bOptions.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in options"); } } synchronized(this) { int callingUid = Binder.getCallingUid(); int origUserId = userId; userId = mUserController.handleIncomingUser(Binder.getCallingPid(), callingUid, userId, type == ActivityManager.INTENT_SENDER_BROADCAST, ALLOW_NON_FULL, "getIntentSender", null); if (origUserId == UserHandle.USER_CURRENT) { // We don't want to evaluate this until the pending intent is // actually executed. However, we do want to always do the // security checking for it above. userId = UserHandle.USER_CURRENT; } try { if (callingUid != 0 && callingUid != SYSTEM_UID) { final int uid = AppGlobals.getPackageManager().getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(callingUid)); if (!UserHandle.isSameApp(callingUid, uid)) { String msg = "Permission Denial: getIntentSender() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + ", (need uid=" + uid + ")" + " is not allowed to send as package " + packageName; Slog.w(TAG, msg); throw new SecurityException(msg); } } return getIntentSenderLocked(type, packageName, callingUid, userId, token, resultWho, requestCode, intents, resolvedTypes, flags, bOptions); } catch (RemoteException e) { throw new SecurityException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentSender 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
getIntentSender
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public Conversation getConversation() { return conversation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConversation File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
getConversation
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
ActivityOptions getHomeTransitionActivityOptions(boolean fromSearchHome) { mStartAnimationTriggered = false; if (fromSearchHome) { return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_search_launcher_enter, R.anim.recents_from_search_launcher_exit, mHandler, this); } return ActivityOptions.makeCustomAnimation(mContext, R.anim.recents_from_launcher_enter, R.anim.recents_from_launcher_exit, mHandler, this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHomeTransitionActivityOptions File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0813
MEDIUM
6.6
android
getHomeTransitionActivityOptions
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
0
Analyze the following code function for security vulnerabilities
public void setRecommendedGlobalProxy(@NonNull ComponentName admin, @Nullable ProxyInfo proxyInfo) { throwIfParentInstance("setRecommendedGlobalProxy"); if (mService != null) { try { mService.setRecommendedGlobalProxy(admin, proxyInfo); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRecommendedGlobalProxy 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
setRecommendedGlobalProxy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static void dumpStackTraces(String tracesFile, ArrayList<Integer> firstPids, ArrayList<Integer> nativePids, ArrayList<Integer> extraPids, boolean useTombstonedForJavaTraces) { // We don't need any sort of inotify based monitoring when we're dumping traces via // tombstoned. Data is piped to an "intercept" FD installed in tombstoned so we're in full // control of all writes to the file in question. final DumpStackFileObserver observer; if (useTombstonedForJavaTraces) { observer = null; } else { // Use a FileObserver to detect when traces finish writing. // The order of traces is considered important to maintain for legibility. observer = new DumpStackFileObserver(tracesFile); } // We must complete all stack dumps within 20 seconds. long remainingTime = 20 * 1000; try { if (observer != null) { observer.startWatching(); } // First collect all of the stacks of the most important pids. if (firstPids != null) { int num = firstPids.size(); for (int i = 0; i < num; i++) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for pid " + firstPids.get(i)); final long timeTaken; if (useTombstonedForJavaTraces) { timeTaken = dumpJavaTracesTombstoned(firstPids.get(i), tracesFile, remainingTime); } else { timeTaken = observer.dumpWithTimeout(firstPids.get(i), remainingTime); } remainingTime -= timeTaken; if (remainingTime <= 0) { Slog.e(TAG, "Aborting stack trace dump (current firstPid=" + firstPids.get(i) + "); deadline exceeded."); return; } if (DEBUG_ANR) { Slog.d(TAG, "Done with pid " + firstPids.get(i) + " in " + timeTaken + "ms"); } } } // Next collect the stacks of the native pids if (nativePids != null) { for (int pid : nativePids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for native pid " + pid); final long nativeDumpTimeoutMs = Math.min(NATIVE_DUMP_TIMEOUT_MS, remainingTime); final long start = SystemClock.elapsedRealtime(); Debug.dumpNativeBacktraceToFileTimeout( pid, tracesFile, (int) (nativeDumpTimeoutMs / 1000)); final long timeTaken = SystemClock.elapsedRealtime() - start; remainingTime -= timeTaken; if (remainingTime <= 0) { Slog.e(TAG, "Aborting stack trace dump (current native pid=" + pid + "); deadline exceeded."); return; } if (DEBUG_ANR) { Slog.d(TAG, "Done with native pid " + pid + " in " + timeTaken + "ms"); } } } // Lastly, dump stacks for all extra PIDs from the CPU tracker. if (extraPids != null) { for (int pid : extraPids) { if (DEBUG_ANR) Slog.d(TAG, "Collecting stacks for extra pid " + pid); final long timeTaken; if (useTombstonedForJavaTraces) { timeTaken = dumpJavaTracesTombstoned(pid, tracesFile, remainingTime); } else { timeTaken = observer.dumpWithTimeout(pid, remainingTime); } remainingTime -= timeTaken; if (remainingTime <= 0) { Slog.e(TAG, "Aborting stack trace dump (current extra pid=" + pid + "); deadline exceeded."); return; } if (DEBUG_ANR) { Slog.d(TAG, "Done with extra pid " + pid + " in " + timeTaken + "ms"); } } } } finally { if (observer != null) { observer.stopWatching(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpStackTraces 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
dumpStackTraces
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public ErrorListener getErrorListener() { return ThrowingErrorListener.INSTANCE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getErrorListener File: hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0265
HIGH
7.5
hazelcast
getErrorListener
hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
4d6b666cd0291abd618c3b95cdbb51aa4208e748
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private void onlyUsePhantasm(String poc) { xrayCmd.setPoc(String.format("%s", poc)); for (JCheckBox box : checkBoxList) { box.setSelected(false); } phantasmCheckBox.setSelected(true); for (Map.Entry<String, Object> entry : configObj.entrySet()) { if (entry.getKey().equals("plugins")) { Map<String, Object> plugins = (Map<String, Object>) entry.getValue(); for (Map.Entry<String, Object> plugin : plugins.entrySet()) { Map<String, Object> items = (Map<String, Object>) plugin.getValue(); if (plugin.getKey().equals("phantasm")) { items.put("enabled", true); } else { items.put("enabled", false); } } } } refreshConfig(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onlyUsePhantasm File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
onlyUsePhantasm
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
0
Analyze the following code function for security vulnerabilities
@Override public void onResume() { super.onResume(); if (!mUserCaps.mEnabled) return; if (mShouldUpdateUserList) { mUserCaps.updateAddUserCapabilities(getActivity()); loadProfile(); updateUserList(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
onResume
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
private void setExpirationAlarmCheckLocked(Context context, int userHandle, boolean parent) { final long expiration = getPasswordExpirationLocked(null, userHandle, parent); final long now = System.currentTimeMillis(); final long timeToExpire = expiration - now; final long alarmTime; if (expiration == 0) { // No expirations are currently configured: Cancel alarm. alarmTime = 0; } else if (timeToExpire <= 0) { // The password has already expired: Repeat every 24 hours. alarmTime = now + MS_PER_DAY; } else { // Selecting the next alarm time: Roll forward to the next 24 hour multiple before // the expiration time. long alarmInterval = timeToExpire % MS_PER_DAY; if (alarmInterval == 0) { alarmInterval = MS_PER_DAY; } alarmTime = now + alarmInterval; } mInjector.binderWithCleanCallingIdentity(() -> { int affectedUserHandle = parent ? getProfileParentId(userHandle) : userHandle; AlarmManager am = mInjector.getAlarmManager(); // Broadcast alarms sent by system are immutable PendingIntent pi = PendingIntent.getBroadcastAsUser(context, REQUEST_EXPIRE_PASSWORD, new Intent(ACTION_EXPIRED_PASSWORD_NOTIFICATION), PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE, UserHandle.of(affectedUserHandle)); am.cancel(pi); if (alarmTime != 0) { am.set(AlarmManager.RTC, alarmTime, pi); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExpirationAlarmCheckLocked 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
setExpirationAlarmCheckLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public Integer size() { ensureSearchEntityLoaded(); SearchCoordinatorSvcImpl.verifySearchHasntFailedOrThrowInternalErrorException(mySearchEntity); Integer size = mySearchEntity.getTotalCount(); if (size != null) { return Math.max(0, size); } if (mySearchEntity.getSearchType() == SearchTypeEnum.HISTORY) { return null; } else { return mySearchCoordinatorSvc.getSearchTotal(myUuid).orElse(null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: size File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
size
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
String getAuthQuery(String axa) { if (authQuery!=null) return authQuery; List<String> list = new ArrayList<String>(); list.add("openid.ns=http://specs.openid.net/auth/2.0"); list.add("openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select"); list.add("openid.identity=http://specs.openid.net/auth/2.0/identifier_select"); list.add("openid.mode=checkid_setup"); list.add("openid.ns." + axa + "=http://openid.net/srv/ax/1.0"); list.add("openid." + axa + ".mode=fetch_request"); list.add("openid." + axa + ".type.email=http://axschema.org/contact/email"); list.add("openid." + axa + ".type.fullname=http://axschema.org/namePerson"); list.add("openid." + axa + ".type.language=http://axschema.org/pref/language"); list.add("openid." + axa + ".type.firstname=http://axschema.org/namePerson/first"); list.add("openid." + axa + ".type.lastname=http://axschema.org/namePerson/last"); list.add("openid." + axa + ".type.gender=http://axschema.org/person/gender"); list.add("openid." + axa + ".required=email,fullname,language,firstname,lastname,gender"); String query = Utils.buildQuery(list); authQuery = query; return query; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthQuery File: JOpenId/src/org/expressme/openid/OpenIdManager.java Repository: michaelliao/jopenid The code follows secure coding practices.
[ "CWE-208" ]
CVE-2010-10006
LOW
1.4
michaelliao/jopenid
getAuthQuery
JOpenId/src/org/expressme/openid/OpenIdManager.java
c9baaa976b684637f0d5a50268e91846a7a719ab
0
Analyze the following code function for security vulnerabilities
@Override public Grid<T> getParent() { return super.getParent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParent File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getParent
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override protected int deleteOldContent(Date deleteFrom) throws DotDataException { ContentletCache cc = CacheLocator.getContentletCache(); Calendar calendar = Calendar.getInstance(); calendar.setTime(deleteFrom); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); Date date = calendar.getTime(); //Because of the way Oracle databases handle dates, //this string is converted to Uppercase.This does //not cause a problem with the other databases DotConnect dc = new DotConnect(); String countSQL = ("select count(*) as count from contentlet"); dc.setSQL(countSQL); List<Map<String, String>> result = dc.loadResults(); int before = Integer.parseInt(result.get(0).get("count")); String deleteContentletSQL = "delete from contentlet where identifier<>'SYSTEM_HOST' and mod_date < ? " + "and not exists (select * from contentlet_version_info where working_inode=contentlet.inode or live_inode=contentlet.inode)"; dc.setSQL(deleteContentletSQL); dc.addParam(date); dc.loadResult(); String deleteOrphanInodes="delete from inode where type='contentlet' and idate < ? and inode not in (select inode from contentlet)"; dc.setSQL(deleteOrphanInodes); dc.addParam(date); dc.loadResult(); dc.setSQL(countSQL); result = dc.loadResults(); int after = Integer.parseInt(result.get(0).get("count")); int deleted=before - after; // deleting orphan binary files java.io.File assets=new java.io.File(APILocator.getFileAPI().getRealAssetsRootPath()); for(java.io.File ff1 : assets.listFiles()) if(ff1.isDirectory() && ff1.getName().length()==1 && ff1.getName().matches("^[a-f0-9]$")) for(java.io.File ff2 : ff1.listFiles()) if(ff2.isDirectory() && ff2.getName().length()==1 && ff2.getName().matches("^[a-f0-9]$")) for(java.io.File ff3 : ff2.listFiles()) try { if(ff3.isDirectory()) { Contentlet con=find(ff3.getName()); if(con==null || !UtilMethods.isSet(con.getIdentifier())) if(!FileUtils.deleteQuietly(ff3)) Logger.warn(this, "can't delete "+ff3.getAbsolutePath()); } } catch(Exception ex) { Logger.warn(this, ex.getMessage()); } return deleted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteOldContent File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
deleteOldContent
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
void setCustomizeSplashScreenExitAnimation(boolean enable) { if (mHandleExitSplashScreen == enable) { return; } mHandleExitSplashScreen = enable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCustomizeSplashScreenExitAnimation 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
setCustomizeSplashScreenExitAnimation
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public boolean runOnJSDispatchThread(Runnable r) { if (isJSDispatchThread()) { r.run(); return true; } if (useJSDispatchThread()) { jsDispatchThread().run(r); } else { getActivity().runOnUiThread(r); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runOnJSDispatchThread 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
runOnJSDispatchThread
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private String extractServletPath(HttpServletRequest pReq) { return pReq.getRequestURI().substring(0,pReq.getContextPath().length()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractServletPath File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
extractServletPath
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
@Override protected List<Object> getCommandConfigurationBeans() { return Arrays.asList(configuration, httpConfiguration, elasticsearchConfiguration, elasticsearchClientConfiguration, emailConfiguration, mongoDbConfiguration, versionCheckConfiguration, kafkaJournalConfiguration, nettyTransportConfiguration, pipelineConfiguration, viewsConfiguration, processingStatusConfig, jobSchedulerConfiguration, prometheusExporterConfiguration, tlsConfiguration, geoIpProcessorConfig, telemetryConfiguration); }
Vulnerability Classification: - CWE: CWE-345 - CVE: CVE-2023-41045 - Severity: MEDIUM - CVSS Score: 5.3 Description: Merge pull request from GHSA-g96c-x7rh-99r3 * Add support for randomizing DNS Lookup source port * Clarify purpose of lease * Skip initial refresh Previously, the pool was being refreshed immediately upon initialization. Now, the refresh waits until the `poolRefreshSeconds` duration has elapsed. * Ensure thread safety, skip unused poller refreshes * Add change log Function: getCommandConfigurationBeans File: graylog2-server/src/main/java/org/graylog2/commands/Server.java Repository: Graylog2/graylog2-server Fixed Code: @Override protected List<Object> getCommandConfigurationBeans() { return Arrays.asList(configuration, httpConfiguration, elasticsearchConfiguration, elasticsearchClientConfiguration, emailConfiguration, mongoDbConfiguration, versionCheckConfiguration, kafkaJournalConfiguration, nettyTransportConfiguration, pipelineConfiguration, viewsConfiguration, processingStatusConfig, jobSchedulerConfiguration, prometheusExporterConfiguration, tlsConfiguration, geoIpProcessorConfig, telemetryConfiguration, dnsLookupAdapterConfiguration); }
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
getCommandConfigurationBeans
graylog2-server/src/main/java/org/graylog2/commands/Server.java
466af814523cffae9fbc7e77bab7472988f03c3e
1
Analyze the following code function for security vulnerabilities
@Override public BigDecimal getBigDecimal() { if (currentEvent != Event.VALUE_NUMBER) { throw new IllegalStateException( JsonMessages.PARSER_GETBIGDECIMAL_ERR(currentEvent)); } return tokenizer.getBigDecimal(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBigDecimal File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
getBigDecimal
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = { "/transaction" }) public String actionTransaction(HttpServletRequest theServletRequest, final TransactionRequest theRequest, final BindingResult theBindingResult, final ModelMap theModel) { addCommonParams(theServletRequest, theRequest, theModel); CaptureInterceptor interceptor = new CaptureInterceptor(); FhirContext context = getContext(theRequest); GenericClient client = theRequest.newClient(theServletRequest, context, myConfig, interceptor); String body = preProcessMessageBody(theRequest.getTransactionBody()); try { if (body.startsWith("{")) { // JSON content } else if (body.startsWith("<")) { // XML content } else { theModel.put("errorMsg", toDisplayError("Message body does not appear to be a valid FHIR resource instance document. Body should start with '<' (for XML encoding) or '{' (for JSON encoding).", null)); return "home"; } } catch (DataFormatException e) { ourLog.warn("Failed to parse bundle", e); theModel.put("errorMsg", toDisplayError("Failed to parse transaction bundle body. Error was: " + e.getMessage(), e)); return "home"; } ResultType returnsResource = ResultType.BUNDLE; long start = System.currentTimeMillis(); try { ourLog.info(logPrefix(theModel) + "Executing transaction"); client.transaction().withBundle(body).execute(); } catch (Exception e) { returnsResource = handleClientException(client, e, theModel); } long delay = System.currentTimeMillis() - start; processAndAddLastClientInvocation(client, returnsResource, theModel, delay, "Transaction", interceptor, theRequest); return "result"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: actionTransaction File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
actionTransaction
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0