instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public final boolean replaceOrderedBroadcastLocked(BroadcastRecord r) { for (int i = mOrderedBroadcasts.size() - 1; i > 0; i--) { if (r.intent.filterEquals(mOrderedBroadcasts.get(i).intent)) { if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "***** DROPPING ORDERED [" + mQueueName + "]: " + r.intent); mOrderedBroadcasts.set(i, r); return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceOrderedBroadcastLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
replaceOrderedBroadcastLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean isLegacyLockPatternEnabled(int userId) { // Note: this value should default to {@code true} to avoid any reset that might result. // We must use a special key to read this value, since it will by default return the value // based on the new logic. return getBoolean(LEGACY_LOCK_PATTERN_ENABLED, true, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLegacyLockPatternEnabled File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isLegacyLockPatternEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
protected TabChromeWebContentsDelegateAndroid createWebContentsDelegate() { return new TabChromeWebContentsDelegateAndroid(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createWebContentsDelegate 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
createWebContentsDelegate
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setMaximumExpansionSize(int theMaximumExpansionSize) { Validate.isTrue(theMaximumExpansionSize > 0, "theMaximumExpansionSize must be > 0"); myMaximumExpansionSize = theMaximumExpansionSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaximumExpansionSize File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setMaximumExpansionSize
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public static void openBrowser(String url) throws Exception { try { String osName = StringUtils.toLowerEnglish( Utils.getProperty("os.name", "linux")); Runtime rt = Runtime.getRuntime(); String browser = Utils.getProperty(SysProperties.H2_BROWSER, null); if (browser == null) { // under Linux, this will point to the default system browser try { browser = System.getenv("BROWSER"); } catch (SecurityException se) { // ignore } } if (browser != null) { if (browser.startsWith("call:")) { browser = browser.substring("call:".length()); Utils.callStaticMethod(browser, url); } else if (browser.contains("%url")) { String[] args = StringUtils.arraySplit(browser, ',', false); for (int i = 0; i < args.length; i++) { args[i] = StringUtils.replaceAll(args[i], "%url", url); } rt.exec(args); } else if (osName.contains("windows")) { rt.exec(new String[] { "cmd.exe", "/C", browser, url }); } else { rt.exec(new String[] { browser, url }); } return; } try { Class<?> desktopClass = Class.forName("java.awt.Desktop"); // Desktop.isDesktopSupported() Boolean supported = (Boolean) desktopClass. getMethod("isDesktopSupported"). invoke(null, new Object[0]); URI uri = new URI(url); if (supported) { // Desktop.getDesktop(); Object desktop = desktopClass.getMethod("getDesktop"). invoke(null); // desktop.browse(uri); desktopClass.getMethod("browse", URI.class). invoke(desktop, uri); return; } } catch (Exception e) { // ignore } if (osName.contains("windows")) { rt.exec(new String[] { "rundll32", "url.dll,FileProtocolHandler", url }); } else if (osName.contains("mac") || osName.contains("darwin")) { // Mac OS: to open a page with Safari, use "open -a Safari" Runtime.getRuntime().exec(new String[] { "open", url }); } else { String[] browsers = { "xdg-open", "chromium", "google-chrome", "firefox", "mozilla-firefox", "mozilla", "konqueror", "netscape", "opera", "midori" }; boolean ok = false; for (String b : browsers) { try { rt.exec(new String[] { b, url }); ok = true; break; } catch (Exception e) { // ignore and try the next } } if (!ok) { // No success in detection. throw new Exception( "Browser detection failed, and java property 'h2.browser' " + "and environment variable BROWSER are not set to a browser executable."); } } } catch (Exception e) { throw new Exception( "Failed to start a browser to open the URL " + url + ": " + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openBrowser File: h2/src/main/org/h2/tools/Server.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
openBrowser
h2/src/main/org/h2/tools/Server.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private boolean isUrlOk() { // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.SANDBOX) // In SANDBOX, we cannot read any URL return false; if (SecurityUtils.getSecurityProfile() == SecurityProfile.LEGACY) return true; if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) // We are UNSECURE anyway return true; if (isInUrlAllowList()) // ::done return true; // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.INTERNET) { if (forbiddenURL(cleanPath(internal.toString()))) return false; final int port = internal.getPort(); // Using INTERNET profile, port 80 and 443 are ok return port == 80 || port == 443 || port == -1; } return false; // ::done }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2023-3431 - Severity: MEDIUM - CVSS Score: 5.3 Description: feat: remove legacy ALLOW_INCLUDE use PLANTUML_SECURITY_PROFILE instead https://github.com/plantuml/plantuml-server/issues/232 Function: isUrlOk File: src/net/sourceforge/plantuml/security/SURL.java Repository: plantuml Fixed Code: public boolean isUrlOk() { // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.SANDBOX) // In SANDBOX, we cannot read any URL return false; if (SecurityUtils.getSecurityProfile() == SecurityProfile.LEGACY) return true; if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) // We are UNSECURE anyway return true; if (isInUrlAllowList()) // ::done return true; // ::comment when __CORE__ if (SecurityUtils.getSecurityProfile() == SecurityProfile.INTERNET) { if (forbiddenURL(cleanPath(internal.toString()))) return false; final int port = internal.getPort(); // Using INTERNET profile, port 80 and 443 are ok return port == 80 || port == 443 || port == -1; } return false; // ::done }
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
isUrlOk
src/net/sourceforge/plantuml/security/SURL.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
1
Analyze the following code function for security vulnerabilities
@Override public OnGoingLogicalCondition gt(ComparableFunction<T> value) { Condition conditionLocal = new GtCondition<T>(selector, selector.generateParameter(value)); return getOnGoingLogicalCondition(conditionLocal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gt File: src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java Repository: xjodoin/torpedoquery The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2019-11343
HIGH
7.5
xjodoin/torpedoquery
gt
src/main/java/org/torpedoquery/jpa/internal/conditions/ConditionBuilder.java
3c20b874fba9cc2a78b9ace10208de1602b56c3f
0
Analyze the following code function for security vulnerabilities
@Override public ApplicationBasicInfo[] getPaginatedApplicationBasicInfo(String tenantDomain, String username, int pageNumber, String filter) throws IdentityApplicationManagementException { ApplicationBasicInfo[] applicationBasicInfoArray; try { startTenantFlow(tenantDomain, username); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); // invoking pre listeners if (appDAO instanceof PaginatableFilterableApplicationDAO) { Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && listener instanceof AbstractApplicationMgtListener && !((AbstractApplicationMgtListener) listener).doPreGetPaginatedApplicationBasicInfo( tenantDomain, username, pageNumber, filter)) { return new ApplicationBasicInfo[0]; } } applicationBasicInfoArray = ((PaginatableFilterableApplicationDAO) appDAO) .getPaginatedApplicationBasicInfo(pageNumber, filter); // invoking post listeners for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && listener instanceof AbstractApplicationMgtListener && !((AbstractApplicationMgtListener) listener).doPostGetPaginatedApplicationBasicInfo (tenantDomain, username, pageNumber, filter, applicationBasicInfoArray)) { return new ApplicationBasicInfo[0]; } } } else { throw new UnsupportedOperationException("Application filtering and pagination not supported. " + "Tenant domain: " + tenantDomain); } } finally { endTenantFlow(); } return applicationBasicInfoArray; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPaginatedApplicationBasicInfo File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getPaginatedApplicationBasicInfo
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@MediumTest @Test public void testSendCallEventNull() throws Exception { IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); mInCallServiceFixtureX.mInCallAdapter.sendCallEvent(ids.mCallId, TEST_EVENT, 26, null); verify(mConnectionServiceFixtureA.getTestDouble(), timeout(TEST_TIMEOUT)) .sendCallEvent(eq(ids.mConnectionId), eq(TEST_EVENT), isNull(Bundle.class), any()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSendCallEventNull File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testSendCallEventNull
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static ClassLoader getSystemClassLoader() { return PlatformDependent0.getSystemClassLoader(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemClassLoader File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
getSystemClassLoader
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
@Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode == RESULT_OK) { if (xmppConnectionServiceBound) { this.mPostponedActivityResult = null; if (requestCode == REQUEST_CREATE_CONFERENCE) { Account account = extractAccount(intent); final String name = intent.getStringExtra(ChooseContactActivity.EXTRA_GROUP_CHAT_NAME); final List<Jid> jids = ChooseContactActivity.extractJabberIds(intent); if (account != null && jids.size() > 0) { if (xmppConnectionService.createAdhocConference(account, name, jids, mAdhocConferenceCallback)) { mToast = Toast.makeText(this, R.string.creating_conference, Toast.LENGTH_LONG); mToast.show(); } } } } else { this.mPostponedActivityResult = new Pair<>(requestCode, intent); } } super.onActivityResult(requestCode, requestCode, intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActivityResult File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onActivityResult
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public static AdapterState make(AdapterService service, AdapterProperties adapterProperties) { Log.d(TAG, "make() - Creating AdapterState"); AdapterState as = new AdapterState(service, adapterProperties); as.start(); return as; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: make File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
make
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public void showLowBatteryWarning(boolean playSound) { Slog.i(TAG, "show low battery warning: level=" + mBatteryLevel + " [" + mBucket + "] playSound=" + playSound); mPlaySound = playSound; mWarning = true; updateNotification(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showLowBatteryWarning File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
showLowBatteryWarning
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
public long optLong(int index) { return optLong(index, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optLong 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
optLong
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public void sendError(int i, String s) throws IOException { this.response.sendError(i, s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendError File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
sendError
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public void testSimpleViaObjectMapper() throws IOException { ObjectMapper mapper = new ObjectMapper(); // also need tree mapper to construct tree to serialize ObjectNode n = mapper.getNodeFactory().objectNode(); n.put("number", 15); n.put("string", "abc"); ObjectNode n2 = n.putObject("ob"); n2.putArray("arr"); StringWriter sw = new StringWriter(); JsonGenerator jg = mapper.createGenerator(sw); mapper.writeTree(jg, n); Map<String,Object> result = (Map<String,Object>) mapper.readValue(sw.toString(), Map.class); assertEquals(3, result.size()); assertEquals("abc", result.get("string")); assertEquals(Integer.valueOf(15), result.get("number")); Map<String,Object> ob = (Map<String,Object>) result.get("ob"); assertEquals(1, ob.size()); List<Object> list = (List<Object>) ob.get("arr"); assertNotNull(list); assertEquals(0, list.size()); jg.close(); }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2020-36518 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fix #3473 (re-implementation of #2816 for 2.14) Function: testSimpleViaObjectMapper File: src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java Repository: FasterXML/jackson-databind Fixed Code: @SuppressWarnings("unchecked") public void testSimpleViaObjectMapper() throws IOException { ObjectMapper mapper = new ObjectMapper(); // also need tree mapper to construct tree to serialize ObjectNode n = mapper.getNodeFactory().objectNode(); n.put("number", 15); n.put("string", "abc"); ObjectNode n2 = n.putObject("ob"); n2.putArray("arr"); StringWriter sw = new StringWriter(); JsonGenerator jg = mapper.createGenerator(sw); mapper.writeTree(jg, n); Map<String,Object> result = (Map<String,Object>) mapper.readValue(sw.toString(), Map.class); assertEquals(3, result.size()); assertEquals("abc", result.get("string")); assertEquals(Integer.valueOf(15), result.get("number")); Map<String,Object> ob = (Map<String,Object>) result.get("ob"); assertEquals(1, ob.size()); List<Object> list = (List<Object>) ob.get("arr"); if (list == null) { fail("Missing entry 'arr': "+ob); } assertEquals(0, list.size()); jg.close(); }
[ "CWE-787" ]
CVE-2020-36518
MEDIUM
5
FasterXML/jackson-databind
testSimpleViaObjectMapper
src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
8238ab41d0350fb915797c89d46777b4496b74fd
1
Analyze the following code function for security vulnerabilities
private void updateFontScaleIfNeeded(@UserIdInt int userId) { final float scaleFactor = Settings.System.getFloatForUser(mContext.getContentResolver(), FONT_SCALE, 1.0f, userId); synchronized (this) { if (getGlobalConfiguration().fontScale == scaleFactor) { return; } final Configuration configuration = mWindowManager.computeNewConfiguration(DEFAULT_DISPLAY); configuration.fontScale = scaleFactor; updatePersistentConfigurationLocked(configuration, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFontScaleIfNeeded 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
updateFontScaleIfNeeded
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Order(1) @Test void deleteApplication() { // Check the the applications live table lists the created application. ApplicationsLiveTableElement appsLiveTable = appWithinMinutesHomePage.getAppsLiveTable(); assertTrue(appsLiveTable.hasColumn("Actions")); appsLiveTable.filterApplicationName(appName.substring(0, 3)); assertTrue(appsLiveTable.isApplicationListed(appName)); // Click the delete icon then cancel the confirmation. appsLiveTable.clickDeleteApplication(appName).clickNo(); // We should be taken back to the AppWithinMinutes home page. appWithinMinutesHomePage = new AppWithinMinutesHomePage(); appsLiveTable = appWithinMinutesHomePage.getAppsLiveTable(); // The application name filter should've been preserved. assertEquals(appName.substring(0, 3), appsLiveTable.getApplicationNameFilter()); // Click the delete icon again and this confirm the action. appsLiveTable.clickDeleteApplication(appName).clickYes(); // We should be taken back to the AppWithinMinutes home page. appWithinMinutesHomePage = new AppWithinMinutesHomePage(); appsLiveTable = appWithinMinutesHomePage.getAppsLiveTable(); // The application name filter should've been preserved. assertEquals(appName.substring(0, 3), appsLiveTable.getApplicationNameFilter()); // And the deleted application shouldn't be listed anymore. assertFalse(appsLiveTable.isApplicationListed(appName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteApplication File: xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29515
MEDIUM
5.4
xwiki/xwiki-platform
deleteApplication
xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java
e73b890623efa604adc484ad82f37e31596fe1a6
0
Analyze the following code function for security vulnerabilities
public Point getAppTaskThumbnailSize() throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppTaskThumbnailSize File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getAppTaskThumbnailSize
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public boolean startAsUser(Activity activity, Bundle options, UserHandle user) { throw new RuntimeException("ChooserTargets should be started as caller."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startAsUser File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
startAsUser
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
public void unregisterForSubscriptionInfoReady(Handler h) { mCdmaForSubscriptionInfoReadyRegistrants.remove(h); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterForSubscriptionInfoReady File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
unregisterForSubscriptionInfoReady
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public void setCreateDate(Date createDate) { this.createDate = createDate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCreateDate File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setCreateDate
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
protected final boolean _isIntNumber(String text) { final int len = text.length(); if (len > 0) { char c = text.charAt(0); // skip leading sign (plus not allowed for strict JSON numbers but...) int i; if (c == '-' || c == '+') { if (len == 1) { return false; } i = 1; } else { i = 0; } // We will allow leading for (; i < len; ++i) { int ch = text.charAt(i); if (ch > '9' || ch < '0') { return false; } } return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _isIntNumber File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_isIntNumber
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
protected HtmlTree.Converter<Spanned> getSpanConverter() { return new HtmlUtils.SpannedConverter(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpanConverter 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
getSpanConverter
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public IPage<SysUserSysDepartModel> queryUserByOrgCode(String orgCode, SysUser userParams, IPage page) { List<SysUserSysDepartModel> list = baseMapper.getUserByOrgCode(page, orgCode, userParams); Integer total = baseMapper.getUserByOrgCodeTotal(orgCode, userParams); IPage<SysUserSysDepartModel> result = new Page<>(page.getCurrent(), page.getSize(), total); result.setRecords(list); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryUserByOrgCode File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
queryUserByOrgCode
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
@Override public CharSequence getShortSupportMessageForUser(@NonNull ComponentName who, int userHandle) { if (!mHasFeature) { return null; } Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity()), String.format(NOT_SYSTEM_CALLER_MSG, "query support message for user")); synchronized (getLockObject()) { ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle); if (admin != null) { return admin.shortSupportMessage; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShortSupportMessageForUser 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
getShortSupportMessageForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private String getStringValue(Node node) { String value = node.getNodeValue(); if (node.hasChildNodes()) { Node first = node.getFirstChild(); if (first.getNodeType() == Node.TEXT_NODE) { return first.getNodeValue(); } } return value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStringValue File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
getStringValue
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
private void addOrReparentStartingActivity(@NonNull Task task, String reason) { TaskFragment newParent = task; if (mInTaskFragment != null) { // TODO(b/234351413): remove remaining embedded Task logic. // mInTaskFragment is created and added to the leaf task by task fragment organizer's // request. If the task was resolved and different than mInTaskFragment, reparent the // task to mInTaskFragment for embedding. if (mInTaskFragment.getTask() != task) { if (shouldReparentInTaskFragment(task)) { task.reparent(mInTaskFragment, POSITION_TOP); } } else { newParent = mInTaskFragment; } } else { TaskFragment candidateTf = mAddingToTaskFragment != null ? mAddingToTaskFragment : null; if (candidateTf == null) { final ActivityRecord top = task.topRunningActivity(false /* focusableOnly */, false /* includingEmbeddedTask */); if (top != null) { candidateTf = top.getTaskFragment(); } } if (candidateTf != null && candidateTf.isEmbedded() && canEmbedActivity(candidateTf, mStartActivity, false /* newTask */, task)) { // Use the embedded TaskFragment of the top activity as the new parent if the // activity can be embedded. newParent = candidateTf; } } // Start Activity to the Task if mStartActivity's min dimensions are not satisfied. if (newParent.isEmbedded() && newParent.smallerThanMinDimension(mStartActivity)) { reason += " - MinimumDimensionViolation"; mService.mWindowOrganizerController.sendMinimumDimensionViolation( newParent, mStartActivity.getMinDimensions(), mRequest.errorCallbackToken, reason); newParent = task; } if (mStartActivity.getTaskFragment() == null || mStartActivity.getTaskFragment() == newParent) { newParent.addChild(mStartActivity, POSITION_TOP); } else { mStartActivity.reparent(newParent, newParent.getChildCount() /* top */, reason); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOrReparentStartingActivity File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
addOrReparentStartingActivity
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
public static String buildValidFatFilename(String name) { if (TextUtils.isEmpty(name) || ".".equals(name) || "..".equals(name)) { return "(invalid)"; } final StringBuilder res = new StringBuilder(name.length()); for (int i = 0; i < name.length(); i++) { final char c = name.charAt(i); if (isValidFatFilenameChar(c)) { res.append(c); } else { res.append('_'); } } trimFilename(res, MAX_FILENAME_BYTES); return res.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildValidFatFilename File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
buildValidFatFilename
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
@Override public GateKeeperResponse[] newArray(int size) { return new GateKeeperResponse[size]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newArray File: core/java/android/service/gatekeeper/GateKeeperResponse.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-0806
HIGH
9.3
android
newArray
core/java/android/service/gatekeeper/GateKeeperResponse.java
b87c968e5a41a1a09166199bf54eee12608f3900
0
Analyze the following code function for security vulnerabilities
@Override public int delete(Uri uri, String selection, String[] selectionArgs) { int match = sURLMatcher.match(uri); if (LOCAL_LOGV) { Log.v(TAG, "Delete uri=" + uri + ", match=" + match); } String table, extraSelection = null; boolean notify = false; switch (match) { case MMS_ALL_ID: case MMS_INBOX_ID: case MMS_SENT_ID: case MMS_DRAFTS_ID: case MMS_OUTBOX_ID: notify = true; table = TABLE_PDU; extraSelection = Mms._ID + "=" + uri.getLastPathSegment(); break; case MMS_ALL: case MMS_INBOX: case MMS_SENT: case MMS_DRAFTS: case MMS_OUTBOX: notify = true; table = TABLE_PDU; if (match != MMS_ALL) { int msgBox = getMessageBoxByMatch(match); extraSelection = Mms.MESSAGE_BOX + "=" + msgBox; } break; case MMS_ALL_PART: table = TABLE_PART; break; case MMS_MSG_PART: table = TABLE_PART; extraSelection = Part.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_PART_ID: table = TABLE_PART; extraSelection = Part._ID + "=" + uri.getPathSegments().get(1); break; case MMS_MSG_ADDR: table = TABLE_ADDR; extraSelection = Addr.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_DRM_STORAGE: table = TABLE_DRM; break; default: Log.w(TAG, "No match for URI '" + uri + "'"); return 0; } String finalSelection = concatSelections(selection, extraSelection); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int deletedRows = 0; if (TABLE_PDU.equals(table)) { deletedRows = deleteMessages(getContext(), db, finalSelection, selectionArgs, uri); } else if (TABLE_PART.equals(table)) { deletedRows = deleteParts(db, finalSelection, selectionArgs); } else if (TABLE_DRM.equals(table)) { deletedRows = deleteTempDrmData(db, finalSelection, selectionArgs); } else { deletedRows = db.delete(table, finalSelection, selectionArgs); } if ((deletedRows > 0) && notify) { notifyChange(uri); } return deletedRows; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-3914
HIGH
9.3
android
delete
src/com/android/providers/telephony/MmsProvider.java
3a3a5d145d380deef2d5b7c3150864cd04be397f
0
Analyze the following code function for security vulnerabilities
public URI toUri(String schemePrefix) { StringBuilder builder = new StringBuilder(); String db = getDatabase().orElse(null); for (Entry<String, String> entry : options.entrySet()) { if (ClickHouseClientOption.DATABASE.getKey().equals(entry.getKey())) { db = entry.getValue(); continue; } builder.append(entry.getKey()).append('=').append(entry.getValue()).append('&'); } String query = null; if (builder.length() > 0) { builder.setLength(builder.length() - 1); query = builder.toString(); } builder.setLength(0); boolean first = true; for (String tag : tags) { if (first) { first = false; } else { builder.append(','); } builder.append(ClickHouseUtils.encode(tag)); } String p = protocol.name().toLowerCase(Locale.ROOT); if (ClickHouseChecker.isNullOrEmpty(schemePrefix)) { schemePrefix = p; } else { if (schemePrefix.charAt(schemePrefix.length() - 1) == ':') { schemePrefix = schemePrefix.concat(p); } else { schemePrefix = new StringBuilder(schemePrefix).append(':').append(p).toString(); } } try { return new URI(schemePrefix, null, host, port, ClickHouseChecker.isNullOrEmpty(db) ? "" : "/".concat(db), query, builder.length() > 0 ? builder.toString() : null); } catch (URISyntaxException e) { throw new IllegalStateException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toUri File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
toUri
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@POST @Path("survey") @Operation(summary = "Attaches an survey building block", description = "Attaches an survey building block") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachSurveyPost(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId, @QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle, @QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives, @QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules, @QueryParam("surveyResourceableId") Long surveyResourceableId, @Context HttpServletRequest request) { return attachSurvey(courseId, parentNodeId, position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, surveyResourceableId, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachSurveyPost File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
attachSurveyPost
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public void setTime(int time) { if(nativeVideo != null){ nativeVideo.seekTo(time); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTime 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
setTime
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getParamNames(){ Set<String> names = request.getQueryParams().keySet(); return new ArrayList<>(names); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamNames File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getParamNames
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public void setCssErrorClass(String cssErrorClass) { throw new UnsupportedOperationException("The 'cssErrorClass' attribute is not supported for forms"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCssErrorClass File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
setCssErrorClass
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
@Override public List<BatchUpload> getImportsAvailable(EPerson eperson) throws Exception { File uploadDir = new File(getImportUploadableDirectory(eperson)); if (!uploadDir.exists() || !uploadDir.isDirectory()) { return null; } Map<String, BatchUpload> fileNames = new TreeMap<>(); for (String fileName : uploadDir.list()) { File file = new File(uploadDir + File.separator + fileName); if (file.isDirectory()){ BatchUpload upload = new BatchUpload(file); fileNames.put(upload.getDir().getName(), upload); } } if (fileNames.size() > 0) { return new ArrayList<>(fileNames.values()); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getImportsAvailable File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
getImportsAvailable
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
protected void handleUnknownProperty(JsonParser p, DeserializationContext ctxt, Object instanceOrClass, String propName) throws IOException { if (instanceOrClass == null) { instanceOrClass = handledType(); } // Maybe we have configured handler(s) to take care of it? if (ctxt.handleUnknownProperty(p, this, instanceOrClass, propName)) { return; } /* But if we do get this far, need to skip whatever value we * are pointing to now (although handler is likely to have done that already) */ p.skipChildren(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUnknownProperty File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
handleUnknownProperty
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Override public void setVoiceInteractionPackagesProvider(PackagesProvider provider) { synchronized (mPackages) { mDefaultPermissionPolicy.setVoiceInteractionPackagesProviderLPw(provider); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVoiceInteractionPackagesProvider 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
setVoiceInteractionPackagesProvider
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static @NonNull Iterator<String> buildUniqueNameIterator(@NonNull File parent, @NonNull String name) { if (isDcim(parent)) { final Matcher dcfStrict = PATTERN_DCF_STRICT.matcher(name); if (dcfStrict.matches()) { // Generate names like "IMG_1001" final String prefix = dcfStrict.group(1); return new Iterator<String>() { int i = Integer.parseInt(dcfStrict.group(2)); @Override public String next() { final String res = String.format(Locale.US, "%s%04d", prefix, i); i++; return res; } @Override public boolean hasNext() { return i <= 9999; } }; } final Matcher dcfRelaxed = PATTERN_DCF_RELAXED.matcher(name); if (dcfRelaxed.matches()) { // Generate names like "IMG_20190102_030405~2" final String prefix = dcfRelaxed.group(1); return new Iterator<String>() { int i = TextUtils.isEmpty(dcfRelaxed.group(2)) ? 1 : Integer.parseInt(dcfRelaxed.group(2)); @Override public String next() { final String res = (i == 1) ? prefix : String.format(Locale.US, "%s~%d", prefix, i); i++; return res; } @Override public boolean hasNext() { return i <= 99; } }; } } // Generate names like "foo (2)" return new Iterator<String>() { int i = 0; @Override public String next() { final String res = (i == 0) ? name : name + " (" + i + ")"; i++; return res; } @Override public boolean hasNext() { return i < 32; } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildUniqueNameIterator File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
buildUniqueNameIterator
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
private ProcessRecord findProcessLocked(String process, int userId, String callName) { userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, callName, null); ProcessRecord proc = null; try { int pid = Integer.parseInt(process); synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(pid); } } catch (NumberFormatException e) { } if (proc == null) { ArrayMap<String, SparseArray<ProcessRecord>> all = mProcessNames.getMap(); SparseArray<ProcessRecord> procs = all.get(process); if (procs != null && procs.size() > 0) { proc = procs.valueAt(0); if (userId != UserHandle.USER_ALL && proc.userId != userId) { for (int i=1; i<procs.size(); i++) { ProcessRecord thisProc = procs.valueAt(i); if (thisProc.userId == userId) { proc = thisProc; break; } } } } } return proc; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findProcessLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
findProcessLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void removeColumn(Object propertyId) throws IllegalArgumentException { if (!columns.keySet().contains(propertyId)) { throw new IllegalArgumentException( "There is no column for given property id " + propertyId); } List<Column> removed = new ArrayList<Column>(); removed.add(getColumn(propertyId)); internalRemoveColumn(propertyId); datasourceExtension.columnsRemoved(removed); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeColumn 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
removeColumn
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private int getWikiPort(WikiDescriptor wikiDescriptor, XWikiContext context) { // Try wiki descriptor int port = wikiDescriptor.getPort(); if (port != -1) { return port; } // Try main wiki try { port = getWikiDescriptorManager().getMainWikiDescriptor().getPort(); if (port != -1) { return port; } } catch (WikiManagerException e) { LOGGER.error("Failed to get main wiki descriptor", e); } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWikiPort 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
getWikiPort
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 int jjMoveStringLiteralDfa5_2(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_2(3, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(4, active0); return 5; } switch(curChar) { case 110: return jjMoveStringLiteralDfa6_2(active0, 0x400000000000L); default : break; } return jjStartNfa_2(4, active0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjMoveStringLiteralDfa5_2 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjMoveStringLiteralDfa5_2
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
public void unblockConversation(final Blockable conversation) { activity.xmppConnectionService.sendUnblockRequest(conversation); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unblockConversation 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
unblockConversation
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public void setAuthzAcl(String authzAcl) { this.authzAcl = authzAcl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAuthzAcl File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setAuthzAcl
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public long getLongValue(String fieldName) { BaseObject object = getFirstObject(fieldName, null); if (object == null) { return 0; } else { return object.getLongValue(fieldName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLongValue 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
getLongValue
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 remove(Structure st) { String inode = st.getInode(); String structureName = st.getName(); cache.remove(primaryGroup + inode,primaryGroup); cache.remove(primaryGroup + structureName,primaryGroup); clearURLMasterPattern(); removeStructuresByType(st.getStructureType()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remove File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
remove
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@LargeTest @Test public void testSingleIncomingCallLocalDisconnect() throws Exception { IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); mInCallServiceFixtureX.mInCallAdapter.disconnectCall(ids.mCallId); assertEquals(Call.STATE_DISCONNECTING, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); assertEquals(Call.STATE_DISCONNECTING, mInCallServiceFixtureY.getCall(ids.mCallId).getState()); when(mClockProxy.currentTimeMillis()).thenReturn(TEST_DISCONNECT_TIME); when(mClockProxy.elapsedRealtime()).thenReturn(TEST_DISCONNECT_ELAPSED_TIME); mConnectionServiceFixtureA.sendSetDisconnected(ids.mConnectionId, DisconnectCause.LOCAL); assertEquals(Call.STATE_DISCONNECTED, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); assertEquals(Call.STATE_DISCONNECTED, mInCallServiceFixtureY.getCall(ids.mCallId).getState()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSingleIncomingCallLocalDisconnect File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testSingleIncomingCallLocalDisconnect
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public boolean hasPermission(Permission permission) { return Jenkins.getInstance().hasPermission(permission); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasPermission File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
hasPermission
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
public List<SyncInfo> getCurrentSyncsAsUser(int userId) { enforceCrossUserPermission(userId, "no permission to read the sync settings for user " + userId); mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); long identityToken = clearCallingIdentity(); try { return getSyncManager().getSyncStorageEngine().getCurrentSyncsCopy(userId); } finally { restoreCallingIdentity(identityToken); } }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2016-2426 - Severity: MEDIUM - CVSS Score: 4.3 Description: Redact Account info from getCurrentSyncs BUG:26094635 If the caller to ContentResolver#getCurrentSyncs does not hold the GET_ACCOUNTS permission, return a SyncInfo object that does not contain any Account information. Change-Id: I5628ebe1f56c8e3f784aaf1b3281e6b829d19314 (cherry picked from commit b63057e698a01dafcefc7ba09b397b0336bba43d) Function: getCurrentSyncsAsUser File: services/core/java/com/android/server/content/ContentService.java Repository: android Fixed Code: public List<SyncInfo> getCurrentSyncsAsUser(int userId) { enforceCrossUserPermission(userId, "no permission to read the sync settings for user " + userId); mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_SYNC_STATS, "no permission to read the sync stats"); final boolean canAccessAccounts = mContext.checkCallingOrSelfPermission(Manifest.permission.GET_ACCOUNTS) == PackageManager.PERMISSION_GRANTED; long identityToken = clearCallingIdentity(); try { return getSyncManager().getSyncStorageEngine() .getCurrentSyncsCopy(userId, canAccessAccounts); } finally { restoreCallingIdentity(identityToken); } }
[ "CWE-200" ]
CVE-2016-2426
MEDIUM
4.3
android
getCurrentSyncsAsUser
services/core/java/com/android/server/content/ContentService.java
63363af721650e426db5b0bdfb8b2d4fe36abdb0
1
Analyze the following code function for security vulnerabilities
@Override public void onResume() { getmGoogleApiClient(); // This should initialize it if it isn't already. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onResume
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String[] getIsimPcscf() throws RemoteException { PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(getDefaultSubscription()); return phoneSubInfoProxy.getIsimPcscf(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIsimPcscf File: src/java/com/android/internal/telephony/PhoneSubInfoController.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-0831
MEDIUM
4.3
android
getIsimPcscf
src/java/com/android/internal/telephony/PhoneSubInfoController.java
79eecef63f3ea99688333c19e22813f54d4a31b1
0
Analyze the following code function for security vulnerabilities
static boolean isExternalizable(Class<?> cl) { return EXTERNALIZABLE.isAssignableFrom(cl); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExternalizable File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
isExternalizable
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private MutableHttpResponse errorResultToResponse(Object result) { MutableHttpResponse<?> response; if (result == null) { response = io.micronaut.http.HttpResponse.serverError(); } else if (result instanceof io.micronaut.http.HttpResponse) { response = (MutableHttpResponse) result; } else { response = io.micronaut.http.HttpResponse.serverError() .body(result); MediaType.fromType(result.getClass()).ifPresent(response::contentType); } return response; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: errorResultToResponse File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
errorResultToResponse
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public final String getScopesAsString() { return Joiner.on(' ').join(scopes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getScopesAsString File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
getScopesAsString
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(USE_FINGERPRINT) public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel, int flags, @NonNull AuthenticationCallback callback, Handler handler, int userId) { if (callback == null) { throw new IllegalArgumentException("Must supply an authentication callback"); } if (cancel != null) { if (cancel.isCanceled()) { Log.w(TAG, "authentication already canceled"); return; } else { cancel.setOnCancelListener(new OnAuthenticationCancelListener(crypto)); } } if (mService != null) try { useHandler(handler); mAuthenticationCallback = callback; mCryptoObject = crypto; long sessionId = crypto != null ? crypto.getOpId() : 0; mService.authenticate(mToken, sessionId, userId, mServiceReceiver, flags, mContext.getOpPackageName()); } catch (RemoteException e) { Log.w(TAG, "Remote exception while authenticating: ", e); if (callback != null) { // Though this may not be a hardware issue, it will cause apps to give up or try // again later. callback.onAuthenticationError(FINGERPRINT_ERROR_HW_UNAVAILABLE, getErrorString(FINGERPRINT_ERROR_HW_UNAVAILABLE)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: authenticate File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
authenticate
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public String getRequestNormalisedPath() { return context.normalizedPath(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestNormalisedPath 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
getRequestNormalisedPath
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 V fromByte(K name, byte value) { try { return valueConverter.convertByte(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert byte value for header '" + name + '\'', e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromByte File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
fromByte
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public Channel getChannel() { return channel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChannel File: src/main/java/org/elasticsearch/transport/netty/NettyTransportChannel.java Repository: elastic/elasticsearch The code follows secure coding practices.
[ "CWE-74" ]
CVE-2015-5377
HIGH
7.5
elastic/elasticsearch
getChannel
src/main/java/org/elasticsearch/transport/netty/NettyTransportChannel.java
bf3052d14c874aead7da8855c5fcadf5428a43f2
0
Analyze the following code function for security vulnerabilities
protected boolean hasIncludes() { ensureSearchEntityLoaded(); return !mySearchEntity.getIncludes().isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasIncludes File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
hasIncludes
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
public void passStage(Stage stage) { completeStage(stage, JobResult.Passed); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: passStage 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
passStage
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@SystemApi @NonNull @RequiresPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public DevicePolicyState getDevicePolicyState() { if (mService != null) { try { return mService.getDevicePolicyState(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDevicePolicyState File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getDevicePolicyState
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static OneConstructor newConstructor() { return new OneConstructor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newConstructor File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21249
MEDIUM
6.5
theonedev/onedev
newConstructor
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
0
Analyze the following code function for security vulnerabilities
private boolean makeAppCrashingLocked(ProcessRecord app, String shortMsg, String longMsg, String stackTrace) { app.crashing = true; app.crashingReport = generateProcessError(app, ActivityManager.ProcessErrorStateInfo.CRASHED, null, shortMsg, longMsg, stackTrace); startAppProblemLocked(app); app.stopFreezingAllLocked(); return handleAppCrashLocked(app, shortMsg, longMsg, stackTrace); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeAppCrashingLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
makeAppCrashingLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void initializeAutoRedirection(EntityReference source, AttachmentReference destination, XWikiDocument sourceDocument) throws XWikiException { int idx = sourceDocument.createXObject(RedirectAttachmentClassDocumentInitializer.REFERENCE, this.xcontextProvider.get()); BaseObject xObject = sourceDocument.getXObject(RedirectAttachmentClassDocumentInitializer.REFERENCE, idx); if (xObject != null) { xObject.setStringValue(SOURCE_NAME_FIELD, source.getName()); xObject.setStringValue(TARGET_LOCATION_FIELD, this.entityReferenceSerializer.serialize(destination.getParent())); xObject.setStringValue(TARGET_NAME_FIELD, destination.getName()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeAutoRedirection File: xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJob.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-37910
HIGH
8.1
xwiki/xwiki-platform
initializeAutoRedirection
xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJob.java
d7720219d60d7201c696c3196c9d4a86d0881325
0
Analyze the following code function for security vulnerabilities
private static String ignoreScheme(String url) { if (url.startsWith("http://")) { return url.substring("http:".length()); } else if (url.startsWith("https://")) { return url.substring("https:".length()); } return url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ignoreScheme 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
ignoreScheme
web/src/main/java/com/zrlog/web/interceptor/TemplateHelper.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
@NonNull protected Account[] getAccountsFromCache(UserAccounts userAccounts, String accountType, int callingUid, @Nullable String callingPackage, boolean includeManagedNotVisible) { Preconditions.checkState(!Thread.holdsLock(userAccounts.cacheLock), "Method should not be called with cacheLock"); if (accountType != null) { Account[] accounts; synchronized (userAccounts.cacheLock) { accounts = userAccounts.accountCache.get(accountType); } if (accounts == null) { return EMPTY_ACCOUNT_ARRAY; } else { return filterAccounts(userAccounts, Arrays.copyOf(accounts, accounts.length), callingUid, callingPackage, includeManagedNotVisible); } } else { int totalLength = 0; Account[] accountsArray; synchronized (userAccounts.cacheLock) { for (Account[] accounts : userAccounts.accountCache.values()) { totalLength += accounts.length; } if (totalLength == 0) { return EMPTY_ACCOUNT_ARRAY; } accountsArray = new Account[totalLength]; totalLength = 0; for (Account[] accountsOfType : userAccounts.accountCache.values()) { System.arraycopy(accountsOfType, 0, accountsArray, totalLength, accountsOfType.length); totalLength += accountsOfType.length; } } return filterAccounts(userAccounts, accountsArray, callingUid, callingPackage, includeManagedNotVisible); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccountsFromCache 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
getAccountsFromCache
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private File createTemporaryFolderIn(File parentFolder) throws IOException { File createdFolder = null; for (int i = 0; i < TEMP_DIR_ATTEMPTS; ++i) { // Use createTempFile to get a suitable folder name. String suffix = ".tmp"; File tmpFile = File.createTempFile(TMP_PREFIX, suffix, parentFolder); String tmpName = tmpFile.toString(); // Discard .tmp suffix of tmpName. String folderName = tmpName.substring(0, tmpName.length() - suffix.length()); createdFolder = new File(folderName); if (createdFolder.mkdir()) { tmpFile.delete(); return createdFolder; } tmpFile.delete(); } throw new IOException("Unable to create temporary directory in: " + parentFolder.toString() + ". Tried " + TEMP_DIR_ATTEMPTS + " times. " + "Last attempted to create: " + createdFolder.toString()); }
Vulnerability Classification: - CWE: CWE-732 - CVE: CVE-2020-15250 - Severity: LOW - CVSS Score: 1.9 Description: Merge pull request from GHSA-269g-pwp5-87pp When running on Java 7 or later, temporary directories are now created Using Java’s NIO API which restricts permissions to owner-only by default. Function: createTemporaryFolderIn File: src/main/java/org/junit/rules/TemporaryFolder.java Repository: junit-team/junit4 Fixed Code: private static File createTemporaryFolderIn(File parentFolder) throws IOException { try { return createTemporaryFolderWithNioApi(parentFolder); } catch (ClassNotFoundException ignore) { // Fallback for Java 5 and 6 return createTemporaryFolderWithFileApi(parentFolder); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); if (cause instanceof IOException) { throw (IOException) cause; } if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } IOException exception = new IOException("Failed to create temporary folder in " + parentFolder); exception.initCause(cause); throw exception; } catch (Exception e) { throw new RuntimeException("Failed to create temporary folder in " + parentFolder, e); } }
[ "CWE-732" ]
CVE-2020-15250
LOW
1.9
junit-team/junit4
createTemporaryFolderIn
src/main/java/org/junit/rules/TemporaryFolder.java
610155b8c22138329f0723eec22521627dbc52ae
1
Analyze the following code function for security vulnerabilities
<T> List<T> search(String userSearchFilter, Object[] filterArgs, Mapper<T> mapper, int maxResult);
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2022-24832 - Severity: MEDIUM - CVSS Score: 4.9 Description: Escape/encode values when building search filters. Function: search File: src/main/java/cd/go/authentication/ldap/LdapClient.java Repository: gocd/gocd-ldap-authentication-plugin Fixed Code: <T> List<T> search(String userSearchFilter, String[] filterArgs, Mapper<T> mapper, int maxResult);
[ "CWE-74" ]
CVE-2022-24832
MEDIUM
4.9
gocd/gocd-ldap-authentication-plugin
search
src/main/java/cd/go/authentication/ldap/LdapClient.java
87fa7dac5d899b3960ab48e151881da4793cfcc3
1
Analyze the following code function for security vulnerabilities
public final void error(final SAXParseException e) throws SAXException { LOGGER.debug("XML error: {}", e.getLocalizedMessage()); super.error(e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: error File: core/src/main/java/org/mapfish/print/map/style/SLDParserPlugin.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-15232
MEDIUM
6.4
mapfish/mapfish-print
error
core/src/main/java/org/mapfish/print/map/style/SLDParserPlugin.java
e1d0527d13db06b2b62ca7d6afb9e97dacd67a0e
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getEnforcingAdminAndUserDetails(int userId, String restriction) { Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity())); return getEnforcingAdminAndUserDetailsInternal(userId, restriction); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnforcingAdminAndUserDetails 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
getEnforcingAdminAndUserDetails
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override boolean check(SerializerConfig c1, SerializerConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getTypeClass(), c2.getTypeClass()) && nullSafeEqual(c1.getTypeClassName(), c2.getTypeClassName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void cancel(String accountName, String remotePath, @Nullable ResultCode resultCode) { Pair<UploadFileOperation, String> removeResult = mPendingUploads.remove(accountName, remotePath); UploadFileOperation upload = removeResult.first; if (upload == null && mCurrentUpload != null && mCurrentAccount != null && mCurrentUpload.getRemotePath().startsWith(remotePath) && accountName.equals(mCurrentAccount.name)) { upload = mCurrentUpload; } if (upload != null) { upload.cancel(resultCode); // need to update now table in mUploadsStorageManager, // since the operation will not get to be run by FileUploader#uploadFile if (resultCode != null) { mUploadsStorageManager.updateDatabaseUploadResult(new RemoteOperationResult(resultCode), upload); notifyUploadResult(upload, new RemoteOperationResult(resultCode)); } else { mUploadsStorageManager.removeUpload(accountName, remotePath); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancel File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
cancel
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
public boolean isHandleWidgetEvents() { return getState(false).handleWidgetEvents; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHandleWidgetEvents 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
isHandleWidgetEvents
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishVoiceTask File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
finishVoiceTask
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public void subscribeToNotifications(String email, String channelId) { if (!StringUtils.isBlank(email) && !StringUtils.isBlank(channelId)) { Sysprop s = pc.read(channelId); if (s == null || !s.hasProperty("emails")) { s = new Sysprop(channelId); s.addProperty("emails", new LinkedList<>()); } Set<String> emails = new HashSet<>((List<String>) s.getProperty("emails")); if (emails.add(email)) { s.addProperty("emails", emails); pc.create(s); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: subscribeToNotifications 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
subscribeToNotifications
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public boolean isAppStartModeDisabled(int uid, String packageName) { synchronized (this) { return getAppStartModeLocked(uid, packageName, 0, -1, false, true, false) == ActivityManager.APP_START_MODE_DISABLED; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAppStartModeDisabled 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
isAppStartModeDisabled
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected String logPrefix(ModelMap theModel) { return "[server=" + theModel.get("serverId") + "] - "; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logPrefix File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
logPrefix
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
ProcessExecutor createProcessExecutor(File targetDir, DbProperties dbProperties) { Properties connectionProperties = dbProperties.connectionProperties(); Properties pgProperties = Driver.parseURL(dbProperties.url(), connectionProperties); ArrayList<String> argv = new ArrayList<>(); LinkedHashMap<String, String> env = new LinkedHashMap<>(); if (isNotBlank(dbProperties.password())) { env.put("PGPASSWORD", dbProperties.password()); } // override with any user specified environment env.putAll(dbProperties.extraBackupEnv()); String dbName = pgProperties.getProperty("PGDBNAME"); argv.add("pg_dump"); argv.add("--host=" + pgProperties.getProperty("PGHOST")); argv.add("--port=" + pgProperties.getProperty("PGPORT")); argv.add("--dbname=" + dbName); if (isNotBlank(dbProperties.user())) { argv.add("--username=" + dbProperties.user()); } argv.add("--no-password"); // append any user specified args for pg_dump if (isNotBlank(dbProperties.extraBackupCommandArgs())) { Collections.addAll(argv, Commandline.translateCommandline(dbProperties.extraBackupCommandArgs())); } argv.add("--file=" + new File(targetDir, "db." + dbName)); ProcessExecutor processExecutor = new ProcessExecutor(); processExecutor.redirectOutputAlsoTo(Slf4jStream.of(getClass()).asDebug()); processExecutor.redirectErrorAlsoTo(Slf4jStream.of(getClass()).asDebug()); processExecutor.environment(env); processExecutor.command(argv); return processExecutor; }
Vulnerability Classification: - CWE: CWE-532 - CVE: CVE-2023-28630 - Severity: MEDIUM - CVSS Score: 4.4 Description: Improve error messages on failure to launch backup process ztexec can include env vars in the error message which we don't want in this case. Function: createProcessExecutor File: db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java Repository: gocd Fixed Code: ProcessExecutor createProcessExecutor(File targetDir, DbProperties dbProperties) { Properties connectionProperties = dbProperties.connectionProperties(); Properties pgProperties = Driver.parseURL(dbProperties.url(), connectionProperties); Map<String, String> env = new LinkedHashMap<>(); if (isNotBlank(dbProperties.password())) { env.put("PGPASSWORD", dbProperties.password()); } // override with any user specified environment env.putAll(dbProperties.extraBackupEnv()); List<String> argv = new ArrayList<>(); argv.add(COMMAND); String dbName = pgProperties.getProperty("PGDBNAME"); argv.add("--host=" + pgProperties.getProperty("PGHOST")); argv.add("--port=" + pgProperties.getProperty("PGPORT")); argv.add("--dbname=" + dbName); if (isNotBlank(dbProperties.user())) { argv.add("--username=" + dbProperties.user()); } argv.add("--no-password"); // append any user specified args for pg_dump if (isNotBlank(dbProperties.extraBackupCommandArgs())) { Collections.addAll(argv, Commandline.translateCommandline(dbProperties.extraBackupCommandArgs())); } argv.add("--file=" + new File(targetDir, "db." + dbName)); ProcessExecutor processExecutor = new ProcessExecutor(); processExecutor.redirectOutputAlsoTo(Slf4jStream.of(getClass()).asDebug()); processExecutor.redirectErrorAlsoTo(Slf4jStream.of(getClass()).asDebug()); processExecutor.environment(env); processExecutor.command(argv); return processExecutor; }
[ "CWE-532" ]
CVE-2023-28630
MEDIUM
4.4
gocd
createProcessExecutor
db-support/db-support-postgresql/src/main/java/com/thoughtworks/go/server/database/pg/PostgresqlBackupProcessor.java
6545481e7b36817dd6033bf614585a8db242070d
1
Analyze the following code function for security vulnerabilities
public void setDate(Date date) { if ((date != null) && (!date.equals(this.updateDate))) { setMetaDataDirty(true); } // Make sure we drop milliseconds for consistency with the database if (date != null) { date.setTime((date.getTime() / 1000) * 1000); } this.updateDate = date; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDate 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
setDate
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public boolean setPermittedInputMethods(ComponentName who, String callerPackageName, List<String> packageList, boolean calledOnParentInstance) { if (!mHasFeature) { return false; } CallerIdentity caller; if (isPolicyEngineForFinanceFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); Objects.requireNonNull(who, "ComponentName is null"); } int userId = getProfileParentUserIfRequested( caller.getUserId(), calledOnParentInstance); if (calledOnParentInstance) { if (!isPolicyEngineForFinanceFlagEnabled()) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice(caller)); } Preconditions.checkArgument(packageList == null || packageList.isEmpty(), "Permitted input methods must allow all input methods or only " + "system input methods when called on the parent instance of an " + "organization-owned device"); } else if (!isPolicyEngineForFinanceFlagEnabled()) { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); } if (packageList != null) { for (String pkg : packageList) { enforceMaxPackageNameLength(pkg); } List<InputMethodInfo> enabledImes = mInjector.binderWithCleanCallingIdentity(() -> InputMethodManagerInternal.get().getEnabledInputMethodListAsUser(userId)); if (enabledImes != null) { List<String> enabledPackages = new ArrayList<String>(); for (InputMethodInfo ime : enabledImes) { enabledPackages.add(ime.getPackageName()); } if (!checkPackagesInPermittedListOrSystem(enabledPackages, packageList, userId)) { Slogf.e(LOG_TAG, "Cannot set permitted input methods, because the list of " + "permitted input methods excludes an already-enabled input method."); return false; } } } synchronized (getLockObject()) { if (isPolicyEngineForFinanceFlagEnabled()) { EnforcingAdmin admin = enforcePermissionAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_INPUT_METHODS, caller.getPackageName(), userId); if (packageList == null) { mDevicePolicyEngine.removeLocalPolicy( PolicyDefinition.PERMITTED_INPUT_METHODS, admin, userId); } else { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.PERMITTED_INPUT_METHODS, admin, new StringSetPolicyValue(new HashSet<>(packageList)), userId); } } else { ActiveAdmin admin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()), calledOnParentInstance); admin.permittedInputMethods = packageList; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_PERMITTED_INPUT_METHODS) .setAdmin(caller.getPackageName()) .setStrings(getStringArrayForLogging(packageList, calledOnParentInstance)) .write(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPermittedInputMethods 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
setPermittedInputMethods
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean windowsAreFocusable() { return windowsAreFocusable(false /* fromUserTouch */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: windowsAreFocusable 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
windowsAreFocusable
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static byte[] readFrom(File src) throws IOException { long srcsize = src.length(); if (srcsize > Integer.MAX_VALUE) { throw new IllegalArgumentException( "File too big to be loaded in memory"); } RandomAccessFile accessFile = new RandomAccessFile(src, "r"); byte[] array = new byte[(int) srcsize]; try { FileChannel fileChannel = accessFile.getChannel(); ByteBuffer byteBuffer = ByteBuffer.wrap(array); int read = 0; while (read < srcsize) { read += fileChannel.read(byteBuffer); } } finally { accessFile.close(); } return array; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFrom File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
readFrom
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
@Override protected Component newTopbarTitle(String componentId) { return new Label(componentId, "Branding"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newTopbarTitle File: server-core/src/main/java/io/onedev/server/web/page/admin/brandingsetting/BrandingSettingPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-552" ]
CVE-2022-39208
HIGH
7.5
theonedev/onedev
newTopbarTitle
server-core/src/main/java/io/onedev/server/web/page/admin/brandingsetting/BrandingSettingPage.java
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
0
Analyze the following code function for security vulnerabilities
@Override public void init(Fragment fragment) { if (fragment instanceof SplitLayoutListener) { ((SplitLayoutListener) fragment).setSplitLayoutSupported(mIsTwoPaneLayout); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
init
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
native boolean setAdapterPropertyNative(int type);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAdapterPropertyNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
setAdapterPropertyNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public boolean isStrict302Handling() { return strict302Handling; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStrict302Handling File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
isStrict302Handling
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("ResultOfMethodCallIgnored") @Inject(at = @At("TAIL"), method = "loadServerPack(Ljava/io/File;Lnet/minecraft/resource/ResourcePackSource;)Ljava/util/concurrent/CompletableFuture;") public void loadServerPack(File file, ResourcePackSource packSource, CallbackInfoReturnable<CompletableFuture<Void>> cir) { try (ZipResourcePack zipResourcePack = new ZipResourcePack("lmao", file, false)) { //noinspection DataFlowIssue ZipFile zipFile = ((ZipResourcePackInvoker) zipResourcePack).getTheZipFile(); try { Path path = MinecraftClient.getInstance().runDirectory.toPath().resolve("serverrp_exposer"); Files.createDirectories(path); int i = 1; while (Files.exists(path.resolve("server_resource_pack_" + i))) { i++; } path = path.resolve("server_resource_pack_" + i); ServerRPExposer.LOGGER.info("[ServerRPExposer] Copying server resource pack to: " + path); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryDestination = path.resolve(entry.getName()).toFile(); if (entry.isDirectory()) { entryDestination.mkdirs(); } else { entryDestination.getParentFile().mkdirs(); InputStream in = zipFile.getInputStream(entry); OutputStream out = new FileOutputStream(entryDestination); byte[] buffer = new byte[4096]; int len; while ((len = in.read(buffer)) >= 0) { out.write(buffer, 0, len); } in.close(); out.close(); } } } catch (IOException e) { ServerRPExposer.LOGGER.error("[ServerRPExposer] Failed to extract server resource pack!"); } } catch (IOException e) { ServerRPExposer.LOGGER.error("[ServerRPExposer] Failed to extract server resource pack!"); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2024-22779 - Severity: CRITICAL - CVSS Score: 9.8 Description: - bumped version to 1.0.3 - fixed vulnerability allowing servers to add files into arbitrary folders (unlikely but possible) Function: loadServerPack File: src/main/java/com/kihron/serverrpexposer/mixins/ServerResourcePackProviderMixin.java Repository: Kihron/ServerRPExposer Fixed Code: @SuppressWarnings("ResultOfMethodCallIgnored") @Inject(at = @At("TAIL"), method = "loadServerPack(Ljava/io/File;Lnet/minecraft/resource/ResourcePackSource;)Ljava/util/concurrent/CompletableFuture;") public void loadServerPack(File file, ResourcePackSource packSource, CallbackInfoReturnable<CompletableFuture<Void>> cir) { try (ZipResourcePack zipResourcePack = new ZipResourcePack("lmao", file, false)) { //noinspection DataFlowIssue ZipFile zipFile = ((ZipResourcePackInvoker) zipResourcePack).getTheZipFile(); try { Path path = MinecraftClient.getInstance().runDirectory.toPath().resolve("serverrp_exposer"); Files.createDirectories(path); int i = 1; while (Files.exists(path.resolve("server_resource_pack_" + i))) { i++; } path = path.resolve("server_resource_pack_" + i); ServerRPExposer.LOGGER.info("[ServerRPExposer] Copying server resource pack to: " + path); Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); File entryDestination = path.resolve(entry.getName()).toFile(); if (!entryDestination.getCanonicalPath().startsWith(path.toRealPath() + "/")) continue; if (entry.isDirectory()) { entryDestination.mkdirs(); } else { entryDestination.getParentFile().mkdirs(); InputStream in = zipFile.getInputStream(entry); OutputStream out = new FileOutputStream(entryDestination); byte[] buffer = new byte[4096]; int len; while ((len = in.read(buffer)) >= 0) { out.write(buffer, 0, len); } in.close(); out.close(); } } } catch (IOException e) { ServerRPExposer.LOGGER.error("[ServerRPExposer] Failed to extract server resource pack!"); } } catch (IOException e) { ServerRPExposer.LOGGER.error("[ServerRPExposer] Failed to extract server resource pack!"); } }
[ "CWE-22" ]
CVE-2024-22779
CRITICAL
9.8
Kihron/ServerRPExposer
loadServerPack
src/main/java/com/kihron/serverrpexposer/mixins/ServerResourcePackProviderMixin.java
8f7b829df633f59e828d677f736c53652d6f1b8f
1
Analyze the following code function for security vulnerabilities
@Override public String toString() { StringWriter buf = new StringWriter(); buf.write("type ="+type+"\n"); buf.write("pattern dir = "+patternDir.getAbsolutePath()); if (type == RUNTYPE.testinfo) { buf.write("info file = "+info); if (info != null) buf.write(", path = "+infoPath.getAbsolutePath()); } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
toString
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); reply.readException(); ParcelFileDescriptor pfd = null; if (reply.readInt() != 0) { pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); } data.recycle(); reply.recycle(); return pfd; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openContentUri File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
openContentUri
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@EJB(beanInterface = BackendLocal.class, mappedName = "java:global/engine/bll/Backend!org.ovirt.engine.core.common.interfaces.BackendLocal") public void setBackend(BackendLocal backend) { this.backend = backend; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBackend File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java Repository: oVirt/ovirt-engine The code follows secure coding practices.
[ "CWE-287" ]
CVE-2024-0822
HIGH
7.5
oVirt/ovirt-engine
setBackend
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
036f617316f6d7077cd213eb613eb4816e33d1fc
0
Analyze the following code function for security vulnerabilities
public String getShortRefererText(String referer, int length) { try { return this.xwiki.getRefererText(referer, getXWikiContext()).substring(0, length); } catch (Exception e) { return this.xwiki.getRefererText(referer, getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShortRefererText 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
getShortRefererText
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public boolean isAnimatingBetweenKeyguardAndSurfaceBehind() { return mSurfaceBehindRemoteAnimationRunning; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAnimatingBetweenKeyguardAndSurfaceBehind File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
isAnimatingBetweenKeyguardAndSurfaceBehind
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Nullable public static Message findLatestIncomingMessage( List<Message> messages) { for (int i = messages.size() - 1; i >= 0; i--) { Message m = messages.get(i); // Incoming messages have a non-empty sender. if (m.mSender != null && !TextUtils.isEmpty(m.mSender.getName())) { return m; } } if (!messages.isEmpty()) { // No incoming messages, fall back to outgoing message return messages.get(messages.size() - 1); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findLatestIncomingMessage File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
findLatestIncomingMessage
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void setCredential(String credential, String savedCredential, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCredential File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
setCredential
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
public boolean interceptTouchEvent(MotionEvent event) { if (DEBUG_GESTURES) { if (event.getActionMasked() != MotionEvent.ACTION_MOVE) { EventLog.writeEvent(EventLogTags.SYSUI_STATUSBAR_TOUCH, event.getActionMasked(), (int) event.getX(), (int) event.getY(), mDisabled1, mDisabled2); } } if (SPEW) { Log.d(TAG, "Touch: rawY=" + event.getRawY() + " event=" + event + " mDisabled1=" + mDisabled1 + " mDisabled2=" + mDisabled2 + " mTracking=" + mTracking); } else if (CHATTY) { if (event.getAction() != MotionEvent.ACTION_MOVE) { Log.d(TAG, String.format( "panel: %s at (%f, %f) mDisabled1=0x%08x mDisabled2=0x%08x", MotionEvent.actionToString(event.getAction()), event.getRawX(), event.getRawY(), mDisabled1, mDisabled2)); } } if (DEBUG_GESTURES) { mGestureRec.add(event); } if (mStatusBarWindowState == WINDOW_STATE_SHOWING) { final boolean upOrCancel = event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL; if (upOrCancel && !mExpandedVisible) { setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false); } else { setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: interceptTouchEvent 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
interceptTouchEvent
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private Item addItem(Context c, Collection[] mycollections, String path, String itemname, PrintWriter mapOut, boolean template) throws Exception { String mapOutputString = null; System.out.println("Adding item from directory " + itemname); // create workspace item Item myitem = null; WorkspaceItem wi = null; if (!isTest) { wi = WorkspaceItem.create(c, mycollections[0], template); myitem = wi.getItem(); } // now fill out dublin core for item loadMetadata(c, myitem, path + File.separatorChar + itemname + File.separatorChar); // and the bitstreams from the contents file // process contents file, add bistreams and bundles, return any // non-standard permissions List<String> options = processContentsFile(c, myitem, path + File.separatorChar + itemname, "contents"); if (useWorkflow) { // don't process handle file // start up a workflow if (!isTest) { // Should we send a workflow alert email or not? if (ConfigurationManager.getProperty("workflow", "workflow.framework").equals("xmlworkflow")) { if (useWorkflowSendEmail) { XmlWorkflowManager.start(c, wi); } else { XmlWorkflowManager.startWithoutNotify(c, wi); } } else { if (useWorkflowSendEmail) { WorkflowManager.start(c, wi); } else { WorkflowManager.startWithoutNotify(c, wi); } } // send ID to the mapfile mapOutputString = itemname + " " + myitem.getID(); } } else { // only process handle file if not using workflow system String myhandle = processHandleFile(c, myitem, path + File.separatorChar + itemname, "handle"); // put item in system if (!isTest) { try { InstallItem.installItem(c, wi, myhandle); } catch (Exception e) { wi.deleteAll(); log.error("Exception after install item, try to revert...", e); throw e; } // find the handle, and output to map file myhandle = HandleManager.findHandle(c, myitem); mapOutputString = itemname + " " + myhandle; } // set permissions if specified in contents file if (options.size() > 0) { System.out.println("Processing options"); processOptions(c, myitem, options); } } // now add to multiple collections if requested if (mycollections.length > 1) { for (int i = 1; i < mycollections.length; i++) { if (!isTest) { mycollections[i].addItem(myitem); } } } // made it this far, everything is fine, commit transaction if (mapOut != null) { mapOut.println(mapOutputString); } c.commit(); return myitem; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItem File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
addItem
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
protected abstract void doGet(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGet File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java Repository: openmrs/openmrs-core The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23612
MEDIUM
5
openmrs/openmrs-core
doGet
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
db8454bf19a092a78d53ee4dba2af628b730a6e7
0
Analyze the following code function for security vulnerabilities
protected void lockSession(WrappedSession wrappedSession) { Lock lock = getSessionLock(wrappedSession); if (lock == null) { /* * No lock found in the session attribute. Ensure only one lock is * created and used by everybody by doing double checked locking. * Assumes there is a memory barrier for the attribute (i.e. that * the CPU flushes its caches and reads the value directly from main * memory). */ synchronized (VaadinService.class) { lock = getSessionLock(wrappedSession); if (lock == null) { lock = new ReentrantLock(); setSessionLock(wrappedSession, lock); } } } lock.lock(); try { // Someone might have invalidated the session between fetching the // lock and acquiring it. Guard for this by calling a method that's // specified to throw IllegalStateException if invalidated // (#12282) wrappedSession.getAttribute(getLockAttributeName()); } catch (IllegalStateException e) { lock.unlock(); throw e; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lockSession File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
lockSession
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0