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 int getPage() { return page; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPage File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
getPage
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
@Override public void onJoinDialogPositiveClick(Dialog dialog, Spinner spinner, AutoCompleteTextView jid, boolean isBookmarkChecked) { if (!xmppConnectionServiceBound) { return; } final Account account = getSelectedAccount(spinner); if (account == null) { return; } final Jid conferenceJid; try { conferenceJid = Jid.of(jid.getText().toString()); } catch (final IllegalArgumentException e) { jid.setError(getString(R.string.invalid_jid)); return; } if (isBookmarkChecked) { if (account.hasBookmarkFor(conferenceJid)) { jid.setError(getString(R.string.bookmark_already_exists)); } else { final Bookmark bookmark = new Bookmark(account, conferenceJid.asBareJid()); bookmark.setAutojoin(getBooleanPreference("autojoin", R.bool.autojoin)); String nick = conferenceJid.getResource(); if (nick != null && !nick.isEmpty()) { bookmark.setNick(nick); } account.getBookmarks().add(bookmark); xmppConnectionService.pushBookmarks(account); final Conversation conversation = xmppConnectionService .findOrCreateConversation(account, conferenceJid, true, true, true); bookmark.setConversation(conversation); dialog.dismiss(); switchToConversation(conversation); } } else { final Conversation conversation = xmppConnectionService .findOrCreateConversation(account, conferenceJid, true, true, true); dialog.dismiss(); switchToConversation(conversation); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onJoinDialogPositiveClick File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onJoinDialogPositiveClick
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected abstract void clearBodyInternal() throws JMSException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearBodyInternal File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
clearBodyInternal
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public void setEnforceReferenceTargetTypes(boolean theEnforceReferenceTargetTypes) { myEnforceReferenceTargetTypes = theEnforceReferenceTargetTypes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnforceReferenceTargetTypes File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setEnforceReferenceTargetTypes
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
void checkTime(long startTime, String where) { long now = SystemClock.uptimeMillis(); if ((now - startTime) > 50) { // If we are taking more than 50ms, log about it. Slog.w(TAG, "Slow operation: " + (now - startTime) + "ms so far, now at " + where); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkTime File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
checkTime
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private ByteBuffer load(final File file) { final ByteBuffer dataFromLoadPath = paths.stream() .map(p -> loadFromLoadPath(p, file)) .filter(d -> d != null) .findFirst() .orElse(null); if (dataFromLoadPath != null) { return dataFromLoadPath; } else if (unlimitedAccess && file.isFile()) { return loadFile(file); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: load File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java Repository: jlangch/venice The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-36007
LOW
3.3
jlangch/venice
load
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
c942c73136333bc493050910f171a48e6f575b23
0
Analyze the following code function for security vulnerabilities
public static boolean contains(File[] dirs, File file) { for (File dir : dirs) { if (contains(dir, file)) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: contains File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
contains
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
FileOutputStreamWithPath openIconFileForWrite(@UserIdInt int userId, ShortcutInfo shortcut) throws IOException { final File packagePath = new File(getUserBitmapFilePath(userId), shortcut.getPackage()); if (!packagePath.isDirectory()) { packagePath.mkdirs(); if (!packagePath.isDirectory()) { throw new IOException("Unable to create directory " + packagePath); } SELinux.restorecon(packagePath); } final String baseName = String.valueOf(injectCurrentTimeMillis()); for (int suffix = 0; ; suffix++) { final String filename = (suffix == 0 ? baseName : baseName + "_" + suffix) + ".png"; final File file = new File(packagePath, filename); if (!file.exists()) { if (DEBUG) { Slog.d(TAG, "Saving icon to " + file.getAbsolutePath()); } return new FileOutputStreamWithPath(file); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openIconFileForWrite File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
openIconFileForWrite
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public Date parseDate(String str) { try { return dateFormat.parse(str); } catch (java.text.ParseException e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseDate File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parseDate
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
int getUidState(int uid) { synchronized (this) { UidRecord uidRec = mActiveUids.get(uid); return uidRec == null ? ActivityManager.PROCESS_STATE_NONEXISTENT : uidRec.curProcState; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidState File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
getUidState
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private void initActionBar() { LogUtils.d(LOG_TAG, "initializing action bar in ComposeActivity"); final ActionBar actionBar = getSupportActionBar(); if (actionBar == null) { return; } if (mComposeMode == ComposeActivity.COMPOSE) { actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.compose_title); } else { actionBar.setTitle(null); if (mComposeModeAdapter == null) { mComposeModeAdapter = new ComposeModeAdapter(actionBar.getThemedContext()); } actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setListNavigationCallbacks(mComposeModeAdapter, this); switch (mComposeMode) { case ComposeActivity.REPLY: actionBar.setSelectedNavigationItem(0); break; case ComposeActivity.REPLY_ALL: actionBar.setSelectedNavigationItem(1); break; case ComposeActivity.FORWARD: actionBar.setSelectedNavigationItem(2); break; } } actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP); actionBar.setHomeButtonEnabled(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initActionBar 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
initActionBar
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private int getTargetSdk(String packageName, int userId) { final ApplicationInfo ai; try { ai = mIPackageManager.getApplicationInfo(packageName, 0, userId); return ai == null ? 0 : ai.targetSdkVersion; } catch (RemoteException e) { // Shouldn't happen Slogf.wtf(LOG_TAG, "Error getting application info", e); return 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTargetSdk File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getTargetSdk
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int getStartLineNumber() { return startLineNumber_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStartLineNumber 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
getStartLineNumber
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
private DocumentReferenceResolver<EntityReference> getExplicitReferenceDocumentReferenceResolver() { if (this.explicitReferenceDocumentReferenceResolver == null) { this.explicitReferenceDocumentReferenceResolver = Utils.getComponent(DocumentReferenceResolver.TYPE_REFERENCE, "explicit"); } return this.explicitReferenceDocumentReferenceResolver; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExplicitReferenceDocumentReferenceResolver 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
getExplicitReferenceDocumentReferenceResolver
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 setNotValidAfter(Date notValidAfter) { this.notValidAfter = notValidAfter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNotValidAfter File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setNotValidAfter
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int getEndCharacterOffset() { return fEndCharacterOffset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEndCharacterOffset File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
getEndCharacterOffset
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override public boolean isResetPasswordTokenActive(ComponentName admin, String callerPackageName) { if (!mHasFeature || !mLockPatternUtils.hasSecureLockScreen()) { return false; } CallerIdentity caller; if (isUnicornFlagEnabled()) { caller = getCallerIdentity(admin, callerPackageName); } else { caller = getCallerIdentity(admin); } int userId = caller.getUserId(); if (isUnicornFlagEnabled()) { EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin( admin, MANAGE_DEVICE_POLICY_RESET_PASSWORD, caller.getPackageName(), userId); Long currentTokenHandle = mDevicePolicyEngine.getLocalPolicySetByAdmin( PolicyDefinition.RESET_PASSWORD_TOKEN, enforcingAdmin, userId); return isResetPasswordTokenActiveForUserLocked( currentTokenHandle == null ? 0 : currentTokenHandle, userId); } else { Objects.requireNonNull(admin, "ComponentName is null"); Preconditions.checkCallAuthorization( isProfileOwner(caller) || isDefaultDeviceOwner(caller)); synchronized (getLockObject()) { DevicePolicyData policy = getUserData(userId); return isResetPasswordTokenActiveForUserLocked(policy.mPasswordTokenHandle, userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isResetPasswordTokenActive File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isResetPasswordTokenActive
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public String[] getExcludedColumns() { return new String[] {}; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExcludedColumns File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getExcludedColumns
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
public void setUnmarshallerListener(Unmarshaller.Listener unmarshallerListener) { this.unmarshallerListener = unmarshallerListener; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUnmarshallerListener File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setUnmarshallerListener
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
public void setUsername(@Nullable String username) { this.username = username; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsername File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setUsername
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
protected abstract Build getBuild();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBuild File: server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/artifacts/ArtifactUploadPanel.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-38301
HIGH
8.8
theonedev/onedev
getBuild
server-core/src/main/java/io/onedev/server/web/page/project/builds/detail/artifacts/ArtifactUploadPanel.java
5b6a19c1f7fe9c271acc4268bcd261a9a1cbb3ea
0
Analyze the following code function for security vulnerabilities
private void notifyUserForCaCertificate() { if (mCurrentTofuConfig == null) return; if (useTrustOnFirstUse()) { if (null == mPendingRootCaCert) return; if (null == mPendingServerCert) return; } dismissDialogAndNotification(); PendingIntent tapPendingIntent; if (useTrustOnFirstUse()) { tapPendingIntent = genCaCertNotifIntent(ACTION_CERT_NOTIF_TAP, mCurrentTofuConfig.SSID); } else { Intent openLinkIntent = new Intent(Intent.ACTION_VIEW) .setData(Uri.parse(mCaCertHelpLink)) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); tapPendingIntent = mFacade.getActivity(mContext, 0, openLinkIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); } String title = useTrustOnFirstUse() ? mContext.getString(R.string.wifi_ca_cert_notification_title) : mContext.getString(R.string.wifi_ca_cert_notification_preT_title); String content = useTrustOnFirstUse() ? mContext.getString(R.string.wifi_ca_cert_notification_message, mCurrentTofuConfig.SSID) : mContext.getString(R.string.wifi_ca_cert_notification_preT_message, mCurrentTofuConfig.SSID); Notification.Builder builder = mFacade.makeNotificationBuilder(mContext, WifiService.NOTIFICATION_NETWORK_ALERTS) .setSmallIcon(Icon.createWithResource(mContext.getWifiOverlayApkPkgName(), com.android.wifi.resources.R.drawable.stat_notify_wifi_in_range)) .setContentTitle(title) .setContentText(content) .setStyle(new Notification.BigTextStyle().bigText(content)) .setContentIntent(tapPendingIntent) .setOngoing(true) .setColor(mContext.getResources().getColor( android.R.color.system_notification_accent_color)); // On a device which does not support Trust On First Use, // a user can accept or reject this network via the notification. if (!useTrustOnFirstUse()) { Notification.Action acceptAction = new Notification.Action.Builder( null /* icon */, mContext.getString(R.string.wifi_ca_cert_dialog_preT_continue_text), genCaCertNotifIntent(ACTION_CERT_NOTIF_ACCEPT, mCurrentTofuConfig.SSID)) .build(); Notification.Action rejectAction = new Notification.Action.Builder( null /* icon */, mContext.getString(R.string.wifi_ca_cert_dialog_preT_abort_text), genCaCertNotifIntent(ACTION_CERT_NOTIF_REJECT, mCurrentTofuConfig.SSID)) .build(); builder.addAction(rejectAction).addAction(acceptAction); } mNotificationManager.notify(SystemMessage.NOTE_SERVER_CA_CERTIFICATE, builder.build()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyUserForCaCertificate File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
notifyUserForCaCertificate
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void onGuildVoiceMove(@NotNull GuildVoiceMoveEvent event) { super.onGuildVoiceMove(event); SQLResponse sqlResponse = Main.getInstance().getSqlConnector().getSqlWorker().getEntity(TemporalVoicechannel.class, "SELECT * FROM TemporalVoicechannel WHERE GID = ? AND VID = ?", event.getGuild().getId(), event.getChannelJoined().getId()); if (sqlResponse.isSuccess()) { VoiceChannel voiceChannel = event.getGuild().getVoiceChannelById(event.getChannelJoined().getId()); if (voiceChannel == null) return; if (!((TemporalVoicechannel) sqlResponse.getEntity()).getVoiceChannelId().equalsIgnoreCase(voiceChannel.getId())) { return; } if (voiceChannel.getParentCategory() != null) { voiceChannel.getParentCategory().createVoiceChannel("Temporal VC #" + event.getGuild().getVoiceChannels().stream().filter(c -> c.getName().startsWith("Temporal VC")).toList().size() + 1).queue(channel -> { event.getGuild().moveVoiceMember(event.getMember(), channel).queue(); ArrayUtil.temporalVoicechannel.add(channel.getId()); }); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onGuildVoiceMove File: src/main/java/de/presti/ree6/events/OtherEvents.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
onGuildVoiceMove
src/main/java/de/presti/ree6/events/OtherEvents.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
public static void installExpressionFactory(ServletContextEvent event) { JellyFacet.setExpressionFactory(event, new ExpressionFactory2()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installExpressionFactory File: core/src/main/java/hudson/WebAppMain.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-254" ]
CVE-2014-9634
MEDIUM
5
jenkinsci/jenkins
installExpressionFactory
core/src/main/java/hudson/WebAppMain.java
582128b9ac179a788d43c1478be8a5224dc19710
0
Analyze the following code function for security vulnerabilities
String getSkinFileURL(String filename, XWikiContext context) { boolean forceSkinAction = BooleanUtils.toBoolean((Boolean) getParameter(FORCE_SKIN_ACTION, filename, context)); StringBuilder url = new StringBuilder(context.getWiki().getSkinFile(filename, forceSkinAction, context)); if (forceSkinAction) { String parameters = StringUtils.removeStart(parametersAsQueryString(filename, context), PARAMETER_SEPARATOR); if (!StringUtils.isEmpty(parameters)) { String queryParamDelimiter = StringUtils.contains(url, QUERY_PARAMETER_DELIMITER) ? PARAMETER_SEPARATOR : QUERY_PARAMETER_DELIMITER; url.append(queryParamDelimiter).append(parameters); } } return url.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkinFileURL File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getSkinFileURL
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) { HttpHeaders headers = request.getHeaders(); Optional<String> originHeader = headers.getOrigin(); originHeader.ifPresent(requestOrigin -> { Optional<CorsOriginConfiguration> optionalConfig = getConfiguration(requestOrigin); if (optionalConfig.isPresent()) { CorsOriginConfiguration config = optionalConfig.get(); if (CorsUtil.isPreflightRequest(request)) { Optional<HttpMethod> result = headers.getFirst(ACCESS_CONTROL_REQUEST_METHOD, HttpMethod.class); setAllowMethods(result.get(), response); Optional<List> allowedHeaders = headers.get(ACCESS_CONTROL_REQUEST_HEADERS, Argument.of(List.class, String.class)); allowedHeaders.ifPresent(val -> setAllowHeaders(val, response) ); setMaxAge(config.getMaxAge(), response); } setOrigin(requestOrigin, response); setVary(response); setExposeHeaders(config.getExposedHeaders(), response); setAllowCredentials(config, response); } }); }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2022-21700 - Severity: MEDIUM - CVSS Score: 5.0 Description: Use ConversionContext constants where possible instead of class (#2356) Changes ------- * Added ArgumentConversionContext constants in ConversionContext * Replaced Argument.of and use of argument classes with ConversionContext constants where possible * Added getFirst method in ConvertibleMultiValues that accepts ArgumentConversionContent parameter Partially addresses issue #2355 Function: handleResponse File: http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java Repository: micronaut-projects/micronaut-core Fixed Code: protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) { HttpHeaders headers = request.getHeaders(); Optional<String> originHeader = headers.getOrigin(); originHeader.ifPresent(requestOrigin -> { Optional<CorsOriginConfiguration> optionalConfig = getConfiguration(requestOrigin); if (optionalConfig.isPresent()) { CorsOriginConfiguration config = optionalConfig.get(); if (CorsUtil.isPreflightRequest(request)) { Optional<HttpMethod> result = headers.getFirst(ACCESS_CONTROL_REQUEST_METHOD, CONVERSION_CONTEXT_HTTP_METHOD); setAllowMethods(result.get(), response); Optional<List<String>> allowedHeaders = headers.get(ACCESS_CONTROL_REQUEST_HEADERS, ConversionContext.LIST_OF_STRING); allowedHeaders.ifPresent(val -> setAllowHeaders(val, response) ); setMaxAge(config.getMaxAge(), response); } setOrigin(requestOrigin, response); setVary(response); setExposeHeaders(config.getExposedHeaders(), response); setAllowCredentials(config, response); } }); }
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
handleResponse
http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
1
Analyze the following code function for security vulnerabilities
@Test public void detectsComplexConstructorExpression() { assertThat(hasConstructorExpression("select new foo.bar.Foo(ip.id, ip.name, sum(lp.amount)) " // + "from Bar lp join lp.investmentProduct ip " // + "where (lp.toDate is null and lp.fromDate <= :now and lp.fromDate is not null) and lp.accountId = :accountId " // + "group by ip.id, ip.name, lp.accountId " // + "order by ip.name ASC"), is(true)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: detectsComplexConstructorExpression File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
detectsComplexConstructorExpression
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
public Field apply(String key) { return apply(key, this.lang); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
apply
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
@Override public boolean onOptionsItemSelected(MenuItem item) { final int itemId = item.getItemId(); if (itemId == android.R.id.home) { // See ActionBar#setDisplayHomeAsUpEnabled() CallFeaturesSetting.goUpToTopLevelSetting(this, mSubscriptionInfoHelper); return true; } return super.onOptionsItemSelected(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOptionsItemSelected File: src/com/android/phone/CdmaCallForwardOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onOptionsItemSelected
src/com/android/phone/CdmaCallForwardOptions.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
private String getDestinationBaseDirectoryName(String state, boolean forceDefault) { String baseDir = null; if ( state.equals(Recording.STATE_PROCESSING) || state.equals(Recording.STATE_PROCESSED) ) baseDir = processDir; else if ( state.equals(Recording.STATE_PUBLISHED) ) baseDir = publishedDir; else if ( state.equals(Recording.STATE_UNPUBLISHED) ) baseDir = unpublishedDir; else if ( state.equals(Recording.STATE_DELETED) ) baseDir = deletedDir; else if ( forceDefault ) baseDir = publishedDir; return baseDir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDestinationBaseDirectoryName File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
getDestinationBaseDirectoryName
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
@Override public int getSoftkeyCount() { /** * one menu button only. we may have to stuff some code here as soon as * there are devices that no longer have only a single menu button. */ return 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSoftkeyCount File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getSoftkeyCount
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder data(byte[] data);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: data File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
data
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public void setDisabledStatus(boolean disabledStatus) { this.user.setDisabled(disabledStatus, getXWikiContext()); }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2022-41929 - Severity: MEDIUM - CVSS Score: 4.9 Description: XWIKI-19804: Bulletproof user API Function: setDisabledStatus File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/User.java Repository: xwiki/xwiki-platform Fixed Code: public void setDisabledStatus(boolean disabledStatus) { if (hasAdminRights()) { this.user.setDisabled(disabledStatus, getXWikiContext()); } }
[ "CWE-862" ]
CVE-2022-41929
MEDIUM
4.9
xwiki/xwiki-platform
setDisabledStatus
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/User.java
0b732f2ef0224e2aaf10e2e1ef48dbd3fb6e10cd
1
Analyze the following code function for security vulnerabilities
@Override public void writeLong(long value) throws JMSException { writePrimitive(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeLong File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
writeLong
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
void handleUnlockUser(int userId) { if (DEBUG || DEBUG_REBOOT) { Slog.d(TAG, "handleUnlockUser: user=" + userId); } synchronized (mUnlockedUsers) { mUnlockedUsers.put(userId, true); } // Preload the user data. // Note, we don't use mHandler here but instead just start a new thread. // This is because mHandler (which uses com.android.internal.os.BackgroundThread) is very // busy at this point and this could take hundreds of milliseconds, which would be too // late since the launcher would already have started. // So we just create a new thread. This code runs rarely, so we don't use a thread pool // or anything. final long start = getStatStartTime(); injectRunOnNewThread(() -> { Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "shortcutHandleUnlockUser"); synchronized (mLock) { logDurationStat(Stats.ASYNC_PRELOAD_USER_DELAY, start); getUserShortcutsLocked(userId); } Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUnlockUser File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
handleUnlockUser
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void binderDied() { try { synchronized (mWmService.mGlobalLock) { final WindowState win = mWmService .windowForClientLocked(mSession, mClient, false); Slog.i(TAG, "WIN DEATH: " + win); if (win != null) { final DisplayContent dc = getDisplayContent(); if (win.mActivityRecord != null && win.mActivityRecord.findMainWindow() == win) { mWmService.mTaskSnapshotController.onAppDied(win.mActivityRecord); } win.removeIfPossible(shouldKeepVisibleDeadAppWindow()); } else if (mHasSurface) { Slog.e(TAG, "!!! LEAK !!! Window removed but surface still valid."); WindowState.this.removeIfPossible(); } } } catch (IllegalArgumentException ex) { // This will happen if the window has already been removed. } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: binderDied 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
binderDied
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private void updateLeftPreview() { View previewBefore = mLeftPreview; if (previewBefore != null) { mPreviewContainer.removeView(previewBefore); } if (mLeftIsVoiceAssist) { mLeftPreview = mPreviewInflater.inflatePreviewFromService( mAssistManager.getVoiceInteractorComponentName()); } else { mLeftPreview = mPreviewInflater.inflatePreview(mLeftButton.getIntent()); } if (mLeftPreview != null) { mPreviewContainer.addView(mLeftPreview); mLeftPreview.setVisibility(View.INVISIBLE); } if (mAffordanceHelper != null) { mAffordanceHelper.updatePreviews(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLeftPreview File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateLeftPreview
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setDownloadOptionLabelFromRequestParameter() { Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); String value = params.get("optionvalue"); if (StringUtils.isNotBlank(value)) { setSelectedDownloadOptionLabel(value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDownloadOptionLabelFromRequestParameter 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
setDownloadOptionLabelFromRequestParameter
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
public void registerCallback(XMPPServiceCallback callBack) { this.mServiceCallBack = callBack; mService.registerReceiver(mPingAlarmReceiver, new IntentFilter(PING_ALARM)); mService.registerReceiver(mPongTimeoutAlarmReceiver, new IntentFilter(PONG_TIMEOUT_ALARM)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerCallback 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
registerCallback
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private void countSiteVisit(HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(false); boolean PAGE_MODE = true; if (session != null) { PAGE_MODE = PageRequestModeUtil.isPageMode(session); } if (PAGE_MODE) { NumberOfTimeVisitedCounter.maybeCount(request, response); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countSiteVisit File: dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
countSiteVisit
dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String correlationId = getCorrelationId(request); CorrelationIdTracker.setCorrelationId(correlationId); response.addHeader(CORRELATION_ID_HEADER, correlationId); super.service(request, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: service File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java Repository: oVirt/ovirt-engine The code follows secure coding practices.
[ "CWE-287" ]
CVE-2024-0822
HIGH
7.5
oVirt/ovirt-engine
service
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
036f617316f6d7077cd213eb613eb4816e33d1fc
0
Analyze the following code function for security vulnerabilities
@Override public int getProcessLimit() { synchronized (this) { return mProcessLimitOverride; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessLimit File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getProcessLimit
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private int barMode(int vis, int transientFlag, int translucentFlag, int transparentFlag) { int lightsOutTransparent = View.SYSTEM_UI_FLAG_LOW_PROFILE | transparentFlag; return (vis & transientFlag) != 0 ? MODE_SEMI_TRANSPARENT : (vis & translucentFlag) != 0 ? MODE_TRANSLUCENT : (vis & lightsOutTransparent) == lightsOutTransparent ? MODE_LIGHTS_OUT_TRANSPARENT : (vis & transparentFlag) != 0 ? MODE_TRANSPARENT : (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0 ? MODE_LIGHTS_OUT : MODE_OPAQUE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: barMode 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
barMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private static byte[] readFile(final HttpQuery query, final File file, final int max_length) { final int length = (int) file.length(); if (length <= 0) { return null; } FileInputStream in; try { in = new FileInputStream(file.getPath()); } catch (FileNotFoundException e) { return null; } try { final byte[] buf = new byte[Math.min(length, max_length)]; final int read = in.read(buf); if (read != buf.length) { logError(query, "When reading " + file + ": read only " + read + " bytes instead of " + buf.length); return null; } return buf; } catch (IOException e) { logError(query, "Error while reading " + file, e); return null; } finally { try { in.close(); } catch (IOException e) { logError(query, "Error while closing " + file, e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFile File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
readFile
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public ServerBuilder accessLogger(String loggerName) { requireNonNull(loggerName, "loggerName"); return accessLogger(LoggerFactory.getLogger(loggerName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: accessLogger 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
accessLogger
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public static boolean jsFunction_sleep(Context cx, Scriptable thisObj, Object[] args, Function funObj) { if (isStringArray(args)) { String millis = (String) args[0]; try { Thread.sleep(Long.parseLong(millis)); } catch (InterruptedException e) { log.error("Sleep Thread Interrupted"); return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_sleep 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_sleep
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
protected VaadinSession getExistingSession(VaadinRequest request, boolean allowSessionCreation) throws SessionExpiredException { final WrappedSession session = getWrappedSession(request, allowSessionCreation); VaadinSession vaadinSession = loadSession(session); if (vaadinSession == null) { return null; } return vaadinSession; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExistingSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
getExistingSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Override public void updated(@SuppressWarnings("rawtypes") Dictionary properties) throws ConfigurationException { addJobLoad = LoadUtil.getConfiguredLoadValue(properties, ADD_JOB_LOAD_KEY, DEFAULT_ADD_JOB_LOAD, serviceRegistry); deleteJobLoad = LoadUtil.getConfiguredLoadValue(properties, DELETE_JOB_LOAD_KEY, DEFAULT_DELETE_JOB_LOAD, serviceRegistry); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updated File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-21318
MEDIUM
5.5
opencast
updated
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
b18c6a7f81f08ed14884592a6c14c9ab611ad450
0
Analyze the following code function for security vulnerabilities
@Override protected <T> T getProperty(String key, Class<T> valueClass) { // Get property from request String requestValue = getRequestParameter(key); if (requestValue != null) { return this.converter.convert(valueClass, requestValue); } // Get property from session T sessionValue = getSessionAttribute(key); if (sessionValue != null) { return sessionValue; } // Get property from configuration return this.configuration.getProperty(key, valueClass); }
Vulnerability Classification: - CWE: CWE-287 - CVE: CVE-2022-39387 - Severity: HIGH - CVSS Score: 7.5 Description: OIDC-118: Fix bad handling of request parameters Function: getProperty File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc Fixed Code: @Override protected <T> T getProperty(String key, Class<T> valueClass) { if (SAFE_PROPERTIES.contains(key)) { // Get property from request String requestValue = getRequestParameter(key); if (requestValue != null) { return this.converter.convert(valueClass, requestValue); } } // Get property from session T sessionValue = getSessionAttribute(key); if (sessionValue != null) { return sessionValue; } // Get property from configuration return this.configuration.getProperty(key, valueClass); }
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
getProperty
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
1
Analyze the following code function for security vulnerabilities
public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; // Rebuild HTTP Client according to the new "clientConfig" value. this.httpClient = buildHttpClient(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientConfig File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setClientConfig
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void setLockScreenShown(boolean keyguardShowing, boolean aodShowing, int secondaryDisplayShowing) { if (checkCallingPermission(android.Manifest.permission.DEVICE_POWER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.DEVICE_POWER); } synchronized(this) { long ident = Binder.clearCallingIdentity(); if (mKeyguardShown != keyguardShowing) { mKeyguardShown = keyguardShowing; reportCurKeyguardUsageEventLocked(); } try { mKeyguardController.setKeyguardShown(keyguardShowing, aodShowing, secondaryDisplayShowing); } finally { Binder.restoreCallingIdentity(ident); } } mHandler.obtainMessage(DISPATCH_SCREEN_KEYGUARD_MSG, keyguardShowing ? 1 : 0, 0) .sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockScreenShown 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
setLockScreenShown
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
void stopSipService(Context context, String sipProfileName) { // Stop the sip service for the profile. AccountEntry accountEntry = getAccountEntry(sipProfileName); if (accountEntry != null ) { SipManager sipManager = SipManager.newInstance(context); accountEntry.stopSipService(sipManager); } // Un-register its PhoneAccount. PhoneAccountHandle handle = SipUtil.createAccountHandle(context, sipProfileName); TelecomManager.from(context).unregisterPhoneAccount(handle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopSipService File: sip/src/com/android/services/telephony/sip/SipAccountRegistry.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
stopSipService
sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
a294ae5342410431a568126183efe86261668b5d
0
Analyze the following code function for security vulnerabilities
private void updatePersistentConfigurationLocked(Configuration values, @UserIdInt int userId) { final long origId = Binder.clearCallingIdentity(); try { updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */); } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePersistentConfigurationLocked 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
updatePersistentConfigurationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getLogid() { synchronized (this) { if (StringUtils.isEmpty(logid)) { return "-"; } return logid; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogid 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
getLogid
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@Override public String getAppArg() { if (super.getAppArg() != null) { // This just maintains backward compatibility in case people are manually // setting the AppArg in their properties. It reproduces the general // behaviour the existed when AppArg was just another Display property. return super.getAppArg(); } if (getActivity() == null) { return null; } android.content.Intent intent = getActivity().getIntent(); if (intent != null) { String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); intent.removeExtra(Intent.EXTRA_TEXT); Uri u = intent.getData(); String scheme = intent.getScheme(); if (u == null && intent.getExtras() != null) { if (intent.getExtras().keySet().contains("android.intent.extra.STREAM")) { try { u = (Uri)intent.getParcelableExtra("android.intent.extra.STREAM"); scheme = u.getScheme(); System.out.println("u="+u); } catch (Exception ex) { Log.d("Codename One", "Failed to load parcelable extra from intent: "+ex.getMessage()); } } } if (u != null) { //String scheme = intent.getScheme(); intent.setData(null); if ("content".equals(scheme)) { try { InputStream attachment = getActivity().getContentResolver().openInputStream(u); if (attachment != null) { String name = getContentName(getActivity().getContentResolver(), u); if (name != null) { String filePath = getAppHomePath() + getFileSystemSeparator() + name; if(filePath.startsWith("file:")) { filePath = filePath.substring(5); } File f = new File(filePath); OutputStream tmp = createFileOuputStream(f); byte[] buffer = new byte[1024]; int read = -1; while ((read = attachment.read(buffer)) > -1) { tmp.write(buffer, 0, read); } tmp.close(); attachment.close(); setAppArg(addFile(filePath)); return addFile(filePath); } } } catch (FileNotFoundException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; } catch (Exception e) { e.printStackTrace(); return null; } } else { /* // Why do we need this special case? u.toString() // will include the full URL including query string. // This special case causes urls like myscheme://part1/part2 // to only return "/part2" which is obviously problematic and // is inconsistent with iOS. Is this special case necessary // in some versions of Android? String encodedPath = u.getEncodedPath(); if (encodedPath != null && encodedPath.length() > 0) { String query = u.getQuery(); if(query != null && query.length() > 0){ encodedPath += "?" + query; } setAppArg(encodedPath); return encodedPath; } */ if (sharedText != null) { setAppArg(sharedText); return sharedText; } else { setAppArg(u.toString()); return u.toString(); } } } else if (sharedText != null) { setAppArg(sharedText); return sharedText; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppArg File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getAppArg
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public BufferedImage readRasterImageFromFile() { // https://www.experts-exchange.com/questions/26171948/Why-are-ImageIO-read-images-losing-their-transparency.html // https://stackoverflow.com/questions/18743790/can-java-load-images-with-transparency if (isFileOk()) try { // ::comment when __CORE__ if (internal.getName().endsWith(".webp")) return readWebp(); else // ::done return SecurityUtils.readRasterImage(new ImageIcon(this.getAbsolutePath())); } catch (Exception e) { Logme.error(e); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readRasterImageFromFile File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
readRasterImageFromFile
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
void setQsScrimEnabled(boolean scrimEnabled) { mNotificationPanel.setQsScrimEnabled(scrimEnabled); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQsScrimEnabled 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
setQsScrimEnabled
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void pushBackInputStreamIfNecessary(PushbackInputStream pushbackInputStream) throws IOException { int n = inflater.getRemaining(); if (n > 0) { byte[] rawDataCache = getLastReadRawDataCache(); pushbackInputStream.unread(rawDataCache, len - n, n); } }
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: pushBackInputStreamIfNecessary File: src/main/java/net/lingala/zip4j/io/inputstream/InflaterInputStream.java Repository: srikanth-lingala/zip4j Fixed Code: @Override public int pushBackInputStreamIfNecessary(PushbackInputStream pushbackInputStream) throws IOException { int n = inflater.getRemaining(); if (n > 0) { byte[] rawDataCache = getLastReadRawDataCache(); pushbackInputStream.unread(rawDataCache, len - n, n); } return n; }
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
pushBackInputStreamIfNecessary
src/main/java/net/lingala/zip4j/io/inputstream/InflaterInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
1
Analyze the following code function for security vulnerabilities
@Deprecated protected JavaType modifyTypeByAnnotation(DeserializationContext ctxt, Annotated a, JavaType type) throws JsonMappingException { AnnotationIntrospector intr = ctxt.getAnnotationIntrospector(); if (intr == null) { return type; } return intr.refineDeserializationType(ctxt.getConfig(), a, type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modifyTypeByAnnotation File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
modifyTypeByAnnotation
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private V fromObject(K name, Object value) { try { return valueConverter.convertObject(checkNotNull(value, "value")); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert object value for header '" + name + '\'', e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromObject File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
fromObject
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public InstantDt getPublished() { ensureSearchEntityLoaded(); return new InstantDt(mySearchEntity.getCreated()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPublished File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getPublished
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
public synchronized Image getResponseImage() { byte[] bytes = this.responseBytes; if (bytes == null) { return null; } return Toolkit.getDefaultToolkit().createImage(bytes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponseImage File: Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getResponseImage
Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public RemoteViews makeBigContentView() { RemoteViews customContent = mBuilder.mN.bigContentView != null ? mBuilder.mN.bigContentView : mBuilder.mN.contentView; return makeMediaBigContentView(customContent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeBigContentView File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
makeBigContentView
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean isDenied() throws IOException { SFile securityPath = SecurityUtils.getSecurityPath(); if (securityPath == null) return false; return getSanitizedPath().startsWith(securityPath.getSanitizedPath()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDenied File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
isDenied
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
private void writeInitial(HttpServletResponse response, String service) throws IOException { doNotCache(response); response.setHeader("Content-Type", "application/x-" + service + "-advertisement"); PacketLineOut pack = new PacketLineOut(response.getOutputStream()); pack.setFlushOnEnd(false); pack.writeString("# service=" + service + "\n"); pack.end(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeInitial File: server-core/src/main/java/io/onedev/server/git/GitFilter.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
writeInitial
server-core/src/main/java/io/onedev/server/git/GitFilter.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public boolean isWifiStandardSupported(@WifiStandard int standard) { return mWifiNative.isWifiStandardSupported(mInterfaceName, standard); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWifiStandardSupported 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
isWifiStandardSupported
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public Object fromXML(String xml, Object root) { return fromXML(new StringReader(xml), root); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromXML 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
fromXML
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
private String buildPostAuthnRequest(AuthnRequestType authnRequest, boolean sign, PrivateKey privateKey, X509Certificate certificate, Algorithm algorithm, String xmlSignatureC14nMethod) throws SAMLException { Document document = marshallToDocument(PROTOCOL_OBJECT_FACTORY.createAuthnRequest(authnRequest), AuthnRequestType.class); try { Element toSign = document.getDocumentElement(); String xml; if (sign) { xml = signXML(privateKey, certificate, algorithm, xmlSignatureC14nMethod, document, toSign, null); } else { xml = marshallToString(document); } return Base64.getEncoder().encodeToString(xml.getBytes(StandardCharsets.UTF_8)); } catch (Exception e) { throw new SAMLException("Unable to sign XML SAML response", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildPostAuthnRequest File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java Repository: FusionAuth/fusionauth-samlv2 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-27736
MEDIUM
4
FusionAuth/fusionauth-samlv2
buildPostAuthnRequest
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
c66fb689d50010662f705d5b585c6388ce555dbd
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setJournalMode(@NonNull String journalMode) { Preconditions.checkNotNull(journalMode); mJournalMode = journalMode; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setJournalMode File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
setJournalMode
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private void setNetworkLoggingActiveInternal(boolean active) { mInjector.binderWithCleanCallingIdentity(() -> { boolean shouldSendNotification = false; synchronized (getLockObject()) { if (active) { if (mNetworkLogger == null) { final int affectedUserId = getNetworkLoggingAffectedUser(); mNetworkLogger = new NetworkLogger(this, mInjector.getPackageManagerInternal(), affectedUserId == UserHandle.USER_SYSTEM ? UserHandle.USER_ALL : affectedUserId); } if (!mNetworkLogger.startNetworkLogging()) { mNetworkLogger = null; Slogf.wtf(LOG_TAG, "Network logging could not be started due to the logging" + " service not being available yet."); } maybePauseDeviceWideLoggingLocked(); shouldSendNotification = shouldSendNetworkLoggingNotificationLocked(); } else { if (mNetworkLogger != null && !mNetworkLogger.stopNetworkLogging()) { Slogf.wtf(LOG_TAG, "Network logging could not be stopped due to the logging" + " service not being available yet."); } mNetworkLogger = null; } } if (active) { if (shouldSendNotification) { mHandler.post(() -> handleSendNetworkLoggingNotification()); } } else { mHandler.post(() -> handleCancelNetworkLoggingNotification()); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNetworkLoggingActiveInternal 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
setNetworkLoggingActiveInternal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public DocumentReference resolveClassReference(String documentName) { DocumentReference defaultReference = new DocumentReference(getDocumentReference().getWikiReference().getName(), XWiki.SYSTEM_SPACE, getDocumentReference().getName()); return getExplicitDocumentReferenceResolver().resolve(documentName, defaultReference); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveClassReference 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
resolveClassReference
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
@Override public int getUserHandle(int userSerialNumber) { synchronized (mPackagesLock) { for (int userId : mUserIds) { UserInfo info = getUserInfoLocked(userId); if (info != null && info.serialNumber == userSerialNumber) return userId; } // Not found return -1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserHandle File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
getUserHandle
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private byte[] enrollCredential(byte[] enrolledHandle, String enrolledCredential, String toEnroll, int userId) throws RemoteException { checkWritePermission(userId); byte[] enrolledCredentialBytes = enrolledCredential == null ? null : enrolledCredential.getBytes(); byte[] toEnrollBytes = toEnroll == null ? null : toEnroll.getBytes(); GateKeeperResponse response = getGateKeeperService().enroll(userId, enrolledHandle, enrolledCredentialBytes, toEnrollBytes); if (response == null) { return null; } byte[] hash = response.getPayload(); if (hash != null) { setKeystorePassword(toEnroll, userId); } else { // Should not happen Slog.e(TAG, "Throttled while enrolling a password"); } return hash; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enrollCredential File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
enrollCredential
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
@NonNull private List<String> getPackagesWithAutoRevokePolicy(int autoRevokePolicy, int userId) { mContext.enforceCallingPermission(Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, "Must hold " + Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY); List<String> result = new ArrayList<>(); mPackageManagerInt.forEachInstalledPackage(pkg -> { if (pkg.getAutoRevokePermissions() == autoRevokePolicy) { result.add(pkg.getPackageName()); } }, userId); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackagesWithAutoRevokePolicy File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
getPackagesWithAutoRevokePolicy
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUsbDataSignalingEnabledForUser(int userId) { final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(isSystemUid(caller)); synchronized (getLockObject()) { return isUsbDataSignalingEnabledInternalLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUsbDataSignalingEnabledForUser 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
isUsbDataSignalingEnabledForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setXObject(int nb, BaseObject object) { object.setOwnerDocument(this); object.setNumber(nb); List<BaseObject> objects = this.xObjects.get(object.getXClassReference()); if (objects == null) { objects = new ArrayList<BaseObject>(); this.xObjects.put(object.getXClassReference(), objects); } while (nb >= objects.size()) { objects.add(null); } objects.set(nb, object); setMetaDataDirty(true); }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-26470 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-19223: Improve xobject memory storage in XWikidocument Function: setXObject File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform Fixed Code: public void setXObject(int nb, BaseObject object) { object.setOwnerDocument(this); object.setNumber(nb); BaseObjects objects = this.xObjects.get(object.getXClassReference()); if (objects == null) { objects = new BaseObjects(); this.xObjects.put(object.getXClassReference(), objects); } while (nb >= objects.size()) { objects.add(null); } objects.set(nb, object); setMetaDataDirty(true); }
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setXObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
1
Analyze the following code function for security vulnerabilities
@Override public boolean containsHeader(String name) { return this.response.containsHeader(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsHeader File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
containsHeader
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
public void clearAttachmentsToRemove() { this.attachmentsToRemove.clear(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearAttachmentsToRemove 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
clearAttachmentsToRemove
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
@Unstable public static String escape(String content) { return escapeAttributeValue(content); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escape File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-24898
MEDIUM
4
xwiki/xwiki-commons
escape
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
947e8921ebd95462d5a7928f397dd1b64f77c7d5
0
Analyze the following code function for security vulnerabilities
public void setDialectClass(String dialectClass) { this.dialectClass = dialectClass; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDialectClass File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
setDialectClass
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
public static Uri uriWithAddedParameters(Context context, Uri baseUri) { Uri.Builder builder = baseUri.buildUpon(); // Add in the preferred language builder.appendQueryParameter(PARAM_LANGUAGE_CODE, Locale.getDefault().toString()); // Add in the package version code if (sCachedVersionCode == null) { // There is no cached version code, so try to get it from the package manager. try { // cache the version code PackageInfo info = context.getPackageManager().getPackageInfo( context.getPackageName(), 0); sCachedVersionCode = Integer.toString(info.versionCode); // append the version code to the uri builder.appendQueryParameter(PARAM_VERSION, sCachedVersionCode); } catch (NameNotFoundException e) { // Cannot find the package name, so don't add in the version parameter // This shouldn't happen. Log.wtf(TAG, "Invalid package name for context", e); } } else { builder.appendQueryParameter(PARAM_VERSION, sCachedVersionCode); } // Build the full uri and return it return builder.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uriWithAddedParameters File: packages/SettingsLib/src/com/android/settingslib/HelpUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
uriWithAddedParameters
packages/SettingsLib/src/com/android/settingslib/HelpUtils.java
e206f02d46ae5e38c74d138b51f6e1637e261abe
0
Analyze the following code function for security vulnerabilities
@Override public void update(Context context, Collection collection) throws SQLException, AuthorizeException { // Check authorisation canEdit(context, collection, true); log.info(LogHelper.getHeader(context, "update_collection", "collection_id=" + collection.getID())); super.update(context, collection); collectionDAO.save(context, collection); if (collection.isModified()) { context.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, collection.getID(), null, getIdentifiers(context, collection))); collection.clearModified(); } if (collection.isMetadataModified()) { context.addEvent(new Event(Event.MODIFY_METADATA, Constants.COLLECTION, collection.getID(), collection.getDetails(),getIdentifiers(context, collection))); collection.clearModified(); } collection.clearDetails(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
update
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public boolean isEmpty() { return this.map.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEmpty File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
isEmpty
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
private boolean hasWriteSecureSettingsPermission() { // Write secure settings is a more protected permission. If caller has it we are good. if (getContext().checkCallingOrSelfPermission(Manifest.permission.WRITE_SECURE_SETTINGS) == PackageManager.PERMISSION_GRANTED) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasWriteSecureSettingsPermission 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
hasWriteSecureSettingsPermission
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
void schedulePauseTimeout() { pauseTime = SystemClock.uptimeMillis(); mAtmService.mH.postDelayed(mPauseTimeoutRunnable, PAUSE_TIMEOUT); ProtoLog.v(WM_DEBUG_STATES, "Waiting for pause to complete..."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: schedulePauseTimeout 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
schedulePauseTimeout
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static void uploadNewFile( Context context, Account account, String localPath, String remotePath, int behaviour, String mimeType, boolean createRemoteFile, int createdBy, boolean requiresWifi, boolean requiresCharging, NameCollisionPolicy nameCollisionPolicy ) { uploadNewFile( context, account, new String[]{localPath}, new String[]{remotePath}, new String[]{mimeType}, behaviour, createRemoteFile, createdBy, requiresWifi, requiresCharging, nameCollisionPolicy ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uploadNewFile File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
uploadNewFile
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
public boolean isValidateRemoteUpToVar() { return validateRemoteUpToVar; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidateRemoteUpToVar File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
isValidateRemoteUpToVar
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
private final int _nextByte() throws IOException { int inPtr = _inputPtr; if (inPtr < _inputEnd) { int ch = _inputBuffer[inPtr]; _inputPtr = inPtr+1; return ch; } loadMoreGuaranteed(); return _inputBuffer[_inputPtr++]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _nextByte File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_nextByte
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@Override public void releasePersistableUriPermission(Uri uri, int mode, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); uri.writeToParcel(data, 0); data.writeInt(mode); data.writeInt(userId); mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releasePersistableUriPermission File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
releasePersistableUriPermission
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void initializeErrorPages(final DeploymentImpl deployment, final DeploymentInfo deploymentInfo) { final Map<Integer, String> codes = new HashMap<>(); final Map<Class<? extends Throwable>, String> exceptions = new HashMap<>(); String defaultErrorPage = null; for (final ErrorPage page : deploymentInfo.getErrorPages()) { if (page.getExceptionType() != null) { exceptions.put(page.getExceptionType(), page.getLocation()); } else if (page.getErrorCode() != null) { codes.put(page.getErrorCode(), page.getLocation()); } else { if (defaultErrorPage != null) { throw UndertowServletMessages.MESSAGES.moreThanOneDefaultErrorPage(defaultErrorPage, page.getLocation()); } else { defaultErrorPage = page.getLocation(); } } } deployment.setErrorPages(new ErrorPages(codes, exceptions, defaultErrorPage)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeErrorPages File: servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
initializeErrorPages
servlet/src/main/java/io/undertow/servlet/core/DeploymentManagerImpl.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
public void put(Object key, Object value) { lazilyCreateDataHolder(); dataHolder.put(key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
put
xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public final @Nonnull Date getTime() { return new Date(timestamp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTime File: core/src/main/java/hudson/slaves/OfflineCause.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2603
LOW
3.5
jenkinsci/jenkins
getTime
core/src/main/java/hudson/slaves/OfflineCause.java
3cd946cbef82c6da5ccccf3890d0ae4e091c4265
0
Analyze the following code function for security vulnerabilities
public static Locale getLocaleFromText(String text) { // try to detect locale by language detector if (isNotEmptyOrWhitespaceOnly(text)) { try { Detector detector = DetectorFactory.create(); detector.append(text); String lang = detector.detect(); Locale loc = new Locale(lang); if (OpenCms.getLocaleManager().getAvailableLocales().contains(loc)) { return loc; } } catch (LangDetectException e) { LOG.debug(e); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocaleFromText File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
getLocaleFromText
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private static byte[] pickBestDigestForV4( List<ApkSigningBlockUtils.Result.SignerInfo.ContentDigest> contentDigests) { Map<ContentDigestAlgorithm, byte[]> apkContentDigests = new HashMap<>(); collectApkContentDigests(contentDigests, apkContentDigests); return ApkSigningBlockUtils.pickBestDigestForV4(apkContentDigests); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pickBestDigestForV4 File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
pickBestDigestForV4
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
StackInfo getStackInfoLocked(int stackId) { ActivityStack stack = getStack(stackId); if (stack != null) { return getStackInfoLocked(stack); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStackInfoLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getStackInfoLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
void immediatelyNotifyBlastSync() { // We could be more subtle with Integer.MAX_VALUE and track a seqId in the timeout. finishDrawing(null, Integer.MAX_VALUE); mWmService.mH.removeMessages(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this); if (!useBLASTSync()) return; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: immediatelyNotifyBlastSync 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
immediatelyNotifyBlastSync
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String getError(){ // TODO return "系统设置了安全规则,敏感表和敏感字段禁止查询,联系管理员授权!"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getError 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
getError
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java
dd7bf104e7ed59142909567ecd004335c3442ec5
0
Analyze the following code function for security vulnerabilities
protected PgResultSet upperCaseFieldLabels() { for (Field field: fields ) { field.upperCaseLabel(); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: upperCaseFieldLabels 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
upperCaseFieldLabels
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Test public void createsCountQueryForConstructorQueries() throws Exception { assertCountQuery("select distinct new User(u.name) from User u where u.foo = ?", "select count(distinct u) from User u where u.foo = ?"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createsCountQueryForConstructorQueries File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
createsCountQueryForConstructorQueries
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
public static String changeFileNameSuffixTo(String filename, String suffix) { int dotPos = filename.lastIndexOf('.'); if (dotPos != -1) { return filename.substring(0, dotPos + 1) + suffix; } else { // the string has no suffix return filename; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: changeFileNameSuffixTo File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
changeFileNameSuffixTo
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0