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 HttpMethod getAPIMethod() { if (this.method() != HttpMethod.GET) { return this.method(); } else { if (this.hasQueryStringParam("method_override")) { final String qs_method = this.getQueryStringParam("method_override"); if (qs_method == null || qs_method.isEmpty()) { throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, "Missing method override value"); } if (qs_method.toLowerCase().equals("get")) { // you can't fix dumb return HttpMethod.GET; } else if (qs_method.toLowerCase().equals("post")){ return HttpMethod.POST; } else if (qs_method.toLowerCase().equals("put")){ return HttpMethod.PUT; } else if (qs_method.toLowerCase().equals("delete")){ return HttpMethod.DELETE; } else { throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, "Unknown or unsupported method override value"); } } // no override, so just return the method return this.method(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAPIMethod File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
getAPIMethod
src/tsd/HttpQuery.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
protected Map<String, Object> createPagerdutyEvent(InstanceEvent event, Instance instance) { Map<String, Object> result = new HashMap<>(); result.put("service_key", serviceKey); result.put("incident_key", instance.getRegistration().getName() + "/" + event.getInstance()); result.put("description", getDescription(event, instance)); Map<String, Object> details = getDetails(event); result.put("details", details); if (event instanceof InstanceStatusChangedEvent) { if ("UP".equals(((InstanceStatusChangedEvent) event).getStatusInfo().getStatus())) { result.put("event_type", "resolve"); } else { result.put("event_type", "trigger"); if (client != null) { result.put("client", client); } if (clientUrl != null) { result.put("client_url", clientUrl); } Map<String, Object> context = new HashMap<>(); context.put("type", "link"); context.put("href", instance.getRegistration().getHealthUrl()); context.put("text", "Application health-endpoint"); result.put("contexts", singletonList(context)); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createPagerdutyEvent File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
createPagerdutyEvent
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
void onAudioStateChanged(AudioState oldAudioState, AudioState newAudioState) { Log.v(this, "onAudioStateChanged, audioState: %s -> %s", oldAudioState, newAudioState); for (CallsManagerListener listener : mListeners) { listener.onAudioStateChanged(oldAudioState, newAudioState); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAudioStateChanged File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
onAudioStateChanged
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public static void reportRenderingFeedback(Context launcher, Account account, Message message, String body) { launch(launcher, account, message, FORWARD, "android-gmail-readability@google.com", body, null, null, null /* extraValues */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportRenderingFeedback File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
reportRenderingFeedback
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public static String verifyRedirectUri(KeycloakSession session, String redirectUri, ClientModel client) { return verifyRedirectUri(session, redirectUri, client, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyRedirectUri File: services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java Repository: keycloak The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4361
MEDIUM
6.1
keycloak
verifyRedirectUri
services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java
a1cfe6e24e5b34792699a00b8b4a8016a5929e3a
0
Analyze the following code function for security vulnerabilities
public void callback(int dwArgc, Pointer lpszArgv) { ServiceControl serviceControl = new ServiceControl(); serviceStatusHandle = ADVAPI_32.RegisterServiceCtrlHandlerEx(serviceName, serviceControl, null); reportStatus(Winsvc.SERVICE_START_PENDING, WinError.NO_ERROR, 3000); reportStatus(Winsvc.SERVICE_RUNNING, WinError.NO_ERROR, 0); Thread.currentThread().setContextClassLoader(WindowsService.class.getClassLoader()); run(); try { synchronized (waitObject) { waitObject.wait(); } } catch (InterruptedException e) { e.printStackTrace(); } reportStatus(Winsvc.SERVICE_STOPPED, WinError.NO_ERROR, 0); // Avoid returning from ServiceMain, which will cause a crash // See http://support.microsoft.com/kb/201349, which recommends // having init() wait for this thread. // Waiting on this thread in init() won't fix the crash, though. System.exit(0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: callback File: src/main/java/org/traccar/WindowsService.java Repository: traccar The code follows secure coding practices.
[ "CWE-428" ]
CVE-2021-21292
LOW
1.9
traccar
callback
src/main/java/org/traccar/WindowsService.java
cc69a9907ac9878db3750aa14ffedb28626455da
0
Analyze the following code function for security vulnerabilities
@LogMessage(level = Level.WARN) @Message(id = 712, value = "Unable to dissociate context {0} when destroying request {1}", format = Format.MESSAGE_FORMAT) void unableToDissociateContext(Context context, HttpServletRequest request);
Vulnerability Classification: - CWE: CWE-362 - CVE: CVE-2014-8122 - Severity: MEDIUM - CVSS Score: 4.3 Description: WELD-1802 An exception during context deactivation/dissociation should not abort further procesing Function: unableToDissociateContext File: impl/src/main/java/org/jboss/weld/logging/ServletLogger.java Repository: weld/core Fixed Code: @LogMessage(level = Level.WARN) @Message(id = 712, value = "Unable to dissociate context {0} from the storage {1}", format = Format.MESSAGE_FORMAT) void unableToDissociateContext(Object context, Object storage);
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
unableToDissociateContext
impl/src/main/java/org/jboss/weld/logging/ServletLogger.java
8e413202fa1af08c09c580f444e4fd16874f9c65
1
Analyze the following code function for security vulnerabilities
public boolean releaseActivityInstance(IBinder token) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releaseActivityInstance File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
releaseActivityInstance
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public @Nullable String getValue() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValue File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getValue
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void onAccountAccessed(String token) throws RemoteException { final int uid = Binder.getCallingUid(); if (UserHandle.getAppId(uid) == Process.SYSTEM_UID) { return; } final int userId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { for (Account account : getAccounts(userId, mContext.getOpPackageName())) { if (Objects.equals(account.getAccessId(), token)) { // An app just accessed the account. At this point it knows about // it and there is not need to hide this account from the app. // Do we need to update account visibility here? if (!hasAccountAccess(account, null, uid)) { updateAppPermission(account, AccountManager.ACCOUNT_ACCESS_TOKEN_TYPE, uid, true); } } } } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAccountAccessed File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
onAccountAccessed
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public boolean hasAccessLevel(String level) { return hasAccessLevel(level, getXWikiContext().getUser(), getXWikiContext().getDoc().getFullName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAccessLevel File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
hasAccessLevel
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public PageReference getPageReference() { if (this.pageReferenceCache == null) { this.pageReferenceCache = intern(getPageReferenceResolver().resolve(getDocumentReference())); } return this.pageReferenceCache; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageReference File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getPageReference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClassLoader File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java Repository: apache/incubator-kie-drools The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2014-8125
HIGH
7.5
apache/incubator-kie-drools
setClassLoader
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
0
Analyze the following code function for security vulnerabilities
void releaseSoundPool() { synchronized (this) { if (mSoundPool != null) { mSoundPool.release(); mSoundPool = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releaseSoundPool File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
releaseSoundPool
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
void showPausedNotification() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { createChannel(); } NotificationCompat.Builder builder = MediaStyleHelper.from(this, mMediaSessionCompat); if( builder == null ) { return; } builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_previous, "Prev", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS))); builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_play, "Play", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_PLAY_PAUSE))); builder.addAction(new NotificationCompat.Action(android.R.drawable.ic_media_next, "Next", MediaButtonReceiver.buildMediaButtonPendingIntent(this, PlaybackStateCompat.ACTION_SKIP_TO_NEXT))); builder.setStyle(new MediaStyle().setShowActionsInCompactView(0, 1, 2).setMediaSession(mMediaSessionCompat.getSessionToken())); builder.setSmallIcon(android.R.drawable.stat_notify_sync); Notification notification = builder.build(); NotificationManagerCompat.from(this).notify(1, notification); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showPausedNotification File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
showPausedNotification
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public static double safeParseDouble(String dirty) throws NumberFormatException { String clean = ILLEGAL_IN_FLOAT.matcher(dirty).replaceAll(""); return Double.parseDouble(clean); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: safeParseDouble File: core/lib/src/main/java/org/opennms/core/utils/WebSecurityUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-6555
MEDIUM
4.3
OpenNMS/opennms
safeParseDouble
core/lib/src/main/java/org/opennms/core/utils/WebSecurityUtils.java
29007e7aeeb792aa73d45fafb16ae9ef19e78a18
0
Analyze the following code function for security vulnerabilities
@Override public void restart() { if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SET_ACTIVITY_WATCHER); } Log.i(TAG, "Sending shutdown broadcast..."); BroadcastReceiver br = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // Now the broadcast is done, finish up the low-level shutdown. Log.i(TAG, "Shutting down activity manager..."); shutdown(10000); Log.i(TAG, "Shutdown complete, restarting!"); killProcess(myPid()); System.exit(10); } }; // First send the high-level shut down broadcast. Intent intent = new Intent(Intent.ACTION_SHUTDOWN); intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_SHUTDOWN_USERSPACE_ONLY, true); /* For now we are not doing a clean shutdown, because things seem to get unhappy. mContext.sendOrderedBroadcastAsUser(intent, UserHandle.ALL, null, br, mHandler, 0, null, null); */ br.onReceive(mContext, intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restart 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
restart
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static <T> T unmarshal(final Class<T> clazz, final Resource resource) { return unmarshal(clazz, resource, VALIDATE_IF_POSSIBLE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmarshal File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
unmarshal
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
private WifiLinkLayerStats updateLinkLayerStatsRssiSpeedFrequencyCapabilities(long txBytes, long rxBytes) { WifiLinkLayerStats stats = getWifiLinkLayerStats(); WifiNl80211Manager.SignalPollResult pollResult = mWifiNative.signalPoll(mInterfaceName); if (pollResult == null) { return stats; } int newRssi = pollResult.currentRssiDbm; int newTxLinkSpeed = pollResult.txBitrateMbps; int newFrequency = pollResult.associationFrequencyMHz; int newRxLinkSpeed = pollResult.rxBitrateMbps; if (mVerboseLoggingEnabled) { logd("updateLinkLayerStatsRssiSpeedFrequencyCapabilities rssi=" + newRssi + " TxLinkspeed=" + newTxLinkSpeed + " freq=" + newFrequency + " RxLinkSpeed=" + newRxLinkSpeed); } /* * set Tx link speed only if it is valid */ if (newTxLinkSpeed > 0) { mWifiInfo.setLinkSpeed(newTxLinkSpeed); mWifiInfo.setTxLinkSpeedMbps(newTxLinkSpeed); } /* * set Rx link speed only if it is valid */ if (newRxLinkSpeed > 0) { mWifiInfo.setRxLinkSpeedMbps(newRxLinkSpeed); } if (newFrequency > 0) { mWifiInfo.setFrequency(newFrequency); } // updateLinkBandwidth() requires the latest frequency information if (newRssi > WifiInfo.INVALID_RSSI && newRssi < WifiInfo.MAX_RSSI) { /* * Positive RSSI is possible when devices are close(~0m apart) to each other. * And there are some driver/firmware implementation, where they avoid * reporting large negative rssi values by adding 256. * so adjust the valid rssi reports for such implementations. */ if (newRssi > (WifiInfo.INVALID_RSSI + 256)) { Log.wtf(getTag(), "Error! +ve value RSSI: " + newRssi); newRssi -= 256; } mWifiInfo.setRssi(newRssi); /* * Rather then sending the raw RSSI out every time it * changes, we precalculate the signal level that would * be displayed in the status bar, and only send the * broadcast if that much more coarse-grained number * changes. This cuts down greatly on the number of * broadcasts, at the cost of not informing others * interested in RSSI of all the changes in signal * level. */ int newSignalLevel = RssiUtil.calculateSignalLevel(mContext, newRssi); if (newSignalLevel != mLastSignalLevel) { // TODO (b/162602799): Do we need to change the update frequency? sendRssiChangeBroadcast(newRssi); } updateLinkBandwidthAndCapabilities(stats, newSignalLevel != mLastSignalLevel, txBytes, rxBytes); mLastSignalLevel = newSignalLevel; } else { mWifiInfo.setRssi(WifiInfo.INVALID_RSSI); updateCapabilities(); mLastSignalLevel = -1; } mWifiConfigManager.updateScanDetailCacheFromWifiInfo(mWifiInfo); /* * Increment various performance metrics */ mWifiMetrics.handlePollResult(mInterfaceName, mWifiInfo); return stats; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLinkLayerStatsRssiSpeedFrequencyCapabilities File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateLinkLayerStatsRssiSpeedFrequencyCapabilities
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void endOfCompressedDataReached() throws IOException { //With inflater, without knowing the compressed or uncompressed size, we over read necessary data //In such cases, we have to push back the inputstream to the end of data decompressedInputStream.pushBackInputStreamIfNecessary(inputStream); //First signal the end of data for this entry so that ciphers can read any header data if applicable decompressedInputStream.endOfEntryReached(inputStream); readExtendedLocalFileHeaderIfPresent(); verifyCrc(); resetFields(); this.entryEOFReached = true; }
Vulnerability Classification: - CWE: CWE-346 - CVE: CVE-2023-22899 - Severity: MEDIUM - CVSS Score: 5.9 Description: #485 Calculate AES mac with cache and push back functionality Function: endOfCompressedDataReached File: src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java Repository: srikanth-lingala/zip4j Fixed Code: private void endOfCompressedDataReached() throws IOException { //With inflater, without knowing the compressed or uncompressed size, we over read necessary data //In such cases, we have to push back the inputstream to the end of data int numberOfBytesPushedBack = decompressedInputStream.pushBackInputStreamIfNecessary(inputStream); //First signal the end of data for this entry so that ciphers can read any header data if applicable decompressedInputStream.endOfEntryReached(inputStream, numberOfBytesPushedBack); readExtendedLocalFileHeaderIfPresent(); verifyCrc(); resetFields(); this.entryEOFReached = true; }
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
endOfCompressedDataReached
src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
1
Analyze the following code function for security vulnerabilities
public static SortDirection fromOptionalString(Optional<String> direction) { if ("DESC".equalsIgnoreCase(direction.orElse(null))) return DESC; return ASC; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15569 - Severity: HIGH - CVSS Score: 7.5 Description: style fix Function: fromOptionalString File: src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SortDirection.java Repository: hmcts/ccd-data-store-api Fixed Code: public static SortDirection fromOptionalString(Optional<String> direction) { if ("DESC".equalsIgnoreCase(direction.orElse(null))) { return DESC; } return ASC; }
[ "CWE-89" ]
CVE-2019-15569
HIGH
7.5
hmcts/ccd-data-store-api
fromOptionalString
src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SortDirection.java
f151e694307dd59dc0f111d44bbd329276ab0004
1
Analyze the following code function for security vulnerabilities
public WebMarkupContainer getMainContainer() { return mainContainer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMainContainer File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
getMainContainer
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
public void updateDoubleTapSupport(boolean supportsDoubleTap) { if (mNativeContentViewCore == 0) return; nativeSetDoubleTapSupportEnabled(mNativeContentViewCore, supportsDoubleTap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDoubleTapSupport 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
updateDoubleTapSupport
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public static String generateValidVHDLLabel(String initialLabel, String suffix) { assert (initialLabel != null); // As a default, trim whitespaces at the beginning and at the end // of a label (no risks with that potentially, therefore avoid // to append the suffix if that was the only change) initialLabel = initialLabel.trim(); String label = initialLabel; if (label.isEmpty()) { logger.warn("Empty label is not a valid VHDL label"); label = "L_"; } // If the string has a ! or ~ symbol, then replace it with "NOT" label = label.replaceAll("[\\!~]", "NOT_"); // Force string to start with a letter if (!label.matches("^[A-Za-z].*$")) label = "L_" + label; // Force the rest to be either letters, or numbers, or underscores label = label.replaceAll("[^A-Za-z0-9_]", "_"); // Suppress multiple successive underscores and an underscore at the end label = label.replaceAll("_+", "_"); if (label.endsWith("_")) label = label.substring(0, label.length() - 1); if (!label.equals(initialLabel)) { // Concatenate a unique ID if the string has been altered label = label + "_" + suffix; // Replace the "-" characters in the UUID with underscores label = label.replaceAll("-", "_"); } return (label); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateValidVHDLLabel File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
generateValidVHDLLabel
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
private void installExistingAdminPackage(int userId, String packageName) { try { final int status = mContext.getPackageManager().installExistingPackageAsUser( packageName, userId); if (status != PackageManager.INSTALL_SUCCEEDED) { throw new ServiceSpecificException( ERROR_ADMIN_PACKAGE_INSTALLATION_FAILED, String.format("Failed to install existing package %s for user %d with " + "result code %d", packageName, userId, status)); } } catch (NameNotFoundException e) { throw new ServiceSpecificException( ERROR_ADMIN_PACKAGE_INSTALLATION_FAILED, String.format("Failed to install existing package %s for user %d: %s", packageName, userId, e.getMessage())); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installExistingAdminPackage 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
installExistingAdminPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String getURLToLoginAsAdminAndGotoPage(final String pageURL) { return getURLToLoginAndGotoPage(ADMIN_CREDENTIALS.getUserName(), ADMIN_CREDENTIALS.getPassword(), pageURL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURLToLoginAsAdminAndGotoPage File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getURLToLoginAsAdminAndGotoPage
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private String buildBaseSql(ID mainid, String relatedExpr, String q, boolean count, ID user) { // format: Entity.Field Entity relatedEntity = MetadataHelper.getEntity(relatedExpr.split("\\.")[0]); String where = new ProtocolFilterParser(null).parseRelated(relatedExpr, mainid); // @see FeedsListController#fetchFeeds if (relatedEntity.getEntityCode() == EntityHelper.Feeds) { where += String.format(" and (type = %d or type = %d)", FeedsType.FOLLOWUP.getMask(), FeedsType.SCHEDULE.getMask()); List<String> in = new ArrayList<>(); in.add("scope = 'ALL'"); for (Team t : Application.getUserStore().getUser(user).getOwningTeams()) { in.add(String.format("scope = '%s'", t.getIdentity())); } where += " and ( " + StringUtils.join(in, " or ") + " )"; } if (StringUtils.isNotBlank(q)) { Set<String> searchFields = ParseHelper.buildQuickFields(relatedEntity, null); if (!searchFields.isEmpty()) { String like = " like '%" + StringEscapeUtils.escapeSql(q) + "%'"; String searchWhere = " and ( " + StringUtils.join(searchFields.iterator(), like + " or ") + like + " )"; where += searchWhere; } } Field primaryField = relatedEntity.getPrimaryField(); Field namedField = relatedEntity.getNameField(); StringBuilder sql = new StringBuilder("select "); if (count) { sql.append("count(").append(primaryField.getName()).append(")"); } else { sql.append(primaryField.getName()).append(",") .append(namedField.getName()).append(",") .append(EntityHelper.ModifiedOn); if (MetadataHelper.hasApprovalField(relatedEntity)) { sql.append(",").append(EntityHelper.ApprovalState); } } sql.append(" from ").append(relatedEntity.getName()).append(" where ").append(where); return sql.toString(); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-1495 - Severity: MEDIUM - CVSS Score: 6.5 Description: H5 sync2 (#595) * style: 目录样式gh * style: J_new * feat: advListFilterTabs * feat: nav-copyto * enh: 助记码全拼 * enh: 地图搜索选点 * enh: topnav * list pn * .form-line.v33 * open TAG * KVS addShutdownHook * fix: #594 --------- Co-authored-by: devezhao <zhaofang123@gmail.com> Function: buildBaseSql File: src/main/java/com/rebuild/web/general/RelatedListController.java Repository: getrebuild/rebuild Fixed Code: private String buildBaseSql(ID mainid, String relatedExpr, String q, boolean count, ID user) { // format: Entity.Field Entity relatedEntity = MetadataHelper.getEntity(relatedExpr.split("\\.")[0]); String where = new ProtocolFilterParser(null).parseRelated(relatedExpr, mainid); // @see FeedsListController#fetchFeeds if (relatedEntity.getEntityCode() == EntityHelper.Feeds) { where += String.format(" and (type = %d or type = %d)", FeedsType.FOLLOWUP.getMask(), FeedsType.SCHEDULE.getMask()); List<String> in = new ArrayList<>(); in.add("scope = 'ALL'"); for (Team t : Application.getUserStore().getUser(user).getOwningTeams()) { in.add(String.format("scope = '%s'", t.getIdentity())); } where += " and ( " + StringUtils.join(in, " or ") + " )"; } if (StringUtils.isNotBlank(q)) { Set<String> searchFields = ParseHelper.buildQuickFields(relatedEntity, null); if (!searchFields.isEmpty()) { String like = " like '%" + CommonsUtils.escapeSql(q) + "%'"; String searchWhere = " and ( " + StringUtils.join(searchFields.iterator(), like + " or ") + like + " )"; where += searchWhere; } } Field primaryField = relatedEntity.getPrimaryField(); Field namedField = relatedEntity.getNameField(); StringBuilder sql = new StringBuilder("select "); if (count) { sql.append("count(").append(primaryField.getName()).append(")"); } else { sql.append(primaryField.getName()).append(",") .append(namedField.getName()).append(",") .append(EntityHelper.ModifiedOn); if (MetadataHelper.hasApprovalField(relatedEntity)) { sql.append(",").append(EntityHelper.ApprovalState); } } sql.append(" from ").append(relatedEntity.getName()).append(" where ").append(where); return sql.toString(); }
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
buildBaseSql
src/main/java/com/rebuild/web/general/RelatedListController.java
c9474f84e5f376dd2ade2078e3039961a9425da7
1
Analyze the following code function for security vulnerabilities
public static void encrypt( final AEADBlockCipher cipher, final SecretKey key, final Nonce nonce, final InputStream input, final OutputStream output) throws CryptoException, StreamException { final byte[] iv = nonce.generate(); final byte[] header = new CiphertextHeader(iv).encode(); cipher.init(true, new AEADParameters(new KeyParameter(key.getEncoded()), MAC_SIZE_BITS, iv, header)); writeHeader(header, output); process(new AEADBlockCipherAdapter(cipher), input, output); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2020-7226 - Severity: MEDIUM - CVSS Score: 5.0 Description: Define new ciphertext header format. New format does not allocate any memory until HMAC check passes, which guards against untrusted input. All encryption components have been updated to use the new header, while preserving backward compatibility to decrypt messages encrypted with the old format. The decoding process for the old header has been hardened to impose reasonable limits on header fields: nonce sizes up to 255 bytes, key names up to 500 bytes. Fixes #52. Function: encrypt File: src/main/java/org/cryptacular/util/CipherUtil.java Repository: vt-middleware/cryptacular Fixed Code: public static void encrypt( final AEADBlockCipher cipher, final SecretKey key, final Nonce nonce, final InputStream input, final OutputStream output) throws CryptoException, StreamException { final byte[] iv = nonce.generate(); final byte[] header = new CiphertextHeaderV2(iv, "1").encode(key); cipher.init(true, new AEADParameters(new KeyParameter(key.getEncoded()), MAC_SIZE_BITS, iv, header)); writeHeader(header, output); process(new AEADBlockCipherAdapter(cipher), input, output); }
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
encrypt
src/main/java/org/cryptacular/util/CipherUtil.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
1
Analyze the following code function for security vulnerabilities
protected XWikiDocument getDocument(DocumentReference documentReference) throws XWikiException { XWikiContext xcontext = this.xcontextProvider.get(); DocumentReference documentReferenceWithoutLocale = documentReference.getLocale() == null ? documentReference : new DocumentReference(documentReference, (Locale) null); XWikiDocument document = xcontext.getWiki().getDocument(documentReferenceWithoutLocale, xcontext); return document; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocument File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
getDocument
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public boolean offerToPool(String key, Channel channel) { return channelPool.offer(key, channel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: offerToPool File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
offerToPool
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
private boolean doesPackageMatchUid(String packageName, int uid) { final int userId = UserHandle.getUserId(uid); try { ApplicationInfo appInfo = mIPackageManager.getApplicationInfo(packageName, 0, userId); // Since this call goes directly to PackageManagerService a NameNotFoundException is not // thrown but null data can be returned; if the appInfo for the specified package cannot // be found then return false to prevent crashing the app. if (appInfo == null) { Slogf.w(LOG_TAG, "appInfo could not be found for package %s", packageName); return false; } else if (uid != appInfo.uid) { String message = String.format("Package %s (uid=%d) does not match provided uid %d", packageName, appInfo.uid, uid); Slogf.w(LOG_TAG, message); throw new SecurityException(message); } } catch (RemoteException e) { // If an exception is caught obtaining the appInfo just return false to prevent crashing // apps due to an internal error. Slogf.e(LOG_TAG, e, "Exception caught obtaining appInfo for package %s", packageName); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doesPackageMatchUid 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
doesPackageMatchUid
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public boolean isOutgoingCallPermitted(PhoneAccountHandle phoneAccountHandle, String callingPackage) { Log.startSession("TSI.iOCP"); try { enforceCallingPackage(callingPackage, "isOutgoingCallPermitted"); enforcePhoneAccountHandleMatchesCaller(phoneAccountHandle, callingPackage); enforcePermission(android.Manifest.permission.MANAGE_OWN_CALLS); enforceUserHandleMatchesCaller(phoneAccountHandle); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { return mCallsManager.isOutgoingCallPermitted(phoneAccountHandle); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOutgoingCallPermitted File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
isOutgoingCallPermitted
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public static List<DashboardCategory> getCategories(Context context, HashMap<Pair<String, String>, Tile> cache) { final long startTime = System.currentTimeMillis(); ArrayList<Tile> tiles = new ArrayList<>(); UserManager userManager = UserManager.get(context); for (UserHandle user : userManager.getUserProfiles()) { // TODO: Needs much optimization, too many PM queries going on here. if (user.getIdentifier() == ActivityManager.getCurrentUser()) { // Only add Settings for this user. getTilesForAction(context, user, SETTINGS_ACTION, cache, null, tiles, true); getTilesForAction(context, user, OPERATOR_SETTINGS, cache, OPERATOR_DEFAULT_CATEGORY, tiles, false); getTilesForAction(context, user, MANUFACTURER_SETTINGS, cache, MANUFACTURER_DEFAULT_CATEGORY, tiles, false); } getTilesForAction(context, user, EXTRA_SETTINGS_ACTION, cache, null, tiles, false); } HashMap<String, DashboardCategory> categoryMap = new HashMap<>(); for (Tile tile : tiles) { DashboardCategory category = categoryMap.get(tile.category); if (category == null) { category = createCategory(context, tile.category); if (category == null) { Log.w(LOG_TAG, "Couldn't find category " + tile.category); continue; } categoryMap.put(category.key, category); } category.addTile(tile); } ArrayList<DashboardCategory> categories = new ArrayList<>(categoryMap.values()); for (DashboardCategory category : categories) { Collections.sort(category.tiles, TILE_COMPARATOR); } Collections.sort(categories, CATEGORY_COMPARATOR); if (DEBUG_TIMING) Log.d(LOG_TAG, "getCategories took " + (System.currentTimeMillis() - startTime) + " ms"); return categories; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3889 - Severity: HIGH - CVSS Score: 7.2 Description: Pre-setup restrictions - Prevent external tiles from system apps - Disable help Bug: 29194585 Change-Id: I92da498110db49f7a523d6f775f191c4b52a4ad6 Function: getCategories File: packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java Repository: android Fixed Code: public static List<DashboardCategory> getCategories(Context context, HashMap<Pair<String, String>, Tile> cache) { final long startTime = System.currentTimeMillis(); boolean setup = Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) != 0; ArrayList<Tile> tiles = new ArrayList<>(); UserManager userManager = UserManager.get(context); for (UserHandle user : userManager.getUserProfiles()) { // TODO: Needs much optimization, too many PM queries going on here. if (user.getIdentifier() == ActivityManager.getCurrentUser()) { // Only add Settings for this user. getTilesForAction(context, user, SETTINGS_ACTION, cache, null, tiles, true); getTilesForAction(context, user, OPERATOR_SETTINGS, cache, OPERATOR_DEFAULT_CATEGORY, tiles, false); getTilesForAction(context, user, MANUFACTURER_SETTINGS, cache, MANUFACTURER_DEFAULT_CATEGORY, tiles, false); } if (setup) { getTilesForAction(context, user, EXTRA_SETTINGS_ACTION, cache, null, tiles, false); } } HashMap<String, DashboardCategory> categoryMap = new HashMap<>(); for (Tile tile : tiles) { DashboardCategory category = categoryMap.get(tile.category); if (category == null) { category = createCategory(context, tile.category); if (category == null) { Log.w(LOG_TAG, "Couldn't find category " + tile.category); continue; } categoryMap.put(category.key, category); } category.addTile(tile); } ArrayList<DashboardCategory> categories = new ArrayList<>(categoryMap.values()); for (DashboardCategory category : categories) { Collections.sort(category.tiles, TILE_COMPARATOR); } Collections.sort(categories, CATEGORY_COMPARATOR); if (DEBUG_TIMING) Log.d(LOG_TAG, "getCategories took " + (System.currentTimeMillis() - startTime) + " ms"); return categories; }
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
getCategories
packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
e206f02d46ae5e38c74d138b51f6e1637e261abe
1
Analyze the following code function for security vulnerabilities
@GuardedBy("mPm.mLock") private void disableStubPackage(DeletePackageAction action, PackageSetting deletedPs, @NonNull int[] allUserHandles) { final PackageSetting stubPs = mPm.mSettings.getPackageLPr( deletedPs.getPackageName()); if (stubPs != null) { int userId = action.mUser == null ? UserHandle.USER_ALL : action.mUser.getIdentifier(); if (userId == UserHandle.USER_ALL) { for (int aUserId : allUserHandles) { stubPs.setEnabled(COMPONENT_ENABLED_STATE_DISABLED, aUserId, "android"); } } else if (userId >= UserHandle.USER_SYSTEM) { stubPs.setEnabled(COMPONENT_ENABLED_STATE_DISABLED, userId, "android"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableStubPackage 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
disableStubPackage
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public @Nonnull PropertyType getPropertyTypeOrDie(@Nonnull Object instance, @Nonnull String field) { PropertyType propertyType = getPropertyType(instance, field); if (propertyType != null) { return propertyType; } else if (instance == this) { throw new AssertionError(getClass().getName() + " has no property " + field); } else { throw new AssertionError(clazz.getName() + " has no property " + field); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPropertyTypeOrDie 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
getPropertyTypeOrDie
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public String path() { return path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: path File: jooby/src/main/java/org/jooby/internal/RouteImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
path
jooby/src/main/java/org/jooby/internal/RouteImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
ServerBuilder routingDecorator(RouteDecoratingService routeDecoratingService) { virtualHostTemplate.addRouteDecoratingService(routeDecoratingService); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: routingDecorator File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
routingDecorator
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Deprecated public int copyWiki(String sourceWiki, String targetWiki, String locale, boolean clean, XWikiContext context) throws XWikiException { int documents = copySpaceBetweenWikis(null, sourceWiki, targetWiki, locale, clean, context); ObservationManager om = getObservationManager(); if (om != null) { om.notify(new WikiCopiedEvent(sourceWiki, targetWiki), sourceWiki, context); } return documents; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyWiki 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
copyWiki
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void exportProperty(StringBuilder output, String prefix, Property<?> p) { addProperty(output, prefix + PROPERTY_PARAMNAME, p.getName()); addProperty(output, prefix + PROPERTY_PARAMTYPE, p.getClass().getCanonicalName()); addProperty(output, prefix + PROPERTY_PARAMVALUE, p.asString()); if (null != p.getFixedValues() && !p.getFixedValues().isEmpty()) { addProperty(output, prefix + PROPERTY_PARAMFIXED_VALUES, String.join(",", p.getFixedValues().stream().map(Object::toString).collect(Collectors.toSet()))); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exportProperty File: ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
exportProperty
ff4j-config-properties/src/main/java/org/ff4j/parser/properties/PropertiesParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
@Override public void toWriter(boolean wholeDocument, Writer writer, Properties outputProperties) { try { super.toWriter(wholeDocument, writer, outputProperties); } catch (TransformerException e) { throw wrapExceptionAsRuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toWriter File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
toWriter
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private String quoteValue(String val, Type type) { if (NumberUtils.isNumber(val) && isNumberType(type)) { return val; } else if (StringUtils.isNotBlank(val)) { return String.format("'%s'", StringEscapeUtils.escapeSql(val)); } return "''"; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-1495 - Severity: MEDIUM - CVSS Score: 6.5 Description: H5 sync2 (#595) * style: 目录样式gh * style: J_new * feat: advListFilterTabs * feat: nav-copyto * enh: 助记码全拼 * enh: 地图搜索选点 * enh: topnav * list pn * .form-line.v33 * open TAG * KVS addShutdownHook * fix: #594 --------- Co-authored-by: devezhao <zhaofang123@gmail.com> Function: quoteValue File: src/main/java/com/rebuild/core/service/query/AdvFilterParser.java Repository: getrebuild/rebuild Fixed Code: private String quoteValue(String val, Type type) { if (NumberUtils.isNumber(val) && isNumberType(type)) { return val; } else if (StringUtils.isNotBlank(val)) { return String.format("'%s'", CommonsUtils.escapeSql(val)); } return "''"; }
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
quoteValue
src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
c9474f84e5f376dd2ade2078e3039961a9425da7
1
Analyze the following code function for security vulnerabilities
@Override public void setInputStream(InputStream in) { this.in = new InputStreamWrapper(in) { @Override public void close() throws IOException { } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInputStream File: server-core/src/main/java/io/onedev/server/git/GitSshCommand.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
setInputStream
server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
private int startWifiIPPacketOffload(int slot, KeepalivePacketData packetData, int intervalSeconds) { byte[] packet = null; byte[] dstMac = null; int proto = 0; try { packet = packetData.getPacket(); dstMac = getDstMacForKeepalive(packetData); proto = getEtherProtoForKeepalive(packetData); } catch (InvalidPacketException e) { return e.getError(); } int ret = mWifiNative.startSendingOffloadedPacket( mInterfaceName, slot, dstMac, packet, proto, intervalSeconds * 1000); if (ret != 0) { loge("startWifiIPPacketOffload(" + slot + ", " + intervalSeconds + "): hardware error " + ret); return SocketKeepalive.ERROR_HARDWARE_ERROR; } else { return SocketKeepalive.SUCCESS; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startWifiIPPacketOffload File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
startWifiIPPacketOffload
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public List<WifiScanner.ScanSettings.HiddenNetwork> retrieveHiddenNetworkList( boolean autoJoinOnly) { List<WifiScanner.ScanSettings.HiddenNetwork> hiddenList = new ArrayList<>(); List<WifiConfiguration> networks = getConfiguredNetworks(); // Remove any non hidden networks. networks.removeIf(config -> !config.hiddenSSID); networks.sort(mScanListComparator); // The most frequently connected network has the highest priority now. for (WifiConfiguration config : networks) { if (!autoJoinOnly || config.allowAutojoin) { hiddenList.add(new WifiScanner.ScanSettings.HiddenNetwork(config.SSID)); } } return hiddenList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveHiddenNetworkList 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
retrieveHiddenNetworkList
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void onConfigurationChanged(Configuration newParentConfig) { // We want to collect the ActivityRecord if the windowing mode is changed, so that it will // dispatch app transition finished event correctly at the end. // Check #isVisible() because we don't want to animate for activity that stays invisible. // Activity with #isVisibleRequested() changed should be collected when that is requested. if (mTransitionController.isShellTransitionsEnabled() && isVisible() && isVisibleRequested()) { final int projectedWindowingMode = getRequestedOverrideWindowingMode() == WINDOWING_MODE_UNDEFINED ? newParentConfig.windowConfiguration.getWindowingMode() : getRequestedOverrideWindowingMode(); if (getWindowingMode() != projectedWindowingMode) { mTransitionController.collect(this); } } if (mCompatDisplayInsets != null) { Configuration overrideConfig = getRequestedOverrideConfiguration(); // Adapt to changes in orientation locking. The app is still non-resizable, but // it can change which orientation is fixed. If the fixed orientation changes, // update the rotation used on the "compat" display boolean wasFixedOrient = overrideConfig.windowConfiguration.getRotation() != ROTATION_UNDEFINED; int requestedOrient = getRequestedConfigurationOrientation(); if (requestedOrient != ORIENTATION_UNDEFINED && requestedOrient != getConfiguration().orientation // The task orientation depends on the top activity orientation, so it // should match. If it doesn't, just wait until it does. && requestedOrient == getParent().getConfiguration().orientation && (overrideConfig.windowConfiguration.getRotation() != getParent().getWindowConfiguration().getRotation())) { overrideConfig.windowConfiguration.setRotation( getParent().getWindowConfiguration().getRotation()); onRequestedOverrideConfigurationChanged(overrideConfig); return; } else if (wasFixedOrient && requestedOrient == ORIENTATION_UNDEFINED && (overrideConfig.windowConfiguration.getRotation() != ROTATION_UNDEFINED)) { overrideConfig.windowConfiguration.setRotation(ROTATION_UNDEFINED); onRequestedOverrideConfigurationChanged(overrideConfig); return; } } final boolean wasInPictureInPicture = inPinnedWindowingMode(); final DisplayContent display = mDisplayContent; if (wasInPictureInPicture && attachedToProcess() && display != null) { // If the PIP activity is changing to fullscreen with display orientation change, the // fixed rotation will take effect that requires to send fixed rotation adjustments // before the process configuration (if the process is a configuration listener of the // activity). So when performing process configuration on client side, it can apply // the adjustments (see WindowToken#onFixedRotationStatePrepared). try { app.pauseConfigurationDispatch(); super.onConfigurationChanged(newParentConfig); if (mVisibleRequested && !inMultiWindowMode()) { final int rotation = display.rotationForActivityInDifferentOrientation(this); if (rotation != ROTATION_UNDEFINED) { app.resumeConfigurationDispatch(); display.setFixedRotationLaunchingApp(this, rotation); } } } finally { if (app.resumeConfigurationDispatch()) { app.dispatchConfiguration(app.getConfiguration()); } } } else { super.onConfigurationChanged(newParentConfig); } // Configuration's equality doesn't consider seq so if only seq number changes in resolved // override configuration. Therefore ConfigurationContainer doesn't change merged override // configuration, but it's used to push configuration changes so explicitly update that. if (getMergedOverrideConfiguration().seq != getResolvedOverrideConfiguration().seq) { onMergedOverrideConfigurationChanged(); } // Before PiP animation is done, th windowing mode of the activity is still the previous // mode (see RootWindowContainer#moveActivityToPinnedRootTask). So once the windowing mode // of activity is changed, it is the signal of the last step to update the PiP states. if (!wasInPictureInPicture && inPinnedWindowingMode() && task != null) { mWaitForEnteringPinnedMode = false; mTaskSupervisor.scheduleUpdatePictureInPictureModeIfNeeded(task, task.getBounds()); } if (display == null) { return; } if (mVisibleRequested) { // It may toggle the UI for user to restart the size compatibility mode activity. display.handleActivitySizeCompatModeIfNeeded(this); } else if (mCompatDisplayInsets != null && !visibleIgnoringKeyguard && (app == null || !app.hasVisibleActivities())) { // visibleIgnoringKeyguard is checked to avoid clearing mCompatDisplayInsets during // displays change. Displays are turned off during the change so mVisibleRequested // can be false. // The override changes can only be obtained from display, because we don't have the // difference of full configuration in each hierarchy. final int displayChanges = display.getCurrentOverrideConfigurationChanges(); final int orientationChanges = CONFIG_WINDOW_CONFIGURATION | CONFIG_SCREEN_SIZE | CONFIG_ORIENTATION; final boolean hasNonOrienSizeChanged = hasResizeChange(displayChanges) // Filter out the case of simple orientation change. && (displayChanges & orientationChanges) != orientationChanges; // For background activity that uses size compatibility mode, if the size or density of // the display is changed, then reset the override configuration and kill the activity's // process if its process state is not important to user. if (hasNonOrienSizeChanged || (displayChanges & ActivityInfo.CONFIG_DENSITY) != 0) { restartProcessIfVisible(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onConfigurationChanged File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
onConfigurationChanged
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static int defaultMaxRedirects() { return Integer.getInteger(ASYNC_CLIENT + "maxRedirects", 5); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultMaxRedirects File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultMaxRedirects
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") final void updateProcessForegroundLocked(ProcessRecord proc, boolean isForeground, boolean oomAdj) { if (isForeground != proc.foregroundServices) { proc.foregroundServices = isForeground; ArrayList<ProcessRecord> curProcs = mForegroundPackages.get(proc.info.packageName, proc.info.uid); if (isForeground) { if (curProcs == null) { curProcs = new ArrayList<ProcessRecord>(); mForegroundPackages.put(proc.info.packageName, proc.info.uid, curProcs); } if (!curProcs.contains(proc)) { curProcs.add(proc); mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_FOREGROUND_START, proc.info.packageName, proc.info.uid); } } else { if (curProcs != null) { if (curProcs.remove(proc)) { mBatteryStatsService.noteEvent( BatteryStats.HistoryItem.EVENT_FOREGROUND_FINISH, proc.info.packageName, proc.info.uid); if (curProcs.size() <= 0) { mForegroundPackages.remove(proc.info.packageName, proc.info.uid); } } } } if (oomAdj) { updateOomAdjLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateProcessForegroundLocked 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
updateProcessForegroundLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getRelativeUrlTags() throws IndexUnreachableException, DAOException, PresentationException { if (!isRecordLoaded() || navigationHelper == null) { return ""; } if (logger.isTraceEnabled()) { logger.trace("current view: {}", navigationHelper.getCurrentView()); } StringBuilder sb = new StringBuilder(); // Add canonical links if (viewManager.getCurrentPage() != null) { if (StringUtils.isNotEmpty(viewManager.getCurrentPage().getUrn())) { String urnResolverUrl = DataManager.getInstance().getConfiguration().getUrnResolverUrl() + viewManager.getCurrentPage().getUrn(); sb.append("\n<link rel=\"canonical\" href=\"").append(urnResolverUrl).append("\" />"); } if (viewManager.getCurrentPage().equals(viewManager.getRepresentativePage())) { String piResolverUrl = navigationHelper.getApplicationUrl() + "piresolver?id=" + viewManager.getPi(); sb.append("\n<link rel=\"canonical\" href=\"").append(piResolverUrl).append("\" />"); } } PageType currentPageType = PageType.getByName(navigationHelper.getCurrentView()); if (currentPageType != null && StringUtils.isNotEmpty(currentPageType.name())) { // logger.trace("page type: {}", currentPageType.getName()); // logger.trace("current url: {}", navigationHelper.getCurrentUrl()); String currentUrl = navigationHelper.getCurrentUrl(); if(currentUrl.contains(SolrTools.unescapeSpecialCharacters(getLogid()))) { currentUrl = currentUrl.replace(SolrTools.unescapeSpecialCharacters(getLogid()), getLogid()); } if (currentUrl.contains("!" + currentPageType.getName())) { // Preferred view - add regular view URL sb.append("\n<link rel=\"canonical\" href=\"") .append(currentUrl.replace("!" + currentPageType.getName(), currentPageType.getName())) .append("\" />"); } else if (currentUrl.contains(currentPageType.getName())) { // Regular view - add preferred view URL sb.append("\n<link rel=\"canonical\" href=\"") .append(currentUrl.replace(currentPageType.getName(), "!" + currentPageType.getName())) .append("\" />"); } } // Skip prev/next links for non-paginated views if (PageType.viewMetadata.equals(currentPageType) || PageType.viewToc.equals(currentPageType)) { return ""; } // Add next/prev links String currentUrl = getPageUrl(imageToShow); String prevUrl = getPreviousPageUrl(); String nextUrl = getNextPageUrl(); if (StringUtils.isNotEmpty(nextUrl) && !nextUrl.equals(currentUrl)) { sb.append("\n<link rel=\"next\" href=\"").append(nextUrl).append("\" />"); } if (StringUtils.isNotEmpty(prevUrl) && !prevUrl.equals(currentUrl)) { sb.append("\n<link rel=\"prev\" href=\"").append(prevUrl).append("\" />"); } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativeUrlTags File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
getRelativeUrlTags
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
public void addImplicitCollection(Class ownerType, String fieldName, String itemFieldName, Class itemType) { addImplicitMap(ownerType, fieldName, itemFieldName, itemType, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addImplicitCollection File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
addImplicitCollection
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private static String normalizeArch(String value) { value = normalize(value); if (value.matches("^(x8664|amd64|ia32e|em64t|x64)$")) { return "x86_64"; } if (value.matches("^(x8632|x86|i[3-6]86|ia32|x32)$")) { return "x86_32"; } if (value.matches("^(ia64|itanium64)$")) { return "itanium_64"; } if (value.matches("^(sparc|sparc32)$")) { return "sparc_32"; } if (value.matches("^(sparcv9|sparc64)$")) { return "sparc_64"; } if (value.matches("^(arm|arm32)$")) { return "arm_32"; } if ("aarch64".equals(value)) { return "aarch_64"; } if (value.matches("^(ppc|ppc32)$")) { return "ppc_32"; } if ("ppc64".equals(value)) { return "ppc_64"; } if ("ppc64le".equals(value)) { return "ppcle_64"; } if ("s390".equals(value)) { return "s390_32"; } if ("s390x".equals(value)) { return "s390_64"; } return "unknown"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizeArch File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
normalizeArch
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private int getAppId(String dumpPackage) { if (dumpPackage != null) { try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo( dumpPackage, 0); return UserHandle.getAppId(info.uid); } catch (NameNotFoundException e) { e.printStackTrace(); } } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppId 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
getAppId
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private Setting getSecureSetting(String name, int requestingUserId) { if (DEBUG) { Slog.v(LOG_TAG, "getSecureSetting(" + name + ", " + requestingUserId + ")"); } // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name); // Special case for location (sigh). if (isLocationProvidersAllowedRestricted(name, callingUserId, owningUserId)) { return mSettingsRegistry.getSettingsLocked(SETTINGS_TYPE_SECURE, owningUserId).getNullSetting(); } // Get the value. synchronized (mLock) { return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE, owningUserId, name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecureSetting 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
getSecureSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
private void tryToRemoveUserFromGroup(RosterGroup group, RosterEntry rosterEntry) throws YaximXMPPException { try { group.removeEntry(rosterEntry); } catch (XMPPException e) { throw new YaximXMPPException("tryToRemoveUserFromGroup", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tryToRemoveUserFromGroup 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
tryToRemoveUserFromGroup
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void pullExternalCall(Call call) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("pullExternalCall")) { try { logOutgoing("pullExternalCall %s", callId); mServiceInterface.pullExternalCall(callId, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException ignored) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pullExternalCall File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
pullExternalCall
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public Entry<P> addPrimitive(final P primitive, Keyset.Key key) throws GeneralSecurityException { if (key.getStatus() != KeyStatusType.ENABLED) { throw new GeneralSecurityException("only ENABLED key is allowed"); } Entry<P> entry = new Entry<P>( primitive, CryptoFormat.getOutputPrefix(key), key.getStatus(), key.getOutputPrefixType(), key.getKeyId()); List<Entry<P>> list = new ArrayList<Entry<P>>(); list.add(entry); // Cannot use [] as keys in hash map, convert to string. String identifier = new String(entry.getIdentifier(), UTF_8); List<Entry<P>> existing = primitives.put(identifier, Collections.unmodifiableList(list)); if (existing != null) { List<Entry<P>> newList = new ArrayList<Entry<P>>(); newList.addAll(existing); newList.add(entry); primitives.put(identifier, Collections.unmodifiableList(newList)); } return entry; }
Vulnerability Classification: - CWE: CWE-176 - CVE: CVE-2020-8929 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fixing ciphertext malleability issue in Java caused by storing the ciphertext prefix in a hashmap keyed by UTF8 encoded strings, instead of byte arrays, leading to the ability to retrieve keys with IDs that happen to be invalid Unicode strings with a changed ID. PiperOrigin-RevId: 336763863 Function: addPrimitive File: java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java Repository: tink-crypto/tink Fixed Code: public Entry<P> addPrimitive(final P primitive, Keyset.Key key) throws GeneralSecurityException { if (key.getStatus() != KeyStatusType.ENABLED) { throw new GeneralSecurityException("only ENABLED key is allowed"); } Entry<P> entry = new Entry<P>( primitive, CryptoFormat.getOutputPrefix(key), key.getStatus(), key.getOutputPrefixType(), key.getKeyId()); List<Entry<P>> list = new ArrayList<Entry<P>>(); list.add(entry); // Cannot use [] as keys in hash map, convert to Prefix wrapper class. Prefix identifier = new Prefix(entry.getIdentifier()); List<Entry<P>> existing = primitives.put(identifier, Collections.unmodifiableList(list)); if (existing != null) { List<Entry<P>> newList = new ArrayList<Entry<P>>(); newList.addAll(existing); newList.add(entry); primitives.put(identifier, Collections.unmodifiableList(newList)); } return entry; }
[ "CWE-176" ]
CVE-2020-8929
MEDIUM
5
tink-crypto/tink
addPrimitive
java_src/src/main/java/com/google/crypto/tink/PrimitiveSet.java
93d839a5865b9d950dffdc9d0bc99b71280a8899
1
Analyze the following code function for security vulnerabilities
public HashMap getNamedDestinationFromStrings() { if (catalog.get(PdfName.NAMES) != null) { PdfDictionary dic = (PdfDictionary)getPdfObjectRelease(catalog.get(PdfName.NAMES)); if (dic != null) { dic = (PdfDictionary)getPdfObjectRelease(dic.get(PdfName.DESTS)); if (dic != null) { HashMap names = PdfNameTree.readTree(dic); for (Iterator it = names.entrySet().iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry)it.next(); PdfArray arr = getNameArray((PdfObject)entry.getValue()); if (arr != null) entry.setValue(arr); else it.remove(); } return names; } } } return new HashMap(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNamedDestinationFromStrings 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
getNamedDestinationFromStrings
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public final IQRequestHandler unregisterIQRequestHandler(IQRequestHandler iqRequestHandler) { return unregisterIQRequestHandler(iqRequestHandler.getElement(), iqRequestHandler.getNamespace(), iqRequestHandler.getType()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterIQRequestHandler 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
unregisterIQRequestHandler
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected int getMaxKeyguardNotifications(boolean recompute) { if (recompute) { mMaxKeyguardNotifications = Math.max(1, mNotificationPanel.computeMaxKeyguardNotifications( mMaxAllowedKeyguardNotifications)); return mMaxKeyguardNotifications; } return mMaxKeyguardNotifications; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxKeyguardNotifications 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
getMaxKeyguardNotifications
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private CharSequence processTextSpans(CharSequence text) { if (mInNightMode) { return ContrastColorUtil.clearColorSpans(text); } return text; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processTextSpans File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
processTextSpans
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean isAllowedVAADINBuildUrl(String filenameWithPath) { // Check that we target VAADIN/build return filenameWithPath.startsWith("/" + VAADIN_BUILD_FILES_PATH); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAllowedVAADINBuildUrl File: flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
isAllowedVAADINBuildUrl
flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
public static void writeFallBackSettingsFiles(List<String> filePaths) { final int numFiles = filePaths.size(); for (int i = 0; i < numFiles; i++) { final String filePath = filePaths.get(i); final File originalFile = new File(filePath); if (SettingsState.stateFileExists(originalFile)) { final File fallBackFile = new File(filePath + FALLBACK_FILE_SUFFIX); try { FileUtils.copy(originalFile, fallBackFile); } catch (IOException ex) { Slog.w(LOG_TAG, "Failed to write fallback file for: " + filePath); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFallBackSettingsFiles File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
writeFallBackSettingsFiles
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public void sendSetRinging(String id) throws Exception { mConnectionById.get(id).state = Connection.STATE_RINGING; for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setRinging(id, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetRinging File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendSetRinging
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private void preloadRecentApps() { mPreloadedRecentApps = true; try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { statusbar.preloadRecentApps(); } } catch (RemoteException e) { Slog.e(TAG, "RemoteException when preloading recent apps", e); // re-acquire status bar service next time it is needed. mStatusBarService = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: preloadRecentApps 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
preloadRecentApps
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private String getInnerQuerySql() { return "select " + T_ALIAS + ".uid, " + T_ALIAS + ".sharing, " + "array_agg(ou.uid) agg_ou_uid " + "from " + getBaseTableName() + " " + T_ALIAS + " left join " + getRelationshipTableName() + " " + REL_TABLE_ALIAS + " on " + T_ALIAS + "." + getJoinColumnName() + " = " + REL_TABLE_ALIAS + "." + getJoinColumnName() + " left join organisationunit ou " + " on " + REL_TABLE_ALIAS + ".organisationunitid = ou.organisationunitid " + "where"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInnerQuerySql File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getInnerQuerySql
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
public java.lang.Object parseGroovyFromPage(String fullname) throws XWikiException { XWikiDocument doc = this.xwiki.getDocument(fullname, getXWikiContext()); if (this.xwiki.getRightService().hasProgrammingRights(doc, getXWikiContext())) { return this.xwiki.parseGroovyFromString(doc.getContent(), getXWikiContext()); } return "groovy_missingrights"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGroovyFromPage File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
parseGroovyFromPage
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public boolean existSameField(String fieldString) { String[] arr = fieldString.split(","); for (String exp : fields) { for (String config : arr) { if (exp.equals(config)) { // 非常明确的列直接比较 log.warn("sql黑名单校验,表【"+name+"】中字段【"+config+"】禁止查询"); return true; } else { // 使用表达式的列 只能判读字符串包含了 String aliasColumn = config; if (alias != null && alias.length() > 0) { aliasColumn = alias + "." + config; } if (exp.indexOf(aliasColumn) > 0) { log.warn("sql黑名单校验,表【"+name+"】中字段【"+config+"】禁止查询"); return true; } } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: existSameField File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34602
HIGH
7.5
jeecgboot/jeecg-boot
existSameField
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java
dd7bf104e7ed59142909567ecd004335c3442ec5
0
Analyze the following code function for security vulnerabilities
public boolean setNetworkCandidateScanResult(int networkId, ScanResult scanResult, int score, SecurityParams params) { if (mVerboseLoggingEnabled) { Log.v(TAG, "Set network candidate scan result " + scanResult + " for " + networkId + " with security params " + params); } WifiConfiguration config = getInternalConfiguredNetwork(networkId); if (config == null) { Log.e(TAG, "Cannot find network for " + networkId); return false; } config.getNetworkSelectionStatus().setCandidate(scanResult); config.getNetworkSelectionStatus().setCandidateScore(score); config.getNetworkSelectionStatus().setSeenInLastQualifiedNetworkSelection(true); config.getNetworkSelectionStatus().setCandidateSecurityParams(params); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNetworkCandidateScanResult 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
setNetworkCandidateScanResult
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private StackTraceElement getCallingMethod() { try { throw new RuntimeException("Stacktrace Dummy Exception"); } catch (RuntimeException e) { try { final String prefix = this.getClass().getPackage().getName(); for (StackTraceElement element : e.getStackTrace()) { if (!element.getClassName().startsWith(prefix)) { return element; } } } catch (Throwable t) { // dont break - return nothing rather than stop return null; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallingMethod File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
getCallingMethod
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
boolean updateConfigurationLocked(Configuration values, ActivityRecord starting, boolean initLocale, boolean deferResume) { // pass UserHandle.USER_NULL as userId because we don't persist configuration for any user return updateConfigurationLocked(values, starting, initLocale, false /* persistent */, UserHandle.USER_NULL, deferResume); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateConfigurationLocked 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
updateConfigurationLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder d(String data) { return cdata(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: d File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
d
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private boolean isCrossProfileQuickContactDisabled(@UserIdInt int userId) { return getCrossProfileCallerIdDisabledForUser(userId) && getCrossProfileContactsSearchDisabledForUser(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCrossProfileQuickContactDisabled 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
isCrossProfileQuickContactDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private String map(String libName) { /* * libraries in the Macintosh use the extension .jnilib but the some * VMs map to .dylib. */ libName = System.mapLibraryName(libName); String ext = ".dylib"; if (libName.endsWith(ext)) { libName = libName.substring(0, libName.length() - ext.length()) + ".jnilib"; } return libName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: map File: hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java Repository: fusesource/hawtjni The code follows secure coding practices.
[ "CWE-94" ]
CVE-2013-2035
MEDIUM
4.4
fusesource/hawtjni
map
hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java
92c266170ce98edc200c656bd034a237098b8aa5
0
Analyze the following code function for security vulnerabilities
public void addCustomParam(final String key, final String value) { this.customParams.put(key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addCustomParam File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
addCustomParam
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
private void updateHomepageAppBar() { if (!mIsEmbeddingActivityEnabled) { return; } updateAppBarMinHeight(); if (mIsTwoPane) { findViewById(R.id.homepage_app_bar_regular_phone_view).setVisibility(View.GONE); findViewById(R.id.homepage_app_bar_two_pane_view).setVisibility(View.VISIBLE); findViewById(R.id.suggestion_container_two_pane).setVisibility(View.VISIBLE); } else { findViewById(R.id.homepage_app_bar_regular_phone_view).setVisibility(View.VISIBLE); findViewById(R.id.homepage_app_bar_two_pane_view).setVisibility(View.GONE); findViewById(R.id.suggestion_container_two_pane).setVisibility(View.GONE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateHomepageAppBar File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
updateHomepageAppBar
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
@Override public void notifyPinnedStackAnimationEnded() { mTaskChangeNotificationController.notifyPinnedStackAnimationEnded(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyPinnedStackAnimationEnded 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
notifyPinnedStackAnimationEnded
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static Map<String, Object> updateUserLoginSecurity(DispatchContext ctx, Map<String, ?> context) { Map<String, Object> result = new LinkedHashMap<>(); Delegator delegator = ctx.getDelegator(); Security security = ctx.getSecurity(); GenericValue loggedInUserLogin = (GenericValue) context.get("userLogin"); Locale locale = (Locale) context.get("locale"); String userLoginId = (String) context.get("userLoginId"); String errMsg = null; if (UtilValidate.isEmpty(userLoginId)) { userLoginId = loggedInUserLogin.getString("userLoginId"); } // <b>security check</b>: must have PARTYMGR_UPDATE permission if (!security.hasEntityPermission("PARTYMGR", "_UPDATE", loggedInUserLogin) && !security.hasEntityPermission("SECURITY", "_UPDATE", loggedInUserLogin)) { errMsg = UtilProperties.getMessage(resource,"loginservices.not_permission_update_security_info_for_user_login", locale); return ServiceUtil.returnError(errMsg); } GenericValue userLoginToUpdate = null; try { userLoginToUpdate = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", userLoginId).queryOne(); } catch (GenericEntityException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_change_password_read_failure", messageMap, locale); return ServiceUtil.returnError(errMsg); } if (userLoginToUpdate == null) { Map<String, String> messageMap = UtilMisc.toMap("userLoginId", userLoginId); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_change_password_userlogin_with_id_not_exist", messageMap, locale); return ServiceUtil.returnError(errMsg); } boolean wasEnabled = !"N".equals(userLoginToUpdate.get("enabled")); if (context.containsKey("enabled")) { userLoginToUpdate.set("enabled", context.get("enabled"), true); } if (context.containsKey("disabledDateTime")) { userLoginToUpdate.set("disabledDateTime", context.get("disabledDateTime"), true); } if (context.containsKey("successiveFailedLogins")) { userLoginToUpdate.set("successiveFailedLogins", context.get("successiveFailedLogins"), true); } if (context.containsKey("externalAuthId")) { userLoginToUpdate.set("externalAuthId", context.get("externalAuthId"), true); } if (context.containsKey("userLdapDn")) { userLoginToUpdate.set("userLdapDn", context.get("userLdapDn"), true); } if (context.containsKey("requirePasswordChange")) { userLoginToUpdate.set("requirePasswordChange", context.get("requirePasswordChange"), true); } // if was disabled and we are enabling it, clear disabledDateTime if (!wasEnabled && "Y".equals(context.get("enabled"))) { userLoginToUpdate.set("disabledDateTime", null); userLoginToUpdate.set("disabledBy", null); } if ("N".equals(context.get("enabled"))) { userLoginToUpdate.set("disabledBy", loggedInUserLogin.getString("userLoginId")); } try { userLoginToUpdate.store(); } catch (GenericEntityException e) { Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_change_password_write_failure", messageMap, locale); return ServiceUtil.returnError(errMsg); } result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUserLoginSecurity File: framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java Repository: apache/ofbiz-framework The code follows secure coding practices.
[ "CWE-209" ]
CVE-2021-25958
MEDIUM
5
apache/ofbiz-framework
updateUserLoginSecurity
framework/common/src/main/java/org/apache/ofbiz/common/login/LoginServices.java
2f5b8d33e32c4d9a48243cf9e503236acd5aec5c
0
Analyze the following code function for security vulnerabilities
@Override public void checkPermission(Permission perm) { var permName = perm.getName(); var permActions = perm.getActions(); var permString = String.valueOf(perm); try { if (enterPublicInterface()) return; // for files: read, readlink, write, delete // for threads: modifyThread // for preferences: preferences // for redefinition of IO: setIO var whitelist = List.of("getClassLoader", "accessSystemModules"); //$NON-NLS-1$ //$NON-NLS-2$ if (whitelist.contains(permName)) return; var blacklist = List.of("manageProcess", "shutdownHooks", "createSecurityManager"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (blacklist.contains(permName)) checkForNonWhitelistedStackFrames(() -> localized("security.error_blacklist") + permString); //$NON-NLS-1$ if ("setIO".equals(permName) && !isMainThreadAndInactive()) //$NON-NLS-1$ checkForNonWhitelistedStackFrames(() -> localized("security.error_blacklist") + permString); //$NON-NLS-1$ // this could be removed / reduced, if the specified part is needed if ("setSecurityManager".equals(permName) && !isPartlyDisabled) //$NON-NLS-1$ throw new SecurityException(localized("security.error_security_manager")); //$NON-NLS-1$ if (perm instanceof SerializablePermission) throw new SecurityException(localized("security.error_modify_serialization") + permString); //$NON-NLS-1$ if (perm instanceof AWTPermission) throw new SecurityException(localized("security.error_awt") + permString); //$NON-NLS-1$ if (perm instanceof ManagementPermission) checkForNonWhitelistedStackFrames(() -> localized("security.error_management") + permString); //$NON-NLS-1$ if ((configuration == null || configuration.allowLocalPortsAbove().isEmpty()) && (perm instanceof NetPermission || perm instanceof SocketPermission)) throw new SecurityException(localized("security.error_networking") + permString); //$NON-NLS-1$ if (perm instanceof SecurityPermission) { if (permName.startsWith("getPolicy") || permName.startsWith("getProperty")) //$NON-NLS-1$ //$NON-NLS-2$ return; checkForNonWhitelistedStackFrames(() -> localized("security.error_modify_security") + permString); //$NON-NLS-1$ } if (perm instanceof SSLPermission) throw new SecurityException(localized("security.error_modify_ssl") + permString); //$NON-NLS-1$ if (perm instanceof AuthPermission) throw new SecurityException(localized("security.error_modify_auth") + permString); //$NON-NLS-1$ if (perm instanceof FilePermission) checkPathAccess(permName, PathActionLevel.getLevelOf(permActions)); if (perm instanceof ReflectPermission || "accessDeclaredMembers".equals(permName)) //$NON-NLS-1$ checkForNonWhitelistedStackFrames(() -> localized("security.error_modify_security") + permString); //$NON-NLS-1$ } finally { exitPublicInterface(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
checkPermission
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
protected void handleCloseEvent(final AjaxRequestTarget target) { }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2013-7251 - Severity: MEDIUM - CVSS Score: 6.8 Description: CSRF protection. Function: handleCloseEvent File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp Fixed Code: protected void handleCloseEvent(final AjaxRequestTarget target) { csrfTokenHandler.onSubmit(); }
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
handleCloseEvent
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
1
Analyze the following code function for security vulnerabilities
boolean errorDetected() { return errorDetected_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: errorDetected File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
errorDetected
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public String getUserPrettyName(Serializable user) { return user.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserPrettyName File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java Repository: ManyDesigns/Portofino The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getUserPrettyName
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
@Override public java.util.Collection<Part> getParts() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParts 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
getParts
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private Map<String, CWLElement> getStepInputsOutputs(JsonNode inOut) { Map<String, CWLElement> returnMap = new HashMap<>(); if (inOut.getClass() == ArrayNode.class) { // array<WorkflowStepInput> for (JsonNode inOutNode : inOut) { if (inOutNode.getClass() == ObjectNode.class) { CWLElement inputOutput = new CWLElement(); List<String> sources = extractSource(inOutNode); if (sources.size() > 0) { for (String source : sources) { inputOutput.addSourceID(stepIDFromSource(source)); } } else { inputOutput.setDefaultVal(extractDefault(inOutNode)); } returnMap.put(extractID(inOutNode), inputOutput); } } } else if (inOut.getClass() == ObjectNode.class) { // map<WorkflowStepInput.id, WorkflowStepInput.source> Iterator<Map.Entry<String, JsonNode>> iterator = inOut.fields(); while (iterator.hasNext()) { Map.Entry<String, JsonNode> inOutNode = iterator.next(); CWLElement inputOutput = new CWLElement(); if (inOutNode.getValue().getClass() == ObjectNode.class) { JsonNode properties = inOutNode.getValue(); if (properties.has(SOURCE)) { inputOutput.addSourceID(stepIDFromSource(properties.get(SOURCE).asText())); } else { inputOutput.setDefaultVal(extractDefault(properties)); } } else if (inOutNode.getValue().getClass() == ArrayNode.class) { for (JsonNode key : inOutNode.getValue()) { inputOutput.addSourceID(stepIDFromSource(key.asText())); } } else { inputOutput.addSourceID(stepIDFromSource(inOutNode.getValue().asText())); } returnMap.put(inOutNode.getKey(), inputOutput); } } return returnMap; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStepInputsOutputs File: src/main/java/org/commonwl/view/cwl/CWLService.java Repository: common-workflow-language/cwlviewer The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-41110
HIGH
7.5
common-workflow-language/cwlviewer
getStepInputsOutputs
src/main/java/org/commonwl/view/cwl/CWLService.java
f6066f09edb70033a2ce80200e9fa9e70a5c29de
0
Analyze the following code function for security vulnerabilities
protected void quickEdit(String previousValue, @StringRes int hint, OnValueEdited callback, boolean permitEmpty) { quickEdit(previousValue, callback, hint, false, permitEmpty); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quickEdit File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
quickEdit
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public boolean isThirdPartTemplate(Project project) { return project.getThirdPartTemplate() != null && project.getThirdPartTemplate() && PlatformPluginService.isPluginPlatform(project.getPlatform()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isThirdPartTemplate File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
isThirdPartTemplate
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public String getSystemMessage() { return systemMessage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemMessage File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getSystemMessage
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
void pauseRotationLocked() { mDeferredRotationPauseCount += 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pauseRotationLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
pauseRotationLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public String setValue(String value) { throw new UnsupportedOperationException("read-only"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValue 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
setValue
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
protected void engineInit( int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { CipherParameters param; if (params == null || params instanceof OAEPParameterSpec) { if (key instanceof RSAPublicKey) { if (privateKeyOnly && opmode == Cipher.ENCRYPT_MODE) { throw new InvalidKeyException( "mode 1 requires RSAPrivateKey"); } param = RSAUtil.generatePublicKeyParameter((RSAPublicKey)key); } else if (key instanceof RSAPrivateKey) { if (publicKeyOnly && opmode == Cipher.ENCRYPT_MODE) { throw new InvalidKeyException( "mode 2 requires RSAPublicKey"); } param = RSAUtil.generatePrivateKeyParameter((RSAPrivateKey)key); } else { throw new InvalidKeyException("unknown key type passed to RSA"); } if (params != null) { OAEPParameterSpec spec = (OAEPParameterSpec)params; paramSpec = params; if (!spec.getMGFAlgorithm().equalsIgnoreCase("MGF1") && !spec.getMGFAlgorithm().equals(PKCSObjectIdentifiers.id_mgf1.getId())) { throw new InvalidAlgorithmParameterException("unknown mask generation function specified"); } if (!(spec.getMGFParameters() instanceof MGF1ParameterSpec)) { throw new InvalidAlgorithmParameterException("unkown MGF parameters"); } Digest digest = DigestFactory.getDigest(spec.getDigestAlgorithm()); if (digest == null) { throw new InvalidAlgorithmParameterException("no match on digest algorithm: "+ spec.getDigestAlgorithm()); } MGF1ParameterSpec mgfParams = (MGF1ParameterSpec)spec.getMGFParameters(); Digest mgfDigest = DigestFactory.getDigest(mgfParams.getDigestAlgorithm()); if (mgfDigest == null) { throw new InvalidAlgorithmParameterException("no match on MGF digest algorithm: "+ mgfParams.getDigestAlgorithm()); } cipher = new OAEPEncoding(new RSABlindedEngine(), digest, mgfDigest, ((PSource.PSpecified)spec.getPSource()).getValue()); } } else { throw new InvalidAlgorithmParameterException("unknown parameter type: " + params.getClass().getName()); } if (!(cipher instanceof RSABlindedEngine)) { if (random != null) { param = new ParametersWithRandom(param, random); } else { param = new ParametersWithRandom(param, new SecureRandom()); } } bOut.reset(); switch (opmode) { case Cipher.ENCRYPT_MODE: case Cipher.WRAP_MODE: cipher.init(true, param); break; case Cipher.DECRYPT_MODE: case Cipher.UNWRAP_MODE: cipher.init(false, param); break; default: throw new InvalidParameterException("unknown opmode " + opmode + " passed to RSA"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineInit
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
public static PSystemVersion createTestDot(UmlSource source) throws IOException { final List<String> strings = new ArrayList<>(); strings.add(Version.fullDescription()); GraphvizUtils.addDotStatus(strings, true); return new PSystemVersion(source, false, strings); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTestDot File: src/net/sourceforge/plantuml/version/PSystemVersion.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
createTestDot
src/net/sourceforge/plantuml/version/PSystemVersion.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
boolean isObscuringDisplay() { Task task = getTask(); if (task != null && task.getRootTask() != null && !task.getRootTask().fillsParent()) { return false; } return isOpaqueDrawn() && fillsDisplay(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isObscuringDisplay 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
isObscuringDisplay
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public final R getSomeBuildWithWorkspace() { int cnt=0; for (R b = getLastBuild(); cnt<5 && b!=null; b=b.getPreviousBuild()) { FilePath ws = b.getWorkspace(); if (ws!=null) return b; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSomeBuildWithWorkspace File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getSomeBuildWithWorkspace
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
<T> void processQuery( SQLConnection connection, QueryHelper queryHelper, Integer total, String statMethod, Function<TotaledResults, T> resultSetMapper, Handler<AsyncResult<T>> replyHandler ) { long start = System.nanoTime(); log.debug("Attempting query: " + queryHelper.selectQuery); connection.query(queryHelper.selectQuery, query -> { if (!queryHelper.transactionMode) { connection.close(); } try { if (query.failed()) { log.error("process query: " + query.cause().getMessage() + " - " + queryHelper.selectQuery, query.cause()); replyHandler.handle(Future.failedFuture(query.cause())); } else { replyHandler.handle(Future.succeededFuture(resultSetMapper.apply(new TotaledResults(query.result(), total)))); } long queryTime = (System.nanoTime() - start); StatsTracker.addStatElement(STATS_KEY + statMethod, queryTime); log.debug("timer: get " + queryHelper.selectQuery + " (ns) " + queryTime); } catch (Exception e) { log.error(e.getMessage(), e); replyHandler.handle(Future.failedFuture(e)); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processQuery File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
processQuery
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public boolean isLaunchTransitionFadingAway() { return mLaunchTransitionFadingAway; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLaunchTransitionFadingAway 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
isLaunchTransitionFadingAway
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override protected AbstractSelect createCompatibleSelect( Class<? extends AbstractSelect> fieldType) { if (anySelect(fieldType)) { return super.createCompatibleSelect(ComboBox.class); } return super.createCompatibleSelect(fieldType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCompatibleSelect 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
createCompatibleSelect
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public static boolean jsFunction_isSelfSignupEnabledForTenant(Context cx, Scriptable thisObj, Object[] args, Function funObj) { boolean status = false; if (!isStringArray(args)) { return status; } String tenantDomain = args[0].toString(); try { UserRegistrationConfigDTO signupConfig = SelfSignUpUtil.getSignupConfiguration(tenantDomain); if (signupConfig != null) { status = signupConfig.isSignUpEnabled(); } } catch (APIManagementException e) { log.error("error while loading configuration from registry", e); } return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_isSelfSignupEnabledForTenant File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_isSelfSignupEnabledForTenant
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
private void _skipSpaces () throws JsonParseException { final JsonStringBuilder aStrSpaces = m_aSB1.reset (); while (true) { final int c = _readChar (); // Check for comment if (c == '/') { final int c2 = _readChar (); if (c2 == '*') { if (aStrSpaces.hasContent ()) { // Notify on previous whitespaces m_aCallback.onWhitespace (aStrSpaces.getAsString ()); aStrSpaces.reset (); } // start comment _readComment (); // Finished comment - check for next whitespace continue; } // backup c2 as it is no comment _backupChar (c2); } if (c != ' ' && c != '\t' && c != '\r' && c != '\n' && c != '\f') { // End of whitespaces reached if (aStrSpaces.hasContent ()) m_aCallback.onWhitespace (aStrSpaces.getAsString ()); // backup c - if previously c2 was backed up this is where we need 2 // chars pushback :) _backupChar (c); return; } // It's a whitespace character aStrSpaces.append ((char) c); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _skipSpaces File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
_skipSpaces
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
private void handleIPv4Failure() { // TODO: Move this to provisioning failure, not DHCP failure. // DHCPv4 failure is expected on an IPv6-only network. mWifiDiagnostics.triggerBugReportDataCapture(WifiDiagnostics.REPORT_REASON_DHCP_FAILURE); if (mVerboseLoggingEnabled) { int count = -1; WifiConfiguration config = getConnectedWifiConfigurationInternal(); if (config != null) { count = config.getNetworkSelectionStatus().getDisableReasonCounter( WifiConfiguration.NetworkSelectionStatus.DISABLED_DHCP_FAILURE); } log("DHCP failure count=" + count); } synchronized (mDhcpResultsParcelableLock) { mDhcpResultsParcelable = new DhcpResultsParcelable(); } if (mVerboseLoggingEnabled) { logd("handleIPv4Failure"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleIPv4Failure File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handleIPv4Failure
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private String createRuntimeSource(RuntimeModel model, String baseClassName, boolean scriptInDocs) { if (scriptInDocs) { throw new RuntimeException("Do no know how to clean the block comments yet"); } SourceWriter writer = new SourceWriter(model); writer.setScript(stripComments(theScript)); writer.setBaseClassName(baseClassName); scriptModel.write(writer); return writer.getSource(); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-24816 - Severity: HIGH - CVSS Score: 7.5 Description: Validate Jiffle input variable names according to grammar, escape javadocs when including Jiffle sources in output Function: createRuntimeSource File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext Fixed Code: private String createRuntimeSource(RuntimeModel model, String baseClassName, boolean scriptInDocs) { SourceWriter writer = new SourceWriter(model); if (scriptInDocs) { writer.setScript(theScript); } writer.setBaseClassName(baseClassName); scriptModel.write(writer); return writer.getSource(); }
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
createRuntimeSource
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
1
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<ProviderInfo> queryContentProviders(String processName, int uid, int flags) { ArrayList<ProviderInfo> finalList = null; // reader synchronized (mPackages) { final Iterator<PackageParser.Provider> i = mProviders.mProviders.values().iterator(); final int userId = processName != null ? UserHandle.getUserId(uid) : UserHandle.getCallingUserId(); while (i.hasNext()) { final PackageParser.Provider p = i.next(); PackageSetting ps = mSettings.mPackages.get(p.owner.packageName); if (ps != null && p.info.authority != null && (processName == null || (p.info.processName.equals(processName) && UserHandle.isSameApp(p.info.applicationInfo.uid, uid))) && mSettings.isEnabledLPr(p.info, flags, userId) && (!mSafeMode || (p.info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)) { if (finalList == null) { finalList = new ArrayList<ProviderInfo>(3); } ProviderInfo info = PackageParser.generateProviderInfo(p, flags, ps.readUserState(userId), userId); if (info != null) { finalList.add(info); } } } } if (finalList != null) { Collections.sort(finalList, mProviderInitOrderSorter); return new ParceledListSlice<ProviderInfo>(finalList); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryContentProviders 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
queryContentProviders
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private native int nativeGetCurrentRenderProcessId(long nativeContentViewCoreImpl);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetCurrentRenderProcessId 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
nativeGetCurrentRenderProcessId
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0