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
@Override public int getInstallLocation() { return android.provider.Settings.Global.getInt(mContext.getContentResolver(), android.provider.Settings.Global.DEFAULT_INSTALL_LOCATION, PackageHelper.APP_INSTALL_AUTO); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstallLocation 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
getInstallLocation
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public float[] getAnimationScales() { return new float[] { mWindowAnimationScaleSetting, mTransitionAnimationScaleSetting, mAnimatorDurationScaleSetting }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAnimationScales File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
getAnimationScales
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Column(name = "menu", nullable = false) public boolean isMenu() { return this.menu; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMenu File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-18927
LOW
3.5
sanluan/PublicCMS
isMenu
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java
2b411dc2821c69539138aaf7632b938b659a58fa
0
Analyze the following code function for security vulnerabilities
@Override public boolean providesPatternDao() { return providePatternDao; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: providesPatternDao File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
providesPatternDao
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public static File createTempFile(String ext) throws IOException { return File.createTempFile("okm", "." + ext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTempFile File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
createTempFile
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
@Deprecated public WearableExtender setHintShowBackgroundOnly(boolean hintShowBackgroundOnly) { setFlag(FLAG_HINT_SHOW_BACKGROUND_ONLY, hintShowBackgroundOnly); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHintShowBackgroundOnly File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setHintShowBackgroundOnly
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean bindHeaderTextSecondary(RemoteViews contentView, StandardTemplateParams p, boolean hasTextToLeft) { if (p.mHideSubText) { return false; } if (!TextUtils.isEmpty(p.headerTextSecondary)) { contentView.setTextViewText(R.id.header_text_secondary, processTextSpans( processLegacyText(p.headerTextSecondary))); setTextViewColorSecondary(contentView, R.id.header_text_secondary, p); contentView.setViewVisibility(R.id.header_text_secondary, View.VISIBLE); if (hasTextToLeft) { contentView.setViewVisibility(R.id.header_text_secondary_divider, View.VISIBLE); setTextViewColorSecondary(contentView, R.id.header_text_secondary_divider, p); } return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindHeaderTextSecondary File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bindHeaderTextSecondary
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override boolean canBeAnimationTarget() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canBeAnimationTarget 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
canBeAnimationTarget
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static void extractRelativeResource(Class<?> c, String path, File dest) throws FileNotFoundException, IOException { InputStream in = c.getResourceAsStream(path); OutputStream out = new FileOutputStream(dest); byte[] buf = new byte[1024]; int len = in.read(buf); while (true) { if (len > 0) { out.write(buf, 0, len); len = in.read(buf); } else { break; } } in.close(); out.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractRelativeResource File: src/main/java/org/lemsml/jlems/io/util/JUtil.java Repository: LEMS/jLEMS The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4583
HIGH
8.8
LEMS/jLEMS
extractRelativeResource
src/main/java/org/lemsml/jlems/io/util/JUtil.java
8c224637d7d561076364a9e3c2c375daeaf463dc
0
Analyze the following code function for security vulnerabilities
private void setTimeFromNITZString (String nitz, long nitzReceiveTime) { // "yy/mm/dd,hh:mm:ss(+/-)tz" // tz is in number of quarter-hours long start = SystemClock.elapsedRealtime(); if (DBG) {log("NITZ: " + nitz + "," + nitzReceiveTime + " start=" + start + " delay=" + (start - nitzReceiveTime)); } try { /* NITZ time (hour:min:sec) will be in UTC but it supplies the timezone * offset as well (which we won't worry about until later) */ Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT")); c.clear(); c.set(Calendar.DST_OFFSET, 0); String[] nitzSubs = nitz.split("[/:,+-]"); int year = 2000 + Integer.parseInt(nitzSubs[0]); c.set(Calendar.YEAR, year); // month is 0 based! int month = Integer.parseInt(nitzSubs[1]) - 1; c.set(Calendar.MONTH, month); int date = Integer.parseInt(nitzSubs[2]); c.set(Calendar.DATE, date); int hour = Integer.parseInt(nitzSubs[3]); c.set(Calendar.HOUR, hour); int minute = Integer.parseInt(nitzSubs[4]); c.set(Calendar.MINUTE, minute); int second = Integer.parseInt(nitzSubs[5]); c.set(Calendar.SECOND, second); boolean sign = (nitz.indexOf('-') == -1); int tzOffset = Integer.parseInt(nitzSubs[6]); int dst = (nitzSubs.length >= 8 ) ? Integer.parseInt(nitzSubs[7]) : 0; // The zone offset received from NITZ is for current local time, // so DST correction is already applied. Don't add it again. // // tzOffset += dst * 4; // // We could unapply it if we wanted the raw offset. tzOffset = (sign ? 1 : -1) * tzOffset * 15 * 60 * 1000; TimeZone zone = null; // As a special extension, the Android emulator appends the name of // the host computer's timezone to the nitz string. this is zoneinfo // timezone name of the form Area!Location or Area!Location!SubLocation // so we need to convert the ! into / if (nitzSubs.length >= 9) { String tzname = nitzSubs[8].replace('!','/'); zone = TimeZone.getTimeZone( tzname ); } String iso = ((TelephonyManager) mPhone.getContext(). getSystemService(Context.TELEPHONY_SERVICE)). getNetworkCountryIsoForPhone(mPhone.getPhoneId()); if (zone == null) { if (mGotCountryCode) { if (iso != null && iso.length() > 0) { zone = TimeUtils.getTimeZone(tzOffset, dst != 0, c.getTimeInMillis(), iso); } else { // We don't have a valid iso country code. This is // most likely because we're on a test network that's // using a bogus MCC (eg, "001"), so get a TimeZone // based only on the NITZ parameters. zone = getNitzTimeZone(tzOffset, (dst != 0), c.getTimeInMillis()); } } } if ((zone == null) || (mZoneOffset != tzOffset) || (mZoneDst != (dst != 0))){ // We got the time before the country or the zone has changed // so we don't know how to identify the DST rules yet. Save // the information and hope to fix it up later. mNeedFixZoneAfterNitz = true; mZoneOffset = tzOffset; mZoneDst = dst != 0; mZoneTime = c.getTimeInMillis(); } if (zone != null) { if (getAutoTimeZone()) { setAndBroadcastNetworkSetTimeZone(zone.getID()); } saveNitzTimeZone(zone.getID()); } String ignore = SystemProperties.get("gsm.ignore-nitz"); if (ignore != null && ignore.equals("yes")) { log("NITZ: Not setting clock because gsm.ignore-nitz is set"); return; } try { mWakeLock.acquire(); if (getAutoTime()) { long millisSinceNitzReceived = SystemClock.elapsedRealtime() - nitzReceiveTime; if (millisSinceNitzReceived < 0) { // Sanity check: something is wrong if (DBG) { log("NITZ: not setting time, clock has rolled " + "backwards since NITZ time was received, " + nitz); } return; } if (millisSinceNitzReceived > Integer.MAX_VALUE) { // If the time is this far off, something is wrong > 24 days! if (DBG) { log("NITZ: not setting time, processing has taken " + (millisSinceNitzReceived / (1000 * 60 * 60 * 24)) + " days"); } return; } // Note: with range checks above, cast to int is safe c.add(Calendar.MILLISECOND, (int)millisSinceNitzReceived); if (DBG) { log("NITZ: Setting time of day to " + c.getTime() + " NITZ receive delay(ms): " + millisSinceNitzReceived + " gained(ms): " + (c.getTimeInMillis() - System.currentTimeMillis()) + " from " + nitz); } setAndBroadcastNetworkSetTime(c.getTimeInMillis()); Rlog.i(LOG_TAG, "NITZ: after Setting time of day"); } SystemProperties.set("gsm.nitz.time", String.valueOf(c.getTimeInMillis())); saveNitzTime(c.getTimeInMillis()); if (VDBG) { long end = SystemClock.elapsedRealtime(); log("NITZ: end=" + end + " dur=" + (end - start)); } mNitzUpdatedTime = true; } finally { mWakeLock.release(); } } catch (RuntimeException ex) { loge("NITZ: Parsing NITZ time " + nitz + " ex=" + ex); } }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2016-3831 - Severity: MEDIUM - CVSS Score: 5.0 Description: backport security fix: avoid set NITZ time to 2038 Bug: 29083635 Change-Id: I21c5f4147d8146f92b7e33f0967a179ae644a263 Function: setTimeFromNITZString File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android Fixed Code: private void setTimeFromNITZString (String nitz, long nitzReceiveTime) { // "yy/mm/dd,hh:mm:ss(+/-)tz" // tz is in number of quarter-hours long start = SystemClock.elapsedRealtime(); if (DBG) {log("NITZ: " + nitz + "," + nitzReceiveTime + " start=" + start + " delay=" + (start - nitzReceiveTime)); } try { /* NITZ time (hour:min:sec) will be in UTC but it supplies the timezone * offset as well (which we won't worry about until later) */ Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT")); c.clear(); c.set(Calendar.DST_OFFSET, 0); String[] nitzSubs = nitz.split("[/:,+-]"); int year = 2000 + Integer.parseInt(nitzSubs[0]); if (year > MAX_NITZ_YEAR) { if (DBG) loge("NITZ year: " + year + " exceeds limit, skip NITZ time update"); return; } c.set(Calendar.YEAR, year); // month is 0 based! int month = Integer.parseInt(nitzSubs[1]) - 1; c.set(Calendar.MONTH, month); int date = Integer.parseInt(nitzSubs[2]); c.set(Calendar.DATE, date); int hour = Integer.parseInt(nitzSubs[3]); c.set(Calendar.HOUR, hour); int minute = Integer.parseInt(nitzSubs[4]); c.set(Calendar.MINUTE, minute); int second = Integer.parseInt(nitzSubs[5]); c.set(Calendar.SECOND, second); boolean sign = (nitz.indexOf('-') == -1); int tzOffset = Integer.parseInt(nitzSubs[6]); int dst = (nitzSubs.length >= 8 ) ? Integer.parseInt(nitzSubs[7]) : 0; // The zone offset received from NITZ is for current local time, // so DST correction is already applied. Don't add it again. // // tzOffset += dst * 4; // // We could unapply it if we wanted the raw offset. tzOffset = (sign ? 1 : -1) * tzOffset * 15 * 60 * 1000; TimeZone zone = null; // As a special extension, the Android emulator appends the name of // the host computer's timezone to the nitz string. this is zoneinfo // timezone name of the form Area!Location or Area!Location!SubLocation // so we need to convert the ! into / if (nitzSubs.length >= 9) { String tzname = nitzSubs[8].replace('!','/'); zone = TimeZone.getTimeZone( tzname ); } String iso = ((TelephonyManager) mPhone.getContext(). getSystemService(Context.TELEPHONY_SERVICE)). getNetworkCountryIsoForPhone(mPhone.getPhoneId()); if (zone == null) { if (mGotCountryCode) { if (iso != null && iso.length() > 0) { zone = TimeUtils.getTimeZone(tzOffset, dst != 0, c.getTimeInMillis(), iso); } else { // We don't have a valid iso country code. This is // most likely because we're on a test network that's // using a bogus MCC (eg, "001"), so get a TimeZone // based only on the NITZ parameters. zone = getNitzTimeZone(tzOffset, (dst != 0), c.getTimeInMillis()); } } } if ((zone == null) || (mZoneOffset != tzOffset) || (mZoneDst != (dst != 0))){ // We got the time before the country or the zone has changed // so we don't know how to identify the DST rules yet. Save // the information and hope to fix it up later. mNeedFixZoneAfterNitz = true; mZoneOffset = tzOffset; mZoneDst = dst != 0; mZoneTime = c.getTimeInMillis(); } if (zone != null) { if (getAutoTimeZone()) { setAndBroadcastNetworkSetTimeZone(zone.getID()); } saveNitzTimeZone(zone.getID()); } String ignore = SystemProperties.get("gsm.ignore-nitz"); if (ignore != null && ignore.equals("yes")) { log("NITZ: Not setting clock because gsm.ignore-nitz is set"); return; } try { mWakeLock.acquire(); if (getAutoTime()) { long millisSinceNitzReceived = SystemClock.elapsedRealtime() - nitzReceiveTime; if (millisSinceNitzReceived < 0) { // Sanity check: something is wrong if (DBG) { log("NITZ: not setting time, clock has rolled " + "backwards since NITZ time was received, " + nitz); } return; } if (millisSinceNitzReceived > Integer.MAX_VALUE) { // If the time is this far off, something is wrong > 24 days! if (DBG) { log("NITZ: not setting time, processing has taken " + (millisSinceNitzReceived / (1000 * 60 * 60 * 24)) + " days"); } return; } // Note: with range checks above, cast to int is safe c.add(Calendar.MILLISECOND, (int)millisSinceNitzReceived); if (DBG) { log("NITZ: Setting time of day to " + c.getTime() + " NITZ receive delay(ms): " + millisSinceNitzReceived + " gained(ms): " + (c.getTimeInMillis() - System.currentTimeMillis()) + " from " + nitz); } setAndBroadcastNetworkSetTime(c.getTimeInMillis()); Rlog.i(LOG_TAG, "NITZ: after Setting time of day"); } SystemProperties.set("gsm.nitz.time", String.valueOf(c.getTimeInMillis())); saveNitzTime(c.getTimeInMillis()); if (VDBG) { long end = SystemClock.elapsedRealtime(); log("NITZ: end=" + end + " dur=" + (end - start)); } mNitzUpdatedTime = true; } finally { mWakeLock.release(); } } catch (RuntimeException ex) { loge("NITZ: Parsing NITZ time " + nitz + " ex=" + ex); } }
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
setTimeFromNITZString
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
1
Analyze the following code function for security vulnerabilities
@Test public void createsCountQueryForDistinctQueries() throws Exception { assertCountQuery("select distinct u from User u where u.foo = ?", "select count(distinct u) from User u where u.foo = ?"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createsCountQueryForDistinctQueries File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
createsCountQueryForDistinctQueries
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
@Override public void addBTEItems(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template, String inputType, String workingDir) throws Exception { //Determine the folder where BTE will output the results String outputFolder = null; if (workingDir == null){ //This indicates a command line import, create a random path File importDir = new File(ConfigurationManager.getProperty("org.dspace.app.batchitemimport.work.dir")); if (!importDir.exists()){ boolean success = importDir.mkdir(); if (!success) { log.info("Cannot create batch import directory!"); throw new Exception("Cannot create batch import directory!"); } } //Get a random folder in case two admins batch import data at the same time outputFolder = importDir + File.separator + generateRandomFilename(true); } else { //This indicates a UI import, working dir is preconfigured outputFolder = workingDir; } BTEBatchImportService dls = new DSpace().getSingletonService(BTEBatchImportService.class); DataLoader dataLoader = dls.getDataLoaders().get(inputType); Map<String, String> outputMap = dls.getOutputMap(); TransformationEngine te = dls.getTransformationEngine(); if (dataLoader==null){ System.out.println("ERROR: The key used in -i parameter must match a valid DataLoader in the BTE Spring XML configuration file!"); return; } if (outputMap==null){ System.out.println("ERROR: The key used in -i parameter must match a valid outputMapping in the BTE Spring XML configuration file!"); return; } if (dataLoader instanceof FileDataLoader){ FileDataLoader fdl = (FileDataLoader) dataLoader; if (!StringUtils.isBlank(sourceDir)) { System.out.println("INFO: Dataloader will load data from the file specified in the command prompt (and not from the Spring XML configuration file)"); fdl.setFilename(sourceDir); } } else if (dataLoader instanceof OAIPMHDataLoader){ OAIPMHDataLoader fdl = (OAIPMHDataLoader) dataLoader; System.out.println(sourceDir); if (!StringUtils.isBlank(sourceDir)){ System.out.println("INFO: Dataloader will load data from the address specified in the command prompt (and not from the Spring XML configuration file)"); fdl.setServerAddress(sourceDir); } } if (dataLoader!=null){ System.out.println("INFO: Dataloader " + dataLoader.toString()+" will be used for the import!"); te.setDataLoader(dataLoader); DSpaceOutputGenerator outputGenerator = new DSpaceOutputGenerator(outputMap); outputGenerator.setOutputDirectory(outputFolder); te.setOutputGenerator(outputGenerator); try { TransformationResult res = te.transform(new TransformationSpec()); List<String> output = res.getOutput(); outputGenerator.writeOutput(output); } catch (Exception e) { System.err.println("Exception"); e.printStackTrace(); throw e; } addItems(c, mycollections, outputFolder, mapFile, template); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBTEItems 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
addBTEItems
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
@Deprecated public List<String> searchDocuments(String wheresql, int nb, int start) throws XWikiException { return this.xwiki.getStore().searchDocumentsNames(wheresql, nb, start, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocuments 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
searchDocuments
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 JSONObject saveFile() { JSONObject array = new JSONObject(); try { String content = this.get.get("content"); content = FileManagerUtils.decodeContent(content); // before bakup bakupFile(new File(getRealFilePath())); FileManagerUtils.writeString(getRealFilePath(), content); array.put("Path", this.get.get("path")); array.put("Error", ""); array.put("Code", 0); } catch (JSONException e) { logger.error("JSONObject error", e); this.error("JSONObject error"); } catch (IOException e) { logger.error("IOException error", e); this.error("IOException error"); } return array; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveFile File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java Repository: jflyfox/jfinal_cms The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-37262
MEDIUM
5
jflyfox/jfinal_cms
saveFile
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
public static String generatePageId(String pageName) { try { String encoded = new String(Base64.encodeBase64(pageName.getBytes("utf-8")), "us-ascii"); encoded = encoded.replace('/', '_'); //base64 can contain "/" so we have to replace them return encoded; } catch (UnsupportedEncodingException e) { throw new OLATRuntimeException(WikiManager.class, "Encoding UTF-8 not supported by your platform!", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generatePageId File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
generatePageId
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String characterEncoding = getCharacterEncoding(); if (characterEncoding != null) { request.setCharacterEncoding(characterEncoding); } // Look for unauthorized status if (isUnauthorized(response)) { handleUnauthorizedResponse(request, response); return; } // first, we populate all required parameters sent into session for later retrieval. If they exists. populateSessionWithSAMLParameters(request); // get an authenticated user or tries to authenticate if this is a authentication request Principal userPrincipal = request.getPrincipal(); if (userPrincipal == null) { if (getIdpConfiguration().isSSLClientAuthentication()) { if (request.isSecure()) { getSSLAuthenticator().invoke(request, response); // we always reset/recycle the response to remove any data written to the response by the ssl // authenticator response.resetBuffer(); response.recycle(); } } } HttpSession session = request.getSession(); if (isAjaxRequest(request) && session.getAttribute(IDP_SESSION_USER) == null) { response.sendError(403); return; } invokeNextValve(request, response); userPrincipal = request.getUserPrincipal(); // we only handle SAML messages for authenticated users. if (userPrincipal != null) { if (session.getAttribute(IDP_SESSION_USER) == null) { session.setAttribute(IDP_SESSION_USER, userPrincipal); } if (isGlobalLogout(request) && request.getParameter(SAML_REQUEST_KEY) == null) { prepareLocalGlobalLogoutRequest(request, userPrincipal); } handleSAMLMessage(request, response); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2015-3158 - Severity: MEDIUM - CVSS Score: 4.0 Description: [PLINK-708] - Checking if user is authorized right after authentication. Function: invoke File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings Fixed Code: @Override public void invoke(Request request, Response response) throws IOException, ServletException { String characterEncoding = getCharacterEncoding(); if (characterEncoding != null) { request.setCharacterEncoding(characterEncoding); } // Look for unauthorized status if (isUnauthorized(response)) { handleUnauthorizedResponse(request, response); return; } // first, we populate all required parameters sent into session for later retrieval. If they exists. populateSessionWithSAMLParameters(request); // get an authenticated user or tries to authenticate if this is a authentication request Principal userPrincipal = request.getPrincipal(); if (userPrincipal == null) { if (getIdpConfiguration().isSSLClientAuthentication()) { if (request.isSecure()) { getSSLAuthenticator().invoke(request, response); // we always reset/recycle the response to remove any data written to the response by the ssl // authenticator response.resetBuffer(); response.recycle(); } } } HttpSession session = request.getSession(); if (isAjaxRequest(request) && session.getAttribute(IDP_SESSION_USER) == null) { response.sendError(403); return; } invokeNextValve(request, response); if (isUnauthorized(response)) { return; } userPrincipal = request.getUserPrincipal(); // we only handle SAML messages for authenticated users. if (userPrincipal != null) { if (session.getAttribute(IDP_SESSION_USER) == null) { session.setAttribute(IDP_SESSION_USER, userPrincipal); } if (isGlobalLogout(request) && request.getParameter(SAML_REQUEST_KEY) == null) { prepareLocalGlobalLogoutRequest(request, userPrincipal); } handleSAMLMessage(request, response); } }
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
invoke
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
1
Analyze the following code function for security vulnerabilities
public void writeRecords(final Object iRecords, final String iFetchPlan, String iFormat, final String accept) throws IOException { writeRecords(iRecords, iFetchPlan, iFormat, accept, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeRecords File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
writeRecords
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
public static String getCurrentDescriptorByNameUrl() { return Descriptor.getCurrentDescriptorByNameUrl(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentDescriptorByNameUrl File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getCurrentDescriptorByNameUrl
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
public static int[] uncompressIntArray(byte[] input, int offset, int length) throws IOException { int uncompressedLength = Snappy.uncompressedLength(input, offset, length); int[] result = new int[uncompressedLength / 4]; impl.rawUncompress(input, offset, length, result, 0); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uncompressIntArray File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
uncompressIntArray
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
@Override public String getModalTitle() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModalTitle File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getModalTitle
src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
public static Set<String> getAccessibleProperties(Class cls) { /** @todo This is a hack to get the "real" class - find out if there is an API method in CGLIB that can be used instead */ if (cls.getName().contains("EnhancerByCGLIB")) cls = cls.getSuperclass(); if (!accessibleProperties.containsKey(cls)) { synchronized(accessibleProperties) { if (!accessibleProperties.containsKey(cls)) { Set<String> properties = new HashSet<String>(); Class c = cls; while (c != null && !c.equals(Object.class)) { for (Field f : c.getDeclaredFields()) { if (!Modifier.isTransient(f.getModifiers()) && !Modifier.isStatic(f.getModifiers())) { String fieldName = f.getName().substring(0, 1).toUpperCase() + f.getName().substring(1); String getterName = String.format("get%s", fieldName); String setterName = String.format("set%s", fieldName); Method getMethod = null; Method setMethod = null; try { getMethod = c.getMethod(getterName); } catch (SecurityException ex) {} catch (NoSuchMethodException ex) { // it might be an "is" method... getterName = String.format("is%s", fieldName); try { getMethod = c.getMethod(getterName); } catch (NoSuchMethodException ex2) { /* don't care */} } try { setMethod = c.getMethod(setterName, new Class[] {f.getType()}); } catch (SecurityException ex) {} catch (NoSuchMethodException ex) { /* don't care */} if (Modifier.isPublic(f.getModifiers()) || (getMethod != null && Modifier.isPublic(getMethod.getModifiers()) || (setMethod != null && Modifier.isPublic(setMethod.getModifiers())))) { properties.add(f.getName()); } } } // for (Method m : c.getDeclaredMethods()) { if (m.getName().startsWith("get") || m.getName().startsWith("is")) { int startIdx = m.getName().startsWith("get") ? 3 : 2; try { c.getMethod(String.format("set%s", m.getName().substring(startIdx)), m.getReturnType()); } catch (NoSuchMethodException ex) { continue; } String propertyName = String.format("%s%s", Character.toLowerCase(m.getName().charAt(startIdx)), m.getName().substring(startIdx + 1)); if (!properties.contains(propertyName)) properties.add(propertyName); } } c = c.getSuperclass(); } accessibleProperties.put(cls, properties); } } } return accessibleProperties.get(cls); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccessibleProperties File: jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/InterfaceGenerator.java Repository: seam2/jboss-seam The code follows secure coding practices.
[ "CWE-264", "CWE-200" ]
CVE-2013-6447
MEDIUM
5
seam2/jboss-seam
getAccessibleProperties
jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/InterfaceGenerator.java
090aa6252affc978a96c388e3fc2c1c2688d9bb5
0
Analyze the following code function for security vulnerabilities
public void removeContentProviderExternal(String name, IBinder token) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeContentProviderExternal File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
removeContentProviderExternal
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected Padding getPadding() { return padding; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPadding File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
getPadding
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
private void handleFinancedDeviceKioskRoleChange() { if (!isPolicyEngineForFinanceFlagEnabled()) { return; } Slog.i(LOG_TAG, "Handling action " + ACTION_DEVICE_FINANCING_STATE_CHANGED); Intent intent = new Intent(ACTION_DEVICE_FINANCING_STATE_CHANGED); mInjector.binderWithCleanCallingIdentity(() -> { for (UserInfo userInfo : mUserManager.getUsers()) { UserHandle user = userInfo.getUserHandle(); broadcastExplicitIntentToRoleHolder( intent, RoleManager.ROLE_SYSTEM_SUPERVISION, user); broadcastExplicitIntentToRoleHolder( intent, RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT, user); ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(user.getIdentifier()); if (admin == null) { continue; } if (!isProfileOwnerOfOrganizationOwnedDevice( admin.info.getComponent(), user.getIdentifier()) && !isDeviceOwner(admin) && !(isProfileOwner(admin.info.getComponent(), user.getIdentifier()) && admin.getUserHandle().isSystem())) { continue; } // Don't send the broadcast twice if the DPC is the same package as the // DMRH if (admin.info.getPackageName().equals(getDeviceManagementRoleHolder(user))) { continue; } broadcastExplicitIntentToPackage( intent, admin.info.getPackageName(), admin.getUserHandle()); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleFinancedDeviceKioskRoleChange 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
handleFinancedDeviceKioskRoleChange
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private String[] toStringArray(Iterable iterable) { List<String> args = new ArrayList<String>(); for (Object obj : iterable) { args.add(String.valueOf(obj)); } return args.toArray(new String[args.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toStringArray File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-285" ]
CVE-2023-48241
HIGH
7.5
xwiki/xwiki-platform
toStringArray
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java
93b8ec702d7075f0f5794bb05dfb651382596764
0
Analyze the following code function for security vulnerabilities
@Override public void onLowMemory() { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLowMemory 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
onLowMemory
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private Properties loadFromStream(InputStream stream) { Properties properties = new Properties(); try { properties.load(stream); } catch (IOException e) { throw new HotRodClientException("Issues configuring from client hotrod-client.properties", e); } return properties; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadFromStream File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
loadFromStream
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
public int getRequestedPasswordMinimumSymbols(int userId) { return getDevicePolicyManager().getPasswordMinimumSymbols(null, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestedPasswordMinimumSymbols 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
getRequestedPasswordMinimumSymbols
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public void onPageFinished(WebView view, String url) { parent.fireWebEvent("onLoad", new ActionEvent(url)); super.onPageFinished(view, url); setShouldCalcPreferredSize(true); dismissProgress(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPageFinished 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
onPageFinished
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private static int handleVmArgs(JavaConfig javaConfig) { if (javaConfig.getLaunchProperties() == null) { System.out.println("Launch properties file was not specified!"); return EXIT_FAILURE; } System.out.println(javaConfig.getLaunchProperties().getVmArgs()); return EXIT_SUCCESS; }
Vulnerability Classification: - CWE: CWE-77 - CVE: CVE-2023-22671 - Severity: CRITICAL - CVSS Score: 9.8 Description: GP-2987: No longer using eval in launch.sh Function: handleVmArgs File: GhidraBuild/LaunchSupport/src/main/java/LaunchSupport.java Repository: NationalSecurityAgency/ghidra Fixed Code: private static int handleVmArgs(JavaConfig javaConfig) { if (javaConfig.getLaunchProperties() == null) { System.out.println("Launch properties file was not specified!"); return EXIT_FAILURE; } javaConfig.getLaunchProperties().getVmArgList().forEach(arg -> System.out.println(arg)); return EXIT_SUCCESS; }
[ "CWE-77" ]
CVE-2023-22671
CRITICAL
9.8
NationalSecurityAgency/ghidra
handleVmArgs
GhidraBuild/LaunchSupport/src/main/java/LaunchSupport.java
1640b544c3d99b5ce8a89d9ca4b540da22be3a0e
1
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object o) { return o instanceof DefaultHttpHeaders && headers.equals(((DefaultHttpHeaders) o).headers, CASE_SENSITIVE_HASHER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
equals
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
Right getLikeRight();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLikeRight File: xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2023-35152
HIGH
8.8
xwiki/xwiki-platform
getLikeRight
xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java
0993a7ab3c102f9ac37ffe361a83a3dc302c0e45
0
Analyze the following code function for security vulnerabilities
protected Lock getSessionLock(WrappedSession wrappedSession) { Object lock = wrappedSession.getAttribute(getLockAttributeName()); if (lock instanceof ReentrantLock) { return (ReentrantLock) lock; } if (lock == null) { return null; } throw new RuntimeException( "Something else than a ReentrantLock was stored in the " + getLockAttributeName() + " in the session"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSessionLock 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
getSessionLock
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
Transformer getTransformer() throws TransformerConfigurationException { if (transformer == null) { transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); } return transformer; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-36640 - Severity: MEDIUM - CVSS Score: 4.9 Description: fix(vulnerabilities): fix XXE attacks vulnerabilities and other code smell (#17) * Access to external entities and network access should always be disable to avoid XXS attacks vulnerabilities. * Log error properly * refactor logger name to be compliant with java naming conventions Function: getTransformer File: src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java Repository: bonitasoft/bonita-connector-webservice Fixed Code: Transformer getTransformer() throws TransformerConfigurationException { if (transformer == null) { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); } return transformer; }
[ "CWE-611" ]
CVE-2020-36640
MEDIUM
4.9
bonitasoft/bonita-connector-webservice
getTransformer
src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
a12ad691c05af19e9061d7949b6b828ce48815d5
1
Analyze the following code function for security vulnerabilities
public char next(char c) throws JSONException { char n = this.next(); if (n != c) { if(n > 0) { throw this.syntaxError("Expected '" + c + "' and instead saw '" + n + "'"); } throw this.syntaxError("Expected '" + c + "' and instead saw ''"); } return n; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45690
HIGH
7.5
stleary/JSON-java
next
src/main/java/org/json/JSONTokener.java
7a124d857dc8da1165c87fa788e53359a317d0f7
0
Analyze the following code function for security vulnerabilities
public String getRealm() { // Assumption that issuer contains realm name return token.getIssuer().substring(token.getIssuer().lastIndexOf('/') + 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRealm File: core/src/main/java/org/keycloak/KeycloakSecurityContext.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
getRealm
core/src/main/java/org/keycloak/KeycloakSecurityContext.java
d5483d884de797e2ef6e69f92085bc10bf87e864
0
Analyze the following code function for security vulnerabilities
@Override boolean prepareSync() { if (!super.prepareSync()) { return false; } // In the WindowContainer implementation we immediately mark ready // since a generic WindowContainer only needs to wait for its // children to finish and is immediately ready from its own // perspective but at the WindowState level we need to wait for ourselves // to draw even if the children draw first or don't need to sync, so we start // in WAITING state rather than READY. mSyncState = SYNC_STATE_WAITING_FOR_DRAW; mSyncSeqId++; requestRedrawForSync(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareSync File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
prepareSync
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public void run() { try { for (; ; ) { byte[] buf = new byte[8192]; int l = out.read(buf); InputStreamReader r = new InputStreamReader(new ByteArrayInputStream(buf, 0, l)); StringBuilder sb = new StringBuilder(); for (; ; ) { int c = r.read(); if (c == -1) { break; } sb.append((char) c); } if (sb.length() > 0) { terminal.write(sb.toString()); } String s = terminal.read(); if (s != null && s.length() > 0) { for (byte b : s.getBytes()) { in.write(b); } } } } catch (IOException e) { closed = true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: hawtio-karaf-terminal/src/main/java/io/hawt/web/plugin/karaf/terminal/TerminalServlet.java Repository: hawtio The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0120
MEDIUM
6.8
hawtio
run
hawtio-karaf-terminal/src/main/java/io/hawt/web/plugin/karaf/terminal/TerminalServlet.java
b4e23e002639c274a2f687ada980118512f06113
0
Analyze the following code function for security vulnerabilities
public List<DeletedAttachment> getDeletedAttachments(String docName) { try { List<com.xpn.xwiki.doc.DeletedAttachment> attachments = this.xwiki.getDeletedAttachments(docName, this.context); if (attachments == null || attachments.isEmpty()) { attachments = Collections.emptyList(); } List<DeletedAttachment> result = new ArrayList<DeletedAttachment>(attachments.size()); for (com.xpn.xwiki.doc.DeletedAttachment attachment : attachments) { result.add(new DeletedAttachment(attachment, this.context)); } return result; } catch (Exception ex) { LOGGER.warn("Failed to retrieve deleted attachments", ex); } return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeletedAttachments 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
getDeletedAttachments
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 isInInlineEditMode() { String currentURL = getDriver().getCurrentUrl(); // Keep checking the deprecated inline action for backward compatibility. return currentURL.contains("editor=inline") || currentURL.contains("/inline/"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInInlineEditMode File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
isInInlineEditMode
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public boolean isLast() throws SQLException { checkClosed(); if (onInsertRow) { return false; } List<Tuple> rows = castNonNull(this.rows, "rows"); final int rows_size = rows.size(); if (rows_size == 0) { return false; // No rows. } if (currentRow != (rows_size - 1)) { return false; // Not on the last row of this block. } // We are on the last row of the current block. ResultCursor cursor = this.cursor; if (cursor == null) { // This is the last block and therefore the last row. return true; } if (maxRows > 0 && rowOffset + currentRow == maxRows) { // We are implicitly limited by maxRows. return true; } // Now the more painful case begins. // We are on the last row of the current block, but we don't know if the // current block is the last block; we must try to fetch some more data to // find out. // We do a fetch of the next block, then prepend the current row to that // block (so currentRow == 0). This works as the current row // must be the last row of the current block if we got this far. rowOffset += rows_size - 1; // Discarding all but one row. // Work out how many rows maxRows will let us fetch. int fetchRows = fetchSize; int adaptiveFetchRows = connection.getQueryExecutor() .getAdaptiveFetchSize(adaptiveFetch, cursor); if (adaptiveFetchRows != -1) { fetchRows = adaptiveFetchRows; } if (maxRows != 0) { if (fetchRows == 0 || rowOffset + fetchRows > maxRows) { // Fetch would exceed maxRows, limit it. fetchRows = maxRows - rowOffset; } } // Do the actual fetch. connection.getQueryExecutor() .fetch(cursor, new CursorResultHandler(), fetchRows, adaptiveFetch); // After fetch, update last used fetch size (could be useful during adaptive fetch). lastUsedFetchSize = fetchRows; rows = castNonNull(this.rows, "rows"); // Now prepend our one saved row and move to it. rows.add(0, castNonNull(thisRow)); currentRow = 0; // Finally, now we can tell if we're the last row or not. return (rows.size() == 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLast File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
isLast
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public List<ActivityManager.AppTask> getAppTasks(String pkgName, int uid) { ArrayList<ActivityManager.AppTask> tasks = new ArrayList<>(); List<IBinder> appTasks = ActivityTaskManagerService.this.getAppTasks(pkgName, uid); int numAppTasks = appTasks.size(); for (int i = 0; i < numAppTasks; i++) { tasks.add(new ActivityManager.AppTask(IAppTask.Stub.asInterface(appTasks.get(i)))); } return tasks; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppTasks File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getAppTasks
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public boolean getFeature(final String key) throws SAXNotRecognizedException { if (!getRecognizedFeatures().contains(key)) throw new SAXNotRecognizedException(key); return features.get(key) == Boolean.TRUE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFeature File: src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java Repository: orbeon/orbeon-forms The code follows secure coding practices.
[ "CWE-264" ]
CVE-2010-3260
MEDIUM
6.4
orbeon/orbeon-forms
getFeature
src/java/org/orbeon/oxf/xml/xerces/XercesSAXParserFactoryImpl.java
aba6681660f65af7f1676434da68c10298c30200
0
Analyze the following code function for security vulnerabilities
private ObjectNode getNestedOptions(ImportingJob job, TreeImportingParserBase parser) { ObjectNode options = parser.createParserUIInitializationData( job, new LinkedList<>(), "text/json"); ArrayNode path = ParsingUtilities.mapper.createArrayNode(); path.add("results"); path.add("result"); JSONUtilities.safePut(options, "recordPath", path); return options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNestedOptions File: main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
getNestedOptions
main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java
79994e86da1a3eecc62723f4ba90f14a63ad0e72
0
Analyze the following code function for security vulnerabilities
public void requestPinShortcut(Context context, ShortcutInfo shortcutInfo) { ShortcutManager sm = context.getSystemService(ShortcutManager.class); sm.requestPinShortcut(shortcutInfo, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestPinShortcut File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
requestPinShortcut
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
@Override public void setTaskResizeable(int taskId, boolean resizeable) { synchronized (this) { TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId, false); if (task == null) { Slog.w(TAG, "setTaskResizeable: taskId=" + taskId + " not found"); return; } if (task.mResizeable != resizeable) { task.mResizeable = resizeable; mStackSupervisor.ensureActivitiesVisibleLocked(null, 0); mStackSupervisor.resumeTopActivitiesLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskResizeable File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
setTaskResizeable
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void scheduleLocalNotification(LocalNotification notif, long firstTime, int repeat) { final Intent notificationIntent = new Intent(getContext(), LocalNotificationPublisher.class); notificationIntent.setAction(getContext().getApplicationInfo().packageName + "." + notif.getId()); notificationIntent.putExtra(LocalNotificationPublisher.NOTIFICATION, createBundleFromNotification(notif)); Intent contentIntent = new Intent(); if (activityComponentName != null) { contentIntent.setComponent(activityComponentName); } else { try { contentIntent.setComponent(getContext().getPackageManager().getLaunchIntentForPackage(getContext().getApplicationInfo().packageName).getComponent()); } catch (Exception ex) { System.err.println("Failed to get the component name for local notification. Local notification may not work."); ex.printStackTrace(); } } contentIntent.putExtra("LocalNotificationID", notif.getId()); if (BACKGROUND_FETCH_NOTIFICATION_ID.equals(notif.getId()) && getBackgroundFetchListener() != null) { Context context = AndroidNativeUtil.getContext(); Intent intent = new Intent(context, BackgroundFetchHandler.class); //there is an bug that causes this to not to workhttps://code.google.com/p/android/issues/detail?id=81812 //intent.putExtra("backgroundClass", getBackgroundLocationListener().getName()); //an ugly workaround to the putExtra bug intent.setData(Uri.parse("http://codenameone.com/a?" + getBackgroundFetchListener().getClass().getName())); PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); notificationIntent.putExtra(LocalNotificationPublisher.BACKGROUND_FETCH_INTENT, pendingIntent); } else { contentIntent.setData(Uri.parse("http://codenameone.com/a?LocalNotificationID="+Uri.encode(notif.getId()))); } PendingIntent pendingContentIntent = PendingIntent.getActivity(getContext(), 0, contentIntent, PendingIntent.FLAG_UPDATE_CURRENT); notificationIntent.putExtra(LocalNotificationPublisher.NOTIFICATION_INTENT, pendingContentIntent); PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE); if (BACKGROUND_FETCH_NOTIFICATION_ID.equals(notif.getId())) { alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, getPreferredBackgroundFetchInterval() * 1000, pendingIntent); } else { if(repeat == LocalNotification.REPEAT_NONE){ alarmManager.set(AlarmManager.RTC_WAKEUP, firstTime, pendingIntent); }else if(repeat == LocalNotification.REPEAT_MINUTE){ alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, 60*1000, pendingIntent); }else if(repeat == LocalNotification.REPEAT_HOUR){ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_HALF_HOUR, pendingIntent); }else if(repeat == LocalNotification.REPEAT_DAY){ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_DAY, pendingIntent); }else if(repeat == LocalNotification.REPEAT_WEEK){ alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_DAY * 7, pendingIntent); } } }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2022-4903 - Severity: MEDIUM - CVSS Score: 5.1 Description: Fixed #3583 Pending Intent vulnerability Function: scheduleLocalNotification File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne Fixed Code: public void scheduleLocalNotification(LocalNotification notif, long firstTime, int repeat) { final Intent notificationIntent = new Intent(getContext(), LocalNotificationPublisher.class); notificationIntent.setAction(getContext().getApplicationInfo().packageName + "." + notif.getId()); notificationIntent.putExtra(LocalNotificationPublisher.NOTIFICATION, createBundleFromNotification(notif)); Intent contentIntent = new Intent(); if (activityComponentName != null) { contentIntent.setComponent(activityComponentName); } else { try { contentIntent.setComponent(getContext().getPackageManager().getLaunchIntentForPackage(getContext().getApplicationInfo().packageName).getComponent()); } catch (Exception ex) { System.err.println("Failed to get the component name for local notification. Local notification may not work."); ex.printStackTrace(); } } contentIntent.putExtra("LocalNotificationID", notif.getId()); if (BACKGROUND_FETCH_NOTIFICATION_ID.equals(notif.getId()) && getBackgroundFetchListener() != null) { Context context = AndroidNativeUtil.getContext(); Intent intent = new Intent(context, BackgroundFetchHandler.class); //there is an bug that causes this to not to workhttps://code.google.com/p/android/issues/detail?id=81812 //intent.putExtra("backgroundClass", getBackgroundLocationListener().getName()); //an ugly workaround to the putExtra bug intent.setData(Uri.parse("http://codenameone.com/a?" + getBackgroundFetchListener().getClass().getName())); PendingIntent pendingIntent = getPendingIntent(context, 0, intent); notificationIntent.putExtra(LocalNotificationPublisher.BACKGROUND_FETCH_INTENT, pendingIntent); } else { contentIntent.setData(Uri.parse("http://codenameone.com/a?LocalNotificationID="+Uri.encode(notif.getId()))); } PendingIntent pendingContentIntent = createPendingIntent(getContext(), 0, contentIntent); notificationIntent.putExtra(LocalNotificationPublisher.NOTIFICATION_INTENT, pendingContentIntent); PendingIntent pendingIntent = getBroadcastPendingIntent(getContext(), 0, notificationIntent); AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE); if (BACKGROUND_FETCH_NOTIFICATION_ID.equals(notif.getId())) { alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, getPreferredBackgroundFetchInterval() * 1000, pendingIntent); } else { if(repeat == LocalNotification.REPEAT_NONE){ alarmManager.set(AlarmManager.RTC_WAKEUP, firstTime, pendingIntent); }else if(repeat == LocalNotification.REPEAT_MINUTE){ alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, 60*1000, pendingIntent); }else if(repeat == LocalNotification.REPEAT_HOUR){ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_HALF_HOUR, pendingIntent); }else if(repeat == LocalNotification.REPEAT_DAY){ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_DAY, pendingIntent); }else if(repeat == LocalNotification.REPEAT_WEEK){ alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, firstTime, AlarmManager.INTERVAL_DAY * 7, pendingIntent); } } }
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
scheduleLocalNotification
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
1
Analyze the following code function for security vulnerabilities
public String getSkinPreference(String prefname, XWikiContext context) { return getSkinPreference(prefname, "", context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkinPreference 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
getSkinPreference
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
List<PlatformStatusDTO> getTransitions(String issueKey);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransitions File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getTransitions
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public void setBufferSize(int arg0) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBufferSize File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setBufferSize
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public boolean onCreate() { /* * We use the cache dir as a temporary directory (since Android doesn't give us one) so * on startup we'll clean up any .tmp files from the last run. */ final File[] files = getContext().getCacheDir().listFiles(); if (files != null) { for (File file : files) { final String filename = file.getName(); if (filename.endsWith(".tmp") || filename.startsWith("thmb_")) { file.delete(); } } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: provider_src/com/android/email/provider/AttachmentProvider.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3918
MEDIUM
4.3
android
onCreate
provider_src/com/android/email/provider/AttachmentProvider.java
6b2b0bd7c771c698f11d7be89c2c57c8722c7454
0
Analyze the following code function for security vulnerabilities
@Test public void saveTransNull(TestContext context) { postgresClient = createFoo(context); AsyncResult<SQLConnection> trans = null; setRootLevel(Level.FATAL); postgresClient.save(trans, FOO, xPojo, context.asyncAssertFailure()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveTransNull File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
saveTransNull
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public SerializationConfig setEnableCompression(boolean enableCompression) { this.enableCompression = enableCompression; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEnableCompression File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
setEnableCompression
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void initFromSpinner(Bundle bundle, int action) { if (action == EDIT_DRAFT && mDraft.draftType == UIProvider.DraftType.COMPOSE) { action = COMPOSE; } mFromSpinner.initialize(action, mAccount, mAccounts, mRefMessage); if (bundle != null) { if (bundle.containsKey(EXTRA_SELECTED_REPLY_FROM_ACCOUNT)) { mReplyFromAccount = ReplyFromAccount.deserialize(mAccount, bundle.getString(EXTRA_SELECTED_REPLY_FROM_ACCOUNT)); } else if (bundle.containsKey(EXTRA_FROM_ACCOUNT_STRING)) { final String accountString = bundle.getString(EXTRA_FROM_ACCOUNT_STRING); mReplyFromAccount = mFromSpinner.getMatchingReplyFromAccount(accountString); } } if (mReplyFromAccount == null) { if (mDraft != null) { mReplyFromAccount = getReplyFromAccountFromDraft(mDraft); } else if (mRefMessage != null) { mReplyFromAccount = getReplyFromAccountForReply(mAccount, mRefMessage); } } if (mReplyFromAccount == null) { mReplyFromAccount = getDefaultReplyFromAccount(mAccount); } mFromSpinner.setCurrentAccount(mReplyFromAccount); if (mFromSpinner.getCount() > 1) { // If there is only 1 account, just show that account. // Otherwise, give the user the ability to choose which account to // send mail from / save drafts to. mFromStatic.setVisibility(View.GONE); mFromStaticText.setText(mReplyFromAccount.address); mFromSpinnerWrapper.setVisibility(View.VISIBLE); } else { mFromStatic.setVisibility(View.VISIBLE); mFromStaticText.setText(mReplyFromAccount.address); mFromSpinnerWrapper.setVisibility(View.GONE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initFromSpinner 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
initFromSpinner
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public boolean killPids(int[] pids, String pReason, boolean secure) { if (Binder.getCallingUid() != SYSTEM_UID) { throw new SecurityException("killPids only available to the system"); } String reason = (pReason == null) ? "Unknown" : pReason; // XXX Note: don't acquire main activity lock here, because the window // manager calls in with its locks held. boolean killed = false; synchronized (mPidsSelfLocked) { int worstType = 0; for (int i=0; i<pids.length; i++) { ProcessRecord proc = mPidsSelfLocked.get(pids[i]); if (proc != null) { int type = proc.setAdj; if (type > worstType) { worstType = type; } } } // If the worst oom_adj is somewhere in the cached proc LRU range, // then constrain it so we will kill all cached procs. if (worstType < ProcessList.CACHED_APP_MAX_ADJ && worstType > ProcessList.CACHED_APP_MIN_ADJ) { worstType = ProcessList.CACHED_APP_MIN_ADJ; } // If this is not a secure call, don't let it kill processes that // are important. if (!secure && worstType < ProcessList.SERVICE_ADJ) { worstType = ProcessList.SERVICE_ADJ; } Slog.w(TAG, "Killing processes " + reason + " at adjustment " + worstType); for (int i=0; i<pids.length; i++) { ProcessRecord proc = mPidsSelfLocked.get(pids[i]); if (proc == null) { continue; } int adj = proc.setAdj; if (adj >= worstType && !proc.killedByAm) { proc.kill(reason, true); killed = true; } } } return killed; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killPids 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
killPids
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
List<DemandDTO> getDemandList(String projectId);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDemandList File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getDemandList
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public void windowsChanged();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: windowsChanged File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
windowsChanged
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public <T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException { return getStore().search(sql, nb, start, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: search 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
search
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
protected UriBuilder getUriBuilder(Class<?> resource) { return UriBuilder.fromUri(getBaseURL()).path(resource); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUriBuilder File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getUriBuilder
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
void requestPssAllProcsLocked(long now, boolean always, boolean memLowered) { if (!always) { if (now < (mLastFullPssTime + (memLowered ? mConstants.FULL_PSS_LOWERED_INTERVAL : mConstants.FULL_PSS_MIN_INTERVAL))) { return; } } if (DEBUG_PSS) Slog.d(TAG_PSS, "Requesting pss of all procs! memLowered=" + memLowered); mLastFullPssTime = now; mFullPssPending = true; for (int i = mPendingPssProcesses.size() - 1; i >= 0; i--) { ProcessList.abortNextPssTime(mPendingPssProcesses.get(i).procStateMemTracker);; } mPendingPssProcesses.ensureCapacity(mLruProcesses.size()); mPendingPssProcesses.clear(); for (int i = mLruProcesses.size() - 1; i >= 0; i--) { ProcessRecord app = mLruProcesses.get(i); if (app.thread == null || app.curProcState == ActivityManager.PROCESS_STATE_NONEXISTENT) { continue; } if (memLowered || (always && now > app.lastStateTime+ProcessList.PSS_SAFE_TIME_FROM_STATE_CHANGE) || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) { app.pssProcState = app.setProcState; app.pssStatType = always ? ProcessStats.ADD_PSS_INTERNAL_ALL_POLL : ProcessStats.ADD_PSS_INTERNAL_ALL_MEM; app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, app.procStateMemTracker, mTestPssMode, isSleepingLocked(), now); mPendingPssProcesses.add(app); } } if (!mBgHandler.hasMessages(COLLECT_PSS_BG_MSG)) { mBgHandler.sendEmptyMessage(COLLECT_PSS_BG_MSG); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestPssAllProcsLocked 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
requestPssAllProcsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void notifyChange(Uri uri, IContentObserver observer, boolean observerWantsSelfNotifications, boolean syncToNetwork) { notifyChange(uri, observer, observerWantsSelfNotifications, syncToNetwork, UserHandle.getCallingUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyChange File: services/core/java/com/android/server/content/ContentService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2426
MEDIUM
4.3
android
notifyChange
services/core/java/com/android/server/content/ContentService.java
63363af721650e426db5b0bdfb8b2d4fe36abdb0
0
Analyze the following code function for security vulnerabilities
public void setMinTimeFrameUnits(TimeFrameUnits minTimeFrameUnits) { this.minTimeFrameUnits = minTimeFrameUnits; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMinTimeFrameUnits File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
setMinTimeFrameUnits
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
public String getString(String path, Map<String, ?> queryParams) throws Exception { return getString(getBaseURL(), path, queryParams); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getString File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getString
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public boolean onCreate() { // TODO Auto-generated method stub return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/at/hgz/vocabletrainer/VocableTrainerProvider.java Repository: hgzojer/vocabletrainer The code follows secure coding practices.
[ "CWE-22" ]
CVE-2017-20181
MEDIUM
4.3
hgzojer/vocabletrainer
onCreate
src/at/hgz/vocabletrainer/VocableTrainerProvider.java
accf6838078f8eb105cfc7865aba5c705fb68426
0
Analyze the following code function for security vulnerabilities
void requestTraversal() { synchronized (mWindowMap) { requestTraversalLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestTraversal File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
requestTraversal
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_QR_SCAN) { if (data == null) { return; } String result = data.getStringExtra("com.blikoon.qrcodescanner.got_qr_scan_relult"); if (result == null || !result.startsWith(getString(R.string.login_data_own_scheme))) { mServerStatusIcon = R.drawable.ic_alert; mServerStatusText = "QR Code could not be read!"; showServerStatus(); return; } if (!getResources().getBoolean(R.bool.multiaccount_support) && accountManager.getAccounts().length == 1) { Toast.makeText(this, R.string.no_mutliple_accounts_allowed, Toast.LENGTH_LONG).show(); } else { parseAndLoginFromWebView(result); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActivityResult File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onActivityResult
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public BaseObject addObjectFromRequest(String className, String prefix, XWikiContext context) throws XWikiException { return addObjectFromRequest(className, prefix, 0, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObjectFromRequest 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-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
addObjectFromRequest
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
private boolean extractSearchParamsR5CapabilityStatement(IBaseResource theConformance, String resourceName, TreeSet<String> includes, TreeSet<String> theRevIncludes, TreeSet<String> sortParams, boolean haveSearchParams, List<List<String>> queryIncludes) { org.hl7.fhir.r5.model.CapabilityStatement conformance = (org.hl7.fhir.r5.model.CapabilityStatement) theConformance; for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : conformance.getRest()) { for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent nextRes : nextRest.getResource()) { if (nextRes.getTypeElement().getValue().equals(resourceName)) { for (org.hl7.fhir.r5.model.StringType next : nextRes.getSearchInclude()) { if (next.isEmpty() == false) { includes.add(next.getValue()); } } for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() != org.hl7.fhir.r5.model.Enumerations.SearchParamType.COMPOSITE) { sortParams.add(next.getNameElement().getValue()); } } if (nextRes.getSearchParam().size() > 0) { haveSearchParams = true; } } else { // It's a different resource from the one we're searching, so // scan for revinclude candidates for (org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() == org.hl7.fhir.r5.model.Enumerations.SearchParamType.REFERENCE) { } } } } } return haveSearchParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractSearchParamsR5CapabilityStatement File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
extractSearchParamsR5CapabilityStatement
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
public IdStrategyEnum getResourceServerIdStrategy() { return myResourceServerIdStrategy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceServerIdStrategy 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
getResourceServerIdStrategy
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
@Override public void onHostCardEmulationDeactivated() { if (mCardEmulationManager != null) { mCardEmulationManager.onHostCardEmulationDeactivated(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onHostCardEmulationDeactivated File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
onHostCardEmulationDeactivated
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public static final void setStartTimes(long elapsedRealtime, long uptimeMillis) { sStartElapsedRealtime = elapsedRealtime; sStartUptimeMillis = uptimeMillis; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStartTimes File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
setStartTimes
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
private void maybeWarnAboutDependencies( Class<? extends Component> componentClass, List<String> jsDeps) { if (warnedAboutDeps.add(componentClass)) { for (String jsDep : jsDeps) { if (bundledImports != null && !bundledImports.contains(jsDep)) { getLogger().error("The component class " + componentClass.getName() + " includes '" + jsDep + "' but this file was not included when creating the production bundle. The component will not work properly. Check that you have a reference to the component and that you are not using it only through reflection. If needed add a @Uses(" + componentClass.getSimpleName() + ".class) where it is used."); // Only warn for one file return; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeWarnAboutDependencies File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
maybeWarnAboutDependencies
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private String getDevicePolicyManagementRoleHolderPackageName(Context context) { RoleManager roleManager = context.getSystemService(RoleManager.class); List<String> roleHolders = roleManager.getRoleHolders(RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT); if (roleHolders.isEmpty()) { return null; } return roleHolders.get(0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDevicePolicyManagementRoleHolderPackageName 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
getDevicePolicyManagementRoleHolderPackageName
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void init(Object obj) { ViewContext context = (ViewContext) obj; this.request = context.getRequest(); ctx = context.getVelocityContext(); this.hostWebAPI = WebAPILocator.getHostWebAPI(); }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2012-1826 - Severity: MEDIUM - CVSS Score: 6.0 Description: #261 Function: init File: src/com/dotmarketing/viewtools/XsltTool.java Repository: dotCMS/core Fixed Code: public void init(Object obj) { if(!Config.getBooleanProperty("ENABLE_SCRIPTING", false)){ return; } ViewContext context = (ViewContext) obj; this.request = context.getRequest(); ctx = context.getVelocityContext(); try { host = WebAPILocator.getHostWebAPI().getCurrentHost(request); } catch (PortalException e1) { Logger.error(this,e1.getMessage(),e1); } catch (SystemException e1) { Logger.error(this,e1.getMessage(),e1); } catch (DotDataException e1) { Logger.error(this,e1.getMessage(),e1); } catch (DotSecurityException e1) { Logger.error(this,e1.getMessage(),e1); } userWebAPI = WebAPILocator.getUserWebAPI(); try { user = userWebAPI.getLoggedInFrontendUser(request); backuser = userWebAPI.getLoggedInUser(request); respectFrontendRoles = true; } catch (Exception e) { Logger.error(this, "Error finding the logged in user", e); } this.hostWebAPI = WebAPILocator.getHostWebAPI(); }
[ "CWE-264" ]
CVE-2012-1826
MEDIUM
6
dotCMS/core
init
src/com/dotmarketing/viewtools/XsltTool.java
b6b15c45fd550db7f1103e6aeab8780465855c29
1
Analyze the following code function for security vulnerabilities
private void setModelConfig() { String modelConfigStr = prop.getProperty(MODEL_CONFIG, null); Type type = new TypeToken<Map<String, Map<String, JsonObject>>>() {}.getType(); if (modelConfigStr != null) { this.modelConfig = JsonUtils.GSON.fromJson(modelConfigStr, type); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setModelConfig File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
setModelConfig
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
private boolean yieldIfContendedHelper(boolean throwIfUnsafe, long sleepAfterYieldDelay) { acquireReference(); try { return getThreadSession().yieldTransaction(sleepAfterYieldDelay, throwIfUnsafe, null); } finally { releaseReference(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: yieldIfContendedHelper File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
yieldIfContendedHelper
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
static String guessBetterFormat(ImportingJob job, String bestFormat) { ObjectNode retrievalRecord = job.getRetrievalRecord(); return retrievalRecord != null ? guessBetterFormat(job, retrievalRecord, bestFormat) : bestFormat; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: guessBetterFormat File: main/src/com/google/refine/importing/ImportingUtilities.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
guessBetterFormat
main/src/com/google/refine/importing/ImportingUtilities.java
e243e73e4064de87a913946bd320fbbe246da656
0
Analyze the following code function for security vulnerabilities
ActivityOptions takeOptions() { if (DEBUG_TRANSITION) Slog.i(TAG, "Taking options for " + this + " callers=" + Debug.getCallers(6)); if (mPendingOptions == null) return null; final ActivityOptions opts = mPendingOptions; mPendingOptions = null; // Strip sensitive information from options before sending it to app. opts.setRemoteTransition(null); opts.setRemoteAnimationAdapter(null); return opts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: takeOptions 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
takeOptions
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void refreshDetails() { Set<Object> visibleItemIds = new HashSet<Object>( itemIdToDetailsComponent.keySet()); for (Object itemId : visibleItemIds) { destroyDetails(itemId); createDetails(itemId); refreshRow(itemId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refreshDetails 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
refreshDetails
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public ArrayList<Pair<AuthorityInfo, SyncStatusInfo>> getCopyOfAllAuthoritiesWithSyncStatus() { synchronized (mAuthorities) { ArrayList<Pair<AuthorityInfo, SyncStatusInfo>> infos = new ArrayList<Pair<AuthorityInfo, SyncStatusInfo>>(mAuthorities.size()); for (int i = 0; i < mAuthorities.size(); i++) { infos.add(createCopyPairOfAuthorityWithSyncStatusLocked(mAuthorities.valueAt(i))); } return infos; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCopyOfAllAuthoritiesWithSyncStatus File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getCopyOfAllAuthoritiesWithSyncStatus
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public static void createParentDir(File f, String eMsg) throws IOException { File parent = f.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException("Cant create directory " + (eMsg == null ? parent : eMsg)); } }
Vulnerability Classification: - CWE: CWE-345, CWE-94, CWE-22 - CVE: CVE-2019-10182 - Severity: MEDIUM - CVSS Score: 5.8 Description: Fixed bug when relative path (..) could leak up (even out of cache) - CVE-2019-10182 * netx/net/sourceforge/jnlp/cache/CacheUtil.java: if path or query contains .. is saved to cache via its hash * netx/net/sourceforge/jnlp/util/FileUtils.java: added warning about different behavior on win/linux * tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java: added tests for hashing * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: added test for .. in path. Added test that verifies encoded .. (%2E%2E) do not leak from cahce * tests/netx/unit/net/sourceforge/jnlp/runtime/up.jnlp: example jnlp with .. full url * tests/netx/unit/net/sourceforge/jnlp/runtime/up.jnlp: example jnlp with encoded .. Function: createParentDir File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java Repository: AdoptOpenJDK/IcedTea-Web Fixed Code: public static void createParentDir(File f, String eMsg) throws IOException { File parent = f.getParentFile(); // warning, linux and windows behave differently. Below snippet will pass on win(security hole), fail on linux // warning mkdir is canonicaling, but exists/isDirectory is not. So where mkdirs return true, and really creates dir, isDirectory can still return false // can be seen on this example // mkdirs /a/b/../c // where b do not exists will lead creation of /a/c // but exists on /a/b/../c is false on linux even afterwards // without hexing of .. paths, if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException("Cant create directory " + (eMsg == null ? parent : eMsg)); } }
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
createParentDir
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
1
Analyze the following code function for security vulnerabilities
public static boolean hasShortcutsPermission(Context context) { try { return context.getSystemService(LauncherApps.class).hasShortcutHostPermission(); } catch (SecurityException | IllegalStateException e) { Log.e(TAG, "Failed to make shortcut manager call", e); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasShortcutsPermission File: src/com/android/launcher3/util/PackageManagerHelper.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-40097
HIGH
7.8
android
hasShortcutsPermission
src/com/android/launcher3/util/PackageManagerHelper.java
6c9a41117d5a9365cf34e770bbb00138f6bf997e
0
Analyze the following code function for security vulnerabilities
public void start(final String... args) { try { start(args, null); } catch (Throwable x) { stop(); String msg = "An error occurred while starting the application:"; if (throwBootstrapException) { throw new Err(Status.SERVICE_UNAVAILABLE, msg, x); } else { logger(this).error(msg, x); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
start
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public SyncNotedAppOp startProxyOperation(@NonNull IBinder clientId, int code, @NonNull AttributionSource attributionSource, boolean startIfModeDefault, boolean shouldCollectAsyncNotedOp, String message, boolean shouldCollectMessage, boolean skipProxyOperation, @AttributionFlags int proxyAttributionFlags, @AttributionFlags int proxiedAttributionFlags, int attributionChainId, @NonNull UndecFunction<IBinder, Integer, AttributionSource, Boolean, Boolean, String, Boolean, Boolean, Integer, Integer, Integer, SyncNotedAppOp> superImpl) { if (attributionSource.getUid() == mTargetUid && isTargetOp(code)) { final int shellUid = UserHandle.getUid(UserHandle.getUserId( attributionSource.getUid()), Process.SHELL_UID); final long identity = Binder.clearCallingIdentity(); try { return superImpl.apply(clientId, code, new AttributionSource(shellUid, "com.android.shell", attributionSource.getAttributionTag(), attributionSource.getToken(), attributionSource.getNext()), startIfModeDefault, shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation, proxyAttributionFlags, proxiedAttributionFlags, attributionChainId); } finally { Binder.restoreCallingIdentity(identity); } } return superImpl.apply(clientId, code, attributionSource, startIfModeDefault, shouldCollectAsyncNotedOp, message, shouldCollectMessage, skipProxyOperation, proxyAttributionFlags, proxiedAttributionFlags, attributionChainId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProxyOperation File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
startProxyOperation
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private TelephonyManager getTelephonyManager(int subId) { return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .createForSubscriptionId(subId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTelephonyManager File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
getTelephonyManager
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
void setQuotedExecutableEnabled( boolean quotedExecutableEnabled ) { this.quotedExecutableEnabled = quotedExecutableEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQuotedExecutableEnabled File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setQuotedExecutableEnabled
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
boolean isImeLayeringTarget() { return getDisplayContent().getImeTarget(IME_TARGET_LAYERING) == this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isImeLayeringTarget File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isImeLayeringTarget
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@GET @Path("{configClass}") @ApiOperation(value = "Get configuration settings from database") @Timed @RequiresPermissions(RestPermissions.CLUSTER_CONFIG_ENTRY_READ) public Object read(@ApiParam(name = "configClass", value = "The name of the cluster configuration class", required = true) @PathParam("configClass") @NotBlank String configClass) { final Class<?> cls = classFromName(configClass); if (cls == null) { String error = createNoClassMsg(configClass); throw new NotFoundException(error); } return clusterConfigService.get(cls); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
read
graylog2-server/src/main/java/org/graylog2/rest/resources/system/ClusterConfigResource.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
@Override public int getRotation() { return mRotation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRotation File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
getRotation
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@CLIResolver public Computer getComputer(@Argument(required=true,metaVar="NAME",usage="Node name") String name) { if(name.equals("(master)")) name = ""; for (Computer c : computers.values()) { if(c.getName().equals(name)) return c; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComputer File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getComputer
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override public WorkflowInstance ingest(MediaPackage mp) throws IngestException { try { return ingest(mp, null, null, null); } catch (NotFoundException e) { throw new IngestException(e); } catch (UnauthorizedException e) { throw new IllegalStateException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ingest File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
ingest
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
@Override public void startActivity(Intent intent) { if (resolveActivity(intent) == null) { if (sDebug) { Slog.d(TAG, "Can not startActivity for save UI with intent=" + intent); } return; } intent.putExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY, true); PendingIntent p = PendingIntent.getActivityAsUser(this, /* requestCode= */ 0, intent, PendingIntent.FLAG_MUTABLE, /* options= */ null, UserHandle.CURRENT); if (sDebug) { Slog.d(TAG, "startActivity add save UI restored with intent=" + intent); } // Apply restore mechanism startIntentSenderWithRestore(p, intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
startActivity
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public SVNNodeKind checkRepositoryPath(AbstractProject context, SVNURL repoURL) throws SVNException { SVNRepository repository = null; try { repository = getRepository(context,repoURL); repository.testConnection(); long rev = repository.getLatestRevision(); String repoPath = getRelativePath(repoURL, repository); return repository.checkPath(repoPath, rev); } finally { if (repository != null) repository.closeSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkRepositoryPath File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
checkRepositoryPath
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
private ConsumerBrokerExchange getConsumerBrokerExchange(ConsumerId id) { ConsumerBrokerExchange result = consumerExchanges.get(id); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConsumerBrokerExchange File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
getConsumerBrokerExchange
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public void switchTab(String tabHandle) { getDriver().switchTo().window(tabHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchTab File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
switchTab
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private boolean isFingerprintDisabled(int userId) { final DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); return dpm != null && (dpm.getKeyguardDisabledFeatures(null, userId) & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0 || isSimPinSecure(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFingerprintDisabled File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isFingerprintDisabled
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public static <T> T unmarshal(final Class<T> clazz, final String xml, final boolean validate) { final StringReader sr = new StringReader(xml); final InputSource is = new InputSource(sr); try { return unmarshal(clazz, is, null, validate, false); } finally { IOUtils.closeQuietly(sr); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmarshal File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
unmarshal
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
public static List<PageDecorator> getPageDecorators() { // this method may be called to render start up errors, at which point Hudson doesn't exist yet. see HUDSON-3608 if(Jenkins.getInstance()==null) return Collections.emptyList(); return PageDecorator.all(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageDecorators File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getPageDecorators
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
@Override public void error(final int errorCode, Conversation object) { runOnUiThread(() -> replaceToast(getString(errorCode))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: error File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
error
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected void setPropertySet(PropertySet<T> propertySet) { Objects.requireNonNull(propertySet, "propertySet cannot be null"); this.propertySet = propertySet; if (editor instanceof Extension) { removeExtension((Extension) editor); } editor = createEditor(); if (editor instanceof Extension) { addExtension((Extension) editor); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPropertySet 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
setPropertySet
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0