instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public List<AccessibilityWindowInfo> getWindows() { return AccessibilityInteractionClient.getInstance().getWindows(mConnectionId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWindows File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
getWindows
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
Object nextSimpleValue(char c) { String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': throw syntaxError("Nested object not expected here."); case '[': throw syntaxError("Nested array not expected here."); } /* * Handle unquoted text. This could be the values true, false, or * null, or it can be a number. An implementation (such as this one) * is allowed to also accept non-standard forms. * * Accumulate characters until we reach the end of the text or a * formatting character. */ StringBuilder sb = new StringBuilder(); while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) { sb.append(c); c = this.next(); } if (!this.eof) { this.back(); } string = sb.toString().trim(); if ("".equals(string)) { throw this.syntaxError("Missing value"); } return JSONObject.stringToValue(string); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-5072 - Severity: HIGH - CVSS Score: 7.5 Description: Simplify the check for object keys that are themselves objects. For object keys, we can just skip the part of `nextValue()` that parses values that are objects or arrays. Then the existing logic for unquoted values will already stop at `{` or `[`, and that will produce a `Missing value` exception. Function: nextSimpleValue File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java Fixed Code: Object nextSimpleValue(char c) { String string; switch (c) { case '"': case '\'': return this.nextString(c); } /* * Handle unquoted text. This could be the values true, false, or * null, or it can be a number. An implementation (such as this one) * is allowed to also accept non-standard forms. * * Accumulate characters until we reach the end of the text or a * formatting character. */ StringBuilder sb = new StringBuilder(); while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) { sb.append(c); c = this.next(); } if (!this.eof) { this.back(); } string = sb.toString().trim(); if ("".equals(string)) { throw this.syntaxError("Missing value"); } return JSONObject.stringToValue(string); }
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
nextSimpleValue
src/main/java/org/json/JSONTokener.java
16967f322ee65c301b48fa79bb681e38896fd212
1
Analyze the following code function for security vulnerabilities
private void internalDeleteSubscriptionForNonPartitionedTopic(AsyncResponse asyncResponse, String subName, boolean authoritative) { try { validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.UNSUBSCRIBE); Topic topic = getTopicReference(topicName); Subscription sub = topic.getSubscription(subName); if (sub == null) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Subscription not found")); return; } sub.delete().get(); log.info("[{}][{}] Deleted subscription {}", clientAppId(), topicName, subName); asyncResponse.resume(Response.noContent().build()); } catch (Exception e) { if (e.getCause() instanceof SubscriptionBusyException) { log.error("[{}] Failed to delete subscription {} from topic {}", clientAppId(), subName, topicName, e); asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED, "Subscription has active connected consumers")); } else if (e instanceof WebApplicationException) { if (log.isDebugEnabled()) { log.debug("[{}] Failed to delete subscription from topic {}, redirecting to other brokers.", clientAppId(), topicName, e); } asyncResponse.resume(e); } else { log.error("[{}] Failed to delete subscription {} {}", clientAppId(), topicName, subName, e); asyncResponse.resume(new RestException(e)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalDeleteSubscriptionForNonPartitionedTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalDeleteSubscriptionForNonPartitionedTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
private static void enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission(PackageParser.Package pkg, BasePermission bp) { int index = pkg.requestedPermissions.indexOf(bp.name); if (index == -1) { throw new SecurityException("Package " + pkg.packageName + " has not requested permission " + bp.name); } if (!bp.isRuntime() && !bp.isDevelopment()) { throw new SecurityException("Permission " + bp.name + " is not a changeable permission type"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
enforceDeclaredAsUsedAndRuntimeOrDevelopmentPermission
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void prepareTransfer(ComponentName admin, ComponentName target, PersistableBundle bundle, int callingUserId, String adminType) { saveTransferOwnershipBundleLocked(bundle, callingUserId); mTransferOwnershipMetadataManager.saveMetadataFile( new TransferOwnershipMetadataManager.Metadata(admin, target, callingUserId, adminType)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareTransfer 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
prepareTransfer
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private native void nativeSetMultiTouchZoomSupportEnabled( long nativeContentViewCoreImpl, boolean enabled);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeSetMultiTouchZoomSupportEnabled 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
nativeSetMultiTouchZoomSupportEnabled
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected void remove() { before.after = after; after.before = before; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remove 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
remove
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public void reset() throws JMSException { this.readbuf = null; if (this.reading) { //if we already are reading, all we want to do is reset to the //beginning of the stream try { this.bin = new ByteArrayInputStream(buf); this.in = new ObjectInputStream(this.bin); } catch (IOException x) { throw new RMQJMSException(x); } } else { try { buf = null; if (this.out != null) { this.out.flush(); buf = this.bout.toByteArray(); } else { buf = new byte[0]; } this.bin = new ByteArrayInputStream(buf); this.in = new ObjectInputStream(this.bin); } catch (IOException x) { throw new RMQJMSException(x); } this.reading = true; this.out = null; this.bout = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reset File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
reset
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public void unregisterCancelListenerLocked(IResultReceiver receiver) { if (mCancelCallbacks == null) { return; // Already unregistered or detached. } mCancelCallbacks.unregister(receiver); if (mCancelCallbacks.getRegisteredCallbackCount() <= 0) { mCancelCallbacks = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterCancelListenerLocked File: services/core/java/com/android/server/am/PendingIntentRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
unregisterCancelListenerLocked
services/core/java/com/android/server/am/PendingIntentRecord.java
8418e3a017428683d173c0c82b0eb02d5b923a4e
0
Analyze the following code function for security vulnerabilities
private void resetUserVpnIfNeeded( int userId, Bundle newRestrictions, Bundle prevRestrictions) { final boolean newlyEnforced = !prevRestrictions.getBoolean(UserManager.DISALLOW_CONFIG_VPN) && newRestrictions.getBoolean(UserManager.DISALLOW_CONFIG_VPN); if (newlyEnforced) { mDpms.clearUserConfiguredVpns(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetUserVpnIfNeeded 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
resetUserVpnIfNeeded
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected void handleReachSentLimit(SmsTracker tracker) { if (denyIfQueueLimitReached(tracker)) { return; // queue limit reached; error was returned to caller } CharSequence appLabel = getAppLabel(tracker.mAppInfo.packageName); Resources r = Resources.getSystem(); Spanned messageText = Html.fromHtml(r.getString(R.string.sms_control_message, appLabel)); ConfirmDialogListener listener = new ConfirmDialogListener(tracker, null); AlertDialog d = new AlertDialog.Builder(mContext) .setTitle(R.string.sms_control_title) .setIcon(R.drawable.stat_sys_warning) .setMessage(messageText) .setPositiveButton(r.getString(R.string.sms_control_yes), listener) .setNegativeButton(r.getString(R.string.sms_control_no), listener) .setOnCancelListener(listener) .create(); d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); d.show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleReachSentLimit File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
handleReachSentLimit
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
private boolean regCodeIsRoaming (int code) { return ServiceState.RIL_REG_STATE_ROAMING == code; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: regCodeIsRoaming File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
regCodeIsRoaming
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public boolean hasEditorTreeModel() { return course; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasEditorTreeModel File: src/main/java/org/olat/fileresource/types/ImsCPFileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
hasEditorTreeModel
src/main/java/org/olat/fileresource/types/ImsCPFileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInLockTaskMode() { return getLockTaskModeState() != LOCK_TASK_MODE_NONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInLockTaskMode File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
isInLockTaskMode
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private void enforceRestrictedSystemSettingsMutationForCallingPackage(int operation, String name, int userId) { // System/root/shell can mutate whatever secure settings they want. final int callingUid = Binder.getCallingUid(); if (callingUid == android.os.Process.SYSTEM_UID || callingUid == Process.SHELL_UID || callingUid == Process.ROOT_UID) { return; } switch (operation) { case MUTATION_OPERATION_INSERT: // Insert updates. case MUTATION_OPERATION_UPDATE: { if (Settings.System.PUBLIC_SETTINGS.contains(name)) { return; } // The calling package is already verified. PackageInfo packageInfo = getCallingPackageInfoOrThrow(userId); // Privileged apps can do whatever they want. if ((packageInfo.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0) { return; } warnOrThrowForUndesiredSecureSettingsMutationForTargetSdk( packageInfo.applicationInfo.targetSdkVersion, name); } break; case MUTATION_OPERATION_DELETE: { if (Settings.System.PUBLIC_SETTINGS.contains(name) || Settings.System.PRIVATE_SETTINGS.contains(name)) { throw new IllegalArgumentException("You cannot delete system defined" + " secure settings."); } // The calling package is already verified. PackageInfo packageInfo = getCallingPackageInfoOrThrow(userId); // Privileged apps can do whatever they want. if ((packageInfo.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED) != 0) { return; } warnOrThrowForUndesiredSecureSettingsMutationForTargetSdk( packageInfo.applicationInfo.targetSdkVersion, name); } break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceRestrictedSystemSettingsMutationForCallingPackage 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
enforceRestrictedSystemSettingsMutationForCallingPackage
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
private void transferDeviceOwnershipLocked(ComponentName admin, ComponentName target, int userId) { transferActiveAdminUncheckedLocked(target, admin, userId); mOwners.transferDeviceOwnership(target); Slogf.i(LOG_TAG, "Device owner set: " + target + " on user " + userId); mOwners.writeDeviceOwner(); mDeviceAdminServiceController.startServiceForAdmin( target.getPackageName(), userId, "transfer-device-owner"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: transferDeviceOwnershipLocked 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
transferDeviceOwnershipLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected void onSkipOrClearButtonClick(View view) { handleLeftButton(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSkipOrClearButtonClick 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
onSkipOrClearButtonClick
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
protected void bindResourceAndEstablishSession(Resourcepart resource) throws XMPPErrorException, SmackException, InterruptedException { // Wait until either: // - the servers last features stanza has been parsed // - the timeout occurs LOGGER.finer("Waiting for last features to be received before continuing with resource binding"); lastFeaturesReceived.checkIfSuccessOrWait(); if (!hasFeature(Bind.ELEMENT, Bind.NAMESPACE)) { // Server never offered resource binding, which is REQURIED in XMPP client and // server implementations as per RFC6120 7.2 throw new ResourceBindingNotOfferedException(); } // Resource binding, see RFC6120 7. // Note that we can not use IQReplyFilter here, since the users full JID is not yet // available. It will become available right after the resource has been successfully bound. Bind bindResource = Bind.newSet(resource); PacketCollector packetCollector = createPacketCollectorAndSend(new StanzaIdFilter(bindResource), bindResource); Bind response = packetCollector.nextResultOrThrow(); // Set the connections user to the result of resource binding. It is important that we don't infer the user // from the login() arguments and the configurations service name, as, for example, when SASL External is used, // the username is not given to login but taken from the 'external' certificate. user = response.getJid(); xmppServiceDomain = user.asDomainBareJid(); Session.Feature sessionFeature = getFeature(Session.ELEMENT, Session.NAMESPACE); // Only bind the session if it's announced as stream feature by the server, is not optional and not disabled // For more information see http://tools.ietf.org/html/draft-cridland-xmpp-session-01 // TODO remove this suppression once "disable legacy session" code has been removed from Smack @SuppressWarnings("deprecation") boolean legacySessionDisabled = getConfiguration().isLegacySessionDisabled(); if (sessionFeature != null && !sessionFeature.isOptional() && !legacySessionDisabled) { Session session = new Session(); packetCollector = createPacketCollectorAndSend(new StanzaIdFilter(session), session); packetCollector.nextResultOrThrow(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindResourceAndEstablishSession File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
bindResourceAndEstablishSession
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private void handleStartActivityDismissingKeyguard(Intent intent, boolean onlyProvisioned) { startActivityDismissingKeyguard(intent, onlyProvisioned, true /* dismissShade */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleStartActivityDismissingKeyguard File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
handleStartActivityDismissingKeyguard
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void start(boolean pLazy) { Restrictor restrictor = createRestrictor(configuration); backendManager = new BackendManager(configuration, logHandler, restrictor, pLazy); requestHandler = new HttpRequestHandler(configuration, backendManager, logHandler); if (listenForDiscoveryMcRequests(configuration)) { try { discoveryMulticastResponder = new DiscoveryMulticastResponder(backendManager,restrictor,logHandler); discoveryMulticastResponder.start(); } catch (IOException e) { logHandler.error("Cannot start discovery multicast handler: " + e,e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
start
agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
@Override public void handleMessage(Message msg) { switch (msg.what) { case MESSAGE_RECONSIDER_RANKING: handleRankingReconsideration(msg); break; case MESSAGE_RANKING_SORT: handleRankingSort(); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
handleMessage
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Deprecated public int getPasswordMinimumUpperCase(@Nullable ComponentName admin) { return getPasswordMinimumUpperCase(admin, myUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumUpperCase 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
getPasswordMinimumUpperCase
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUidActive(int uid) { synchronized (mProcLock) { return isUidActiveLOSP(uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUidActive 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
isUidActive
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void bathEditEnv(ApiScenarioBatchRequest request) { if (StringUtils.isNotBlank(request.getEnvironmentId())) { List<ApiScenarioWithBLOBs> apiScenarios = selectByIdsWithBLOBs(request.getIds()); apiScenarios.forEach(item -> { JSONObject object = JSONObject.parseObject(item.getScenarioDefinition()); object.put("environmentId", request.getEnvironmentId()); if (object != null) { item.setScenarioDefinition(JSONObject.toJSONString(object)); } apiScenarioMapper.updateByPrimaryKeySelective(item); apiScenarioReferenceIdService.saveByApiScenario(item); }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bathEditEnv File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
bathEditEnv
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public boolean configure( StaplerRequest req, JSONObject json ) throws FormException { // compatibility return configure(req); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configure File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
configure
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
void scheduleStartProfilesLocked() { if (!mHandler.hasMessages(START_PROFILES_MSG)) { mHandler.sendMessageDelayed(mHandler.obtainMessage(START_PROFILES_MSG), DateUtils.SECOND_IN_MILLIS); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleStartProfilesLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
scheduleStartProfilesLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRequestedSessionIdFromURL() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRequestedSessionIdFromURL File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
isRequestedSessionIdFromURL
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public void setActivityController(IActivityController watcher) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActivityController File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setActivityController
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected B server(boolean isServer) { enforceConstraint("server", "connection", connection); enforceConstraint("server", "codec", decoder); enforceConstraint("server", "codec", encoder); this.isServer = isServer; return self(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: server File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
server
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
@Test public void parseQueryMTypeWExplicitAndRate() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:explicit_tags:rate:sys.cpu.0{host=web01}"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub.getTags()); assertEquals("literal_or(web01)", sub.getTags().get("host")); assertTrue(sub.getRate()); assertTrue(sub.getExplicitTags()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryMTypeWExplicitAndRate File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryMTypeWExplicitAndRate
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
private static Set<String> parseGridWater(final List<Element> waterNodes) { final Set<String> set = new HashSet<>(); for (final Element current : waterNodes) { final int x = Integer.valueOf(current.getAttribute("x")); final int y = Integer.valueOf(current.getAttribute("y")); set.add(x + "-" + y); } return set; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGridWater File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseGridWater
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private boolean isAbsolute(String nameOrPath) { final SFile f = new SFile(nameOrPath); return f.isAbsolute(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAbsolute File: src/net/sourceforge/plantuml/preproc/ImportedFiles.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
isAbsolute
src/net/sourceforge/plantuml/preproc/ImportedFiles.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getRenderedContent(String text) throws XWikiException { return getRenderedContent(text, Syntax.XWIKI_1_0.toIdString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderedContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getRenderedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public boolean isHidden() { return getState(false).hidden; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHidden 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
isHidden
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override protected List<Contentlet> findAllUserVersions(Identifier identifier) throws DotDataException, DotStateException, DotSecurityException { List<Contentlet> cons = new ArrayList<Contentlet>(); if(!InodeUtils.isSet(identifier.getInode())) return cons; HibernateUtil hu = new HibernateUtil(com.dotmarketing.portlets.contentlet.business.Contentlet.class); hu.setQuery("select inode from inode in class " + com.dotmarketing.portlets.contentlet.business.Contentlet.class.getName() + " , vi in class "+ContentletVersionInfo.class.getName()+" where vi.identifier=inode.identifier and " + " inode.inode<>vi.workingInode and "+ " mod_user <> 'system' and inode.identifier = '" + identifier.getInode() + "'" + " and type='contentlet' order by mod_date desc"); List<com.dotmarketing.portlets.contentlet.business.Contentlet> fatties = hu.list(); if(fatties == null) return cons; else{ for (com.dotmarketing.portlets.contentlet.business.Contentlet fatty : fatties) { Contentlet content = convertFatContentletToContentlet(fatty); cc.add(String.valueOf(content.getInode()), content); cons.add(content); } } return cons; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findAllUserVersions 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
findAllUserVersions
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
Product[] getProducts(String[] skus){ if (getBillingSupport() != null) { return getBillingSupport().getProducts(skus, false); } return new Product[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProducts File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getProducts
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public static Frame readFrom(DataInputStream is) throws IOException { int type; int channel; try { type = is.readUnsignedByte(); } catch (SocketTimeoutException ste) { // System.err.println("Timed out waiting for a frame."); return null; // failed } if (type == 'A') { /* * Probably an AMQP.... header indicating a version * mismatch. */ /* * Otherwise meaningless, so try to read the version, * and throw an exception, whether we read the version * okay or not. */ protocolVersionMismatch(is); } channel = is.readUnsignedShort(); int payloadSize = is.readInt(); byte[] payload = new byte[payloadSize]; is.readFully(payload); int frameEndMarker = is.readUnsignedByte(); if (frameEndMarker != AMQP.FRAME_END) { throw new MalformedFrameException("Bad frame end marker: " + frameEndMarker); } return new Frame(type, channel, payload); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-46120 - Severity: HIGH - CVSS Score: 7.5 Description: Add max inbound message size to ConnectionFactory To avoid OOM with a very large message. The default value is 64 MiB. Fixes #1062 (cherry picked from commit 9ed45fde52224ec74fc523321efdf9a157d5cfca) Function: readFrom File: src/main/java/com/rabbitmq/client/impl/Frame.java Repository: rabbitmq/rabbitmq-java-client Fixed Code: public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOException { int type; int channel; try { type = is.readUnsignedByte(); } catch (SocketTimeoutException ste) { // System.err.println("Timed out waiting for a frame."); return null; // failed } if (type == 'A') { /* * Probably an AMQP.... header indicating a version * mismatch. */ /* * Otherwise meaningless, so try to read the version, * and throw an exception, whether we read the version * okay or not. */ protocolVersionMismatch(is); } channel = is.readUnsignedShort(); int payloadSize = is.readInt(); if (payloadSize >= maxPayloadSize) { throw new IllegalStateException(format( "Frame body is too large (%d), maximum size is %d", payloadSize, maxPayloadSize )); } byte[] payload = new byte[payloadSize]; is.readFully(payload); int frameEndMarker = is.readUnsignedByte(); if (frameEndMarker != AMQP.FRAME_END) { throw new MalformedFrameException("Bad frame end marker: " + frameEndMarker); } return new Frame(type, channel, payload); }
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
readFrom
src/main/java/com/rabbitmq/client/impl/Frame.java
714aae602dcae6cb4b53cadf009323ebac313cc8
1
Analyze the following code function for security vulnerabilities
@Override public boolean isNativeCookieSharingSupported() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNativeCookieSharingSupported 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
isNativeCookieSharingSupported
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private <T> T execute(HttpMethod method, Env env, String path, Object request, Class<T> responseType, Object... uriVariables) { if (path.startsWith("/")) { path = path.substring(1, path.length()); } String uri = uriTemplateHandler.expand(path, uriVariables).getPath(); Transaction ct = Tracer.newTransaction("AdminAPI", uri); ct.addData("Env", env); List<ServiceDTO> services = getAdminServices(env, ct); for (ServiceDTO serviceDTO : services) { try { T result = doExecute(method, serviceDTO, path, request, responseType, uriVariables); ct.setStatus(Transaction.SUCCESS); ct.complete(); return result; } catch (Throwable t) { logger.error("Http request failed, uri: {}, method: {}", uri, method, t); Tracer.logError(t); if (canRetry(t, method)) { Tracer.logEvent(TracerEventType.API_RETRY, uri); } else {//biz exception rethrow ct.setStatus(t); ct.complete(); throw t; } } } //all admin server down ServiceException e = new ServiceException(String.format("Admin servers are unresponsive. meta server address: %s, admin servers: %s", portalMetaDomainService.getDomain(env), services)); ct.setStatus(e); ct.complete(); throw e; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2020-15170 - Severity: MEDIUM - CVSS Score: 6.8 Description: add access control support for admin service Function: execute File: apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java Repository: apolloconfig/apollo Fixed Code: private <T> T execute(HttpMethod method, Env env, String path, Object request, Class<T> responseType, Object... uriVariables) { if (path.startsWith("/")) { path = path.substring(1, path.length()); } String uri = uriTemplateHandler.expand(path, uriVariables).getPath(); Transaction ct = Tracer.newTransaction("AdminAPI", uri); ct.addData("Env", env); List<ServiceDTO> services = getAdminServices(env, ct); HttpHeaders extraHeaders = assembleExtraHeaders(env); for (ServiceDTO serviceDTO : services) { try { T result = doExecute(method, extraHeaders, serviceDTO, path, request, responseType, uriVariables); ct.setStatus(Transaction.SUCCESS); ct.complete(); return result; } catch (Throwable t) { logger.error("Http request failed, uri: {}, method: {}", uri, method, t); Tracer.logError(t); if (canRetry(t, method)) { Tracer.logEvent(TracerEventType.API_RETRY, uri); } else {//biz exception rethrow ct.setStatus(t); ct.complete(); throw t; } } } //all admin server down ServiceException e = new ServiceException(String.format("Admin servers are unresponsive. meta server address: %s, admin servers: %s", portalMetaDomainService.getDomain(env), services)); ct.setStatus(e); ct.complete(); throw e; }
[ "CWE-20" ]
CVE-2020-15170
MEDIUM
6.8
apolloconfig/apollo
execute
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/RetryableRestTemplate.java
ae9ba6cfd32ed80469f162e5e3583e2477862ddf
1
Analyze the following code function for security vulnerabilities
private boolean hasLongPressOnPowerBehavior() { return getResolvedLongPressOnPowerBehavior() != LONG_PRESS_POWER_NOTHING; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasLongPressOnPowerBehavior 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
hasLongPressOnPowerBehavior
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void writeFinalNettyResponse(MutableHttpResponse<?> message, AtomicReference<HttpRequest<?>> requestReference, ChannelHandlerContext context) { NettyMutableHttpResponse nettyHttpResponse = (NettyMutableHttpResponse) message; FullHttpResponse nettyResponse = nettyHttpResponse.getNativeResponse(); HttpRequest<?> httpRequest = requestReference.get(); io.netty.handler.codec.http.HttpHeaders nettyHeaders = nettyResponse.headers(); // default Connection header if not set explicitly if (!nettyHeaders.contains(HttpHeaderNames.CONNECTION)) { boolean expectKeepAlive = nettyResponse.protocolVersion().isKeepAliveDefault() || httpRequest.getHeaders().isKeepAlive(); HttpStatus status = nettyHttpResponse.status(); if (!expectKeepAlive || status.getCode() > 299) { nettyHeaders.add(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE); } else { nettyHeaders.add(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE); } } final Object body = message.body(); if (body instanceof NettyCustomizableResponseTypeHandlerInvoker) { NettyCustomizableResponseTypeHandlerInvoker handler = (NettyCustomizableResponseTypeHandlerInvoker) body; handler.invoke(httpRequest, nettyHttpResponse, context); } else { // default to Transfer-Encoding: chunked if Content-Length not set or not already set if (!nettyHeaders.contains(HttpHeaderNames.CONTENT_LENGTH) && !nettyHeaders.contains(HttpHeaderNames.TRANSFER_ENCODING)) { nettyHeaders.add(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED); } // close handled by HttpServerKeepAliveHandler context.writeAndFlush(nettyResponse); context.read(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFinalNettyResponse File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
writeFinalNettyResponse
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public boolean canCover(int nbArg, Set<String> namedArgument) { return nbArg == 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canCover File: src/net/sourceforge/plantuml/tim/stdlib/FileExists.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
canCover
src/net/sourceforge/plantuml/tim/stdlib/FileExists.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
boolean clearAnimatingFlags() { boolean didSomething = false; // We don't want to clear it out for windows that get replaced, because the // animation depends on the flag to remove the replaced window. // // We also don't clear the mAnimatingExit flag for windows which have the // mRemoveOnExit flag. This indicates an explicit remove request has been issued // by the client. We should let animation proceed and not clear this flag or // they won't eventually be removed by WindowStateAnimator#finishExit. if (!mWillReplaceWindow && !mRemoveOnExit) { // Clear mAnimating flag together with mAnimatingExit. When animation // changes from exiting to entering, we need to clear this flag until the // new animation gets applied, so that isAnimationStarting() becomes true // until then. // Otherwise applySurfaceChangesTransaction will fail to skip surface // placement for this window during this period, one or more frame will // show up with wrong position or scale. if (mAnimatingExit) { mAnimatingExit = false; ProtoLog.d(WM_DEBUG_ANIM, "Clear animatingExit: reason=clearAnimatingFlags win=%s", this); didSomething = true; } if (mDestroying) { mDestroying = false; mWmService.mDestroySurface.remove(this); didSomething = true; } } for (int i = mChildren.size() - 1; i >= 0; --i) { didSomething |= (mChildren.get(i)).clearAnimatingFlags(); } return didSomething; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearAnimatingFlags 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
clearAnimatingFlags
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
protected void unlockSession(WrappedSession wrappedSession) { assert getSessionLock(wrappedSession) != null; assert ((ReentrantLock) getSessionLock(wrappedSession)) .isHeldByCurrentThread() : "Trying to unlock the session but it has not been locked by this thread"; getSessionLock(wrappedSession).unlock(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlockSession File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
unlockSession
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
public void selectPages(String ranges) { selectPages(SequenceList.expand(ranges, getNumberOfPages())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectPages File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
selectPages
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public boolean canAccessAppWidget(Widget widget, int uid, String packageName) { if (isHostInPackageForUid(widget.host, uid, packageName)) { // Apps hosting the AppWidget have access to it. return true; } if (isProviderInPackageForUid(widget.provider, uid, packageName)) { // Apps providing the AppWidget have access to it. return true; } if (isHostAccessingProvider(widget.host, widget.provider, uid, packageName)) { // Apps hosting the AppWidget get to bind to a remote view service in the provider. return true; } final int userId = UserHandle.getUserId(uid); if ((widget.host.getUserId() == userId || (widget.provider != null && widget.provider.getUserId() == userId)) && mContext.checkCallingPermission(android.Manifest.permission.BIND_APPWIDGET) == PackageManager.PERMISSION_GRANTED) { // Apps that run in the same user as either the host or the provider and // have the bind widget permission have access to the widget. return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canAccessAppWidget 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
canAccessAppWidget
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public final int getLineBaseline(int line) { // getLineTop(line+1) == getLineTop(line) return getLineTop(line+1) - getLineDescent(line); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLineBaseline File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getLineBaseline
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
private int index(int hash) { return hash & hashMask; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: index File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
index
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
@Override public void lockNow(int flags, String callerPackageName, boolean parent) { CallerIdentity caller; if (isUnicornFlagEnabled()) { caller = getCallerIdentity(callerPackageName); } else { caller = getCallerIdentity(); } final int callingUserId = caller.getUserId(); ComponentName adminComponent = null; synchronized (getLockObject()) { ActiveAdmin admin; // Make sure the caller has any active admin with the right policy or // the required permission. if (isUnicornFlagEnabled()) { admin = enforcePermissionAndGetEnforcingAdmin( /* admin= */ null, /* permission= */ MANAGE_DEVICE_POLICY_LOCK, USES_POLICY_FORCE_LOCK, caller.getPackageName(), getAffectedUser(parent) ).getActiveAdmin(); } else { admin = getActiveAdminOrCheckPermissionForCallerLocked( null, DeviceAdminInfo.USES_POLICY_FORCE_LOCK, parent, LOCK_DEVICE); } checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_LOCK_NOW); final long ident = mInjector.binderClearCallingIdentity(); try { adminComponent = admin == null ? null : admin.info.getComponent(); if (adminComponent != null) { // For Profile Owners only, callers with only permission not allowed. if ((flags & DevicePolicyManager.FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY) != 0) { // Evict key Preconditions.checkCallingUser(isManagedProfile(callingUserId)); Preconditions.checkArgument(!parent, "Cannot set FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY for the parent"); if (!isProfileOwner(adminComponent, callingUserId)) { throw new SecurityException("Only profile owner admins can set " + "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY"); } if (!mInjector.storageManagerIsFileBasedEncryptionEnabled()) { throw new UnsupportedOperationException( "FLAG_EVICT_CREDENTIAL_ENCRYPTION_KEY only applies to FBE" + " devices"); } mUserManager.evictCredentialEncryptionKey(callingUserId); } } // Lock all users unless this is a managed profile with a separate challenge final int userToLock = (parent || !isSeparateProfileChallengeEnabled(callingUserId) ? UserHandle.USER_ALL : callingUserId); mLockPatternUtils.requireStrongAuth( STRONG_AUTH_REQUIRED_AFTER_DPM_LOCK_NOW, userToLock); // Require authentication for the device or profile if (userToLock == UserHandle.USER_ALL) { if (mIsAutomotive) { if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "lockNow(): not powering off display on automotive" + " build"); } } else { // Power off the display mInjector.powerManagerGoToSleep(SystemClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN, 0); } mInjector.getIWindowManager().lockNow(null); } else { mInjector.getTrustManager().setDeviceLockedForUser(userToLock, true); } if (SecurityLog.isLoggingEnabled() && adminComponent != null) { final int affectedUserId = parent ? getProfileParentId(callingUserId) : callingUserId; SecurityLog.writeEvent(SecurityLog.TAG_REMOTE_LOCK, adminComponent.getPackageName(), callingUserId, affectedUserId); } } catch (RemoteException e) { } finally { mInjector.binderRestoreCallingIdentity(ident); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.LOCK_NOW) .setAdmin(adminComponent) .setInt(flags) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lockNow 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
lockNow
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String getJavaScript(RandomAccessFileOrArray file) throws IOException { PdfDictionary names = (PdfDictionary)getPdfObjectRelease(catalog.get(PdfName.NAMES)); if (names == null) return null; PdfDictionary js = (PdfDictionary)getPdfObjectRelease(names.get(PdfName.JAVASCRIPT)); if (js == null) return null; HashMap jscript = PdfNameTree.readTree(js); String sortedNames[] = new String[jscript.size()]; sortedNames = (String[])jscript.keySet().toArray(sortedNames); Arrays.sort(sortedNames); StringBuffer buf = new StringBuffer(); for (int k = 0; k < sortedNames.length; ++k) { PdfDictionary j = (PdfDictionary)getPdfObjectRelease((PdfIndirectReference)jscript.get(sortedNames[k])); if (j == null) continue; PdfObject obj = getPdfObjectRelease(j.get(PdfName.JS)); if (obj != null) { if (obj.isString()) buf.append(((PdfString)obj).toUnicodeString()).append('\n'); else if (obj.isStream()) { byte bytes[] = getStreamBytes((PRStream)obj, file); if (bytes.length >= 2 && bytes[0] == (byte)254 && bytes[1] == (byte)255) buf.append(PdfEncodings.convertToString(bytes, PdfObject.TEXT_UNICODE)); else buf.append(PdfEncodings.convertToString(bytes, PdfObject.TEXT_PDFDOCENCODING)); buf.append('\n'); } } } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJavaScript File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getJavaScript
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
protected DataKeyMapper<T> createKeyMapper( ValueProvider<T, Object> identifierGetter) { return new KeyMapper<T>(identifierGetter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createKeyMapper File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-20" ]
CVE-2021-33609
MEDIUM
4
vaadin/framework
createKeyMapper
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
0
Analyze the following code function for security vulnerabilities
private void sendUserPresentBroadcast() { synchronized (this) { if (mBootCompleted) { int currentUserId = KeyguardUpdateMonitor.getCurrentUser(); final UserHandle currentUser = new UserHandle(currentUserId); final UserManager um = (UserManager) mContext.getSystemService( Context.USER_SERVICE); mUiBgExecutor.execute(() -> { for (int profileId : um.getProfileIdsWithDisabled(currentUser.getIdentifier())) { mContext.sendBroadcastAsUser(USER_PRESENT_INTENT, UserHandle.of(profileId)); } mLockPatternUtils.userPresent(currentUserId); }); } else { mBootSendUserPresent = true; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendUserPresentBroadcast File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
sendUserPresentBroadcast
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Deprecated public String Param(String key, String default_value) { if (getConfiguration() != null) { return getConfiguration().getProperty(key, default_value); } return default_value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: Param File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
Param
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
void printOomLevel(PrintWriter pw, String name, int adj) { pw.print(" "); if (adj >= 0) { pw.print(' '); if (adj < 10) pw.print(' '); } else { if (adj > -10) pw.print(' '); } pw.print(adj); pw.print(": "); pw.print(name); pw.print(" ("); pw.print(stringifySize(mProcessList.getMemLevel(adj), 1024)); pw.println(")"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printOomLevel 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
printOomLevel
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public long optLong(String key) { return optLong(key, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optLong File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
optLong
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
private static Object invokeMethod(Component instance, Method method, JsonArray args) { try { method.setAccessible(true); return method.invoke(instance, decodeArgs(instance, method, args)); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { LoggerFactory.getLogger( PublishedServerEventHandlerRpcHandler.class.getName()) .debug(null, e); throw new RuntimeException(e.getCause()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeMethod File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
invokeMethod
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
@Override public Event next() { if (!hasNext()) { throw new NoSuchElementException(); } return currentEvent = currentContext.getNextEvent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next 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
next
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
public boolean areEquals(Column column1, Column column2) { if (!column1.getName().equals(column2.getName())) { return false; } if (!column1.getClass().getName().equals(column2.getClass().getName())) { return false; } if (column1 instanceof DynamicDateColumn) { DynamicDateColumn dd1 = (DynamicDateColumn) column1; DynamicDateColumn dd2 = (DynamicDateColumn) column2; if (!dd1.getDateType().equals(dd2.getDateType())) { return false; } } if (column1 instanceof FixedDateColumn) { FixedDateColumn fd1 = (FixedDateColumn) column1; FixedDateColumn fd2 = (FixedDateColumn) column2; if (!fd1.getDateType().equals(fd2.getDateType())) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: areEquals File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
areEquals
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
@Override public UserNotificationSessionController createComponentSessionController( MainSessionController mainSessionCtrl, ComponentContext componentContext) { return new UserNotificationSessionController(mainSessionCtrl, componentContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createComponentSessionController File: core-war/src/main/java/org/silverpeas/web/notificationuser/servlets/UserNotificationRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
createComponentSessionController
core-war/src/main/java/org/silverpeas/web/notificationuser/servlets/UserNotificationRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
public void setCode(int code) { this.code = code; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCode File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
setCode
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
protected abstract void computeCOBMatrix(GF2nField B1);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeCOBMatrix File: core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
computeCOBMatrix
core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
int appServicesRestrictedInBackgroundLocked(int uid, String packageName, int packageTargetSdk) { // Persistent app? if (mPackageManagerInt.isPackagePersistent(packageName)) { if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "App " + uid + "/" + packageName + " is persistent; not restricted in background"); } return ActivityManager.APP_START_MODE_NORMAL; } // Non-persistent but background whitelisted? if (uidOnBackgroundWhitelist(uid)) { if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "App " + uid + "/" + packageName + " on background whitelist; not restricted in background"); } return ActivityManager.APP_START_MODE_NORMAL; } // Is this app on the battery whitelist? if (isOnDeviceIdleWhitelistLocked(uid, /*allowExceptIdleToo=*/ false)) { if (DEBUG_BACKGROUND_CHECK) { Slog.i(TAG, "App " + uid + "/" + packageName + " on idle whitelist; not restricted in background"); } return ActivityManager.APP_START_MODE_NORMAL; } // None of the service-policy criteria apply, so we apply the common criteria return appRestrictedInBackgroundLocked(uid, packageName, packageTargetSdk); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appServicesRestrictedInBackgroundLocked 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
appServicesRestrictedInBackgroundLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected void updateNotifications() { mNotificationData.filterAndSort(); updateNotificationShade(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNotifications File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateNotifications
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public boolean isVolatilePersistence() { return volatilePersistence; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVolatilePersistence File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
isVolatilePersistence
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
@Nullable public static String extractTopLevelDir(String path) { final String relativePath = extractRelativePath(path); if (relativePath == null) { return null; } return extractTopLevelDir(relativePath.split("/")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractTopLevelDir File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
extractTopLevelDir
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
@Override public String getRemoteAddr() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoteAddr File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getRemoteAddr
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public void setDescriptionGenerator( DescriptionGenerator<T> descriptionGenerator, ContentMode contentMode) { Objects.requireNonNull(contentMode, "contentMode cannot be null"); this.descriptionGenerator = descriptionGenerator; getState().rowDescriptionContentMode = contentMode; getDataCommunicator().reset(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescriptionGenerator 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
setDescriptionGenerator
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public synchronized void syncDbRooms() { if (!isAuthenticated()) { debugLog("syncDbRooms: aborting, not yet authenticated"); } java.util.Set<String> joinedRooms = multiUserChats.keySet(); Cursor cursor = mContentResolver.query(RosterProvider.MUCS_URI, new String[] {RosterProvider.RosterConstants._ID, RosterProvider.RosterConstants.JID, RosterProvider.RosterConstants.PASSWORD, RosterProvider.RosterConstants.NICKNAME}, null, null, null); final int ID = cursor.getColumnIndexOrThrow(RosterProvider.RosterConstants._ID); final int JID_ID = cursor.getColumnIndexOrThrow(RosterProvider.RosterConstants.JID); final int PASSWORD_ID = cursor.getColumnIndexOrThrow(RosterProvider.RosterConstants.PASSWORD); final int NICKNAME_ID = cursor.getColumnIndexOrThrow(RosterProvider.RosterConstants.NICKNAME); mucJIDs.clear(); while(cursor.moveToNext()) { int id = cursor.getInt(ID); String jid = cursor.getString(JID_ID); String password = cursor.getString(PASSWORD_ID); String nickname = cursor.getString(NICKNAME_ID); mucJIDs.add(jid); //debugLog("Found MUC Room: "+jid+" with nick "+nickname+" and pw "+password); if(!joinedRooms.contains(jid) || !multiUserChats.get(jid).isJoined()) { debugLog("room " + jid + " isn't joined yet, i wanna join..."); joinRoomAsync(jid, nickname, password); // TODO: make historyLen configurable } else { MultiUserChat muc = multiUserChats.get(jid); if (!muc.getNickname().equals(nickname)) { debugLog("room " + jid + ": changing nickname to " + nickname); try { muc.changeNickname(nickname); } catch (XMPPException e) { Log.e(TAG, "Changing nickname failed."); e.printStackTrace(); } } } //debugLog("found data in contentprovider: "+jid+" "+password+" "+nickname); } cursor.close(); for(String room : new HashSet<String>(joinedRooms)) { if(!mucJIDs.contains(room)) { quitRoom(room); } } cleanupMUCs(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncDbRooms File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
syncDbRooms
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private int getEmphasizedActionLayoutResource() { return R.layout.notification_material_action_emphasized; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEmphasizedActionLayoutResource File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getEmphasizedActionLayoutResource
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void onDensityOrFontScaleChanged(NotificationEntry entry) { setExposedGuts(entry.getGuts()); bindGuts(entry.getRow()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDensityOrFontScaleChanged File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
onDensityOrFontScaleChanged
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
@Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().addSystemFlags( android.view.WindowManager.LayoutParams .SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); // Make sure we are running as the primary user only UserManager userManager = getApplicationContext().getSystemService(UserManager.class); if (!userManager.isPrimaryUser()) { Toast.makeText(this, R.string.voice_number_setting_primary_user_only, Toast.LENGTH_SHORT).show(); finish(); return; } // Show the voicemail preference in onResume if the calling intent specifies the // ACTION_ADD_VOICEMAIL action. mShowVoicemailPreference = (icicle == null) && TextUtils.equals(getIntent().getAction(), ACTION_ADD_VOICEMAIL); PhoneAccountHandle phoneAccountHandle = (PhoneAccountHandle) getIntent().getParcelableExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE); if (phoneAccountHandle != null) { getIntent().putExtra(SubscriptionInfoHelper.SUB_ID_EXTRA, PhoneUtils.getSubIdForPhoneAccountHandle(phoneAccountHandle)); } mSubscriptionInfoHelper = new SubscriptionInfoHelper(this, getIntent()); mSubscriptionInfoHelper.setActionBarTitle( getActionBar(), getResources(), R.string.voicemail_settings_with_label); mPhone = mSubscriptionInfoHelper.getPhone(); addPreferencesFromResource(R.xml.voicemail_settings); mVoicemailNotificationPreference = findPreference(getString(R.string.voicemail_notifications_key)); if (mSubMenuVoicemailSettings == null) { mSubMenuVoicemailSettings = (EditPhoneNumberPreference) findPreference(BUTTON_VOICEMAIL_KEY); } final Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS); intent.putExtra(Settings.EXTRA_CHANNEL_ID, NotificationChannelController.CHANNEL_ID_VOICE_MAIL); intent.putExtra(Settings.EXTRA_APP_PACKAGE, mPhone.getContext().getPackageName()); mVoicemailNotificationPreference.setIntent(intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onCreate
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public boolean getTransientLaunch() { return mTransientLaunch; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransientLaunch File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getTransientLaunch
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@Override public void installPackage(String originPath, IPackageInstallObserver2 observer, int installFlags, String installerPackageName, VerificationParams verificationParams, String packageAbiOverride) { installPackageAsUser(originPath, observer, installFlags, installerPackageName, verificationParams, packageAbiOverride, UserHandle.getCallingUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installPackage File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
installPackage
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static long longForQuery(SQLiteStatement prog, String[] selectionArgs) { prog.bindAllArgsAsStrings(selectionArgs); return prog.simpleQueryForLong(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: longForQuery File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
longForQuery
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@Override protected void doDispose() { // nothing to do }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doDispose File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
doDispose
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
ArrayList<StackInfo> getAllStackInfosLocked() { ArrayList<StackInfo> list = new ArrayList<StackInfo>(); for (int displayNdx = 0; displayNdx < mActivityDisplays.size(); ++displayNdx) { ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; for (int ndx = stacks.size() - 1; ndx >= 0; --ndx) { list.add(getStackInfoLocked(stacks.get(ndx))); } } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllStackInfosLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getAllStackInfosLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
protected final boolean isRenew() { return this.renew; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRenew File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java Repository: apereo/java-cas-client The code follows secure coding practices.
[ "CWE-74" ]
CVE-2014-4172
HIGH
7.5
apereo/java-cas-client
isRenew
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
ae37092100c8eaec610dab6d83e5e05a8ee58814
0
Analyze the following code function for security vulnerabilities
private String readBody(RoutingContext ctx) { if (ctx.getBody() != null) { return ctx.getBodyAsString(); } return null; }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2022-2466 - Severity: CRITICAL - CVSS Score: 9.8 Description: GraphQL to terminate the request even if it was active Signed-off-by: Phillip Kruger <phillip.kruger@gmail.com> Function: readBody File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java Repository: quarkusio/quarkus Fixed Code: private String readBody(RoutingContext ctx) { if (ctx.body() != null) { return ctx.body().asString(); } return null; }
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
readBody
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
1
Analyze the following code function for security vulnerabilities
private static boolean isCompatible(RingbufferStoreConfig c1, RingbufferStoreConfig c2) { boolean c1Disabled = c1 == null || !c1.isEnabled(); boolean c2Disabled = c2 == null || !c2.isEnabled(); return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getFactoryClassName(), c2.getFactoryClassName()) && nullSafeEqual(c1.getProperties(), c2.getProperties())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override protected void onDestroy() { if (mOperationsServiceConnection != null) { unbindService(mOperationsServiceConnection); mOperationsServiceBinder = null; } setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR); super.onDestroy(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDestroy File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onDestroy
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
private void updateContentAuthor() { // Temporary set as content author of the document the current script author (until the document is saved) XWikiContext xcontext = getXWikiContext(); getDoc().setContentAuthorReference(xcontext.getAuthorReference()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateContentAuthor File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
updateContentAuthor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, @NonNull String packageName, @NonNull String shortcutId, int userId) { Preconditions.checkStringNotEmpty(packageName, "packageName"); Preconditions.checkStringNotEmpty(shortcutId, "shortcutId"); synchronized (mLock) { throwIfUserLockedL(userId); throwIfUserLockedL(launcherUserId); getLauncherShortcutsLocked(callingPackage, userId, launcherUserId) .attemptToRestoreIfNeededAndSave(); final ShortcutInfo si = getShortcutInfoLocked( launcherUserId, callingPackage, packageName, shortcutId, userId, /*getPinnedByAnyLauncher=*/ false); return si != null && si.isPinned(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPinnedByCaller 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
isPinnedByCaller
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mPm.mLock") @Nullable private PackageSetting getOriginalPackageLocked(@NonNull AndroidPackage pkg, @Nullable String renamedPkgName) { if (ScanPackageUtils.isPackageRenamed(pkg, renamedPkgName)) { return null; } for (int i = ArrayUtils.size(pkg.getOriginalPackages()) - 1; i >= 0; --i) { final PackageSetting originalPs = mPm.mSettings.getPackageLPr(pkg.getOriginalPackages().get(i)); if (originalPs != null) { // the package is already installed under its original name... // but, should we use it? if (!verifyPackageUpdateLPr(originalPs, pkg)) { // the new package is incompatible with the original continue; } else if (mPm.mSettings.getSharedUserSettingLPr(originalPs) != null) { final String sharedUserSettingsName = mPm.mSettings.getSharedUserSettingLPr(originalPs).name; if (!sharedUserSettingsName.equals(pkg.getSharedUserId())) { // the shared user id is incompatible with the original Slog.w(TAG, "Unable to migrate data from " + originalPs.getPackageName() + " to " + pkg.getPackageName() + ": old shared user settings name " + sharedUserSettingsName + " differs from " + pkg.getSharedUserId()); continue; } // TODO: Add case when shared user id is added [b/28144775] } else { if (DEBUG_UPGRADE) { Log.v(TAG, "Renaming new package " + pkg.getPackageName() + " to old name " + originalPs.getPackageName()); } } return originalPs; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOriginalPackageLocked File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
getOriginalPackageLocked
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
@Override public SaReactorFilter setBeforeAuth(SaFilterAuthStrategy beforeAuth) { this.beforeAuth = beforeAuth; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBeforeAuth File: sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
setBeforeAuth
sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/filter/SaReactorFilter.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CertRevokeRequest other = (CertRevokeRequest) obj; if (comments == null) { if (other.comments != null) return false; } else if (!comments.equals(other.comments)) return false; if (encoded == null) { if (other.encoded != null) return false; } else if (!encoded.equals(other.encoded)) return false; if (invalidityDate == null) { if (other.invalidityDate != null) return false; } else if (!invalidityDate.equals(other.invalidityDate)) return false; if (nonce == null) { if (other.nonce != null) return false; } else if (!nonce.equals(other.nonce)) return false; if (reason == null) { if (other.reason != null) return false; } else if (!reason.equals(other.reason)) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
equals
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private String extractBackground(String style) { final Pattern p = Pattern.compile("background:([^;]+)"); final Matcher m = p.matcher(style); if (m.find()) { return m.group(1); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractBackground File: src/net/sourceforge/plantuml/ugraphic/UImageSvg.java Repository: plantuml The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-1231
MEDIUM
4.3
plantuml
extractBackground
src/net/sourceforge/plantuml/ugraphic/UImageSvg.java
c9137be051ce98b3e3e27f65f54ec7d9f8886903
0
Analyze the following code function for security vulnerabilities
boolean stopGattProfileService() { //TODO: can optimize this instead of looping around all supported profiles debugLog("stopGattProfileService()"); Class[] supportedProfileServices = Config.getSupportedProfiles(); setGattProfileServiceState(supportedProfileServices,BluetoothAdapter.STATE_OFF); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopGattProfileService File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
stopGattProfileService
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private void linkNetworks(WifiConfiguration network1, WifiConfiguration network2) { if (mVerboseLoggingEnabled) { Log.v(TAG, "linkNetworks will link " + network2.getProfileKey() + " and " + network1.getProfileKey()); } if (network2.linkedConfigurations == null) { network2.linkedConfigurations = new HashMap<>(); } if (network1.linkedConfigurations == null) { network1.linkedConfigurations = new HashMap<>(); } // TODO (b/30638473): This needs to become a set instead of map, but it will need // public interface changes and need some migration of existing store data. network2.linkedConfigurations.put(network1.getProfileKey(), 1); network1.linkedConfigurations.put(network2.getProfileKey(), 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: linkNetworks 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
linkNetworks
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void rename(String newDocumentName, List<String> backlinkDocumentNames, List<String> childDocumentNames) throws XWikiException { List<DocumentReference> backlinkDocumentReferences = new ArrayList<DocumentReference>(); for (String backlinkDocumentName : backlinkDocumentNames) { backlinkDocumentReferences.add(getCurrentMixedDocumentReferenceResolver().resolve(backlinkDocumentName)); } List<DocumentReference> childDocumentReferences = new ArrayList<DocumentReference>(); for (String childDocumentName : childDocumentNames) { childDocumentReferences.add(getCurrentMixedDocumentReferenceResolver().resolve(childDocumentName)); } rename(getCurrentMixedDocumentReferenceResolver().resolve(newDocumentName), backlinkDocumentReferences, childDocumentReferences); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
rename
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
@Override public void sendHeader() throws IOException { sendHeader(AMQP.PROTOCOL.MAJOR, AMQP.PROTOCOL.MINOR, AMQP.PROTOCOL.REVISION); if (this._socket instanceof SSLSocket) { TlsUtils.logPeerCertificateInfo(((SSLSocket) this._socket).getSession()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendHeader File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
sendHeader
src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@FrameIteratorSkip private final void invokeExact_thunkArchetype_V(Object receiver, int argPlaceholder) { ComputedCalls.dispatchVirtual_V(jittedMethodAddress(receiver), vtableIndexArgument(receiver), receiver, argPlaceholder); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeExact_thunkArchetype_V File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java Repository: eclipse-openj9/openj9 The code follows secure coding practices.
[ "CWE-440", "CWE-250" ]
CVE-2021-41035
HIGH
7.5
eclipse-openj9/openj9
invokeExact_thunkArchetype_V
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
c6e0d9296ff9a3084965d83e207403de373c0bad
0
Analyze the following code function for security vulnerabilities
public abstract JavaType withStaticTyping();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withStaticTyping File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
withStaticTyping
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@CriticalNative private static final native int nativeGetAttributeData(long state, int idx);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetAttributeData File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeGetAttributeData
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public void moveTrackedEntityAttributeValues( TrackedEntityInstance original, TrackedEntityInstance duplicate, List<String> trackedEntityAttributes ) { // Collect existing teav from original for the tea list Map<String, TrackedEntityAttributeValue> originalAttributeValueMap = new HashMap<>(); original.getTrackedEntityAttributeValues().forEach( oav -> { if ( trackedEntityAttributes.contains( oav.getAttribute().getUid() ) ) { originalAttributeValueMap.put( oav.getAttribute().getUid(), oav ); } } ); duplicate.getTrackedEntityAttributeValues() .stream() .filter( av -> trackedEntityAttributes.contains( av.getAttribute().getUid() ) ) .forEach( av -> { TrackedEntityAttributeValue updatedTeav; org.hisp.dhis.common.AuditType auditType; if ( originalAttributeValueMap.containsKey( av.getAttribute().getUid() ) ) { // Teav exists in original, overwrite the value updatedTeav = originalAttributeValueMap.get( av.getAttribute().getUid() ); updatedTeav.setValue( av.getValue() ); auditType = UPDATE; } else { // teav does not exist in original, so create new and attach // it to original updatedTeav = new TrackedEntityAttributeValue(); updatedTeav.setAttribute( av.getAttribute() ); updatedTeav.setEntityInstance( original ); updatedTeav.setValue( av.getValue() ); auditType = CREATE; } getSession().delete( av ); // We need to flush to make sure the previous teav is // deleted. // Or else we might end up breaking a // constraint, since hibernate does not respect order. getSession().flush(); getSession().saveOrUpdate( updatedTeav ); auditTeav( av, updatedTeav, auditType ); } ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTrackedEntityAttributeValues File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
moveTrackedEntityAttributeValues
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
private static void writeEntry(PrintWriter printWriter, String key, String value) { printWriter.printf("\t%s = %s\n", key, escape(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeEntry File: src/main/java/com/gitblit/StoredUserConfig.java Repository: gitblit-org/gitblit The code follows secure coding practices.
[ "CWE-269" ]
CVE-2022-31267
HIGH
7.5
gitblit-org/gitblit
writeEntry
src/main/java/com/gitblit/StoredUserConfig.java
9b4afad6f4be212474809533ec2c280cce86501a
0
Analyze the following code function for security vulnerabilities
private void dumpResources(IndentingPrintWriter pw) { mOverlayPackagesProvider.dump(pw); pw.println(); pw.println("Other overlayable app resources"); pw.increaseIndent(); dumpResources(pw, mContext, "cross_profile_apps", R.array.cross_profile_apps); dumpResources(pw, mContext, "vendor_cross_profile_apps", R.array.vendor_cross_profile_apps); dumpResources(pw, mContext, "config_packagesExemptFromSuspension", R.array.config_packagesExemptFromSuspension); dumpResources(pw, mContext, "policy_exempt_apps", R.array.policy_exempt_apps); dumpResources(pw, mContext, "vendor_policy_exempt_apps", R.array.vendor_policy_exempt_apps); pw.decreaseIndent(); pw.println(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpResources 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
dumpResources
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void sweepCache() { mAnqpCache.sweep(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sweepCache File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
sweepCache
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
ActivityStarter setResultTo(IBinder resultTo) { mRequest.resultTo = resultTo; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResultTo File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
setResultTo
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@Override public int addAppTask(IBinder activityToken, Intent intent, ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException { final int callingUid = Binder.getCallingUid(); final long callingIdent = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { ActivityRecord r = ActivityRecord.isInRootTaskLocked(activityToken); if (r == null) { throw new IllegalArgumentException("Activity does not exist; token=" + activityToken); } ComponentName comp = intent.getComponent(); if (comp == null) { throw new IllegalArgumentException("Intent " + intent + " must specify explicit component"); } if (thumbnail.getWidth() != mThumbnailWidth || thumbnail.getHeight() != mThumbnailHeight) { throw new IllegalArgumentException("Bad thumbnail size: got " + thumbnail.getWidth() + "x" + thumbnail.getHeight() + ", require " + mThumbnailWidth + "x" + mThumbnailHeight); } if (intent.getSelector() != null) { intent.setSelector(null); } if (intent.getSourceBounds() != null) { intent.setSourceBounds(null); } if ((intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_DOCUMENT) != 0) { if ((intent.getFlags() & Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS) == 0) { // The caller has added this as an auto-remove task... that makes no // sense, so turn off auto-remove. intent.addFlags(Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS); } } final ActivityInfo ainfo = AppGlobals.getPackageManager().getActivityInfo(comp, STOCK_PM_FLAGS, UserHandle.getUserId(callingUid)); if (ainfo == null || ainfo.applicationInfo.uid != callingUid) { Slog.e(TAG, "Can't add task for another application: target uid=" + (ainfo == null ? Process.INVALID_UID : ainfo.applicationInfo.uid) + ", calling uid=" + callingUid); return INVALID_TASK_ID; } final Task rootTask = r.getRootTask(); final Task task = new Task.Builder(this) .setWindowingMode(rootTask.getWindowingMode()) .setActivityType(rootTask.getActivityType()) .setActivityInfo(ainfo) .setIntent(intent) .setTaskId(rootTask.getDisplayArea().getNextRootTaskId()) .build(); if (!mRecentTasks.addToBottom(task)) { // The app has too many tasks already and we can't add any more rootTask.removeChild(task, "addAppTask"); return INVALID_TASK_ID; } task.getTaskDescription().copyFrom(description); // TODO: Send the thumbnail to WM to store it. return task.mTaskId; } } finally { Binder.restoreCallingIdentity(callingIdent); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAppTask File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
addAppTask
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String locale, XWikiContext context) throws XWikiException { return copySpaceBetweenWikis(space, sourceWiki, targetWiki, locale, false, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copySpaceBetweenWikis File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
copySpaceBetweenWikis
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0