instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public String getAdType(XWikiContext context) { String adtype = ""; XWikiDocument wikiServer = context.getWikiServer(); if (wikiServer != null) { adtype = wikiServer.getStringValue(VIRTUAL_WIKI_DEFINITION_CLASS_REFERENCE, "adtype"); } if (adtype.equals("")) { adtype = getConfiguration().getProperty("xwiki.ad.type", ""); } return adtype; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAdType File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getAdType
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void setAffordanceHelper(KeyguardAffordanceHelper affordanceHelper) { mAffordanceHelper = affordanceHelper; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAffordanceHelper 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
setAffordanceHelper
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
void onUiCancellation(boolean isUserCancellation);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUiCancellation File: services/credentials/java/com/android/server/credentials/CredentialManagerUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40076
MEDIUM
5.5
android
onUiCancellation
services/credentials/java/com/android/server/credentials/CredentialManagerUi.java
9b68987df85b681f9362a3cadca6496796d23bbc
0
Analyze the following code function for security vulnerabilities
public @NonNull List<PreferentialNetworkServiceConfig> getPreferentialNetworkServiceConfigs() { throwIfParentInstance("getPreferentialNetworkServiceConfigs"); if (mService == null) { return List.of(PreferentialNetworkServiceConfig.DEFAULT); } try { return mService.getPreferentialNetworkServiceConfigs(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreferentialNetworkServiceConfigs File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getPreferentialNetworkServiceConfigs
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Test public void v1AuthUnauthorized() throws Exception { final TSDB tsdb = NettyMocks.getMockedHTTPTSDBWithAuthEnabled(AuthStatus.UNAUTHORIZED); final DataPoints[] datapoints = new DataPoints[1]; datapoints[0] = new MockDataPoints().getMock(); when(query_result.runAsync()).thenReturn( Deferred.fromResult(datapoints)); final HttpQuery query = NettyMocks.getQuery(tsdb,"/api/query?start=1h-ago&m=sum:sys.cpu.user"); try { TestHttpQuery.mockChannelFuture(query); rpc.execute(tsdb, query); fail("Expected BadRequestException"); } catch (BadRequestException e) { assertEquals(HttpResponseStatus.UNAUTHORIZED, e.getStatus()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: v1AuthUnauthorized File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
v1AuthUnauthorized
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public double getWidth() throws IllegalStateException { checkColumnIsAttached(); return getState(false).width; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWidth File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getWidth
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public ComponentName getAllowedNotificationAssistant() { try { return sINM.getAllowedNotificationAssistant(); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllowedNotificationAssistant File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getAllowedNotificationAssistant
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
void attachThumbnailAnimation() { if (!isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION)) { return; } final HardwareBuffer thumbnailHeader = getDisplayContent().mAppTransition.getAppTransitionThumbnailHeader(task); if (thumbnailHeader == null) { ProtoLog.d(WM_DEBUG_APP_TRANSITIONS, "No thumbnail header bitmap for: %s", task); return; } clearThumbnail(); final Transaction transaction = getAnimatingContainer().getPendingTransaction(); mThumbnail = new WindowContainerThumbnail(transaction, getAnimatingContainer(), thumbnailHeader); mThumbnail.startAnimation(transaction, loadThumbnailAnimation(thumbnailHeader)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachThumbnailAnimation 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
attachThumbnailAnimation
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public boolean isUniqueDeviceAttestationSupported() { PackageManager pm = mContext.getPackageManager(); return pm.hasSystemFeature(PackageManager.FEATURE_DEVICE_UNIQUE_ATTESTATION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUniqueDeviceAttestationSupported File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isUniqueDeviceAttestationSupported
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void onUserRemoved(RealmModel realm, String userId) { int num = em.createNamedQuery("deleteClientSessionsByUser").setParameter("userId", userId).executeUpdate(); num = em.createNamedQuery("deleteUserSessionsByUser").setParameter("userId", userId).executeUpdate(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserRemoved File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
onUserRemoved
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
0
Analyze the following code function for security vulnerabilities
private void copyBytesFromBuffer(byte[] b, int off) { lengthToCopyInThisIteration = lengthToRead < remainingAes16ByteBlockLength ? lengthToRead : remainingAes16ByteBlockLength; System.arraycopy(aes16ByteBlock, aes16ByteBlockPointer, b, off, lengthToCopyInThisIteration); incrementAesByteBlockPointer(lengthToCopyInThisIteration); decrementRemainingAesBytesLength(lengthToCopyInThisIteration); bytesCopiedInThisIteration += lengthToCopyInThisIteration; lengthToRead -= lengthToCopyInThisIteration; offsetWithAesBlock += lengthToCopyInThisIteration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyBytesFromBuffer File: src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
copyBytesFromBuffer
src/main/java/net/lingala/zip4j/io/inputstream/AesCipherInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
protected boolean checkUri(final String specialUri) { if (specialUri == null) { return false; } final String toMatch = Util.buildPath(true, specialUri); final String prefix; final int pos = resourceUri.indexOf("/", 1); if (pos < 0) { prefix = noParameters(resourceUri); } else { prefix = resourceUri.substring(0, pos); } if (!toMatch.equals(Util.buildPath(true, prefix))) { noPrefixResourceUri = noParameters(resourceUri); return false; } if (pos < 0) { noPrefixResourceUri = ""; } else { noPrefixResourceUri = noParameters(resourceUri.substring(pos)); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUri File: src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java Repository: Bedework/bw-webdav The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20000
MEDIUM
5
Bedework/bw-webdav
checkUri
src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
67283fb8b9609acdb1a8d2e7fefe195b4a261062
0
Analyze the following code function for security vulnerabilities
private void saveKeyPair() { byte[] privatekey = mCredentials.getData(Credentials.EXTRA_PRIVATE_KEY); String key = Util.toMd5(mCredentials.getData(Credentials.EXTRA_PUBLIC_KEY)); Map<String, byte[]> map = getPkeyMap(); map.put(key, privatekey); savePkeyMap(map); Log.d(TAG, "save privatekey: " + key + " --> #keys:" + map.size()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveKeyPair File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
saveKeyPair
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
@Override public void OnUpdateBlocklist(final Status status) { refreshUi(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: OnUpdateBlocklist 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
OnUpdateBlocklist
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private Configuration getProcessGlobalConfiguration() { // For child windows we want to use the pid for the parent window in case the the child // window was added from another process. final WindowState parentWindow = getParentWindow(); final int pid = parentWindow != null ? parentWindow.mSession.mPid : mSession.mPid; final Configuration processConfig = mWmService.mAtmService.getGlobalConfigurationForPid(pid); return processConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessGlobalConfiguration 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
getProcessGlobalConfiguration
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private RemoteViews applyStandardTemplate(int resId, StandardTemplateParams p, TemplateBindResult result) { p.headerless(resId == getBaseLayoutResource() || resId == getHeadsUpBaseLayoutResource() || resId == getMessagingLayoutResource() || resId == R.layout.notification_template_material_media); RemoteViews contentView = new BuilderRemoteViews(mContext.getApplicationInfo(), resId); resetStandardTemplate(contentView); final Bundle ex = mN.extras; updateBackgroundColor(contentView, p); bindNotificationHeader(contentView, p); bindLargeIconAndApplyMargin(contentView, p, result); boolean showProgress = handleProgressBar(contentView, ex, p); boolean hasSecondLine = showProgress; if (p.hasTitle()) { contentView.setViewVisibility(p.mTitleViewId, View.VISIBLE); contentView.setTextViewText(p.mTitleViewId, processTextSpans(p.title)); setTextViewColorPrimary(contentView, p.mTitleViewId, p); } else if (p.mTitleViewId != R.id.title) { // This alternate title view ID is not cleared by resetStandardTemplate contentView.setViewVisibility(p.mTitleViewId, View.GONE); contentView.setTextViewText(p.mTitleViewId, null); } if (p.text != null && p.text.length() != 0 && (!showProgress || p.mAllowTextWithProgress)) { contentView.setViewVisibility(p.mTextViewId, View.VISIBLE); contentView.setTextViewText(p.mTextViewId, processTextSpans(p.text)); setTextViewColorSecondary(contentView, p.mTextViewId, p); hasSecondLine = true; } else if (p.mTextViewId != R.id.text) { // This alternate text view ID is not cleared by resetStandardTemplate contentView.setViewVisibility(p.mTextViewId, View.GONE); contentView.setTextViewText(p.mTextViewId, null); } setHeaderlessVerticalMargins(contentView, p, hasSecondLine); return contentView; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyStandardTemplate File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
applyStandardTemplate
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setAuthorId(Integer authorId) { this.authorId = authorId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAuthorId File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
setAuthorId
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
public void setPassUserPrincipalToAttributeManager(Boolean passUserPrincipalToAttributeManager) { this.passUserPrincipalToAttributeManager = passUserPrincipalToAttributeManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassUserPrincipalToAttributeManager File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
setPassUserPrincipalToAttributeManager
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
public Wiki toRestWiki(URI baseUri, String wikiName) { Wiki wiki = this.objectFactory.createWiki().withId(wikiName).withName(wikiName); String spacesUri = Utils.createURI(baseUri, SpacesResource.class, wikiName).toString(); Link spacesLink = this.objectFactory.createLink(); spacesLink.setHref(spacesUri); spacesLink.setRel(Relations.SPACES); wiki.getLinks().add(spacesLink); String classesUri = Utils.createURI(baseUri, ClassesResource.class, wikiName).toString(); Link classesLink = this.objectFactory.createLink(); classesLink.setHref(classesUri); classesLink.setRel(Relations.CLASSES); wiki.getLinks().add(classesLink); String modificationsUri = Utils.createURI(baseUri, ModificationsResource.class, wikiName).toString(); Link modificationsLink = this.objectFactory.createLink(); modificationsLink.setHref(modificationsUri); modificationsLink.setRel(Relations.MODIFICATIONS); wiki.getLinks().add(modificationsLink); String searchUri = Utils.createURI(baseUri, WikiSearchResource.class, wikiName).toString(); Link searchLink = this.objectFactory.createLink(); searchLink.setHref(searchUri); searchLink.setRel(Relations.SEARCH); wiki.getLinks().add(searchLink); String queryUri = Utils.createURI(baseUri, WikiSearchQueryResource.class, wikiName).toString(); Link queryLink = this.objectFactory.createLink(); queryLink.setHref(queryUri); queryLink.setRel(Relations.QUERY); wiki.getLinks().add(queryLink); return wiki; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toRestWiki File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
toRestWiki
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
@AfterEach public void stopMail(TestUtils setup, LogCaptureConfiguration logCaptureConfiguration) { if (this.mail != null) { this.mail.stop(); } restoreSettings(setup); logCaptureConfiguration.registerExcludes("CSRFToken: Secret token verification failed, token"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopMail File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-200" ]
CVE-2021-32731
MEDIUM
5
xwiki/xwiki-platform
stopMail
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java
0cf716250b3645a5974c80d8336dcdf885749dff
0
Analyze the following code function for security vulnerabilities
public IntentBuilder setPasswordRequirement(@PasswordComplexity int level, PasswordMetrics metrics) { mIntent.putExtra(EXTRA_KEY_MIN_COMPLEXITY, level); mIntent.putExtra(EXTRA_KEY_MIN_METRICS, metrics); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPasswordRequirement File: src/com/android/settings/password/ChooseLockPassword.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
setPasswordRequirement
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public Hover doHover(DOMDocument xmlDocument, Position position, XMLHoverSettings settings) { return doHover(xmlDocument, position, settings, NULL_CHECKER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doHover File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
doHover
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
private static void log(String msg) { Log.d(LOG_TAG, msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: log File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
log
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
protected void load() { if (loadFromFile(new File(_workspaceDir, "workspace.json"))) { return; } if (loadFromFile(new File(_workspaceDir, "workspace.temp.json"))) { return; } if (loadFromFile(new File(_workspaceDir, "workspace.old.json"))) { return; } logger.error("Failed to load workspace from any attempted alternatives."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: load File: main/src/com/google/refine/io/FileProjectManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-37476
HIGH
7.8
OpenRefine
load
main/src/com/google/refine/io/FileProjectManager.java
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
0
Analyze the following code function for security vulnerabilities
private static void removeSetOfDirectories(Set<String> remove) { for (String s : remove) { File f = new File(s); try { FileUtils.recursiveDelete(f, f); } catch (IOException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSetOfDirectories File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
removeSetOfDirectories
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
private void showCantAddAccount(int errorCode, int userId) { final DevicePolicyManagerInternal dpmi = LocalServices.getService(DevicePolicyManagerInternal.class); Intent intent = null; if (dpmi == null) { intent = getDefaultCantAddAccountIntent(errorCode); } else if (errorCode == AccountManager.ERROR_CODE_USER_RESTRICTED) { intent = dpmi.createUserRestrictionSupportIntent(userId, UserManager.DISALLOW_MODIFY_ACCOUNTS); } else if (errorCode == AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE) { intent = dpmi.createShowAdminSupportIntent(userId, false); } if (intent == null) { intent = getDefaultCantAddAccountIntent(errorCode); } final long identityToken = clearCallingIdentity(); try { mContext.startActivityAsUser(intent, new UserHandle(userId)); } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showCantAddAccount File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
showCantAddAccount
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outState) { if (outState == null) { throw new IllegalArgumentException("outState is null"); } enforceNotIsolatedCaller("getMyMemoryState"); final int callingUid = Binder.getCallingUid(); final int clientTargetSdk = mPackageManagerInt.getUidTargetSdkVersion(callingUid); synchronized (this) { ProcessRecord proc; synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(Binder.getCallingPid()); } if (proc != null) { fillInProcMemInfo(proc, outState, clientTargetSdk); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMyMemoryState 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
getMyMemoryState
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@DELETE @Path("id/{userId}") @RequiresPermissions(USERS_EDIT) @ApiOperation("Removes a user account.") @ApiResponses({@ApiResponse(code = 400, message = "When attempting to remove a read only user (e.g. built-in or LDAP user).")}) @AuditEvent(type = AuditEventTypes.USER_DELETE) public void deleteUserById(@ApiParam(name = "userId", value = "The id of the user to delete.", required = true) @PathParam("userId") String userId) { if (userManagementService.deleteById(userId) == 0) { throw new NotFoundException("Couldn't find user " + userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteUserById File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
deleteUserById
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
public void setValidNotAfterTo(String validNotAfterTo) { this.validNotAfterTo = validNotAfterTo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidNotAfterTo File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setValidNotAfterTo
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void removeFooterRow(int index) { getFooter().removeRow(index); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeFooterRow File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
removeFooterRow
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public String accessToken(String username) { Algorithm algorithm = Algorithm.HMAC256(SECRET); return JWT.create() .withExpiresAt(new Date(new Date().getTime() + ACCESS_EXPIRE_TIME)) .withIssuer(ISSUER) .withClaim("username", username) .sign(algorithm); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2022-24861 - Severity: MEDIUM - CVSS Score: 6.5 Description: fix some security bug (#103) * fix: use hard-code secret * feat: add driver class validate * feat: optimize drvier resource code * fix:ut failed Function: accessToken File: core/src/main/java/com/databasir/core/infrastructure/jwt/JwtTokens.java Repository: vran-dev/databasir Fixed Code: public String accessToken(String username) { Algorithm algorithm = Algorithm.HMAC256(tokenSecret); return JWT.create() .withExpiresAt(new Date(new Date().getTime() + ACCESS_EXPIRE_TIME)) .withIssuer(ISSUER) .withClaim("username", username) .sign(algorithm); }
[ "CWE-20" ]
CVE-2022-24861
MEDIUM
6.5
vran-dev/databasir
accessToken
core/src/main/java/com/databasir/core/infrastructure/jwt/JwtTokens.java
ca22a8fef7a31c0235b0b2951260a7819b89993b
1
Analyze the following code function for security vulnerabilities
private void cleanWifiScore() { mWifiInfo.setLostTxPacketsPerSecond(0); mWifiInfo.setSuccessfulTxPacketsPerSecond(0); mWifiInfo.setRetriedTxPacketsRate(0); mWifiInfo.setSuccessfulRxPacketsPerSecond(0); mWifiScoreReport.reset(); mLastLinkLayerStats = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanWifiScore 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
cleanWifiScore
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@POST @Path("structure") @Operation(summary = "Attach structure element to course", description = "This attaches a Structure Element onto a given course. The element will be\n" + " inserted underneath the supplied parentNodeId") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachStructurePostMultiparts(@PathParam("courseId") Long courseId, @Context HttpServletRequest request) { InputStream in = null; MultipartReader reader = null; try { reader = new MultipartReader(request); String parentNodeId = reader.getValue("parentNodeId"); Integer position = reader.getIntegerValue("position"); String shortTitle = reader.getValue("shortTitle"); String longTitle = reader.getValue("longTitle"); String objectives = reader.getValue("objectives"); String visibilityExpertRules = reader.getValue("visibilityExpertRules"); String displayType = reader.getValue("displayType", STCourseNodeEditController.CONFIG_VALUE_DISPLAY_TOC); String filename = reader.getValue("filename", "attachment"); String accessExpertRules = reader.getValue("accessExpertRules"); if(reader.getFile() != null) { in = new FileInputStream(reader.getFile()); } CustomConfigDelegate config = new StructureFullConfig(displayType, in, filename); return attach(courseId, parentNodeId, "st", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); } catch (Exception e) { log.error("", e); return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build(); } finally { MultipartReader.closeQuietly(reader); IOUtils.closeQuietly(in); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachStructurePostMultiparts File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
attachStructurePostMultiparts
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
private int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjStopAtPos File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjStopAtPos
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
public ApiClient setConnectTimeout(int connectionTimeout) { this.connectionTimeout = connectionTimeout; httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConnectTimeout File: samples/openapi3/client/extensions/x-auth-id-alias/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
setConnectTimeout
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public final void backgroundResourcesReleased(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { ActivityStack stack = ActivityRecord.getStackLocked(token); if (stack != null) { stack.backgroundResourcesReleased(); } } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: backgroundResourcesReleased 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
backgroundResourcesReleased
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void destroyData(Object itemId) { // NO-OP }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroyData File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
destroyData
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private static int getKeyLen(byte[] arr) { if (arr[arr.length - 1] != 0) { return arr.length; } else { // remove zero "termination" return arr.length-1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyLen File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
getKeyLen
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@Override public void onRtlPropertiesChanged(int layoutDirection) { if (layoutDirection != mOldLayoutDirection) { mAffordanceHelper.onRtlPropertiesChanged(); mOldLayoutDirection = layoutDirection; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRtlPropertiesChanged File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onRtlPropertiesChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private boolean endCommentAvailable() throws IOException { int nbCaret = 0; final int originalOffset = fCurrentEntity.offset; final int originalColumnNumber = fCurrentEntity.getColumnNumber(); final int originalCharacterOffset = fCurrentEntity.getCharacterOffset(); while (true) { int c = readPreservingBufferContent(); if (c == -1) { fCurrentEntity.restorePosition(originalOffset, originalColumnNumber, originalCharacterOffset); return false; } else if (c == '>' && nbCaret >= 2) { fCurrentEntity.restorePosition(originalOffset, originalColumnNumber, originalCharacterOffset); return true; } else if (c == '-') { nbCaret++; } else { nbCaret = 0; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endCommentAvailable 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
endCommentAvailable
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public List<SymbolInformation> findSymbolInformations(DOMDocument xmlDocument) { return findSymbolInformations(xmlDocument, NULL_CHECKER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findSymbolInformations File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
findSymbolInformations
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
public static void sanitizeValues(@NonNull ContentValues values, boolean rewriteHiddenFileName) { final String[] relativePath = values.getAsString(MediaColumns.RELATIVE_PATH).split("/"); for (int i = 0; i < relativePath.length; i++) { relativePath[i] = sanitizeDisplayName(relativePath[i], rewriteHiddenFileName); } values.put(MediaColumns.RELATIVE_PATH, String.join("/", relativePath) + "/"); final String displayName = values.getAsString(MediaColumns.DISPLAY_NAME); values.put(MediaColumns.DISPLAY_NAME, sanitizeDisplayName(displayName, rewriteHiddenFileName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sanitizeValues 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
sanitizeValues
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
protected TopicStats internalGetStats(boolean authoritative, boolean getPreciseBacklog, boolean subscriptionBacklogSize) { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.GET_STATS); Topic topic = getTopicReference(topicName); return topic.getStats(getPreciseBacklog, subscriptionBacklogSize); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetStats File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetStats
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void close() throws IOException { input.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
close
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public boolean isStandalone() { return manager.get() == null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStandalone File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
isStandalone
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public void setAdapterInputConnectionFactory(AdapterInputConnectionFactory factory) { mAdapterInputConnectionFactory = factory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAdapterInputConnectionFactory File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
setAdapterInputConnectionFactory
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setLockscreenPublicMode(boolean publicMode, int userId) { mLockscreenPublicMode.put(userId, publicMode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockscreenPublicMode 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
setLockscreenPublicMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public @Nullable NClob getNClob(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getNClob columnIndex: {0}", columnIndex); throw org.postgresql.Driver.notImplemented(this.getClass(), "getNClob(int)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNClob 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
getNClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void setContentType(String contentType) { setStringValue("contenttype", contentType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentType File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-41046
MEDIUM
6.3
xwiki/xwiki-platform
setContentType
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
edc52579eeaab1b4514785c134044671a1ecd839
0
Analyze the following code function for security vulnerabilities
public void setLastseen(Long val) { this.lastseen = val; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLastseen File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
setLastseen
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
Http2StreamSourceChannel getIncomingStream(int streamId) { StreamHolder existing = currentStreams.get(streamId); if(existing == null){ return null; } return existing.sourceChannel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIncomingStream File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getIncomingStream
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public NodeDescriptor getDescriptor() { return DescriptorImpl.INSTANCE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescriptor File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getDescriptor
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public static String inferHudsonURL(StaplerRequest req) { String rootUrl = Jenkins.getInstance().getRootUrl(); if(rootUrl !=null) // prefer the one explicitly configured, to work with load-balancer, frontend, etc. return rootUrl; StringBuilder buf = new StringBuilder(); buf.append(req.getScheme()).append("://"); buf.append(req.getServerName()); if(! (req.getScheme().equals("http") && req.getLocalPort()==80 || req.getScheme().equals("https") && req.getLocalPort()==443)) buf.append(':').append(req.getLocalPort()); buf.append(req.getContextPath()).append('/'); return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inferHudsonURL File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
inferHudsonURL
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private Either<Exception, AccountBO> verifyCredentialsAndGetAccount(final String username, final String password) { final Optional<CredentialsBO> credentials = credentialsService.getByUsernameUnsafe(username); if (credentials.isPresent()) { if (securePassword.verify(password, credentials.get().getHashedPassword())) { return getAccountById(credentials.get().getAccountId()); } else { return Either.left(new ServiceAuthorizationException(ErrorCode.PASSWORDS_DO_NOT_MATCH, "Passwords do not match", EntityType.ACCOUNT, credentials.get().getAccountId())); } } else { return Either.left(new ServiceAuthorizationException(ErrorCode.CREDENTIALS_DOES_NOT_EXIST, "Identifier " + username + " does not exist")); } }
Vulnerability Classification: - CWE: CWE-287 - CVE: CVE-2021-45890 - Severity: HIGH - CVSS Score: 7.5 Description: Prevent authentication with inactive identifiers Function: verifyCredentialsAndGetAccount File: basic-auth/src/main/java/com/nexblocks/authguard/basic/BasicAuthProvider.java Repository: AuthGuard Fixed Code: private Either<Exception, AccountBO> verifyCredentialsAndGetAccount(final String username, final String password) { final Optional<CredentialsBO> credentials = credentialsService.getByUsernameUnsafe(username); // TODO replace this with Either mapping if (credentials.isPresent()) { final Optional<Exception> validationError = checkIdentifier(credentials.get(), username); if (validationError.isPresent()) { return Either.left(validationError.get()); } if (securePassword.verify(password, credentials.get().getHashedPassword())) { return getAccountById(credentials.get().getAccountId()); } else { return Either.left(new ServiceAuthorizationException(ErrorCode.PASSWORDS_DO_NOT_MATCH, "Passwords do not match", EntityType.ACCOUNT, credentials.get().getAccountId())); } } else { return Either.left(new ServiceAuthorizationException(ErrorCode.CREDENTIALS_DOES_NOT_EXIST, "Identifier " + username + " does not exist")); } }
[ "CWE-287" ]
CVE-2021-45890
HIGH
7.5
AuthGuard
verifyCredentialsAndGetAccount
basic-auth/src/main/java/com/nexblocks/authguard/basic/BasicAuthProvider.java
9783b1143da6576028de23e15a1f198b1f937b82
1
Analyze the following code function for security vulnerabilities
private void errorLog(String msg) { Log.e(TAG, msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: errorLog File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
errorLog
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private void clearNativeData() { // PMK should be cleared or it would skip EAP flow next time. if (null != mCurrentTofuConfig) { mWifiNative.removeNetworkCachedData(mCurrentTofuConfig.networkId); } // remove network so that supplicant's PMKSA cache is cleared mWifiNative.removeAllNetworks(mInterfaceName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearNativeData 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
clearNativeData
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void engineInit( int opmode, Key key, SecureRandom random) throws InvalidKeyException { try { engineInit(opmode, key, (AlgorithmParameterSpec)null, random); } catch (InvalidAlgorithmParameterException e) { throw new IllegalArgumentException("cannot handle supplied parameter spec: " + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineInit
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
public static double toDouble(@Nullable String s) throws SQLException { if (s != null) { try { s = s.trim(); return Double.parseDouble(s); } catch (NumberFormatException e) { throw new PSQLException(GT.tr("Bad value for type {0} : {1}", "double", s), PSQLState.NUMERIC_VALUE_OUT_OF_RANGE); } } return 0; // SQL NULL }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDouble 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
toDouble
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public boolean isSecure(int userId) { int mode = getKeyguardStoredPasswordQuality(userId); return isLockPatternEnabled(mode, userId) || isLockPasswordEnabled(mode, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecure File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isSecure
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
void setFrames(ClientWindowFrames clientWindowFrames, int requestedWidth, int requestedHeight) { final WindowFrames windowFrames = mWindowFrames; mTmpRect.set(windowFrames.mParentFrame); if (LOCAL_LAYOUT) { windowFrames.mCompatFrame.set(clientWindowFrames.frame); windowFrames.mFrame.set(clientWindowFrames.frame); windowFrames.mDisplayFrame.set(clientWindowFrames.displayFrame); windowFrames.mParentFrame.set(clientWindowFrames.parentFrame); if (hasCompatScale()) { // The frames sent from the client need to be adjusted to the real coordinate space. windowFrames.mFrame.scale(mGlobalScale); windowFrames.mDisplayFrame.scale(mGlobalScale); windowFrames.mParentFrame.scale(mGlobalScale); } } else { windowFrames.mDisplayFrame.set(clientWindowFrames.displayFrame); windowFrames.mParentFrame.set(clientWindowFrames.parentFrame); windowFrames.mFrame.set(clientWindowFrames.frame); windowFrames.mCompatFrame.set(windowFrames.mFrame); if (hasCompatScale()) { // Also, the scaled frame that we report to the app needs to be adjusted to be in // its coordinate space. windowFrames.mCompatFrame.scale(mInvGlobalScale); } } windowFrames.setParentFrameWasClippedByDisplayCutout( clientWindowFrames.isParentFrameClippedByDisplayCutout); // Calculate relative frame windowFrames.mRelFrame.set(windowFrames.mFrame); WindowContainer<?> parent = getParent(); int parentLeft = 0; int parentTop = 0; if (mIsChildWindow) { parentLeft = ((WindowState) parent).mWindowFrames.mFrame.left; parentTop = ((WindowState) parent).mWindowFrames.mFrame.top; } else if (parent != null) { final Rect parentBounds = parent.getBounds(); parentLeft = parentBounds.left; parentTop = parentBounds.top; } windowFrames.mRelFrame.offsetTo(windowFrames.mFrame.left - parentLeft, windowFrames.mFrame.top - parentTop); if (requestedWidth != mLastRequestedWidth || requestedHeight != mLastRequestedHeight || !mTmpRect.equals(windowFrames.mParentFrame)) { mLastRequestedWidth = requestedWidth; mLastRequestedHeight = requestedHeight; windowFrames.setContentChanged(true); } if (mAttrs.type == TYPE_DOCK_DIVIDER) { if (!windowFrames.mFrame.equals(windowFrames.mLastFrame)) { mMovedByResize = true; } } if (mIsWallpaper) { final Rect lastFrame = windowFrames.mLastFrame; final Rect frame = windowFrames.mFrame; if (lastFrame.width() != frame.width() || lastFrame.height() != frame.height()) { mDisplayContent.mWallpaperController.updateWallpaperOffset(this, false /* sync */); } } updateSourceFrame(windowFrames.mFrame); if (LOCAL_LAYOUT) { if (!mHaveFrame) { // The first frame should not be considered as moved. updateLastFrames(); } } if (mActivityRecord != null && !mIsChildWindow) { mActivityRecord.layoutLetterbox(this); } mSurfacePlacementNeeded = true; mHaveFrame = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFrames 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
setFrames
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
protected abstract void doHandle(final RoutingContext ctx);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doHandle File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
doHandle
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
private String getUserOrgUnitPathsFilter( Set<String> userOrgUnitPaths ) { return Stream.concat( Stream.of( "ou.organisationUnitId is null" ), userOrgUnitPaths.stream() .map( userOrgUnitPath -> "ou.path like '" + userOrgUnitPath + "%'" ) ) .collect( joining( " or ", "(", ")" ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserOrgUnitPathsFilter File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getUserOrgUnitPathsFilter
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java
3b245d04a58b78f0dc9bae8559f36ee4ca36dfac
0
Analyze the following code function for security vulnerabilities
public Object getInterface( Class [] ca ) { if ( interfaces == null ) interfaces = new Hashtable(); // Make a hash of the interface hashcodes in order to cache them int hash = 21; for(int i=0; i<ca.length; i++) hash *= ca[i].hashCode() + 3; Object hashKey = new Integer(hash); Object interf = interfaces.get( hashKey ); if ( interf == null ) { ClassLoader classLoader = ca[0].getClassLoader(); // ? interf = Proxy.newProxyInstance( classLoader, ca, invocationHandler ); interfaces.put( hashKey, interf ); } return interf; }
Vulnerability Classification: - CWE: CWE-19 - CVE: CVE-2016-2510 - Severity: MEDIUM - CVSS Score: 6.8 Description: Avoid (de)serialization of XThis.Handler Function: getInterface File: src/bsh/XThis.java Repository: beanshell Fixed Code: public Object getInterface( Class [] ca ) { if ( interfaces == null ) interfaces = new Hashtable(); // Make a hash of the interface hashcodes in order to cache them int hash = 21; for(int i=0; i<ca.length; i++) hash *= ca[i].hashCode() + 3; Object hashKey = new Integer(hash); Object interf = interfaces.get( hashKey ); if ( interf == null ) { ClassLoader classLoader = ca[0].getClassLoader(); // ? interf = Proxy.newProxyInstance( classLoader, ca, invocationHandler ); interfaces.put( hashKey, interf ); } return interf; }
[ "CWE-19" ]
CVE-2016-2510
MEDIUM
6.8
beanshell
getInterface
src/bsh/XThis.java
1ccc66bb693d4e46a34a904db8eeff07808d2ced
1
Analyze the following code function for security vulnerabilities
@Override public final boolean isEmpty() { return size() == 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEmpty File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
isEmpty
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder comment(String comment);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: comment 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
comment
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void deleteAppWidgetLocked(Widget widget) { // We first unbind all services that are bound to this id unbindAppWidgetRemoteViewsServicesLocked(widget); Host host = widget.host; host.widgets.remove(widget); pruneHostLocked(host); mWidgets.remove(widget); Provider provider = widget.provider; if (provider != null) { provider.widgets.remove(widget); if (!provider.zombie) { // send the broacast saying that this appWidgetId has been deleted sendDeletedIntentLocked(widget); if (provider.widgets.isEmpty()) { // cancel the future updates cancelBroadcasts(provider); // send the broacast saying that the provider is not in use any more sendDisabledIntentLocked(provider); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteAppWidgetLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
deleteAppWidgetLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@TestApi public List<String> getOwnerInstalledCaCerts(@NonNull UserHandle user) { try { return mService.getOwnerInstalledCaCerts(user).getList(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOwnerInstalledCaCerts File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getOwnerInstalledCaCerts
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
int getMaxActivityShortcuts() { return mMaxShortcuts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxActivityShortcuts 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
getMaxActivityShortcuts
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
static void parseTags(String fragment, Set<String> tags) { if (ClickHouseChecker.isNullOrEmpty(fragment)) { return; } for (int i = 0, len = fragment.length(); i < len; i++) { int index = fragment.indexOf(',', i); if (index == i) { continue; } String tag; if (index < 0) { tag = fragment.substring(i).trim(); i = len; } else { tag = fragment.substring(i, index).trim(); i = index; } if (!tag.isEmpty()) { tags.add(tag); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTags File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
parseTags
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@Deprecated public int createUser(String xwikiname, Map<String, ?> map, String parent, String content, String userRights, XWikiContext context) throws XWikiException { return createUser(xwikiname, map, parent, content, Syntax.XWIKI_1_0.toIdString(), userRights, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createUser File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
createUser
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public static HttpRequest trace(final String destination) { return new HttpRequest() .method(HttpMethod.TRACE) .set(destination); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trace File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
trace
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Override public String getServiceProviderNameByClientIdExcludingFileBasedSPs(String clientId, String type, String tenantDomain) throws IdentityApplicationManagementException { String name = null; // invoking the listeners Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPreGetServiceProviderNameByClientIdExcludingFileBasedSPs(name, clientId, type, tenantDomain)) { return null; } } try { ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); name = appDAO.getServiceProviderNameByClientId(clientId, type, tenantDomain); } catch (Exception e) { String error = "Error occurred while retrieving the service provider for client id : " + clientId + ". " + e.getMessage(); throw new IdentityApplicationManagementException(error, e); } for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPostGetServiceProviderNameByClientIdExcludingFileBasedSPs(name, clientId, type, tenantDomain)) { return null; } } return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServiceProviderNameByClientIdExcludingFileBasedSPs File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getServiceProviderNameByClientIdExcludingFileBasedSPs
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
public void setMaxTableSize(int newSize) { this.newMaxHeaderSize = newSize; if (minNewMaxHeaderSize == -1) { minNewMaxHeaderSize = newSize; } else { minNewMaxHeaderSize = Math.min(newSize, minNewMaxHeaderSize); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxTableSize File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
setMaxTableSize
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override public void setTestDefaultCallRedirectionApp(String packageName) { try { Log.startSession("TSI.sTDCRA"); enforceModifyPermission(); if (!Build.IS_USERDEBUG) { throw new SecurityException("Test-only API."); } synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { mCallsManager.getRoleManagerAdapter().setTestDefaultCallRedirectionApp( packageName); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTestDefaultCallRedirectionApp File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
setTestDefaultCallRedirectionApp
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public boolean isGoingToNotificationShade() { return mLeaveOpenOnKeyguardHide; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGoingToNotificationShade 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
isGoingToNotificationShade
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public boolean isOnBranch() { return state.blobIdent.revision == null || getProject().getBranchRef(state.blobIdent.revision) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOnBranch File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
isOnBranch
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
private void removePackageFromSetLocked(final HashSet<String> set, final String packageName) { if (set.contains(packageName)) { // Found it. Remove this one package from the bookkeeping, and // if it's the last participating app under this uid we drop the // (now-empty) set as well. // Note that we deliberately leave it 'known' in the "ever backed up" // bookkeeping so that its current-dataset data will be retrieved // if the app is subsequently reinstalled if (MORE_DEBUG) Slog.v(TAG, " removing participant " + packageName); set.remove(packageName); mPendingBackups.remove(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePackageFromSetLocked File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
removePackageFromSetLocked
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private String cleanXSS(String value) { // You'll need to remove the spaces from the html entities below /* logger.info("InnXSS RequestWrapper ..............." + value); //value = value.replaceAll("<", "& lt;").replaceAll(">", "& gt;"); //value = value.replaceAll("\\(", "& #40;").replaceAll("\\)", "& #41;"); //value = value.replaceAll("'", "& #39;"); value = value.replaceAll("eval\\((.*)\\)", ""); value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\""); value = value.replaceAll("(?i)<script.*?>.*?<script.*?>", ""); value = value.replaceAll("(?i)<script.*?>.*?</script.*?>", ""); value = value.replaceAll("(?i)<.*?javascript:.*?>.*?</.*?>", ""); value = value.replaceAll("(?i)<.*?\\s+on.*?>.*?</.*?>", ""); //value = value.replaceAll("<script>", ""); //value = value.replaceAll("</script>", ""); logger.info("OutnXSS RequestWrapper ........ value ......." + value);*/ return HtmlUtils.htmlEscape(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanXSS File: sm-shop/src/main/java/com/salesmanager/shop/filter/XssHttpServletRequestWrapper.java Repository: shopizer-ecommerce/shopizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
cleanXSS
sm-shop/src/main/java/com/salesmanager/shop/filter/XssHttpServletRequestWrapper.java
197f8c78c8f673b957e41ca2c823afc654c19271
0
Analyze the following code function for security vulnerabilities
protected void muteConversationDialog(final Conversation conversation) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.disable_notifications); final int[] durations = getResources().getIntArray(R.array.mute_options_durations); final CharSequence[] labels = new CharSequence[durations.length]; for (int i = 0; i < durations.length; ++i) { if (durations[i] == -1) { labels[i] = getString(R.string.until_further_notice); } else { labels[i] = TimeframeUtils.resolve(activity, 1000L * durations[i]); } } builder.setItems(labels, (dialog, which) -> { final long till; if (durations[which] == -1) { till = Long.MAX_VALUE; } else { till = System.currentTimeMillis() + (durations[which] * 1000); } conversation.setMutedTill(till); activity.xmppConnectionService.updateConversation(conversation); activity.onConversationsListItemUpdated(); refresh(); getActivity().invalidateOptionsMenu(); }); builder.create().show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: muteConversationDialog File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
muteConversationDialog
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private native boolean pinReplyNative(byte[] address, boolean accept, int len, byte[] pin);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pinReplyNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
pinReplyNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public final void setImageParams(Map<String, Jiffle.ImageRole> params) { imageParams.clear(); imageParams.putAll(params); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setImageParams File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
setImageParams
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private void applyProfileRestrictionsIfDeviceOwnerLocked() { final int doUserId = mOwners.getDeviceOwnerUserId(); if (doUserId == UserHandle.USER_NULL) { if (VERBOSE_LOG) Slogf.d(LOG_TAG, "No DO found, skipping application of restriction."); return; } for (UserInfo userInfo : mUserManager.getUsers()) { UserHandle userHandle = userInfo.getUserHandle(); // Based on CDD : https://source.android.com/compatibility/12/android-12-cdd#95_multi-user_support, // creation of clone profile is not allowed in case device owner is set. // Enforcing this restriction on setting up of device owner. if (!mUserManager.hasUserRestriction( UserManager.DISALLOW_ADD_CLONE_PROFILE, userHandle)) { mUserManager.setUserRestriction(UserManager.DISALLOW_ADD_CLONE_PROFILE, true, userHandle); } // Creation of managed profile is restricted in case device owner is set, enforcing this // restriction by setting user level restriction at time of device owner setup. if (!mUserManager.hasUserRestriction( UserManager.DISALLOW_ADD_MANAGED_PROFILE, userHandle)) { mUserManager.setUserRestriction(UserManager.DISALLOW_ADD_MANAGED_PROFILE, true, userHandle); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyProfileRestrictionsIfDeviceOwnerLocked 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
applyProfileRestrictionsIfDeviceOwnerLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private int updateLruProcessInternalLocked(ProcessRecord app, long now, int index, String what, Object obj, ProcessRecord srcApp) { app.lastActivityTime = now; if (app.activities.size() > 0 || app.recentTasks.size() > 0) { // Don't want to touch dependent processes that are hosting activities. return index; } int lrui = mLruProcesses.lastIndexOf(app); if (lrui < 0) { Slog.wtf(TAG, "Adding dependent process " + app + " not on LRU list: " + what + " " + obj + " from " + srcApp); return index; } if (lrui >= index) { // Don't want to cause this to move dependent processes *back* in the // list as if they were less frequently used. return index; } if (lrui >= mLruProcessActivityStart) { // Don't want to touch dependent processes that are hosting activities. return index; } mLruProcesses.remove(lrui); if (index > 0) { index--; } if (DEBUG_LRU) Slog.d(TAG_LRU, "Moving dep from " + lrui + " to " + index + " in LRU list: " + app); mLruProcesses.add(index, app); return index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLruProcessInternalLocked 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
updateLruProcessInternalLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
ProcessRecord valueAt(int index) { return mPidMap.valueAt(index); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: valueAt 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
valueAt
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public boolean enterPictureInPictureMode(IBinder token, final PictureInPictureParams params) { final long origId = Binder.clearCallingIdentity(); try { synchronized(this) { final ActivityRecord r = ensureValidPictureInPictureActivityParamsLocked( "enterPictureInPictureMode", token, params); // If the activity is already in picture in picture mode, then just return early if (isInPictureInPictureMode(r)) { return true; } // Activity supports picture-in-picture, now check that we can enter PiP at this // point, if it is if (!r.checkEnterPictureInPictureState("enterPictureInPictureMode", false /* beforeStopping */)) { return false; } final Runnable enterPipRunnable = () -> { // Only update the saved args from the args that are set r.pictureInPictureArgs.copyOnlySet(params); final float aspectRatio = r.pictureInPictureArgs.getAspectRatio(); final List<RemoteAction> actions = r.pictureInPictureArgs.getActions(); // Adjust the source bounds by the insets for the transition down final Rect sourceBounds = new Rect(r.pictureInPictureArgs.getSourceRectHint()); mStackSupervisor.moveActivityToPinnedStackLocked(r, sourceBounds, aspectRatio, "enterPictureInPictureMode"); final PinnedActivityStack stack = r.getStack(); stack.setPictureInPictureAspectRatio(aspectRatio); stack.setPictureInPictureActions(actions); MetricsLoggerWrapper.logPictureInPictureEnter(mContext, r.appInfo.uid, r.shortComponentName, r.supportsEnterPipOnTaskSwitch); logPictureInPictureArgs(params); }; if (isKeyguardLocked()) { // If the keyguard is showing or occluded, then try and dismiss it before // entering picture-in-picture (this will prompt the user to authenticate if the // device is currently locked). try { dismissKeyguard(token, new KeyguardDismissCallback() { @Override public void onDismissSucceeded() throws RemoteException { mHandler.post(enterPipRunnable); } }, null /* message */); } catch (RemoteException e) { // Local call } } else { // Enter picture in picture immediately otherwise enterPipRunnable.run(); } return true; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enterPictureInPictureMode 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
enterPictureInPictureMode
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public boolean processLogin(SecurityRequestWrapper request, HttpServletResponse response) throws Exception { return processLogin(request, response, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processLogin File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
processLogin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/user/impl/xwiki/MyFormAuthenticator.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
@Transactional public void removeShares(PanelShareRemoveRequest removeRequest) { String panelId = removeRequest.getPanelId(); PanelGroup panelGroup = panelGroupMapper.selectByPrimaryKey(panelId); extPanelShareMapper.removeShares(removeRequest); SysLogConstants.SOURCE_TYPE targetType = buiType(removeRequest.getType()); DeLogUtils.save(SysLogConstants.OPERATE_TYPE.UNSHARE, SysLogConstants.SOURCE_TYPE.PANEL, panelId, panelGroup.getPid(), removeRequest.getTargetId(), targetType); AuthURD sharedAuthURD = new AuthURD(); List<Long> removeIds = new ArrayList<Long>() {{ add(removeRequest.getTargetId()); }}; buildRedAuthURD(removeRequest.getType(), removeIds, sharedAuthURD); CurrentUserDto user = AuthUtils.getUser(); Gson gson = new Gson(); String msg = panelGroup.getName(); List<String> msgParam = new ArrayList<>(); msgParam.add(panelId); Set<Long> redIds = AuthUtils.userIdsByURD(sharedAuthURD); redIds.forEach(userId -> { if (!user.getUserId().equals(userId)) { DeMsgutil.sendMsg(userId, 3L, user.getNickName() + " 取消分享了仪表板【" + msg + "】,请查收!", gson.toJson(msgParam)); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeShares File: backend/src/main/java/io/dataease/service/panel/ShareService.java Repository: dataease The code follows secure coding practices.
[ "CWE-639" ]
CVE-2023-32310
HIGH
8.1
dataease
removeShares
backend/src/main/java/io/dataease/service/panel/ShareService.java
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
0
Analyze the following code function for security vulnerabilities
private void updateList(List<ServiceInfo> services) { final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); final int managedProfileId = Utils.getManagedProfileId(um, UserHandle.myUserId()); final PreferenceScreen screen = getPreferenceScreen(); final PreferenceCategory allowedCategory = screen.findPreference(ALLOWED_KEY); allowedCategory.removeAll(); final PreferenceCategory notAllowedCategory = screen.findPreference(NOT_ALLOWED_KEY); notAllowedCategory.removeAll(); services.sort(new PackageItemInfo.DisplayNameComparator(mPm)); for (ServiceInfo service : services) { final ComponentName cn = new ComponentName(service.packageName, service.name); CharSequence title = null; try { title = mPm.getApplicationInfoAsUser( service.packageName, 0, UserHandle.myUserId()).loadLabel(mPm); } catch (PackageManager.NameNotFoundException e) { // unlikely, as we are iterating over live services. Log.e(TAG, "can't find package name", e); } final AppPreference pref = new AppPreference(getPrefContext()); pref.setTitle(title); pref.setIcon(mIconDrawableFactory.getBadgedIcon(service, service.applicationInfo, UserHandle.getUserId(service.applicationInfo.uid))); pref.setKey(cn.flattenToString()); pref.setSummary(mBackend.getDeviceList(ICompanionDeviceManager.Stub.asInterface( ServiceManager.getService(Context.COMPANION_DEVICE_SERVICE)), com.android.settings.bluetooth.Utils.getLocalBtManager(mContext), service.packageName, UserHandle.myUserId())); if (managedProfileId != UserHandle.USER_NULL && !mDpm.isNotificationListenerServicePermitted( service.packageName, managedProfileId)) { pref.setSummary(mDpm.getResources().getString( WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED, () -> getString( R.string.work_profile_notification_access_blocked_summary))); } pref.setOnPreferenceClickListener(preference -> { final Bundle args = new Bundle(); args.putString(AppInfoBase.ARG_PACKAGE_NAME, cn.getPackageName()); args.putInt(AppInfoBase.ARG_PACKAGE_UID, service.applicationInfo.uid); Bundle extras = new Bundle(); extras.putString(Settings.EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME, cn.flattenToString()); new SubSettingLauncher(getContext()) .setDestination(NotificationAccessDetails.class.getName()) .setSourceMetricsCategory(getMetricsCategory()) .setTitleRes(R.string.manage_notification_access_title) .setArguments(args) .setExtras(extras) .setUserHandle(UserHandle.getUserHandleForUid(service.applicationInfo.uid)) .launch(); return true; }); pref.setKey(cn.flattenToString()); if (mNm.isNotificationListenerAccessGranted(cn)) { allowedCategory.addPreference(pref); } else { notAllowedCategory.addPreference(pref); } } highlightPreferenceIfNeeded(); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-35667 - Severity: HIGH - CVSS Score: 7.8 Description: Don't hide approved NLSes in Settings Note that an NLS that shouldn't be approvable (because its name is too long) but was already approved (either before the max length check was introduced, or through other means) will disappear from the list if the user revokes its access. This might be somewhat confusing, but since this is a very-edge case already it's fine. Bug: 282932362 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ff255c6eda1528f01a167a9a65b7f8e414d28584) Merged-In: I4c9faea68e6d16b1a4ec7f472b5433cac1704c06 Change-Id: I4c9faea68e6d16b1a4ec7f472b5433cac1704c06 Function: updateList File: src/com/android/settings/notification/NotificationAccessSettings.java Repository: android Fixed Code: @VisibleForTesting void updateList(List<ServiceInfo> services) { final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); final int managedProfileId = Utils.getManagedProfileId(um, UserHandle.myUserId()); final PreferenceScreen screen = getPreferenceScreen(); final PreferenceCategory allowedCategory = screen.findPreference(ALLOWED_KEY); allowedCategory.removeAll(); final PreferenceCategory notAllowedCategory = screen.findPreference(NOT_ALLOWED_KEY); notAllowedCategory.removeAll(); services.sort(new PackageItemInfo.DisplayNameComparator(mPm)); for (ServiceInfo service : services) { final ComponentName cn = new ComponentName(service.packageName, service.name); boolean isAllowed = mNm.isNotificationListenerAccessGranted(cn); if (!isAllowed && cn.flattenToString().length() > MAX_CN_LENGTH) { continue; } CharSequence title = null; try { title = mPm.getApplicationInfoAsUser( service.packageName, 0, UserHandle.myUserId()).loadLabel(mPm); } catch (PackageManager.NameNotFoundException e) { // unlikely, as we are iterating over live services. Log.e(TAG, "can't find package name", e); } final AppPreference pref = new AppPreference(getPrefContext()); pref.setTitle(title); pref.setIcon(mIconDrawableFactory.getBadgedIcon(service, service.applicationInfo, UserHandle.getUserId(service.applicationInfo.uid))); pref.setKey(cn.flattenToString()); pref.setSummary(mBackend.getDeviceList(ICompanionDeviceManager.Stub.asInterface( ServiceManager.getService(Context.COMPANION_DEVICE_SERVICE)), com.android.settings.bluetooth.Utils.getLocalBtManager(mContext), service.packageName, UserHandle.myUserId())); if (managedProfileId != UserHandle.USER_NULL && !mDpm.isNotificationListenerServicePermitted( service.packageName, managedProfileId)) { pref.setSummary(mDpm.getResources().getString( WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED, () -> getString( R.string.work_profile_notification_access_blocked_summary))); } pref.setOnPreferenceClickListener(preference -> { final Bundle args = new Bundle(); args.putString(AppInfoBase.ARG_PACKAGE_NAME, cn.getPackageName()); args.putInt(AppInfoBase.ARG_PACKAGE_UID, service.applicationInfo.uid); Bundle extras = new Bundle(); extras.putString(Settings.EXTRA_NOTIFICATION_LISTENER_COMPONENT_NAME, cn.flattenToString()); new SubSettingLauncher(getContext()) .setDestination(NotificationAccessDetails.class.getName()) .setSourceMetricsCategory(getMetricsCategory()) .setTitleRes(R.string.manage_notification_access_title) .setArguments(args) .setExtras(extras) .setUserHandle(UserHandle.getUserHandleForUid(service.applicationInfo.uid)) .launch(); return true; }); pref.setKey(cn.flattenToString()); if (isAllowed) { allowedCategory.addPreference(pref); } else { notAllowedCategory.addPreference(pref); } } highlightPreferenceIfNeeded(); }
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
updateList
src/com/android/settings/notification/NotificationAccessSettings.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
1
Analyze the following code function for security vulnerabilities
public static String getLinkTokenEmail(Context context, String bitstreamId , int itemID, String reqEmail, String reqName, boolean allfiles) throws SQLException { String base = ConfigurationManager.getProperty("dspace.url"); String specialLink = (new StringBuffer()).append(base).append( base.endsWith("/") ? "" : "/").append( "request-item").append("?step=" + RequestItemServlet.ENTER_TOKEN) .append("&token=") .append(getNewToken(context, Integer.parseInt(bitstreamId), itemID, reqEmail, reqName, allfiles)) .toString(); return specialLink; }
Vulnerability Classification: - CWE: CWE-601, CWE-79 - CVE: CVE-2022-31192 - Severity: MEDIUM - CVSS Score: 6.1 Description: [DS-4383] Request Item Servlet escape HTML Function: getLinkTokenEmail File: dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java Repository: DSpace Fixed Code: public static String getLinkTokenEmail(Context context, int bitstreamId , int itemID, String reqEmail, String reqName, boolean allfiles) throws SQLException { String base = ConfigurationManager.getProperty("dspace.url"); String specialLink = (new StringBuffer()).append(base).append( base.endsWith("/") ? "" : "/").append( "request-item").append("?step=" + RequestItemServlet.ENTER_TOKEN) .append("&token=") .append(getNewToken(context, bitstreamId, itemID, reqEmail, reqName, allfiles)) .toString(); return specialLink; }
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
getLinkTokenEmail
dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java
28eb8158210d41168a62ed5f9e044f754513bc37
1
Analyze the following code function for security vulnerabilities
@Override public boolean activitySupportsIntent(ComponentName component, Intent intent, String resolvedType) { synchronized (mPackages) { if (component.equals(mResolveComponentName)) { // The resolver supports EVERYTHING! return true; } PackageParser.Activity a = mActivities.mActivities.get(component); if (a == null) { return false; } for (int i=0; i<a.intents.size(); i++) { if (a.intents.get(i).match(intent.getAction(), resolvedType, intent.getScheme(), intent.getData(), intent.getCategories(), TAG) >= 0) { return true; } } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activitySupportsIntent File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
activitySupportsIntent
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String getAttachmentURL(String space, String page, String attachment, String action, String queryString) { return getURL(action, new String[] { space, page, attachment }, queryString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentURL File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getAttachmentURL
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setMaximumWidth(double pixels) { checkColumnIsAttached(); final double minwidth = getMinimumWidth(); if (pixels >= 0 && pixels < minwidth && minwidth >= 0) { throw new IllegalArgumentException("New maximum width (" + pixels + ") was less than minimum width (" + minwidth + ")"); } getState().maxWidth = pixels; getGrid().markAsDirty(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaximumWidth File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setMaximumWidth
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void setWindowOpaque(IBinder token, boolean isOpaque) { synchronized (mWindowMap) { setWindowOpaqueLocked(token, isOpaque); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWindowOpaque File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
setWindowOpaque
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void syncZentaoIssueAttachments(IssuesWithBLOBs issue) { List<String> znetaoAttachmentsName = new ArrayList<String>(); AttachmentRequest request = new AttachmentRequest(); request.setBelongType(AttachmentType.ISSUE.type()); request.setBelongId(issue.getId()); List<FileAttachmentMetadata> allMsAttachments = attachmentService.listMetadata(request); List<String> msAttachmentsName = allMsAttachments.stream().map(FileAttachmentMetadata::getName).collect(Collectors.toList()); Map bugInfo = zentaoClient.getBugById(issue.getPlatformId()); Object files = bugInfo.get("files"); Map<String, Object> zenFiles; if (files instanceof List && ((List) files).size() == 0) { zenFiles = null; } else { zenFiles = (Map) files; } // 同步禅道中新的附件 if (zenFiles != null) { for (String fileId : zenFiles.keySet()) { Map fileInfo = (Map) zenFiles.get(fileId); String filename = fileInfo.get("title").toString(); znetaoAttachmentsName.add(filename); if (!msAttachmentsName.contains(filename)) { try { byte[] bytes = zentaoClient.getAttachmentBytes(fileId); FileAttachmentMetadata fileAttachmentMetadata = attachmentService.saveAttachmentByBytes(bytes, AttachmentType.ISSUE.type(), issue.getId(), filename); AttachmentModuleRelation attachmentModuleRelation = new AttachmentModuleRelation(); attachmentModuleRelation.setAttachmentId(fileAttachmentMetadata.getId()); attachmentModuleRelation.setRelationId(issue.getId()); attachmentModuleRelation.setRelationType(AttachmentType.ISSUE.type()); attachmentModuleRelationMapper.insert(attachmentModuleRelation); } catch (Exception e) { LogUtil.error(e); } } } } // 删除禅道中不存在的附件 if (CollectionUtils.isNotEmpty(allMsAttachments)) { List<FileAttachmentMetadata> deleteMsAttachments = allMsAttachments.stream() .filter(msAttachment -> !znetaoAttachmentsName.contains(msAttachment.getName())).collect(Collectors.toList()); deleteMsAttachments.forEach(fileAttachmentMetadata -> { List<String> ids = List.of(fileAttachmentMetadata.getId()); AttachmentModuleRelationExample example = new AttachmentModuleRelationExample(); example.createCriteria().andAttachmentIdIn(ids).andRelationTypeEqualTo(AttachmentType.ISSUE.type()); // 删除MS附件及关联数据 attachmentService.deleteAttachmentByIds(ids); attachmentService.deleteFileAttachmentByIds(ids); attachmentModuleRelationMapper.deleteByExample(example); }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncZentaoIssueAttachments File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
syncZentaoIssueAttachments
test-track/backend/src/main/java/io/metersphere/service/issue/platform/ZentaoPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
private void findViews() { mScrollView = (ScrollView) findViewById(R.id.compose); mScrollView.setVisibility(View.VISIBLE); mCcBccButton = findViewById(R.id.add_cc_bcc); if (mCcBccButton != null) { mCcBccButton.setOnClickListener(this); } mCcBccView = (CcBccView) findViewById(R.id.cc_bcc_wrapper); mAttachmentsView = (AttachmentsView)findViewById(R.id.attachments); mTo = (RecipientEditTextView) findViewById(R.id.to); mTo.setOnKeyListener(mKeyListenerForSendShortcut); initializeRecipientEditTextView(mTo); mTo.setAlternatePopupAnchor(findViewById(R.id.compose_to_dropdown_anchor)); mCc = (RecipientEditTextView) findViewById(R.id.cc); mCc.setOnKeyListener(mKeyListenerForSendShortcut); initializeRecipientEditTextView(mCc); mBcc = (RecipientEditTextView) findViewById(R.id.bcc); mBcc.setOnKeyListener(mKeyListenerForSendShortcut); initializeRecipientEditTextView(mBcc); // TODO: add special chips text change watchers before adding // this as a text changed watcher to the to, cc, bcc fields. mSubject = (TextView) findViewById(R.id.subject); mSubject.setOnKeyListener(mKeyListenerForSendShortcut); mSubject.setOnEditorActionListener(this); mSubject.setOnFocusChangeListener(this); mQuotedTextView = (QuotedTextView) findViewById(R.id.quoted_text_view); mQuotedTextView.setRespondInlineListener(this); mBodyView = (EditText) findViewById(R.id.body); mBodyView.setOnKeyListener(mKeyListenerForSendShortcut); mBodyView.setOnFocusChangeListener(this); mFromStatic = findViewById(R.id.static_from_content); mFromStaticText = (TextView) findViewById(R.id.from_account_name); mFromSpinnerWrapper = findViewById(R.id.spinner_from_content); mFromSpinner = (FromAddressSpinner) findViewById(R.id.from_picker); // Bottom placeholder to forward click events to the body findViewById(R.id.composearea_tap_trap_bottom).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mBodyView.requestFocus(); mBodyView.setSelection(mBodyView.getText().length()); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findViews 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
findViews
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
protected Clob makeClob(long oid) throws SQLException { return new PgClob(connection, oid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeClob 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
makeClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private WifiConfiguration getConfiguredNetworkWithoutMasking(String configKey) { WifiConfiguration config = getInternalConfiguredNetwork(configKey); if (config == null) { return null; } return new WifiConfiguration(config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredNetworkWithoutMasking File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getConfiguredNetworkWithoutMasking
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public void saveSingleFileToServe(String fileName, String content) { Path uploadPath = Paths.get(staticDir.toString(), fileName); try { if (uploadPath.toFile().exists()) { LogUtil.info("file exists"); } else { if (StringUtils.isNotEmpty(content)) { Files.createFile(uploadPath); FileCopyUtils.copy(Base64Decoder.decode(content), Files.newOutputStream(uploadPath)); } } } catch (Exception e) { LogUtil.error("template static resource save error" + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveSingleFileToServe File: core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java Repository: dataease The code follows secure coding practices.
[ "CWE-434" ]
CVE-2023-40183
MEDIUM
5.3
dataease
saveSingleFileToServe
core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java
826513053146721a2b3e09a9c9d3ea41f8f10569
0
Analyze the following code function for security vulnerabilities
@Override public Jooby onStart(final Throwing.Runnable callback) { LifeCycle.super.onStart(callback); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStart File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
onStart
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static boolean isAmqpTextMessage(Map<String, Object> hdrs) { boolean isTextMessage = false; if(hdrs != null) { Object headerJMSType = hdrs.get("JMSType"); isTextMessage = (headerJMSType != null && "TextMessage".equals(headerJMSType.toString())); } return isTextMessage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAmqpTextMessage 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
isAmqpTextMessage
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0