instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private boolean isLegacyPolicyVisibility() { return (mPolicyVisibility & LEGACY_POLICY_VISIBILITY) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLegacyPolicyVisibility 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
isLegacyPolicyVisibility
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public static int getTotalDates(Structure structure) { String typeField = Field.FieldType.DATE.toString(); int intDate = getTotals(structure,typeField); typeField = Field.FieldType.DATE_TIME.toString(); int intDateTime = getTotals(structure,typeField); return intDate + intDateTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTotalDates File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getTotalDates
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
void revertAndEndBackup() { if (MORE_DEBUG) Slog.i(TAG, "Reverting backup queue - restaging everything"); addBackupTrace("transport error; reverting"); // We want to reset the backup schedule based on whatever the transport suggests // by way of retry/backoff time. long delay; try { delay = mTransport.requestBackupTime(); } catch (Exception e) { Slog.w(TAG, "Unable to contact transport for recommended backoff"); delay = 0; // use the scheduler's default } KeyValueBackupJob.schedule(mContext, delay); for (BackupRequest request : mOriginalQueue) { dataChangedImpl(request.packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revertAndEndBackup 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
revertAndEndBackup
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private void inflateEmptyShadeView() { mEmptyShadeView = (EmptyShadeView) LayoutInflater.from(mContext).inflate( R.layout.status_bar_no_notifications, mStackScroller, false); mStackScroller.setEmptyShadeView(mEmptyShadeView); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inflateEmptyShadeView 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
inflateEmptyShadeView
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static ByteSink asByteSink(File file, FileWriteMode... modes) { return new FileByteSink(file, modes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asByteSink File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
asByteSink
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
private void sendNotificationAccountUpdated(Account account, UserAccounts accounts) { Map<String, Integer> packagesToVisibility = getRequestingPackages(account, accounts); for (Entry<String, Integer> packageToVisibility : packagesToVisibility.entrySet()) { if ((packageToVisibility.getValue() != AccountManager.VISIBILITY_NOT_VISIBLE) && (packageToVisibility.getValue() != AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE)) { notifyPackage(packageToVisibility.getKey(), accounts); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendNotificationAccountUpdated 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
sendNotificationAccountUpdated
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Test(description = "Test and run a module which has a module name contains period. eg: foo.bar") public void testBuildAndRunModuleWithPeriod() throws BallerinaTestException { // Test ballerina init Path projectPath = tempProjectDirectory.resolve("buildAndRunModuleWithPeriodProject"); // Create project balClient.runMain("new", new String[] { "buildAndRunModuleWithPeriodProject" }, envVariables, new String[] {}, new LogLeecher[] {}, projectPath.getParent().toString()); Assert.assertTrue(Files.exists(projectPath)); Assert.assertTrue(Files.isDirectory(projectPath)); // Create module named `foo.bar` String moduleName = "foo.bar"; balClient.runMain("add", new String[] { moduleName }, envVariables, new String[] {}, new LogLeecher[] {}, projectPath.toString()); Assert.assertTrue(Files.exists(projectPath.resolve("src").resolve(moduleName))); Assert.assertTrue(Files.isDirectory(projectPath.resolve("src").resolve(moduleName))); // Build module LogLeecher buildLeecher = new LogLeecher("[pass] testFunction"); balClient.runMain("build", new String[] { "-c", "-a" }, envVariables, new String[] {}, new LogLeecher[] { buildLeecher }, projectPath.toString()); buildLeecher.waitForText(60000); // Run module LogLeecher runLeecher = new LogLeecher("Hello World!"); balClient.runMain("run", new String[] { moduleName }, envVariables, new String[] {}, new LogLeecher[] { runLeecher }, projectPath.toString()); buildLeecher.waitForText(5000); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testBuildAndRunModuleWithPeriod File: tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
testBuildAndRunModuleWithPeriod
tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PackagingTestCase.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
public static final String getRevision() { return "a"; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2022-29784 - Severity: MEDIUM - CVSS Score: 5.0 Description: 安全漏洞修复 感谢 姜洋-长亭科技 Function: getRevision File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java Repository: sanluan/PublicCMS Fixed Code: public static final String getRevision() { return "b"; }
[ "CWE-Other" ]
CVE-2022-29784
MEDIUM
5
sanluan/PublicCMS
getRevision
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
1
Analyze the following code function for security vulnerabilities
public SVNLogFilter createSVNLogFilter() { return new DefaultSVNLogFilter(getExcludedRegionsPatterns(), getIncludedRegionsPatterns(), getExcludedUsersNormalized(), getExcludedRevprop(), getExcludedCommitMessagesPatterns(), isIgnoreDirPropChanges()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createSVNLogFilter File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
createSVNLogFilter
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public void incrementUpvotes() { if (this.upvotes == null) { this.upvotes = 1L; } else { this.upvotes = this.upvotes + 1L; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementUpvotes 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
incrementUpvotes
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static NativeObject jsFunction_createApplicationKeys(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws ScriptException, APIManagementException { if (args != null && args.length > 7) { try { String userId = (String) args[0]; String applicationName =(String) args[1]; String tokenType = (String) args[2]; String tokenScope = (String) args[6]; String groupingId = (String) args[7]; Map<String, String> keyDetails = getAPIConsumer(thisObj).completeApplicationRegistration(userId, applicationName, tokenType, tokenScope, groupingId); NativeObject object = new NativeObject(); if (keyDetails != null) { Iterator<Map.Entry<String, String>> entryIterator = keyDetails.entrySet().iterator(); Map.Entry<String, String> entry = null; while (entryIterator.hasNext()) { entry = entryIterator.next(); object.put(entry.getKey(), object, entry.getValue()); } boolean isRegenarateOptionEnabled = true; if (getApplicationAccessTokenValidityPeriodInSeconds() < 0) { isRegenarateOptionEnabled = false; } object.put("enableRegenarate", object, isRegenarateOptionEnabled); } return object; } catch (APIManagementException e) { String msg = "Error while obtaining the application access token for the application:" + args[1]; log.error(msg, e); throw new ScriptException(msg, e); } } else { handleException("Invalid input parameters."); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_createApplicationKeys File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_createApplicationKeys
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public static void noSpace(String string) throws JSONException { int i, length = string.length(); if (length == 0) { throw new JSONException("Empty string."); } for (i = 0; i < length; i += 1) { if (Character.isWhitespace(string.charAt(i))) { throw new JSONException("'" + string + "' contains a space character."); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noSpace File: src/main/java/org/json/XML.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45688
HIGH
7.5
stleary/JSON-java
noSpace
src/main/java/org/json/XML.java
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
0
Analyze the following code function for security vulnerabilities
public static String getScheme(HttpServletRequest request) { if (null != request) { String scheme = request.getHeader("X-Forwarded-Proto"); if ("https".equals(scheme) || "http".equals(scheme)) { return scheme; } else { return request.getScheme(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getScheme File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getScheme
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
public Jooby caseSensitiveRouting(boolean enabled) { this.caseSensitiveRouting = enabled; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: caseSensitiveRouting 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
caseSensitiveRouting
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private @PersonalAppsSuspensionReason int makeSuspensionReasons( boolean explicit, boolean timeout) { int result = PERSONAL_APPS_NOT_SUSPENDED; if (explicit) { result |= PERSONAL_APPS_SUSPENDED_EXPLICITLY; } if (timeout) { result |= PERSONAL_APPS_SUSPENDED_PROFILE_TIMEOUT; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeSuspensionReasons File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
makeSuspensionReasons
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private String getJobToken() { String jobToken = Job.getToken(request); if (jobToken != null) return jobToken; else throw new GeneralException("Job token is expected"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJobToken File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21243
HIGH
7.5
theonedev/onedev
getJobToken
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesResource.java
9637fc8fa461c5777282a0021c3deb1e7a48f137
0
Analyze the following code function for security vulnerabilities
static boolean signaturesMatch(Signature[] storedSigs, PackageInfo target) { if (target == null) { return false; } // If the target resides on the system partition, we allow it to restore // data from the like-named package in a restore set even if the signatures // do not match. (Unlike general applications, those flashed to the system // partition will be signed with the device's platform certificate, so on // different phones the same system app will have different signatures.) if ((target.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { if (MORE_DEBUG) Slog.v(TAG, "System app " + target.packageName + " - skipping sig check"); return true; } // Allow unsigned apps, but not signed on one device and unsigned on the other // !!! TODO: is this the right policy? Signature[] deviceSigs = target.signatures; if (MORE_DEBUG) Slog.v(TAG, "signaturesMatch(): stored=" + storedSigs + " device=" + deviceSigs); if ((storedSigs == null || storedSigs.length == 0) && (deviceSigs == null || deviceSigs.length == 0)) { return true; } if (storedSigs == null || deviceSigs == null) { return false; } // !!! TODO: this demands that every stored signature match one // that is present on device, and does not demand the converse. // Is this this right policy? int nStored = storedSigs.length; int nDevice = deviceSigs.length; for (int i=0; i < nStored; i++) { boolean match = false; for (int j=0; j < nDevice; j++) { if (storedSigs[i].equals(deviceSigs[j])) { match = true; break; } } if (!match) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signaturesMatch 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
signaturesMatch
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public Node getPreviousSibling() { return doc.getPreviousSibling(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreviousSibling File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getPreviousSibling
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
private void dispatchDemoCommandToView(String command, Bundle args, int id) { if (mStatusBarView == null) return; View v = mStatusBarView.findViewById(id); if (v instanceof DemoMode) { ((DemoMode)v).dispatchDemoCommand(command, args); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchDemoCommandToView 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
dispatchDemoCommandToView
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public List<String> getTraceLogs() { return traceLogs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTraceLogs File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
getTraceLogs
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
@Override public DTDHandler getDTDHandler() { return saxDTDHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDTDHandler File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
getDTDHandler
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
@Override public void setDefaultDialerApplication(String packageName) { if (!mHasFeature || !mHasTelephonyFeature) { return; } final CallerIdentity caller = getCallerIdentity(); final int callerUserId = caller.getUserId(); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller)); mInjector.binderWithCleanCallingIdentity(() -> { CompletableFuture<Void> future = new CompletableFuture<>(); Consumer<Boolean> callback = successful -> { if (successful) { future.complete(null); } else { future.completeExceptionally(new IllegalArgumentException( packageName + " cannot be set as the dialer")); } }; mRoleManager.addRoleHolderAsUser( RoleManager.ROLE_DIALER, packageName, 0, UserHandle.of(callerUserId), AsyncTask.THREAD_POOL_EXECUTOR, callback); try { future.get(20, TimeUnit.SECONDS); } catch (TimeoutException e) { throw new IllegalArgumentException("Timeout when setting the app as the dialer", e); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof IllegalArgumentException) { throw (IllegalArgumentException) cause; } else { throw new IllegalStateException(cause); } } }); // Only save the package when the setting the role succeeded without exception. synchronized (getLockObject()) { if (isManagedProfile(callerUserId)) { mInjector.binderWithCleanCallingIdentity( () -> updateDialerAndSmsManagedShortcutsOverrideCache()); } final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(callerUserId); if (!Objects.equals(admin.mDialerPackage, packageName)) { admin.mDialerPackage = packageName; saveSettingsLocked(callerUserId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultDialerApplication 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
setDefaultDialerApplication
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void putStringForUser(ContentResolver resolver, String name, String value, int userHandle) { Settings.Secure.putStringForUser(resolver, name, value, userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putStringForUser 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
putStringForUser
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
@Override public TailPrettyLoggable<String, LogWatch> sinceTime(String sinceTimestamp) { return new PodOperationsImpl(getContext().withSinceTimestamp(sinceTimestamp)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sinceTime File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
sinceTime
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
private native void nativeSetActiveNavigationEntryTitleForUrl(long nativeTabAndroid, String url, String title);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeSetActiveNavigationEntryTitleForUrl File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeSetActiveNavigationEntryTitleForUrl
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public Jooby onStarted(final Throwing.Consumer<Registry> callback) { requireNonNull(callback, "Callback is required."); onStarted.add(callback); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStarted 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
onStarted
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public String getNameForUid(int uid) { // reader synchronized (mPackages) { Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid)); if (obj instanceof SharedUserSetting) { final SharedUserSetting sus = (SharedUserSetting) obj; return sus.name + ":" + sus.userId; } else if (obj instanceof PackageSetting) { final PackageSetting ps = (PackageSetting) obj; return ps.name; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNameForUid 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
getNameForUid
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String getSpacePreference(String preferenceKey, SpaceReference spaceReference, String defaultValue, XWikiContext context) { XWikiDocument currentDocument = context.getDoc(); try { if (spaceReference != null) { context.setDoc(new XWikiDocument(new DocumentReference("WebPreferences", spaceReference))); } else if (currentDocument != null) { spaceReference = currentDocument.getDocumentReference().getLastSpaceReference(); } String result = getSpaceConfiguration().getProperty(preferenceKey, String.class); if (StringUtils.isEmpty(result)) { if (spaceReference == null) { result = getXWikiPreference(preferenceKey, defaultValue, context); } else if (spaceReference.getParent() instanceof SpaceReference) { result = getSpacePreference(preferenceKey, (SpaceReference) spaceReference.getParent(), defaultValue, context); } else if (spaceReference.getParent() instanceof WikiReference) { result = getXWikiPreference(preferenceKey, spaceReference.getParent().getName(), defaultValue, context); } } return result != null ? result : defaultValue; } finally { context.setDoc(currentDocument); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpacePreference 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
getSpacePreference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void setAdminCanGrantSensorsPermissionForUserUnchecked(@UserIdInt int userId, boolean canGrant) { Slogf.d(LOG_TAG, "setAdminCanGrantSensorsPermissionForUserUnchecked(%d, %b)", userId, canGrant); synchronized (getLockObject()) { ActiveAdmin owner = getDeviceOrProfileOwnerAdminLocked(userId); Preconditions.checkState( isDeviceOwner(owner) && owner.getUserHandle().getIdentifier() == userId, "May only be set on a the user of a device owner."); owner.mAdminCanGrantSensorsPermissions = canGrant; mPolicyCache.setAdminCanGrantSensorsPermissions(canGrant); saveSettingsLocked(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAdminCanGrantSensorsPermissionForUserUnchecked 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
setAdminCanGrantSensorsPermissionForUserUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void resendMessage(final Message message) { if (message.isFileOrImage()) { if (!(message.getConversation() instanceof Conversation)) { return; } final Conversation conversation = (Conversation) message.getConversation(); DownloadableFile file = activity.xmppConnectionService.getFileBackend().getFile(message); if (file.exists()) { final XmppConnection xmppConnection = conversation.getAccount().getXmppConnection(); if (!message.hasFileOnRemoteHost() && xmppConnection != null && !xmppConnection.getFeatures().httpUpload(message.getFileParams().size)) { activity.selectPresence(conversation, () -> { message.setCounterpart(conversation.getNextCounterpart()); activity.xmppConnectionService.resendFailedMessages(message); new Handler().post(() -> { int size = messageList.size(); this.binding.messagesView.setSelection(size - 1); }); }); return; } } else { Toast.makeText(activity, R.string.file_deleted, Toast.LENGTH_SHORT).show(); message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED)); activity.onConversationsListItemUpdated(); refresh(); return; } } activity.xmppConnectionService.resendFailedMessages(message); new Handler().post(() -> { int size = messageList.size(); this.binding.messagesView.setSelection(size - 1); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resendMessage 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
resendMessage
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public @Nullable Reader getNCharacterStream(String columnName) throws SQLException { return getNCharacterStream(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNCharacterStream 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
getNCharacterStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
void scheduleLaunchTaskBehindComplete(IBinder token) { mHandler.obtainMessage(LAUNCH_TASK_BEHIND_COMPLETE, token).sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleLaunchTaskBehindComplete File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
scheduleLaunchTaskBehindComplete
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public int getMinY() { if (HAS_MIN_Y) { return getWorld().getMinHeight(); } return super.getMinY(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMinY File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
getMinY
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = { "/read" }) public String actionRead(HttpServletRequest theServletRequest, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) { addCommonParams(theServletRequest, theRequest, theModel); CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); RuntimeResourceDefinition def; try { def = getResourceType(theRequest, theServletRequest); } catch (ServletException e) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError(e.toString(), e)); return "resource"; } String id = StringUtils.defaultString(theServletRequest.getParameter("id")); if (StringUtils.isBlank(id)) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError("No ID specified", null)); return "resource"; } ResultType returnsResource = ResultType.RESOURCE; String versionId = StringUtils.defaultString(theServletRequest.getParameter("vid")); String outcomeDescription; if (StringUtils.isBlank(versionId)) { versionId = null; outcomeDescription = "Read Resource"; } else { outcomeDescription = "VRead Resource"; } long start = System.currentTimeMillis(); try { IdDt resid = new IdDt(def.getName(), id, versionId); ourLog.info(logPrefix(theModel) + "Reading resource: {}", resid); if (resid.hasVersionIdPart()) { client.vread(def.getImplementingClass(), resid); } else { client.read(def.getImplementingClass(), resid); } } catch (Exception e) { returnsResource = handleClientException(client, e, theModel); } long delay = System.currentTimeMillis() - start; processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest); return "result"; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: actionRead File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir Fixed Code: @RequestMapping(value = { "/read" }) public String actionRead(HttpServletRequest theServletRequest, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) { addCommonParams(theServletRequest, theRequest, theModel); CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); RuntimeResourceDefinition def; try { def = getResourceType(theRequest, theServletRequest); } catch (ServletException e) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError(e.toString(), e)); return "resource"; } String id = sanitizeUrlPart(defaultString(theServletRequest.getParameter("id"))); if (StringUtils.isBlank(id)) { populateModelForResource(theServletRequest, theRequest, theModel); theModel.put("errorMsg", toDisplayError("No ID specified", null)); return "resource"; } ResultType returnsResource = ResultType.RESOURCE; String versionId = sanitizeUrlPart(defaultString(theServletRequest.getParameter("vid"))); String outcomeDescription; if (StringUtils.isBlank(versionId)) { versionId = null; outcomeDescription = "Read Resource"; } else { outcomeDescription = "VRead Resource"; } long start = System.currentTimeMillis(); try { IdDt resid = new IdDt(def.getName(), id, versionId); ourLog.info(logPrefix(theModel) + "Reading resource: {}", resid); if (resid.hasVersionIdPart()) { client.vread(def.getImplementingClass(), resid); } else { client.read(def.getImplementingClass(), resid); } } catch (Exception e) { returnsResource = handleClientException(client, e, theModel); } long delay = System.currentTimeMillis() - start; processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest); return "result"; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
actionRead
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
public static DiagnosticSeverity getNoGrammarSeverity(ContentModelSettings settings) { DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Hint; if (settings == null || settings.getValidation() == null) { return defaultSeverity; } XMLValidationSettings problems = settings.getValidation(); String noGrammar = problems.getNoGrammar(); if ("ignore".equalsIgnoreCase(noGrammar)) { // Ignore "noGrammar", return null. return null; } else if ("info".equalsIgnoreCase(noGrammar)) { return DiagnosticSeverity.Information; } else if ("warning".equalsIgnoreCase(noGrammar)) { return DiagnosticSeverity.Warning; } else if ("error".equalsIgnoreCase(noGrammar)) { return DiagnosticSeverity.Error; } return defaultSeverity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNoGrammarSeverity File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/settings/XMLValidationSettings.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-18213
MEDIUM
6.5
eclipse/lemminx
getNoGrammarSeverity
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/contentmodel/settings/XMLValidationSettings.java
c8bf3245a72cace50ee2aae5eee69538c58ce056
0
Analyze the following code function for security vulnerabilities
@Override public final void activityIdle(IBinder token, Configuration config, boolean stopProfiling) { final long origId = Binder.clearCallingIdentity(); synchronized (this) { ActivityStack stack = ActivityRecord.getStackLocked(token); if (stack != null) { ActivityRecord r = mStackSupervisor.activityIdleInternalLocked(token, false /* fromTimeout */, false /* processPausingActivities */, config); if (stopProfiling) { if ((mProfileProc == r.app) && mProfilerInfo != null) { clearProfilerLocked(); } } } } Binder.restoreCallingIdentity(origId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activityIdle 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
activityIdle
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public long write(final InputStream inputStream, final RASegmentOutputStream segmentOutputStream, final boolean close) { long bytesWritten = 0; try { try { bytesWritten = StreamUtil.streamToStream(inputStream, segmentOutputStream, close); } finally { try { // Ensure all streams are closed. if (segmentOutputStream != null) { segmentOutputStream.flush(); if (close) { segmentOutputStream.close(); } } } finally { if (close && inputStream != null) { inputStream.close(); } } } return bytesWritten; } catch (final IOException e) { throw new UncheckedIOException(e); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000651 - Severity: HIGH - CVSS Score: 7.5 Description: gh-813 Turn on secure processing feature for XML parsers etc Function: write File: stroom-core-server/src/main/java/stroom/streamstore/server/fs/serializable/RawInputSegmentWriter.java Repository: gchq/stroom Fixed Code: public long write(final InputStream inputStream, final RASegmentOutputStream segmentOutputStream, final boolean close) { long bytesWritten; try { try { bytesWritten = StreamUtil.streamToStream(inputStream, segmentOutputStream, close); } finally { try { // Ensure all streams are closed. if (segmentOutputStream != null) { segmentOutputStream.flush(); if (close) { segmentOutputStream.close(); } } } finally { if (close && inputStream != null) { inputStream.close(); } } } return bytesWritten; } catch (final IOException e) { throw new UncheckedIOException(e); } }
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
write
stroom-core-server/src/main/java/stroom/streamstore/server/fs/serializable/RawInputSegmentWriter.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
1
Analyze the following code function for security vulnerabilities
@Override public void setName(Group group, String name) throws SQLException { if (group.isPermanent()) { log.error("Attempt to rename permanent Group {} to {}.", group.getName(), name); throw new SQLException("Attempt to rename a permanent Group"); } else { group.setName(name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
setName
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
protected boolean isValidFragment(String fragmentName) { // Almost all fragments are wrapped in this, // except for a few that have their own activities. for (int i = 0; i < SettingsGateway.ENTRY_FRAGMENTS.length; i++) { if (SettingsGateway.ENTRY_FRAGMENTS[i].equals(fragmentName)) return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isValidFragment File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
isValidFragment
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
private CellIdentity getLastKnownCellIdentity() { TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); if (telephonyManager != null) { CellIdentity lastKnownCellIdentity = telephonyManager.getLastKnownCellIdentity(); try { mAppOpsManager.noteOp(AppOpsManager.OP_FINE_LOCATION, mContext.getPackageManager().getPackageUid( getComponentName().getPackageName(), 0), getComponentName().getPackageName()); } catch (PackageManager.NameNotFoundException nameNotFoundException) { Log.e(this, nameNotFoundException, "could not find the package -- %s", getComponentName().getPackageName()); } return lastKnownCellIdentity; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastKnownCellIdentity File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
getLastKnownCellIdentity
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public void setAllowAppSwitches(@NonNull String type, int uid, int userId) { synchronized (ActivityManagerService.this) { if (mUserController.isUserRunning(userId, ActivityManager.FLAG_OR_STOPPED)) { ArrayMap<String, Integer> types = mAllowAppSwitchUids.get(userId); if (types == null) { if (uid < 0) { return; } types = new ArrayMap<>(); mAllowAppSwitchUids.put(userId, types); } if (uid < 0) { types.remove(type); } else { types.put(type, uid); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowAppSwitches 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
setAllowAppSwitches
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void removeShortcutAsync(@NonNull final String... id) { Objects.requireNonNull(id); removeShortcutAsync(Arrays.asList(id)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeShortcutAsync File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
removeShortcutAsync
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public void setDpcDownloaded(boolean downloaded) { Preconditions.checkCallAuthorization(hasCallingOrSelfPermission( MANAGE_PROFILE_AND_DEVICE_OWNERS)); int setTo = downloaded ? 1 : 0; mInjector.binderWithCleanCallingIdentity(() -> Settings.Secure.putInt( mContext.getContentResolver(), MANAGED_PROVISIONING_DPC_DOWNLOADED, setTo)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDpcDownloaded 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
setDpcDownloaded
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void performIdleMaintenance() { if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SET_ACTIVITY_WATCHER); } synchronized (this) { final long now = SystemClock.uptimeMillis(); final long timeSinceLastIdle = now - mLastIdleTime; final long lowRamSinceLastIdle = getLowRamTimeSinceIdle(now); mLastIdleTime = now; mLowRamTimeSinceLastIdle = 0; if (mLowRamStartTime != 0) { mLowRamStartTime = now; } StringBuilder sb = new StringBuilder(128); sb.append("Idle maintenance over "); TimeUtils.formatDuration(timeSinceLastIdle, sb); sb.append(" low RAM for "); TimeUtils.formatDuration(lowRamSinceLastIdle, sb); Slog.i(TAG, sb.toString()); // If at least 1/3 of our time since the last idle period has been spent // with RAM low, then we want to kill processes. boolean doKilling = lowRamSinceLastIdle > (timeSinceLastIdle/3); for (int i = mLruProcesses.size() - 1 ; i >= 0 ; i--) { ProcessRecord proc = mLruProcesses.get(i); if (proc.notCachedSinceIdle) { if (proc.setProcState != ActivityManager.PROCESS_STATE_TOP_SLEEPING && proc.setProcState >= ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE && proc.setProcState <= ActivityManager.PROCESS_STATE_SERVICE) { if (doKilling && proc.initialIdlePss != 0 && proc.lastPss > ((proc.initialIdlePss*3)/2)) { sb = new StringBuilder(128); sb.append("Kill"); sb.append(proc.processName); sb.append(" in idle maint: pss="); sb.append(proc.lastPss); sb.append(", initialPss="); sb.append(proc.initialIdlePss); sb.append(", period="); TimeUtils.formatDuration(timeSinceLastIdle, sb); sb.append(", lowRamPeriod="); TimeUtils.formatDuration(lowRamSinceLastIdle, sb); Slog.wtfQuiet(TAG, sb.toString()); proc.kill("idle maint (pss " + proc.lastPss + " from " + proc.initialIdlePss + ")", true); } } } else if (proc.setProcState < ActivityManager.PROCESS_STATE_HOME) { proc.notCachedSinceIdle = true; proc.initialIdlePss = 0; proc.nextPssTime = ProcessList.computeNextPssTime(proc.curProcState, true, mTestPssMode, isSleeping(), now); } } mHandler.removeMessages(REQUEST_ALL_PSS_MSG); mHandler.sendEmptyMessageDelayed(REQUEST_ALL_PSS_MSG, 2*60*1000); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performIdleMaintenance File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
performIdleMaintenance
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
void initializeSendOrSave();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeSendOrSave 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
initializeSendOrSave
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@JsonProperty("RevokedBy") public String getRevokedBy() { return revokedBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevokedBy File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getRevokedBy
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public Rectangle getPageSizeWithRotation(PdfDictionary page) { Rectangle rect = getPageSize(page); int rotation = getPageRotation(page); while (rotation > 0) { rect = rect.rotate(); rotation -= 90; } return rect; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageSizeWithRotation File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getPageSizeWithRotation
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public void onLoadProgressChanged(int progress) { mContentsClient.onProgressChanged(progress); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLoadProgressChanged File: android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onLoadProgressChanged
android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setProjectNamingStrategy(ProjectNamingStrategy ns) { if(ns == null){ ns = DefaultProjectNamingStrategy.DEFAULT_NAMING_STRATEGY; } projectNamingStrategy = ns; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProjectNamingStrategy 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
setProjectNamingStrategy
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public void attachStack(int stackId, int displayId) { final long origId = Binder.clearCallingIdentity(); try { synchronized (mWindowMap) { final DisplayContent displayContent = mDisplayContents.get(displayId); if (displayContent != null) { TaskStack stack = mStackIdToStack.get(stackId); if (stack == null) { if (DEBUG_STACK) Slog.d(TAG, "attachStack: stackId=" + stackId); stack = new TaskStack(this, stackId); mStackIdToStack.put(stackId, stack); } stack.attachDisplayContent(displayContent); displayContent.attachStack(stack); moveStackWindowsLocked(displayContent); final WindowList windows = displayContent.getWindowList(); for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { windows.get(winNdx).reportResized(); } } } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachStack 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
attachStack
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void setAppFullscreen(IBinder token, boolean toOpaque) { synchronized (mWindowMap) { AppWindowToken atoken = findAppWindowToken(token); if (atoken != null) { atoken.appFullscreen = toOpaque; setWindowOpaqueLocked(token, toOpaque); requestTraversalLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAppFullscreen 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
setAppFullscreen
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override public void pulseWhileDozing(@NonNull PulseCallback callback, int reason) { mDozeScrimController.pulse(new PulseCallback() { @Override public void onPulseStarted() { callback.onPulseStarted(); Collection<HeadsUpManager.HeadsUpEntry> pulsingEntries = mHeadsUpManager.getAllEntries(); if (!pulsingEntries.isEmpty()) { // Only pulse the stack scroller if there's actually something to show. // Otherwise just show the always-on screen. setPulsing(pulsingEntries); } } @Override public void onPulseFinished() { callback.onPulseFinished(); setPulsing(null); } private void setPulsing(Collection<HeadsUpManager.HeadsUpEntry> pulsing) { mStackScroller.setPulsing(pulsing); mNotificationPanel.setPulsing(pulsing != null); mVisualStabilityManager.setPulsing(pulsing != null); } }, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pulseWhileDozing 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
pulseWhileDozing
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void removeContainerViewObserver(ContainerViewObserver observer) { mContainerViewObservers.removeObserver(observer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeContainerViewObserver File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
removeContainerViewObserver
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
@Override public void execute(String jobToken, JobContext jobContext) { AgentQuery parsedQeury = AgentQuery.parse(agentQuery, true); TaskLogger jobLogger = jobContext.getLogger(); OneDev.getInstance(ResourceManager.class).run(new AgentAwareRunnable() { @Override public void runOn(Long agentId, Session agentSession, AgentData agentData) { jobLogger.log(String.format("Executing job (executor: %s, agent: %s)...", getName(), agentData.getName())); jobContext.notifyJobRunning(agentId); List<Map<String, String>> registryLogins = new ArrayList<>(); for (RegistryLogin login: getRegistryLogins()) { registryLogins.add(CollectionUtils.newHashMap( "url", login.getRegistryUrl(), "userName", login.getUserName(), "password", login.getPassword())); } List<Map<String, Serializable>> services = new ArrayList<>(); for (Service service: jobContext.getServices()) services.add(service.toMap()); List<String> trustCertContent = getTrustCertContent(); DockerJobData jobData = new DockerJobData(jobToken, getName(), jobContext.getProjectPath(), jobContext.getProjectId(), jobContext.getCommitId().name(), jobContext.getBuildNumber(), jobContext.getActions(), jobContext.getRetried(), services, registryLogins, trustCertContent, getRunOptions()); try { WebsocketUtils.call(agentSession, jobData, 0); } catch (InterruptedException | TimeoutException e) { new Message(MessageType.CANCEL_JOB, jobToken).sendBy(agentSession); } } }, new HashMap<>(), parsedQeury, jobContext.getResourceRequirements(), jobLogger); }
Vulnerability Classification: - CWE: CWE-610 - CVE: CVE-2022-39206 - Severity: CRITICAL - CVSS Score: 9.9 Description: Fix the docker sock mount security vulnerability Function: execute File: server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java Repository: theonedev/onedev Fixed Code: @Override public void execute(String jobToken, JobContext jobContext) { AgentQuery parsedQeury = AgentQuery.parse(agentQuery, true); TaskLogger jobLogger = jobContext.getLogger(); OneDev.getInstance(ResourceManager.class).run(new AgentAwareRunnable() { @Override public void runOn(Long agentId, Session agentSession, AgentData agentData) { jobLogger.log(String.format("Executing job (executor: %s, agent: %s)...", getName(), agentData.getName())); jobContext.notifyJobRunning(agentId); List<Map<String, String>> registryLogins = new ArrayList<>(); for (RegistryLogin login: getRegistryLogins()) { registryLogins.add(CollectionUtils.newHashMap( "url", login.getRegistryUrl(), "userName", login.getUserName(), "password", login.getPassword())); } List<Map<String, Serializable>> services = new ArrayList<>(); for (Service service: jobContext.getServices()) services.add(service.toMap()); List<String> trustCertContent = getTrustCertContent(); DockerJobData jobData = new DockerJobData(jobToken, getName(), jobContext.getProjectPath(), jobContext.getProjectId(), jobContext.getCommitId().name(), jobContext.getBuildNumber(), jobContext.getActions(), jobContext.getRetried(), services, registryLogins, mountDockerSock, trustCertContent, getRunOptions()); try { WebsocketUtils.call(agentSession, jobData, 0); } catch (InterruptedException | TimeoutException e) { new Message(MessageType.CANCEL_JOB, jobToken).sendBy(agentSession); } } }, new HashMap<>(), parsedQeury, jobContext.getResourceRequirements(), jobLogger); }
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
execute
server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
1
Analyze the following code function for security vulnerabilities
public String getLocalUserName(String user, XWikiContext context) { if (hasCentralizedAuthentication(context)) { return getUserName(user, null, true, context); } else { return getUserName(user.substring(user.indexOf(':') + 1), null, true, context); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalUserName 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
getLocalUserName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void onDetach() { List<StateNode> nodes = new ArrayList<>(); visitNodeTreeBottomUp(nodes::add); nodes.forEach(StateNode::handleOnDetach); for (StateNode node : nodes) { if (node.hasBeenAttached) { node.hasBeenDetached = true; node.fireDetachListeners(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDetach File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
onDetach
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
public void sendVerificationEmail(Sysprop identifier, HttpServletRequest req) { if (identifier != null) { Map<String, Object> model = new HashMap<String, Object>(); Map<String, String> lang = getLang(req); String subject = Utils.formatMessage(lang.get("signin.welcome"), CONF.appName()); String body = getDefaultEmailSignature(CONF.emailsWelcomeText3(lang)); String token = Utils.base64encURL(Utils.generateSecurityToken().getBytes()); identifier.addProperty(Config._EMAIL_TOKEN, token); identifier.addProperty("confirmationTimestamp", Utils.timestamp()); pc.update(identifier); token = CONF.serverUrl() + CONF.serverContextPath() + SIGNINLINK + "/register?id=" + identifier.getCreatorid() + "&token=" + token; body = "<b><a href=\"" + token + "\">" + lang.get("signin.welcome.verify") + "</a></b><br><br>" + body; model.put("subject", escapeHtml(subject)); model.put("logourl", getSmallLogoUrl()); model.put("heading", lang.get("hello")); model.put("body", body); emailer.sendEmail(Arrays.asList(identifier.getId()), subject, compileEmailTemplate(model)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendVerificationEmail File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
sendVerificationEmail
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
static void logInfo(final HttpQuery query, final String msg) { LOG.info(query.channel().toString() + ' ' + msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logInfo File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
logInfo
src/tsd/GraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
0
Analyze the following code function for security vulnerabilities
public void rename(String newDocumentName, List<String> backlinkDocumentNames) throws XWikiException { rename(newDocumentName, backlinkDocumentNames, Collections.emptyList()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
rename
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public Page<E> setEndRow(long endRow) { this.endRow = endRow; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEndRow File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
setEndRow
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
@Override public ServerHttpRequest serverRequest() { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serverRequest File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
serverRequest
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
private Document getDocument(final InputStream input) throws SAXException { try { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); // get the dtd location final String dtdFile = "/games/strategy/engine/xml/" + DTD_FILE_NAME; final URL url = GameParser.class.getResource(dtdFile); if (url == null) { throw new RuntimeException(String.format("Map: %s, Could not find in classpath %s", mapName, dtdFile)); } final DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { @Override public void fatalError(final SAXParseException exception) { errorsSax.add(exception); } @Override public void error(final SAXParseException exception) { errorsSax.add(exception); } @Override public void warning(final SAXParseException exception) { errorsSax.add(exception); } }); final String dtdSystem = url.toExternalForm(); final String system = dtdSystem.substring(0, dtdSystem.length() - 8); return builder.parse(input, system); } catch (final IOException | ParserConfigurationException e) { throw new IllegalStateException("Error parsing: " + mapName, e); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000546 - Severity: MEDIUM - CVSS Score: 6.8 Description: Ensure XXE security Function: getDocument File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea Fixed Code: private Document getDocument(final InputStream input) throws SAXException { try { final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); // Not mandatory, but better than relying on the default implementation to prevent XXE factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); // get the dtd location final String dtdFile = "/games/strategy/engine/xml/" + DTD_FILE_NAME; final URL url = GameParser.class.getResource(dtdFile); if (url == null) { throw new RuntimeException(String.format("Map: %s, Could not find in classpath %s", mapName, dtdFile)); } final DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(new ErrorHandler() { @Override public void fatalError(final SAXParseException exception) { errorsSax.add(exception); } @Override public void error(final SAXParseException exception) { errorsSax.add(exception); } @Override public void warning(final SAXParseException exception) { errorsSax.add(exception); } }); final String dtdSystem = url.toExternalForm(); final String system = dtdSystem.substring(0, dtdSystem.length() - DTD_FILE_NAME.length()); return builder.parse(input, system); } catch (final IOException | ParserConfigurationException e) { throw new IllegalStateException("Error parsing: " + mapName, e); } }
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getDocument
game-core/src/main/java/games/strategy/engine/data/GameParser.java
e41eda46690989f03550315bbbfb833bbd28020c
1
Analyze the following code function for security vulnerabilities
public void onSetUp() throws Exception { databaseTester.onSetup(); pipelineTimeline.clearWhichIsEvilAndShouldNotBeUsedInRealWorld(); if (sqlMapClient != null) { for (Cache cache : sqlMapClient.getConfiguration().getCaches()) { cache.clear(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSetUp File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
onSetUp
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public JSONArray put(int index, Collection value) throws JSONException { put(index, new JSONArray(value)); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = "/repository/restful/artifact/PUT/*", method = RequestMethod.PUT) public ModelAndView putArtifact(@RequestParam("pipelineName") String pipelineName, @RequestParam("pipelineCounter") String pipelineCounter, @RequestParam("stageName") String stageName, @RequestParam(value = "stageCounter", required = false) String stageCounter, @RequestParam("buildName") String buildName, @RequestParam(value = "buildId", required = false) Long buildId, @RequestParam("filePath") String filePath, @RequestParam(value = "agentId", required = false) String agentId, HttpServletRequest request ) throws Exception { if (filePath.contains("..")) { return FileModelAndView.forbiddenUrl(filePath); } JobIdentifier jobIdentifier; try { jobIdentifier = restfulService.findJob(pipelineName, pipelineCounter, stageName, stageCounter, buildName, buildId); } catch (Exception e) { return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter, buildName); } if (isConsoleOutput(filePath)) { return putConsoleOutput(jobIdentifier, request.getInputStream()); } else { return putArtifact(jobIdentifier, filePath, request.getInputStream()); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-43289 - Severity: MEDIUM - CVSS Score: 5.0 Description: #000 - Validate stage counter during upload artifacts Function: putArtifact File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java Repository: gocd Fixed Code: @RequestMapping(value = "/repository/restful/artifact/PUT/*", method = RequestMethod.PUT) public ModelAndView putArtifact(@RequestParam("pipelineName") String pipelineName, @RequestParam("pipelineCounter") String pipelineCounter, @RequestParam("stageName") String stageName, @RequestParam(value = "stageCounter", required = false) String stageCounter, @RequestParam("buildName") String buildName, @RequestParam(value = "buildId", required = false) Long buildId, @RequestParam("filePath") String filePath, @RequestParam(value = "agentId", required = false) String agentId, HttpServletRequest request ) throws Exception { if (filePath.contains("..")) { return FileModelAndView.forbiddenUrl(filePath); } if (!isValidStageCounter(stageCounter)) { return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter, buildName); } JobIdentifier jobIdentifier; try { jobIdentifier = restfulService.findJob(pipelineName, pipelineCounter, stageName, stageCounter, buildName, buildId); } catch (Exception e) { return buildNotFound(pipelineName, pipelineCounter, stageName, stageCounter, buildName); } if (isConsoleOutput(filePath)) { return putConsoleOutput(jobIdentifier, request.getInputStream()); } else { return putArtifact(jobIdentifier, filePath, request.getInputStream()); } }
[ "CWE-22" ]
CVE-2021-43289
MEDIUM
5
gocd
putArtifact
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
c22e0428164af25d3e91baabd3f538a41cadc82f
1
Analyze the following code function for security vulnerabilities
@Test public void closeClientTwiceTenant(TestContext context) { PostgresClient c = PostgresClient.getInstance(vertx, TENANT); context.assertNotNull(c.getClient(), "getClient()"); c.closeClient(context.asyncAssertSuccess()); context.assertNull(c.getClient(), "getClient()"); c.closeClient(context.asyncAssertSuccess()); context.assertNull(c.getClient(), "getClient()"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeClientTwiceTenant File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
closeClientTwiceTenant
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public void onStorageVolumeMounted(@Nullable String volumeUuid, boolean fingerprintChanged) { mPermissionManagerServiceImpl.onStorageVolumeMounted(volumeUuid, fingerprintChanged); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStorageVolumeMounted File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
onStorageVolumeMounted
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private static boolean isAbleToLogin(String username, String password, String serverURL, String tenantDomain) throws APIManagementException { boolean loginStatus = false; //String serverURL = config.getFirstProperty(APIConstants.AUTH_MANAGER_URL); if (serverURL == null) { handleException("API key manager URL unspecified"); } try { AuthenticationAdminStub authAdminStub = new AuthenticationAdminStub(null, serverURL + "AuthenticationAdmin"); //String tenantDomain = MultitenantUtils.getTenantDomain(username); //update permission cache before validate user int tenantId = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager() .getTenantId(tenantDomain); PermissionUpdateUtil.updatePermissionTree(tenantId); String host = new URL(serverURL).getHost(); if (authAdminStub.login(username, password, host)) { loginStatus = true; } } catch (AxisFault axisFault) { log.error("Error while checking the ability to login", axisFault ); } catch (org.wso2.carbon.user.api.UserStoreException e) { log.error("Error while checking the ability to login", e ); } catch (MalformedURLException e) { log.error("Error while checking the ability to login", e); } catch (RemoteException e) { log.error("Error while checking the ability to login", e); } catch (LoginAuthenticationExceptionException e) { log.error("Error while checking the ability to login", e ); } return loginStatus; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAbleToLogin File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
isAbleToLogin
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof RemoteCacheKey)) return false; RemoteCacheKey that = (RemoteCacheKey) o; if (forceReturnValue != that.forceReturnValue) return false; return !(cacheName != null ? !cacheName.equals(that.cacheName) : that.cacheName != null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
equals
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestVisibleBehind File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
requestVisibleBehind
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public boolean dumpActivity(FileDescriptor fd, PrintWriter pw, String name, String[] args, int opti, boolean dumpAll, boolean dumpVisibleRootTasksOnly, boolean dumpFocusedRootTaskOnly, @UserIdInt int userId) { return ActivityTaskManagerService.this.dumpActivity(fd, pw, name, args, opti, dumpAll, dumpVisibleRootTasksOnly, dumpFocusedRootTaskOnly, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpActivity File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
dumpActivity
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public String getCoreConditionSQL(CoreCondition condition) { String columnSQL = getColumnSQL(condition.getColumn()); CoreFunctionType type = condition.getFunction(); Object[] params = condition.getParameters(); if (CoreFunctionType.IS_NULL.equals(type)) { return getIsNullConditionSQL(columnSQL); } if (CoreFunctionType.NOT_NULL.equals(type)) { return getNotNullConditionSQL(columnSQL); } if (CoreFunctionType.EQUALS_TO.equals(type)) { return getIsEqualsToConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.NOT_EQUALS_TO.equals(type)) { return getNotEqualsToConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.NOT_EQUALS_TO.equals(type)) { return getNotEqualsToConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.LIKE_TO.equals(type)) { return getLikeToConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.GREATER_THAN.equals(type)) { return getGreaterThanConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.GREATER_OR_EQUALS_TO.equals(type)) { return getGreaterOrEqualsConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.LOWER_THAN.equals(type)) { return getLowerThanConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.LOWER_OR_EQUALS_TO.equals(type)) { return getLowerOrEqualsConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.BETWEEN.equals(type)) { return getBetweenConditionSQL(columnSQL, params[0], params[1]); } if (CoreFunctionType.IN.equals(type)) { return getInConditionSQL(columnSQL, params[0]); } if (CoreFunctionType.NOT_IN.equals(type)) { return getNotInConditionSQL(columnSQL, params[0]); } throw new IllegalArgumentException("Core condition type not supported: " + type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCoreConditionSQL File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getCoreConditionSQL
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
public ApiClient setBasePath(String basePath) { this.basePath = basePath; setOauthBasePath(basePath); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBasePath File: samples/client/petstore/java/retrofit2-play26/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
setBasePath
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void execute() { try { transactionManager.run(new Runnable() { @Override public void run() { Date now = new Date(); for (Iterator<Map.Entry<Long, Date>> it = updateDates.entrySet().iterator(); it.hasNext();) { Map.Entry<Long, Date> entry = it.next(); if (now.getTime() - entry.getValue().getTime() > 60000) { Project project = get(entry.getKey()); if (project != null) project.setUpdateDate(entry.getValue()); it.remove(); } } } }); } catch (Exception e) { logger.error("Error flushing project update dates", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
execute
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public ApiClient setServerVariables(Map<String, String> serverVariables) { this.serverVariables = serverVariables; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerVariables File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setServerVariables
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
protected void shareLink(boolean http) { String uri = getShareableUri(http); if (uri == null || uri.isEmpty()) { return; } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_TEXT, getShareableUri(http)); try { startActivity(Intent.createChooser(intent, getText(R.string.share_uri_with))); } catch (ActivityNotFoundException e) { Toast.makeText(this, R.string.no_application_to_share_uri, Toast.LENGTH_SHORT).show(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shareLink File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
shareLink
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public void remQsTile(ComponentName tile) { mQSPanel.getHost().removeTile(tile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remQsTile 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
remQsTile
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public List<Delta> getContentDiff(String fromRev, XWikiContext context) throws XWikiException, DifferentiationFailedException { XWikiDocument revdoc = context.getWiki().getDocument(this, fromRev, context); return getContentDiff(revdoc, this, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentDiff File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getContentDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public void privateMsgInMuc(Conversation conversation, String nick) { switchToConversation(conversation, null, false, nick, true); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2018-18467 - Severity: MEDIUM - CVSS Score: 5.0 Description: Do not insert text shared over XMPP uri when already drafting message XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to directly share a message with a specific contact. Previously the text was always appended to the message currently in draft. The message was never send automatically. Essentially those links where treated like normal text share intents (for example when sharing a URL from the browser) but without the contact selection. There is a concern (CVE-2018-18467) that when this URI is invoked automatically and the user is currently drafting a long message to that particular contact the text could be inserted in the draft field (input box) without the user noticing. To circumvent that the text shared over XMPP uris that contain a particular contact is now appended only if the draft box is currently empty. Sharing text normally (**with** manual contact selection) is still treated the same; meaning the shared text will be appended to the current draft. This is intended behaviour to make the 'Hey I have this cool link here;' *open browser*, *share link* - secenario work. Function: privateMsgInMuc File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations Fixed Code: public void privateMsgInMuc(Conversation conversation, String nick) { switchToConversation(conversation, null, false, nick, true, false); }
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
privateMsgInMuc
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
1
Analyze the following code function for security vulnerabilities
public void refreshConfig() { Yaml yaml = new Yaml(); StringWriter writer = new StringWriter(); yaml.dump(configObj, writer); configStr = writer.toString(); try { Files.write(Paths.get("config.yaml"), configStr.getBytes(StandardCharsets.UTF_8)); Files.write(Paths.get(configPath), configStr.getBytes(StandardCharsets.UTF_8)); } catch (Exception ex) { ex.printStackTrace(); logger.error(ex); } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-41958 - Severity: HIGH - CVSS Score: 7.8 Description: yaml rce Function: refreshConfig File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray Fixed Code: public void refreshConfig() { Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); StringWriter writer = new StringWriter(); yaml.dump(configObj, writer); configStr = writer.toString(); try { Files.write(Paths.get("config.yaml"), configStr.getBytes(StandardCharsets.UTF_8)); Files.write(Paths.get(configPath), configStr.getBytes(StandardCharsets.UTF_8)); } catch (Exception ex) { ex.printStackTrace(); logger.error(ex); } }
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
refreshConfig
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
1
Analyze the following code function for security vulnerabilities
@Override public IActivityClientController getActivityClientController() { return mActivityClientController; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityClientController File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getActivityClientController
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private static void fullNavBar(HttpServletRequest request, String suffix, BaseDataInitVO baseDataInitVO) { List<LogNav> logNavList = baseDataInitVO.getLogNavs(); for (LogNav logNav : logNavList) { String url = logNav.get("url").toString(); if ("/".equals(url) && ("/all-1".equals(request.getRequestURI()) || (Constants.getArticleUri() + "all-1").equals(request.getRequestURI()))) { logNav.put("current", true); continue; } else if (url.startsWith("/")) { if (suffix.length() > 0 && url.length() == 1) { url = ""; } else { url = url.substring(1); } if (url.startsWith("/" + Constants.getArticleUri())) { url += suffix; } url = WebTools.getHomeUrlWithHost(request) + url; logNav.put("url", url); } logNav.put("current", ignoreScheme(request.getRequestURL().toString()).equals(ignoreScheme(url))); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fullNavBar File: web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
fullNavBar
web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
private boolean isImmersiveMode(int vis) { final int flags = View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; return mNavigationBar != null && (vis & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0 && (vis & flags) != 0 && canHideNavigationBar(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isImmersiveMode File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
isImmersiveMode
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public void setDocumentConversionService( DocumentConversionService documentConversionService) { this.documentConversionService = documentConversionService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDocumentConversionService File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
setDocumentConversionService
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
private Intent newRequestAccountAccessIntent(Account account, String packageName, int uid, RemoteCallback callback) { return newGrantCredentialsPermissionIntent(account, packageName, uid, new AccountAuthenticatorResponse(new IAccountAuthenticatorResponse.Stub() { @Override public void onResult(Bundle value) throws RemoteException { handleAuthenticatorResponse(true); } @Override public void onRequestContinued() { /* ignore */ } @Override public void onError(int errorCode, String errorMessage) throws RemoteException { handleAuthenticatorResponse(false); } private void handleAuthenticatorResponse(boolean accessGranted) throws RemoteException { cancelNotification(getCredentialPermissionNotificationId(account, AccountManager.ACCOUNT_ACCESS_TOKEN_TYPE, uid), UserHandle.getUserHandleForUid(uid)); if (callback != null) { Bundle result = new Bundle(); result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, accessGranted); callback.sendResult(result); } } }), AccountManager.ACCOUNT_ACCESS_TOKEN_TYPE, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newRequestAccountAccessIntent 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
newRequestAccountAccessIntent
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private void consumeMethodFrame(Frame f) throws IOException { if (f.type == AMQP.FRAME_METHOD) { this.method = AMQImpl.readMethodFrom(f.getInputStream()); this.state = this.method.hasContent() ? CAState.EXPECTING_CONTENT_HEADER : CAState.COMPLETE; } else { throw new UnexpectedFrameError(f, AMQP.FRAME_METHOD); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: consumeMethodFrame File: src/main/java/com/rabbitmq/client/impl/CommandAssembler.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
consumeMethodFrame
src/main/java/com/rabbitmq/client/impl/CommandAssembler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
private void resolveHostUidLocked(String pkg, int uid) { final int N = mHosts.size(); for (int i = 0; i < N; i++) { Host host = mHosts.get(i); if (host.id.uid == UNKNOWN_UID && pkg.equals(host.id.packageName)) { if (DEBUG) { Slog.i(TAG, "host " + host.id + " resolved to uid " + uid); } host.id = new HostId(uid, host.id.hostId, host.id.packageName); return; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveHostUidLocked 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
resolveHostUidLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public static void move(File from, File to) throws IOException { checkNotNull(from); checkNotNull(to); checkArgument(!from.equals(to), "Source %s and destination %s must be different", from, to); if (!from.renameTo(to)) { copy(from, to); if (!from.delete()) { if (!to.delete()) { throw new IOException("Unable to delete " + to); } throw new IOException("Unable to delete " + from); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: move File: android/guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
move
android/guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
private static String subtag(String full, String attribute) { int start = full.indexOf(attribute); if (start < 0) { return null; } start += attribute.length(); int end = full.indexOf(';', start); if (end < 0) { return full.substring(start); } else { return full.substring(start, end); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: subtag File: core/java/android/content/res/StringBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
subtag
core/java/android/content/res/StringBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Deprecated public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType, boolean isBodyNullable) throws ApiException { return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeAPI File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
invokeAPI
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean hasEditComment() { return this.xwiki.hasEditComment(this.context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasEditComment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
hasEditComment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
private void setTitleFromIntent(Intent intent) { Log.d(LOG_TAG, "Starting to set activity title"); final int initialTitleResId = intent.getIntExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1); if (initialTitleResId > 0) { mInitialTitle = null; mInitialTitleResId = initialTitleResId; final String initialTitleResPackageName = intent.getStringExtra( EXTRA_SHOW_FRAGMENT_TITLE_RES_PACKAGE_NAME); if (initialTitleResPackageName != null) { try { Context authContext = createPackageContextAsUser(initialTitleResPackageName, 0 /* flags */, new UserHandle(UserHandle.myUserId())); mInitialTitle = authContext.getResources().getText(mInitialTitleResId); setTitle(mInitialTitle); mInitialTitleResId = -1; return; } catch (NameNotFoundException e) { Log.w(LOG_TAG, "Could not find package" + initialTitleResPackageName); } } else { setTitle(mInitialTitleResId); } } else { mInitialTitleResId = -1; final String initialTitle = intent.getStringExtra(EXTRA_SHOW_FRAGMENT_TITLE); mInitialTitle = (initialTitle != null) ? initialTitle : getTitle(); setTitle(mInitialTitle); } Log.d(LOG_TAG, "Done setting title"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTitleFromIntent File: src/com/android/settings/SettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
setTitleFromIntent
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
public void save(Page page, int... expectedCodes) throws Exception { save(page, true, expectedCodes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save 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
save
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 Map<String, Object> find(int page, int pageSize) { Map<String, Object> data = new HashMap<>(); String sql = "select l.*,t.typeName,t.alias as typeAlias,u.userName,(select count(commentId) from " + Comment.TABLE_NAME + " where logId=l.logId) commentSize from " + TABLE_NAME + " l inner join user u inner join type t where rubbish=? and privacy=? and u.userId=l.userId and t.typeid=l.typeid order by l.logId desc limit ?,?"; data.put("rows", find(sql, rubbish, privacy, ParseUtil.getFirstRecord(page, pageSize), pageSize)); ModelUtil.fillPageData(this, page, pageSize, "from " + TABLE_NAME + " l inner join user u where rubbish=? and privacy=? and u.userId=l.userId ", data, new Object[]{rubbish, privacy}); return data; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: find File: data/src/main/java/com/zrlog/model/Log.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-17420
MEDIUM
6.5
94fzb/zrlog
find
data/src/main/java/com/zrlog/model/Log.java
157b8fbbb64eb22ddb52e7c5754e88180b7c3d4f
0
Analyze the following code function for security vulnerabilities
public ClientConfig getClientConfig() { return clientConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientConfig 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
getClientConfig
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 void generateData(Object itemId, Item item, JsonObject rowData) { RowReference row = new RowReference(Grid.this); row.set(itemId); if (rowStyleGenerator != null) { String style = rowStyleGenerator.getStyle(row); put(GridState.JSONKEY_ROWSTYLE, style, rowData); } if (rowDescriptionGenerator != null) { String description = rowDescriptionGenerator .getDescription(row); put(GridState.JSONKEY_ROWDESCRIPTION, description, rowData); } JsonObject cellStyles = Json.createObject(); JsonObject cellData = Json.createObject(); JsonObject cellDescriptions = Json.createObject(); CellReference cell = new CellReference(row); for (Column column : getColumns()) { cell.set(column.getPropertyId()); writeData(cell, cellData); writeStyles(cell, cellStyles); writeDescriptions(cell, cellDescriptions); } if (cellDescriptionGenerator != null && cellDescriptions.keys().length > 0) { rowData.put(GridState.JSONKEY_CELLDESCRIPTION, cellDescriptions); } if (cellStyleGenerator != null && cellStyles.keys().length > 0) { rowData.put(GridState.JSONKEY_CELLSTYLES, cellStyles); } rowData.put(GridState.JSONKEY_DATA, cellData); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateData 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
generateData
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public void lockOrientation(boolean portrait) { if (getActivity() == null) { return; } if(portrait){ getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }else{ getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lockOrientation File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
lockOrientation
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public NetworkUpdateResult updateBeforeSaveNetwork(WifiConfiguration config, int callingUid, @NonNull String packageName) { NetworkUpdateResult result = addOrUpdateNetwork(config, callingUid); if (!result.isSuccess()) { Log.e(TAG, "saveNetwork adding/updating config=" + config + " failed"); return result; } if (!enableNetwork(result.getNetworkId(), false, callingUid, null)) { Log.e(TAG, "saveNetwork enabling config=" + config + " failed"); return NetworkUpdateResult.makeFailed(); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBeforeSaveNetwork 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
updateBeforeSaveNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
final boolean isSleeping() { final Task rootTask = getRootTask(); return rootTask != null ? rootTask.shouldSleepActivities() : mAtmService.isSleepingLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSleeping 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
isSleeping
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public int getXWikiPreferenceAsInt(String preference) { return this.xwiki.getXWikiPreferenceAsInt(preference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXWikiPreferenceAsInt File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getXWikiPreferenceAsInt
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0