instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public void setRestTemplate(RestTemplate restTemplate) { this.restTemplate = restTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRestTemplate File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DiscordNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setRestTemplate
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DiscordNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public T addChar(K name, char value) { return add(name, fromChar(name, value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addChar File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
addChar
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public String getGoogleLoginURL() { return "https://accounts.google.com/o/oauth2/v2/auth?" + "client_id=" + CONF.googleAppId() + "&response_type=code&scope=openid%20profile%20email&redirect_uri=" + getParaEndpoint() + "/google_auth&state=" + getParaAppId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGoogleLoginURL File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getGoogleLoginURL
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private boolean equalsArray(byte ar1[], byte ar2[], int size) { for (int k = 0; k < size; ++k) { if (ar1[k] != ar2[k]) return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equalsArray File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
equalsArray
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public void setIdToken(IDTokenClaimsSet idToken) { setSessionAttribute(PROP_SESSION_IDTOKEN, idToken); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIdToken File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
setIdToken
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
private static void setAttrMapInSession( SessionProvider sessionProvider, Map attrMap, Object session) throws SessionException { if (attrMap != null && !attrMap.isEmpty()) { Set entrySet = attrMap.entrySet(); for(Iterator iter = entrySet.iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); String attrName = (String)entry.getKey(); String[] attrValues = null; if (attrName.equals(SAMLConstants.USER_NAME) || attrName.equals(SessionProvider.PRINCIPAL_NAME)) { String attrValue = (String)entry.getValue(); attrValues = new String[1]; attrValues[0] = attrValue; } else if (attrName.equals(SessionProvider.REALM) || attrName.equals(SessionProvider.AUTH_LEVEL)) { // ignore continue; } else { attrValues = (String[])entry.getValue(); } sessionProvider.setProperty(session, attrName, attrValues); if (debug.messageEnabled()) { debug.message("SAMLUtils.setAttrMapInSessioin: attrName ="+ attrName); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAttrMapInSession File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
setAttrMapInSession
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
protected HashMap<String,Integer> getItemOIDPos(MetaDataVersionBean metadata){ HashMap<String,Integer> itPoses = new HashMap<String,Integer>(); ArrayList<ItemDefBean> its = (ArrayList<ItemDefBean>)metadata.getItemDefs(); for(int i=0; i<its.size();++i) { itPoses.put(its.get(i).getOid(), i); } return itPoses; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getItemOIDPos File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getItemOIDPos
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private Set<Integer> updatePasswordValidityCheckpointLocked(int userHandle, boolean parent) { final ArraySet<Integer> affectedUserIds = new ArraySet<>(); final int credentialOwner = getCredentialOwner(userHandle, parent); DevicePolicyData policy = getUserData(credentialOwner); PasswordMetrics metrics = mLockSettingsInternal.getUserPasswordMetrics(credentialOwner); // Update the checkpoint only if the user's password metrics is known if (metrics != null) { final int userToCheck = getProfileParentUserIfRequested(userHandle, parent); final boolean newCheckpoint = isPasswordSufficientForUserWithoutCheckpointLocked( metrics, userToCheck); if (newCheckpoint != policy.mPasswordValidAtLastCheckpoint) { policy.mPasswordValidAtLastCheckpoint = newCheckpoint; affectedUserIds.add(credentialOwner); } } return affectedUserIds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePasswordValidityCheckpointLocked 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
updatePasswordValidityCheckpointLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public Locale getDefaultLocale(XWikiContext xcontext) { // Find out what is the default language from the XWiki preferences settings. String defaultLanguage = xcontext.getWiki().getXWikiPreference("default_language", "", xcontext); Locale defaultLocale; if (StringUtils.isBlank(defaultLanguage)) { defaultLocale = Locale.ENGLISH; } else { try { defaultLocale = LocaleUtils.toLocale(Util.normalizeLanguage(defaultLanguage)); } catch (Exception e) { LOGGER.warn("Invalid locale [{}] set as default locale in the preferences", defaultLanguage); defaultLocale = Locale.ENGLISH; } } return defaultLocale; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultLocale 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
getDefaultLocale
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private boolean canDisplayUserSwitcher() { return mFeatureFlags.isEnabled(Flags.BOUNCER_USER_SWITCHER); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canDisplayUserSwitcher File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
canDisplayUserSwitcher
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public static BufferedImage retrieveDistributorImage(LicenseInfo licenseInfo) { if (licenseInfo.getLicenseType() != LicenseType.DISTRIBUTOR) { return null; } try { final byte[] s1 = PLSSignature.retrieveDistributorImageSignature(); if (SignatureUtils.toHexString(s1).equals(SignatureUtils.toHexString(licenseInfo.sha)) == false) return null; final InputStream dis = PSystemVersion.class.getResourceAsStream("/distributor.png"); if (dis == null) return null; try { final BufferedImage result = SImageIO.read(dis); return result; } finally { dis.close(); } } catch (Exception e) { Logme.error(e); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveDistributorImage File: src/net/sourceforge/plantuml/version/LicenseInfo.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
retrieveDistributorImage
src/net/sourceforge/plantuml/version/LicenseInfo.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public Provider getRequestedBy() { return requestedBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestedBy 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
getRequestedBy
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
@Override public TraceBrief queryBasicTraces(long startSecondTB, long endSecondTB, long minDuration, long maxDuration, String endpointName, String serviceId, String serviceInstanceId, String endpointId, String traceId, int limit, int from, TraceState traceState, QueryOrder queryOrder) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> parameters = new ArrayList<>(10); sql.append("from ").append(SegmentRecord.INDEX_NAME).append(" where "); sql.append(" 1=1 "); if (startSecondTB != 0 && endSecondTB != 0) { sql.append(" and ").append(SegmentRecord.TIME_BUCKET).append(" >= ?"); parameters.add(startSecondTB); sql.append(" and ").append(SegmentRecord.TIME_BUCKET).append(" <= ?"); parameters.add(endSecondTB); } if (minDuration != 0 || maxDuration != 0) { if (minDuration != 0) { sql.append(" and ").append(SegmentRecord.LATENCY).append(" >= ?"); parameters.add(minDuration); } if (maxDuration != 0) { sql.append(" and ").append(SegmentRecord.LATENCY).append(" <= ?"); parameters.add(maxDuration); } } if (!Strings.isNullOrEmpty(endpointName)) { sql.append(" and ").append(SegmentRecord.ENDPOINT_NAME).append(" like '%" + endpointName + "%'"); } if (StringUtil.isNotEmpty(serviceId)) { sql.append(" and ").append(SegmentRecord.SERVICE_ID).append(" = ?"); parameters.add(serviceId); } if (StringUtil.isNotEmpty(serviceInstanceId)) { sql.append(" and ").append(SegmentRecord.SERVICE_INSTANCE_ID).append(" = ?"); parameters.add(serviceInstanceId); } if (!Strings.isNullOrEmpty(endpointId)) { sql.append(" and ").append(SegmentRecord.ENDPOINT_ID).append(" = ?"); parameters.add(endpointId); } if (!Strings.isNullOrEmpty(traceId)) { sql.append(" and ").append(SegmentRecord.TRACE_ID).append(" = ?"); parameters.add(traceId); } switch (traceState) { case ERROR: sql.append(" and ").append(SegmentRecord.IS_ERROR).append(" = ").append(BooleanUtils.TRUE); break; case SUCCESS: sql.append(" and ").append(SegmentRecord.IS_ERROR).append(" = ").append(BooleanUtils.FALSE); break; } switch (queryOrder) { case BY_START_TIME: sql.append(" order by ").append(SegmentRecord.START_TIME).append(" ").append(SortOrder.DESC); break; case BY_DURATION: sql.append(" order by ").append(SegmentRecord.LATENCY).append(" ").append(SortOrder.DESC); break; } TraceBrief traceBrief = new TraceBrief(); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery(connection, buildCountStatement(sql.toString()), parameters .toArray(new Object[0]))) { while (resultSet.next()) { traceBrief.setTotal(resultSet.getInt("total")); } } buildLimit(sql, from, limit); try (ResultSet resultSet = h2Client.executeQuery( connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) { while (resultSet.next()) { BasicTrace basicTrace = new BasicTrace(); basicTrace.setSegmentId(resultSet.getString(SegmentRecord.SEGMENT_ID)); basicTrace.setStart(resultSet.getString(SegmentRecord.START_TIME)); basicTrace.getEndpointNames().add(resultSet.getString(SegmentRecord.ENDPOINT_NAME)); basicTrace.setDuration(resultSet.getInt(SegmentRecord.LATENCY)); basicTrace.setError(BooleanUtils.valueToBoolean(resultSet.getInt(SegmentRecord.IS_ERROR))); String traceIds = resultSet.getString(SegmentRecord.TRACE_ID); basicTrace.getTraceIds().add(traceIds); traceBrief.getTraces().add(basicTrace); } } } catch (SQLException e) { throw new IOException(e); } return traceBrief; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2020-13921 - Severity: HIGH - CVSS Score: 7.5 Description: fix fuzzy query sql injection Function: queryBasicTraces File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java Repository: apache/skywalking Fixed Code: @Override public TraceBrief queryBasicTraces(long startSecondTB, long endSecondTB, long minDuration, long maxDuration, String endpointName, String serviceId, String serviceInstanceId, String endpointId, String traceId, int limit, int from, TraceState traceState, QueryOrder queryOrder) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> parameters = new ArrayList<>(10); sql.append("from ").append(SegmentRecord.INDEX_NAME).append(" where "); sql.append(" 1=1 "); if (startSecondTB != 0 && endSecondTB != 0) { sql.append(" and ").append(SegmentRecord.TIME_BUCKET).append(" >= ?"); parameters.add(startSecondTB); sql.append(" and ").append(SegmentRecord.TIME_BUCKET).append(" <= ?"); parameters.add(endSecondTB); } if (minDuration != 0 || maxDuration != 0) { if (minDuration != 0) { sql.append(" and ").append(SegmentRecord.LATENCY).append(" >= ?"); parameters.add(minDuration); } if (maxDuration != 0) { sql.append(" and ").append(SegmentRecord.LATENCY).append(" <= ?"); parameters.add(maxDuration); } } if (!Strings.isNullOrEmpty(endpointName)) { sql.append(" and ").append(SegmentRecord.ENDPOINT_NAME).append(" like concat('%',?,'%')"); parameters.add(endpointName); } if (StringUtil.isNotEmpty(serviceId)) { sql.append(" and ").append(SegmentRecord.SERVICE_ID).append(" = ?"); parameters.add(serviceId); } if (StringUtil.isNotEmpty(serviceInstanceId)) { sql.append(" and ").append(SegmentRecord.SERVICE_INSTANCE_ID).append(" = ?"); parameters.add(serviceInstanceId); } if (!Strings.isNullOrEmpty(endpointId)) { sql.append(" and ").append(SegmentRecord.ENDPOINT_ID).append(" = ?"); parameters.add(endpointId); } if (!Strings.isNullOrEmpty(traceId)) { sql.append(" and ").append(SegmentRecord.TRACE_ID).append(" = ?"); parameters.add(traceId); } switch (traceState) { case ERROR: sql.append(" and ").append(SegmentRecord.IS_ERROR).append(" = ").append(BooleanUtils.TRUE); break; case SUCCESS: sql.append(" and ").append(SegmentRecord.IS_ERROR).append(" = ").append(BooleanUtils.FALSE); break; } switch (queryOrder) { case BY_START_TIME: sql.append(" order by ").append(SegmentRecord.START_TIME).append(" ").append(SortOrder.DESC); break; case BY_DURATION: sql.append(" order by ").append(SegmentRecord.LATENCY).append(" ").append(SortOrder.DESC); break; } TraceBrief traceBrief = new TraceBrief(); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery(connection, buildCountStatement(sql.toString()), parameters .toArray(new Object[0]))) { while (resultSet.next()) { traceBrief.setTotal(resultSet.getInt("total")); } } buildLimit(sql, from, limit); try (ResultSet resultSet = h2Client.executeQuery( connection, "select * " + sql.toString(), parameters.toArray(new Object[0]))) { while (resultSet.next()) { BasicTrace basicTrace = new BasicTrace(); basicTrace.setSegmentId(resultSet.getString(SegmentRecord.SEGMENT_ID)); basicTrace.setStart(resultSet.getString(SegmentRecord.START_TIME)); basicTrace.getEndpointNames().add(resultSet.getString(SegmentRecord.ENDPOINT_NAME)); basicTrace.setDuration(resultSet.getInt(SegmentRecord.LATENCY)); basicTrace.setError(BooleanUtils.valueToBoolean(resultSet.getInt(SegmentRecord.IS_ERROR))); String traceIds = resultSet.getString(SegmentRecord.TRACE_ID); basicTrace.getTraceIds().add(traceIds); traceBrief.getTraces().add(basicTrace); } } } catch (SQLException e) { throw new IOException(e); } return traceBrief; }
[ "CWE-89" ]
CVE-2020-13921
HIGH
7.5
apache/skywalking
queryBasicTraces
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
1
Analyze the following code function for security vulnerabilities
public String getName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
getName
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
public long getXWikiPreferenceAsLong(String preference, XWikiContext context) { return Long.parseLong(getXWikiPreference(preference, context)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXWikiPreferenceAsLong 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
getXWikiPreferenceAsLong
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public String getRealAssetPathTmpBinary() { String assetpath=getRealAssetsRootPath(); java.io.File adir=new java.io.File(assetpath); if(!adir.isDirectory()) adir.mkdir(); String path=assetpath+java.io.File.separator+"tmp_upload"; java.io.File dir=new java.io.File(path); if(!dir.isDirectory()) dir.mkdir(); return path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRealAssetPathTmpBinary File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
getRealAssetPathTmpBinary
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
public AsyncHttpClientConfigBean addResponseFilters(ResponseFilter responseFilter) { responseFilters.add(responseFilter); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addResponseFilters File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
addResponseFilters
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public HttpRequest method(final HttpMethod httpMethod) { this.method = httpMethod.name(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: method File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
method
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAbstract() { return Modifier.isAbstract(_class.getModifiers()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAbstract File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isAbstract
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public @NonNull List<ScanResult> getMostRecentScanResultsForConfiguredNetworks( int maxAgeMillis) { List<ScanResult> results = new ArrayList<>(); long timeNowMs = mClock.getWallClockMillis(); for (WifiConfiguration config : getInternalConfiguredNetworks()) { ScanDetailCache scanDetailCache = getScanDetailCacheForNetwork(config.networkId); if (scanDetailCache == null) { continue; } ScanResult scanResult = scanDetailCache.getMostRecentScanResult(); if (scanResult == null) { continue; } if (timeNowMs - scanResult.seen < maxAgeMillis) { results.add(scanResult); } } return results; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMostRecentScanResultsForConfiguredNetworks File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getMostRecentScanResultsForConfiguredNetworks
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public List<WifiConfiguration> getWifiConfigsForPasspointProfiles(List<String> idList) { if (mProviders.isEmpty()) { return Collections.emptyList(); } List<WifiConfiguration> configs = new ArrayList<>(); Set<String> uniqueIdSet = new HashSet<>(); uniqueIdSet.addAll(idList); for (String uniqueId : uniqueIdSet) { PasspointProvider provider = mProviders.get(uniqueId); if (provider == null) { continue; } WifiConfiguration config = provider.getWifiConfig(); config = mWifiConfigManager.getConfiguredNetwork(config.getProfileKey()); if (config == null) { continue; } // If the Passpoint configuration is from a suggestion, check if the app shares this // suggestion with the user. if (provider.isFromSuggestion() && !mWifiInjector.getWifiNetworkSuggestionsManager() .isPasspointSuggestionSharedWithUser(config)) { continue; } if (mWifiConfigManager.shouldUseNonPersistentRandomization(config)) { config.setRandomizedMacAddress(MacAddress.fromString(DEFAULT_MAC_ADDRESS)); } else { MacAddress result = mMacAddressUtil.calculatePersistentMac(config.getNetworkKey(), mMacAddressUtil.obtainMacRandHashFunction(Process.WIFI_UID)); if (result != null) { config.setRandomizedMacAddress(result); } } configs.add(config); } return configs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWifiConfigsForPasspointProfiles File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getWifiConfigsForPasspointProfiles
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private void doNetworkStatus(int status) { sendMessage(CMD_NETWORK_STATUS, status); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doNetworkStatus File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
doNetworkStatus
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void enforceRegisterSkipCallFiltering() { if (!isCallerSystemApp()) { throw new SecurityException( "EXTRA_SKIP_CALL_FILTERING is only available to system apps."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceRegisterSkipCallFiltering 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
enforceRegisterSkipCallFiltering
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private Set<Integer> clearInternalDataForUser(int user) { localLog("clearInternalUserData: Clearing user internal data for " + user); Set<Integer> removedNetworkIds = new HashSet<>(); // Remove any private networks of the old user before switching the userId. for (WifiConfiguration config : getConfiguredNetworks()) { if ((!config.shared && mWifiPermissionsUtil.doesUidBelongToUser(config.creatorUid, user)) || config.ephemeral) { removedNetworkIds.add(config.networkId); localLog("clearInternalUserData: removed config." + " netId=" + config.networkId + " configKey=" + config.getProfileKey()); mConfiguredNetworks.remove(config.networkId); for (OnNetworkUpdateListener listener : mListeners) { listener.onNetworkRemoved( createExternalWifiConfiguration(config, true, Process.WIFI_UID)); } } } if (!removedNetworkIds.isEmpty()) { sendConfiguredNetworkChangedBroadcast(WifiManager.CHANGE_REASON_REMOVED); } mUserTemporarilyDisabledList.clear(); mNonCarrierMergedNetworksStatusTracker.clear(); mScanDetailCaches.clear(); clearLastSelectedNetwork(); return removedNetworkIds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearInternalDataForUser File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
clearInternalDataForUser
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
String[] getShellArgs() { if ( ( shellArgs == null ) || shellArgs.isEmpty() ) { return null; } else { return shellArgs.toArray( new String[shellArgs.size()] ); } }
Vulnerability Classification: - CWE: CWE-116 - CVE: CVE-2022-29599 - Severity: HIGH - CVSS Score: 7.5 Description: [MSHARED-297] - Minor code cleanup Function: getShellArgs File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils Fixed Code: String[] getShellArgs() { if ( shellArgs.isEmpty() ) { return null; } else { return shellArgs.toArray( new String[0] ); } }
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
getShellArgs
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
bb6b6a4bf44cc09f120068bd29fed3e9ab10eb6f
1
Analyze the following code function for security vulnerabilities
public static boolean isJarSigned(JARDesc jar, AppVerifier verifier, ResourceTracker tracker) throws Exception { JarCertVerifier certVerifier = new JarCertVerifier(verifier); List<JARDesc> singleJarList = new ArrayList<>(); singleJarList.add(jar); certVerifier.add(singleJarList, tracker); return certVerifier.allJarsSigned(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isJarSigned File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
isJarSigned
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
public void setMaxSqlCacheSize(int cacheSize) { if (cacheSize > MAX_SQL_CACHE_SIZE || cacheSize < 0) { throw new IllegalStateException( "expected value between 0 and " + MAX_SQL_CACHE_SIZE); } synchronized (mLock) { throwIfNotOpenLocked(); final int oldMaxSqlCacheSize = mConfigurationLocked.maxSqlCacheSize; mConfigurationLocked.maxSqlCacheSize = cacheSize; try { mConnectionPoolLocked.reconfigure(mConfigurationLocked); } catch (RuntimeException ex) { mConfigurationLocked.maxSqlCacheSize = oldMaxSqlCacheSize; throw ex; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxSqlCacheSize 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
setMaxSqlCacheSize
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<PackageInfo> getInstalledPackages(int flags, int userId) { final boolean listUninstalled = (flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0; enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "get installed packages"); // writer synchronized (mPackages) { ArrayList<PackageInfo> list; if (listUninstalled) { list = new ArrayList<PackageInfo>(mSettings.mPackages.size()); for (PackageSetting ps : mSettings.mPackages.values()) { PackageInfo pi; if (ps.pkg != null) { pi = generatePackageInfo(ps.pkg, flags, userId); } else { pi = generatePackageInfoFromSettingsLPw(ps.name, flags, userId); } if (pi != null) { list.add(pi); } } } else { list = new ArrayList<PackageInfo>(mPackages.size()); for (PackageParser.Package p : mPackages.values()) { PackageInfo pi = generatePackageInfo(p, flags, userId); if (pi != null) { list.add(pi); } } } return new ParceledListSlice<PackageInfo>(list); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstalledPackages 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
getInstalledPackages
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private native void nativeScrollFocusedEditableNodeIntoView(long nativeContentViewCoreImpl);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeScrollFocusedEditableNodeIntoView File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeScrollFocusedEditableNodeIntoView
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setIdProvider( final String[] idProvider ) { this.idProvider = idProvider; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIdProvider File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp The code follows secure coding practices.
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
setIdProvider
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
0189975691e9e6407a9fee87006f730e84f734ff
0
Analyze the following code function for security vulnerabilities
public void renameRosterItem(String user, String newName) throws YaximXMPPException { RosterEntry rosterEntry = mRoster.getEntry(user); if (!(newName.length() > 0) || (rosterEntry == null)) { throw new YaximXMPPException("JabberID to rename is invalid!"); } rosterEntry.setName(newName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renameRosterItem File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
renameRosterItem
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public int run(String[] args) throws IOException, RemoteException { boolean validCommand = false; if (args.length < 1) { return showUsage(); } mUm = IUserManager.Stub.asInterface(ServiceManager.getService("user")); mPm = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); if (mPm == null) { System.err.println(PM_NOT_RUNNING_ERR); return 1; } mInstaller = mPm.getPackageInstaller(); mArgs = args; String op = args[0]; mNextArg = 1; if ("list".equals(op)) { return runList(); } if ("path".equals(op)) { return runPath(); } if ("dump".equals(op)) { return runDump(); } if ("install".equals(op)) { return runInstall(); } if ("install-create".equals(op)) { return runInstallCreate(); } if ("install-write".equals(op)) { return runInstallWrite(); } if ("install-commit".equals(op)) { return runInstallCommit(); } if ("install-abandon".equals(op) || "install-destroy".equals(op)) { return runInstallAbandon(); } if ("set-installer".equals(op)) { return runSetInstaller(); } if ("uninstall".equals(op)) { return runUninstall(); } if ("clear".equals(op)) { return runClear(); } if ("enable".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_ENABLED); } if ("disable".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED); } if ("disable-user".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER); } if ("disable-until-used".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED); } if ("hide".equals(op)) { return runSetHiddenSetting(true); } if ("unhide".equals(op)) { return runSetHiddenSetting(false); } if ("grant".equals(op)) { return runGrantRevokePermission(true); } if ("revoke".equals(op)) { return runGrantRevokePermission(false); } if ("reset-permissions".equals(op)) { return runResetPermissions(); } if ("set-permission-enforced".equals(op)) { return runSetPermissionEnforced(); } if ("set-app-link".equals(op)) { return runSetAppLink(); } if ("get-app-link".equals(op)) { return runGetAppLink(); } if ("set-install-location".equals(op)) { return runSetInstallLocation(); } if ("get-install-location".equals(op)) { return runGetInstallLocation(); } if ("trim-caches".equals(op)) { return runTrimCaches(); } if ("create-user".equals(op)) { return runCreateUser(); } if ("remove-user".equals(op)) { return runRemoveUser(); } if ("get-max-users".equals(op)) { return runGetMaxUsers(); } if ("force-dex-opt".equals(op)) { return runForceDexOpt(); } if ("move-package".equals(op)) { return runMovePackage(); } if ("move-primary-storage".equals(op)) { return runMovePrimaryStorage(); } try { if (args.length == 1) { if (args[0].equalsIgnoreCase("-l")) { validCommand = true; return runListPackages(false); } else if (args[0].equalsIgnoreCase("-lf")){ validCommand = true; return runListPackages(true); } } else if (args.length == 2) { if (args[0].equalsIgnoreCase("-p")) { validCommand = true; return displayPackageFilePath(args[1]); } } return 1; } finally { if (validCommand == false) { if (op != null) { System.err.println("Error: unknown command '" + op + "'"); } showUsage(); } } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3833 - Severity: HIGH - CVSS Score: 9.3 Description: Add pm operation to set user restrictions. Bug: 29189712 Change-Id: I6fdb3b68dfe3f51119e5ce8008880fc7d9c793df Function: run File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android Fixed Code: public int run(String[] args) throws IOException, RemoteException { boolean validCommand = false; if (args.length < 1) { return showUsage(); } mUm = IUserManager.Stub.asInterface(ServiceManager.getService("user")); mPm = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); if (mPm == null) { System.err.println(PM_NOT_RUNNING_ERR); return 1; } mInstaller = mPm.getPackageInstaller(); mArgs = args; String op = args[0]; mNextArg = 1; if ("list".equals(op)) { return runList(); } if ("path".equals(op)) { return runPath(); } if ("dump".equals(op)) { return runDump(); } if ("install".equals(op)) { return runInstall(); } if ("install-create".equals(op)) { return runInstallCreate(); } if ("install-write".equals(op)) { return runInstallWrite(); } if ("install-commit".equals(op)) { return runInstallCommit(); } if ("install-abandon".equals(op) || "install-destroy".equals(op)) { return runInstallAbandon(); } if ("set-installer".equals(op)) { return runSetInstaller(); } if ("uninstall".equals(op)) { return runUninstall(); } if ("clear".equals(op)) { return runClear(); } if ("enable".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_ENABLED); } if ("disable".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED); } if ("disable-user".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER); } if ("disable-until-used".equals(op)) { return runSetEnabledSetting(PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED); } if ("hide".equals(op)) { return runSetHiddenSetting(true); } if ("unhide".equals(op)) { return runSetHiddenSetting(false); } if ("grant".equals(op)) { return runGrantRevokePermission(true); } if ("revoke".equals(op)) { return runGrantRevokePermission(false); } if ("reset-permissions".equals(op)) { return runResetPermissions(); } if ("set-permission-enforced".equals(op)) { return runSetPermissionEnforced(); } if ("set-app-link".equals(op)) { return runSetAppLink(); } if ("get-app-link".equals(op)) { return runGetAppLink(); } if ("set-install-location".equals(op)) { return runSetInstallLocation(); } if ("get-install-location".equals(op)) { return runGetInstallLocation(); } if ("trim-caches".equals(op)) { return runTrimCaches(); } if ("create-user".equals(op)) { return runCreateUser(); } if ("remove-user".equals(op)) { return runRemoveUser(); } if ("get-max-users".equals(op)) { return runGetMaxUsers(); } if ("force-dex-opt".equals(op)) { return runForceDexOpt(); } if ("move-package".equals(op)) { return runMovePackage(); } if ("move-primary-storage".equals(op)) { return runMovePrimaryStorage(); } if ("set-user-restriction".equals(op)) { return runSetUserRestriction(); } try { if (args.length == 1) { if (args[0].equalsIgnoreCase("-l")) { validCommand = true; return runListPackages(false); } else if (args[0].equalsIgnoreCase("-lf")){ validCommand = true; return runListPackages(true); } } else if (args.length == 2) { if (args[0].equalsIgnoreCase("-p")) { validCommand = true; return displayPackageFilePath(args[1]); } } return 1; } finally { if (validCommand == false) { if (op != null) { System.err.println("Error: unknown command '" + op + "'"); } showUsage(); } } }
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
run
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
1
Analyze the following code function for security vulnerabilities
void saveToXml(TypedXmlSerializer out) throws IOException, XmlPullParserException { out.attributeLong(null, ATTR_ID, createTime); out.attributeInt(null, ATTR_LAUNCHEDFROMUID, launchedFromUid); if (launchedFromPackage != null) { out.attribute(null, ATTR_LAUNCHEDFROMPACKAGE, launchedFromPackage); } if (launchedFromFeatureId != null) { out.attribute(null, ATTR_LAUNCHEDFROMFEATURE, launchedFromFeatureId); } if (resolvedType != null) { out.attribute(null, ATTR_RESOLVEDTYPE, resolvedType); } out.attributeBoolean(null, ATTR_COMPONENTSPECIFIED, componentSpecified); out.attributeInt(null, ATTR_USERID, mUserId); if (taskDescription != null) { taskDescription.saveToXml(out); } out.startTag(null, TAG_INTENT); intent.saveToXml(out); out.endTag(null, TAG_INTENT); if (isPersistable() && mPersistentState != null) { out.startTag(null, TAG_PERSISTABLEBUNDLE); mPersistentState.saveToXml(out); out.endTag(null, TAG_PERSISTABLEBUNDLE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveToXml 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
saveToXml
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
protected PutMethod executePut(String uri, String string, String mediaType, String userName, String password) throws Exception { HttpClient httpClient = new HttpClient(); httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password)); httpClient.getParams().setAuthenticationPreemptive(true); PutMethod putMethod = new PutMethod(uri); RequestEntity entity = new StringRequestEntity(string, mediaType, "UTF-8"); putMethod.setRequestEntity(entity); httpClient.executeMethod(putMethod); return putMethod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executePut File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
executePut
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
public static void setUp(TestComponentManager tcm) throws Exception { LocalizationScriptService lss = mock(LocalizationScriptService.class); tcm.registerComponent(ScriptService.class, "localization", lss); // The translations are mocked by returning the translation, suffixed with the list of the String.valueOf // values of the translation parameters if they exist. // We mock the translations instead of using their actual values because they are subject to change from // Weblate, possibly making the build fail unexpectedly. when(lss.render(anyString())).thenAnswer( (Answer<String>) invocationOnMock -> { // Return the translation key as the value return invocationOnMock.getArgument(0); } ); when(lss.render(anyString(), anyCollection())).thenAnswer((Answer<String>) invocationOnMock -> { // Displays the comma-separated list of parameters between squared brackets after the translation key as // the value, so that they can be verified in tests. // For instance: my.key [paramA, paramB] Object key = invocationOnMock.getArgument(0); Collection<?> parameters = invocationOnMock.getArgument(1); return parameters.stream() .map(String::valueOf) .collect(Collectors.joining(", ", key + " [", "]")); }); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2023-29211 - Severity: HIGH - CVSS Score: 8.8 Description: XWIKI-20297: Improved DeleteWiki error message escaping - Cleanup the unknown wiki error message in DeleteWiki - Make it easier to use the TestNoScriptMacro by moving it to xwiki-platform-test-page - Make it easier to use the translation macro in page tests Function: setUp File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java Repository: xwiki/xwiki-platform Fixed Code: public static void setUp(TestComponentManager tcm) throws Exception { LocalizationScriptService lss = mock(LocalizationScriptService.class); tcm.registerComponent(ScriptService.class, "localization", lss); // The translations are mocked by returning the translation, suffixed with the list of the String.valueOf // values of the translation parameters if they exist. // We mock the translations instead of using their actual values because they are subject to change from // Weblate, possibly making the build fail unexpectedly. when(lss.render(anyString())).thenAnswer(invocationOnMock -> { // Return the translation key as the value return renderString(invocationOnMock.getArgument(0), new Object[] {}); } ); when(lss.render(anyString(), anyCollection())).thenAnswer(invocationOnMock -> { // Displays the comma-separated list of parameters between squared brackets after the translation key as // the value, so that they can be verified in tests. // For instance: my.key [paramA, paramB] Collection<?> parameters = invocationOnMock.getArgument(1); return renderString(invocationOnMock.getArgument(0), parameters.toArray()); }); TranslationBundleContext translationBundleContext = tcm.getInstance(TranslationBundleContext.class); TranslationBundle translationBundle = mock(TranslationBundle.class); when(translationBundle.getTranslation(any(), any())) .thenAnswer(invocationOnMockTranslation -> { Translation translation = mock(Translation.class); when(translation.getLocale()).thenReturn(Locale.ENGLISH); String translationKey = invocationOnMockTranslation.getArgument(0); when(translation.getKey()).thenReturn(translationKey); when(translation.render(any())).thenAnswer(invocationOnMockRender -> { Object[] parameters = getVarArgs(invocationOnMockRender, 0); return renderBlock(translationKey, parameters); }); when(translation.render(any(), any())).thenAnswer(invocationOnMockRender -> { Object[] parameters = getVarArgs(invocationOnMockRender, 1); return renderBlock(translationKey, parameters); }); return translation; }); translationBundleContext.addBundle(translationBundle); }
[ "CWE-94" ]
CVE-2023-29211
HIGH
8.8
xwiki/xwiki-platform
setUp
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java
ba4c76265b0b8a5e2218be400d18f08393fe1428
1
Analyze the following code function for security vulnerabilities
public String calculateSidebarToc() throws IOException, PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException { if (getToc() != null) { TOCElement activeTocElement = getToc().getActiveElement(); if (activeTocElement != null) { String result = new StringBuilder("#").append(activeTocElement.getLogId()).toString(); FacesContext.getCurrentInstance().getExternalContext().redirect(result); return result; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateSidebarToc File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
calculateSidebarToc
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
protected void setStudyParemeterConfig(StudyBean study) { StudyParameterValueBean param = new StudyParameterValueDAO(this.ds).findByHandleAndStudy(study.getId(), "collectDob"); study.getStudyParameterConfig().setCollectDob(param.getValue()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStudyParemeterConfig File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
setStudyParemeterConfig
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
HttpMethod method() { final String methodStr = get(HttpHeaderNames.METHOD); checkState(methodStr != null, ":method header does not exist."); return HttpMethod.isSupported(methodStr) ? HttpMethod.valueOf(methodStr) : HttpMethod.UNKNOWN; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: method File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
method
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public boolean deleteDirectory(File path) { if (path.exists()) { File[] files = path.listFiles(); for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { deleteDirectory(files[i]); } else { files[i].delete(); } } } return (path.delete()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDirectory File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
deleteDirectory
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
@Editable(order=25000, group="More Settings", description="Optionally specify where to run service pods " + "specified in job. The first matching locator will be used. If no any locators are found, " + "node selector of the executor will be used") public List<ServiceLocator> getServiceLocators() { return serviceLocators; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServiceLocators File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
getServiceLocators
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
private List<FileAttachmentMetadata> getIssueFileAttachmentMetadata(String issueId) { AttachmentRequest attachmentRequest = new AttachmentRequest(); attachmentRequest.setBelongType(AttachmentType.ISSUE.type()); attachmentRequest.setBelongId(issueId); List<FileAttachmentMetadata> allMsAttachments = attachmentService.listMetadata(attachmentRequest); return allMsAttachments; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssueFileAttachmentMetadata File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getIssueFileAttachmentMetadata
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setIgnoreIncomingSignatures(Boolean ignoreIncomingSignature) { logger.warn("Option 'ignoreIncomingSignatures' is deprecated and not used. Signatures are verified if " + "SAML2SignatureValidationHandler is available."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnoreIncomingSignatures File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
setIgnoreIncomingSignatures
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
@ProxyFromPrimaryToCurrentUser public void onHideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { if (mSystemServicesProxy.isForegroundUserOwner()) { hideRecents(triggeredFromAltTab, triggeredFromHomeKey); } else { Intent intent = createLocalBroadcastIntent(mContext, RecentsUserEventProxyReceiver.ACTION_PROXY_HIDE_RECENTS_TO_USER); intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB, triggeredFromAltTab); intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY, triggeredFromHomeKey); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-0813 - Severity: MEDIUM - CVSS Score: 6.6 Description: DO NOT MERGE Ensure that the device is provisioned before showing Recents. Bug: 25476219 Change-Id: I5bb9cca74790521de71c0037b4f2421c3d21b3f6 Function: onHideRecents File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java Repository: android Fixed Code: @ProxyFromPrimaryToCurrentUser public void onHideRecents(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { // Ensure the device has been provisioned before allowing the user to interact with // recents if (!isDeviceProvisioned()) { return; } if (mSystemServicesProxy.isForegroundUserOwner()) { hideRecents(triggeredFromAltTab, triggeredFromHomeKey); } else { Intent intent = createLocalBroadcastIntent(mContext, RecentsUserEventProxyReceiver.ACTION_PROXY_HIDE_RECENTS_TO_USER); intent.putExtra(EXTRA_TRIGGERED_FROM_ALT_TAB, triggeredFromAltTab); intent.putExtra(EXTRA_TRIGGERED_FROM_HOME_KEY, triggeredFromHomeKey); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); } }
[ "CWE-264" ]
CVE-2016-0813
MEDIUM
6.6
android
onHideRecents
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
1
Analyze the following code function for security vulnerabilities
private static List<Node> filterElementNodes(NodeList list) { List<Node> result = new ArrayList<Node>(list.getLength()); for (int i = 0; i < list.getLength(); i++) { if (list.item(i).getNodeType() == Node.ELEMENT_NODE) { result.add(list.item(i)); } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterElementNodes File: src/main/java/com/dd/plist/XMLPropertyListParser.java Repository: 3breadt/dd-plist The code follows secure coding practices.
[ "CWE-611" ]
CVE-2016-15026
MEDIUM
4.3
3breadt/dd-plist
filterElementNodes
src/main/java/com/dd/plist/XMLPropertyListParser.java
8c954e8d9f6f6863729e50105a8abf3f87fff74c
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder elementBefore(String name, String namespaceURI);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: elementBefore File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
elementBefore
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private boolean isPackageInstalled(String pkg, int userId) { final ApplicationInfo info = mPm.getApplicationInfo(pkg, PackageManager.GET_UNINSTALLED_PACKAGES, userId); if (info == null || (info.flags&ApplicationInfo.FLAG_INSTALLED) == 0) { return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPackageInstalled File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
isPackageInstalled
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("serial") public ModalDialog wantsNotificationOnClose() { mainContainer.add(new AjaxEventBehavior("hidden") { @Override protected void onEvent(final AjaxRequestTarget target) { handleCloseEvent(target); } }); return this; }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2013-7251 - Severity: MEDIUM - CVSS Score: 6.8 Description: CSRF protection. Function: wantsNotificationOnClose File: src/main/java/org/projectforge/web/dialog/ModalDialog.java Repository: micromata/projectforge-webapp Fixed Code: @SuppressWarnings("serial") public ModalDialog wantsNotificationOnClose() { mainContainer.add(new AjaxEventBehavior("hidden") { @Override protected void onEvent(final AjaxRequestTarget target) { csrfTokenHandler.onSubmit(); handleCloseEvent(target); } }); return this; }
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
wantsNotificationOnClose
src/main/java/org/projectforge/web/dialog/ModalDialog.java
422de35e3c3141e418a73bfb39b430d5fd74077e
1
Analyze the following code function for security vulnerabilities
public static SupportedProtocols from(URL url) { return SupportedProtocols.of(url.getProtocol()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: from File: core/src/main/java/apoc/util/FileUtils.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
from
core/src/main/java/apoc/util/FileUtils.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
@Override public void setMinimumRequiredWifiSecurityLevel(String callerPackageName, int level) { CallerIdentity caller; if (isPermissionCheckFlagEnabled()) { caller = getCallerIdentity(callerPackageName); } else { caller = getCallerIdentity(); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller), "Wi-Fi minimum security level can only be controlled by a device owner or " + "a profile owner on an organization-owned device."); } boolean valueChanged = false; synchronized (getLockObject()) { ActiveAdmin admin; if (isPermissionCheckFlagEnabled()) { admin = enforcePermissionAndGetEnforcingAdmin(/* admin= */ null, MANAGE_DEVICE_POLICY_WIFI, caller.getPackageName(), caller.getUserId()) .getActiveAdmin(); } else { admin = getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()); } if (admin.mWifiMinimumSecurityLevel != level) { admin.mWifiMinimumSecurityLevel = level; saveSettingsLocked(caller.getUserId()); valueChanged = true; } } if (valueChanged) notifyMinimumRequiredWifiSecurityLevelChanged(level); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMinimumRequiredWifiSecurityLevel 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
setMinimumRequiredWifiSecurityLevel
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String getTemplatePath() { String templatePath = Constants.WEB_SITE.get("template").toString(); templatePath = templatePath == null ? Constants.DEFAULT_TEMPLATE_PATH : templatePath; String previewTheme = TemplateHelper.getTemplatePathByCookie(getRequest().getCookies()); if (previewTheme != null) { templatePath = previewTheme; } if (!new File(PathKit.getWebRootPath() + templatePath).exists()) { templatePath = Constants.DEFAULT_TEMPLATE_PATH; } return templatePath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTemplatePath File: web/src/main/java/com/zrlog/web/controller/BaseController.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getTemplatePath
web/src/main/java/com/zrlog/web/controller/BaseController.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public void noteWakeupAlarm(IIntentSender sender, WorkSource workSource, int sourceUid, String sourcePkg, String tag) { if (workSource != null && workSource.isEmpty()) { workSource = null; } if (sourceUid <= 0 && workSource == null) { // Try and derive a UID to attribute things to based on the caller. if (sender != null) { if (!(sender instanceof PendingIntentRecord)) { return; } final PendingIntentRecord rec = (PendingIntentRecord) sender; final int callerUid = Binder.getCallingUid(); sourceUid = rec.uid == callerUid ? SYSTEM_UID : rec.uid; } else { // TODO(narayan): Should we throw an exception in this case ? It means that we // haven't been able to derive a UID to attribute things to. return; } } int standbyBucket = 0; mBatteryStatsService.noteWakupAlarm(sourcePkg, sourceUid, workSource, tag); if (workSource != null) { String workSourcePackage = workSource.getPackageName(0); int workSourceUid = workSource.getAttributionUid(); if (workSourcePackage == null) { workSourcePackage = sourcePkg; workSourceUid = sourceUid; } if (mUsageStatsService != null) { standbyBucket = mUsageStatsService.getAppStandbyBucket(workSourcePackage, UserHandle.getUserId(workSourceUid), SystemClock.elapsedRealtime()); } FrameworkStatsLog.write(FrameworkStatsLog.WAKEUP_ALARM_OCCURRED, workSource, tag, sourcePkg, standbyBucket); if (DEBUG_POWER) { Slog.w(TAG, "noteWakeupAlarm[ sourcePkg=" + sourcePkg + ", sourceUid=" + sourceUid + ", workSource=" + workSource + ", tag=" + tag + ", standbyBucket=" + standbyBucket + " wsName=" + workSourcePackage + ")]"); } } else { if (mUsageStatsService != null) { standbyBucket = mUsageStatsService.getAppStandbyBucket(sourcePkg, UserHandle.getUserId(sourceUid), SystemClock.elapsedRealtime()); } FrameworkStatsLog.write_non_chained(FrameworkStatsLog.WAKEUP_ALARM_OCCURRED, sourceUid, null, tag, sourcePkg, standbyBucket); if (DEBUG_POWER) { Slog.w(TAG, "noteWakeupAlarm[ sourcePkg=" + sourcePkg + ", sourceUid=" + sourceUid + ", workSource=" + workSource + ", tag=" + tag + ", standbyBucket=" + standbyBucket + "]"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteWakeupAlarm 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
noteWakeupAlarm
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public int getReadTimeout() { return readTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReadTimeout File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getReadTimeout
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private boolean backupPasswordMatches(String currentPw) { if (hasBackupPassword()) { final boolean pbkdf2Fallback = (mPasswordVersion < BACKUP_PW_FILE_VERSION); if (!passwordMatchesSaved(PBKDF_CURRENT, currentPw, PBKDF2_HASH_ROUNDS) && !(pbkdf2Fallback && passwordMatchesSaved(PBKDF_FALLBACK, currentPw, PBKDF2_HASH_ROUNDS))) { if (DEBUG) Slog.w(TAG, "Backup password mismatch; aborting"); return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: backupPasswordMatches File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
backupPasswordMatches
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private static String decodeRedirectUri(String redirectUri) { if (redirectUri == null) return null; int MAX_DECODING_COUNT = 5; // Max count of attempts for decoding URL (in case it was encoded multiple times) try { KeycloakUriBuilder uriBuilder = KeycloakUriBuilder.fromUri(redirectUri).preserveDefaultPort(); String origQuery = uriBuilder.getQuery(); String origFragment = uriBuilder.getFragment(); String encodedRedirectUri = uriBuilder .replaceQuery(null) .fragment(null) .buildAsString(); String decodedRedirectUri = null; for (int i = 0; i < MAX_DECODING_COUNT; i++) { decodedRedirectUri = Encode.decode(encodedRedirectUri); if (decodedRedirectUri.equals(encodedRedirectUri)) { // URL is decoded. We can return it (after attach original query and fragment) return KeycloakUriBuilder.fromUri(decodedRedirectUri).preserveDefaultPort() .replaceQuery(origQuery) .fragment(origFragment) .buildAsString(); } else { // Next attempt encodedRedirectUri = decodedRedirectUri; } } } catch (IllegalArgumentException iae) { logger.debugf("Illegal redirect URI used: %s, Details: %s", redirectUri, iae.getMessage()); } logger.debugf("Was not able to decode redirect URI: %s", redirectUri); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeRedirectUri File: services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java Repository: keycloak The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4361
MEDIUM
6.1
keycloak
decodeRedirectUri
services/src/main/java/org/keycloak/protocol/oidc/utils/RedirectUtils.java
a1cfe6e24e5b34792699a00b8b4a8016a5929e3a
0
Analyze the following code function for security vulnerabilities
public void sendPresenceRequest(String user, String type) { // HACK: remove the fake roster entry added by handleIncomingSubscribe() subscriptionRequests.remove(user); if ("unsubscribed".equals(type)) deleteRosterEntryFromDB(user); Presence response = new Presence(Presence.Type.valueOf(type)); response.setTo(user); mXMPPConnection.sendPacket(response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendPresenceRequest File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
sendPresenceRequest
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public String resolveDriverClassNameFromLocal(String driverFilePath) { File driverFile = Paths.get(driverFilePath).toFile(); if (!driverFile.exists()) { throw DomainErrors.DRIVER_CLASS_NOT_FOUND.exception("驱动文件不存在,请重新上传"); } return resolveDriverClassName(driverFile); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveDriverClassNameFromLocal File: core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java Repository: vran-dev/databasir The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-31196
HIGH
7.5
vran-dev/databasir
resolveDriverClassNameFromLocal
core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
226c20e0c9124037671a91d6b3e5083bd2462058
0
Analyze the following code function for security vulnerabilities
void notifyTaskPersisterLocked(Task task, boolean flush) { mRecentTasks.notifyTaskPersisterLocked(task, flush); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyTaskPersisterLocked 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
notifyTaskPersisterLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public int compare(Integer o1, Integer o2) { return o2-o1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compare File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
compare
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("comment:edit") @PostMapping("/edit") @ResponseBody public Result update(Integer id, String content) { Comment comment = commentService.selectById(id); comment.setContent(content); commentService.update(comment); return success(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: src/main/java/co/yiiu/pybbs/controller/admin/CommentAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
update
src/main/java/co/yiiu/pybbs/controller/admin/CommentAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
public void setDefaultRow(HeaderRow row) { if (row == defaultRow) { return; } if (row != null && !rows.contains(row)) { throw new IllegalArgumentException( "Cannot set a default row that does not exist in the section"); } if (defaultRow != null) { defaultRow.setDefaultRow(false); } if (row != null) { row.setDefaultRow(true); } defaultRow = row; markAsDirty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultRow 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
setDefaultRow
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private PostgresClient postgresClientNonexistingTenant() { try { postgresClient = new PostgresClient(vertx, "nonexistingTenant"); return postgresClient; } catch (Exception e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postgresClientNonexistingTenant 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
postgresClientNonexistingTenant
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
protected void setTree(StateTree tree) { visitNodeTree(node -> node.doSetTree(tree)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTree File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
setTree
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private static TrustAnchor findBySubjectAndPublicKey(X509Certificate cert, Collection<TrustAnchor> anchors) { PublicKey certPublicKey = cert.getPublicKey(); for (TrustAnchor anchor : anchors) { PublicKey caPublicKey; try { X509Certificate caCert = anchor.getTrustedCert(); if (caCert != null) { caPublicKey = caCert.getPublicKey(); } else { caPublicKey = anchor.getCAPublicKey(); } if (caPublicKey.equals(certPublicKey)) { return anchor; } } catch (Exception e) { // can happen with unsupported public key types } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findBySubjectAndPublicKey File: src/platform/java/org/conscrypt/TrustedCertificateIndex.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
findBySubjectAndPublicKey
src/platform/java/org/conscrypt/TrustedCertificateIndex.java
4c9f9c2201116acf790fca25af43995d29980ee0
0
Analyze the following code function for security vulnerabilities
@Override public void setValue(NotificationPanelView object, float value) { object.setDarkAmount(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValue File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
setValue
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@GetMapping("/fetch/{key:.+}") public ResponseEntity<Resource> fetch(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.parseMediaType(type); Resource file = storageService.loadAsResource(key); if (file == null) { ResponseEntity.notFound(); } return ResponseEntity.ok().contentType(mediaType).body(file); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-18434 - Severity: MEDIUM - CVSS Score: 5.0 Description: fix[litemall-wx-api]: 修复文件路径中包含"../"带来的安全问题 Function: fetch File: litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java Repository: linlinjava/litemall Fixed Code: @GetMapping("/fetch/{key:.+}") public ResponseEntity<Resource> fetch(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { return ResponseEntity.notFound().build(); } if(key.contains("../")){ return ResponseEntity.badRequest().build(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.parseMediaType(type); Resource file = storageService.loadAsResource(key); if (file == null) { return ResponseEntity.notFound().build(); } return ResponseEntity.ok().contentType(mediaType).body(file); }
[ "CWE-22" ]
CVE-2018-18434
MEDIUM
5
linlinjava/litemall
fetch
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxStorageController.java
49ab94d0052672d4fb642505d44b94a18abea332
1
Analyze the following code function for security vulnerabilities
private void tagProvidersAndHosts() { final int providerCount = mProviders.size(); for (int i = 0; i < providerCount; i++) { Provider provider = mProviders.get(i); provider.tag = i; } final int hostCount = mHosts.size(); for (int i = 0; i < hostCount; i++) { Host host = mHosts.get(i); host.tag = i; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tagProvidersAndHosts File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
tagProvidersAndHosts
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private String findAgentUrl(Configuration pConfig) { // System property has precedence String url = System.getProperty("jolokia." + ConfigKey.DISCOVERY_AGENT_URL.getKeyValue()); if (url == null) { url = System.getenv("JOLOKIA_DISCOVERY_AGENT_URL"); if (url == null) { url = pConfig.get(ConfigKey.DISCOVERY_AGENT_URL); } } return NetworkUtil.replaceExpression(url); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findAgentUrl File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
findAgentUrl
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public final HttpRequestInitializer getRequestInitializer() { return requestInitializer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequestInitializer File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
getRequestInitializer
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
public final void setPassword(String password) { resetPassword(password); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassword File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
setPassword
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
static CallsManager getInstance() { return sInstance; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstance File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
getInstance
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public ApiClient setPassword(String password) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setPassword(password); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassword File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setPassword
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private ComponentName resolveActivity(Intent intent) { final PackageManager packageManager = getPackageManager(); final ComponentName componentName = intent.resolveActivity(packageManager); if (componentName != null) { return componentName; } intent.addFlags(Intent.FLAG_ACTIVITY_MATCH_EXTERNAL); final ActivityInfo ai = intent.resolveActivityInfo(packageManager, PackageManager.MATCH_INSTANT); if (ai != null) { return new ComponentName(ai.applicationInfo.packageName, ai.name); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveActivity 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
resolveActivity
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
private void checkThreadCreation() { if (blockThreadCreation || configuration == null || configuration.allowedThreadCount().isEmpty()) { checkForNonWhitelistedStackFrames(() -> localized("security.error_thread_access")); //$NON-NLS-1$ return; } var current = testThreadGroup.activeCount(); var max = configuration.allowedThreadCount().getAsInt(); if (max < current) checkForNonWhitelistedStackFrames(() -> formatLocalized("security.error_thread_maxExceeded", current, max)); //$NON-NLS-1$ }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkThreadCreation File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
checkThreadCreation
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(name = "recovery=") public IRubyObject set_recovery(ThreadContext context, IRubyObject value) { recovery = value.isTrue(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: set_recovery File: ext/java/nokogiri/XmlSaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
set_recovery
ext/java/nokogiri/XmlSaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
protected EnumResolver constructEnumResolver(Class<?> enumClass, DeserializationConfig config, AnnotatedMember jsonValueAccessor) { if (jsonValueAccessor != null) { if (config.canOverrideAccessModifiers()) { ClassUtil.checkAndFixAccess(jsonValueAccessor.getMember(), config.isEnabled(MapperFeature.OVERRIDE_PUBLIC_ACCESS_MODIFIERS)); } return EnumResolver.constructUnsafeUsingMethod(enumClass, jsonValueAccessor, config.getAnnotationIntrospector()); } // 14-Mar-2016, tatu: We used to check `DeserializationFeature.READ_ENUMS_USING_TO_STRING` // here, but that won't do: it must be dynamically changeable... return EnumResolver.constructUnsafe(enumClass, config.getAnnotationIntrospector()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: constructEnumResolver File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
constructEnumResolver
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public boolean removeRequestAckPredicate(StanzaFilter predicate) { synchronized (requestAckPredicates) { return requestAckPredicates.remove(predicate); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeRequestAckPredicate File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
removeRequestAckPredicate
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override public void addMember(Context context, Group groupParent, Group groupChild) throws SQLException { // don't add if it's already a member // and don't add itself if (groupParent.contains(groupChild) || groupParent.getID() == groupChild.getID()) { return; } groupParent.addMember(groupChild); groupChild.addParentGroup(groupParent); context.addEvent(new Event(Event.ADD, Constants.GROUP, groupParent.getID(), Constants.GROUP, groupChild.getID(), groupChild.getName(), getIdentifiers(context, groupParent))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMember File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
addMember
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public void setExecutable( String executable ) { shell.setExecutable( executable ); this.executable = executable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExecutable File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
setExecutable
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
protected StandardEvaluationContext createEvaluationContext(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return context; }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: createEvaluationContext File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: protected EvaluationContext createEvaluationContext(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); return SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
createEvaluationContext
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
private byte[] calculatePackageSignatureDigest(String callerPkg) { MessageDigest digester; try { digester = MessageDigest.getInstance("SHA-256"); PackageInfo pkgInfo = mPackageManager.getPackageInfo( callerPkg, PackageManager.GET_SIGNATURES); for (Signature sig : pkgInfo.signatures) { digester.update(sig.toByteArray()); } } catch (NoSuchAlgorithmException x) { Log.wtf(TAG, "SHA-256 should be available", x); digester = null; } catch (NameNotFoundException e) { Log.w(TAG, "Could not find packageinfo for: " + callerPkg); digester = null; } return (digester == null) ? null : digester.digest(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculatePackageSignatureDigest File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
calculatePackageSignatureDigest
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public void setApplicationRestrictions(String packageName, Bundle restrictions, int userId) { if (UserHandle.getCallingUserId() != userId || !UserHandle.isSameApp(Binder.getCallingUid(), getUidForPackage(packageName))) { checkManageUsersPermission("Only system can set restrictions for other users/apps"); } synchronized (mPackagesLock) { if (restrictions == null || restrictions.isEmpty()) { cleanAppRestrictionsForPackage(packageName, userId); } else { // Write the restrictions to XML writeApplicationRestrictionsLocked(packageName, restrictions, userId); } } if (isPackageInstalled(packageName, userId)) { // Notify package of changes via an intent - only sent to explicitly registered receivers. Intent changeIntent = new Intent(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED); changeIntent.setPackage(packageName); changeIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); mContext.sendBroadcastAsUser(changeIntent, new UserHandle(userId)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApplicationRestrictions File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
setApplicationRestrictions
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Override public List<V> getAllAndRemove(K name) { List<V> all = getAll(name); remove(name); return all; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllAndRemove File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
getAllAndRemove
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override protected void setUpgradeListener(HttpUpgradeListener upgradeListener) { //ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUpgradeListener File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
setUpgradeListener
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override public long getCreationTime() { synchronized (OpenSslEngine.this) { if (creationTime == 0 && !isDestroyed()) { creationTime = SSL.getTime(ssl) * 1000L; } } return creationTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCreationTime File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
getCreationTime
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<SecurityEvent> retrieveSecurityLogs(ComponentName admin, String packageName) { if (!mHasFeature) { return null; } final CallerIdentity caller = getCallerIdentity(admin, packageName); if (isPermissionCheckFlagEnabled()) { Preconditions.checkCallAuthorization(isOrganizationOwnedDeviceWithManagedProfile() || areAllUsersAffiliatedWithDeviceLocked()); enforcePermission(MANAGE_DEVICE_POLICY_SECURITY_LOGGING, caller.getPackageName(), UserHandle.USER_ALL); } else { if (admin != null) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner(caller)); } else { // A delegate app passes a null admin component, which is expected Preconditions.checkCallAuthorization( isCallerDelegate(caller, DELEGATION_SECURITY_LOGGING)); } Preconditions.checkCallAuthorization(isOrganizationOwnedDeviceWithManagedProfile() || areAllUsersAffiliatedWithDeviceLocked()); } if (!mInjector.securityLogGetLoggingEnabledProperty()) { return null; } recordSecurityLogRetrievalTime(); List<SecurityEvent> logs = mSecurityLogMonitor.retrieveLogs(); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.RETRIEVE_SECURITY_LOGS) .setAdmin(caller.getPackageName()) .write(); return logs != null ? new ParceledListSlice<SecurityEvent>(logs) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveSecurityLogs 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
retrieveSecurityLogs
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public FactoryResetProtectionPolicy getFactoryResetProtectionPolicy( @Nullable ComponentName who) { if (!mHasFeature) { return null; } final CallerIdentity caller = getCallerIdentity(who); final int frpManagementAgentUid = getFrpManagementAgentUidOrThrow(); final ActiveAdmin admin; synchronized (getLockObject()) { if (who == null) { Preconditions.checkCallAuthorization(frpManagementAgentUid == caller.getUid() || hasCallingPermission(permission.MASTER_CLEAR), "Must be called by the FRP management agent on device"); admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked( UserHandle.getUserId(frpManagementAgentUid)); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller)); admin = getProfileOwnerOrDeviceOwnerLocked(caller); } } return admin != null ? admin.mFactoryResetProtectionPolicy : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFactoryResetProtectionPolicy 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
getFactoryResetProtectionPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Nullable protected String getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return message.getValue(context, String.class); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getText File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: @Nullable protected String getText(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); SimpleEvaluationContext context = SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); return message.getValue(context, String.class); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getText
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
private byte nextTC() throws IOException { if (hasPushbackTC) { hasPushbackTC = false; // We are consuming it } else { // Just in case a later call decides to really push it back, // we don't require the caller to pass it as parameter pushbackTC = input.readByte(); } return pushbackTC; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextTC File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
nextTC
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private final BigInteger _bigPositive(long l) { BigInteger biggie = BigInteger.valueOf((l << 1) >>> 1); return biggie.or(BIT_63); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _bigPositive File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_bigPositive
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public static @Nullable String[] quotelessTableName(String fullname) { @Nullable String[] parts = new String[]{null, ""}; StringBuilder acc = new StringBuilder(); boolean betweenQuotes = false; for (int i = 0; i < fullname.length(); i++) { char c = fullname.charAt(i); switch (c) { case '"': if ((i < fullname.length() - 1) && (fullname.charAt(i + 1) == '"')) { // two consecutive quotes - keep one i++; acc.append(c); // keep the quote } else { // Discard it betweenQuotes = !betweenQuotes; } break; case '.': if (betweenQuotes) { // Keep it acc.append(c); } else { // Have schema name parts[1] = acc.toString(); acc = new StringBuilder(); } break; default: acc.append((betweenQuotes) ? c : Character.toLowerCase(c)); break; } } // Always put table in slot 0 parts[0] = acc.toString(); return parts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quotelessTableName 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
quotelessTableName
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void setId(String id) { this.id = id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setId 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
setId
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java
2b411dc2821c69539138aaf7632b938b659a58fa
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("comment:examine") @GetMapping("/examine") @ResponseBody public Result examine(Integer id) { Comment comment = commentService.selectById(id); comment.setStatus(true); commentService.update(comment); return success(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: examine File: src/main/java/co/yiiu/pybbs/controller/admin/CommentAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
examine
src/main/java/co/yiiu/pybbs/controller/admin/CommentAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
private boolean restoreRecentTaskLocked(TaskRecord task) { ActivityStack stack = null; // Determine stack to restore task to. if (mLeanbackOnlyDevice) { // There is only one stack for lean back devices. stack = mHomeStack; } else { // Look for the top stack on the home display that isn't the home stack. final ArrayList<ActivityStack> homeDisplayStacks = mHomeStack.mStacks; for (int stackNdx = homeDisplayStacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack tmpStack = homeDisplayStacks.get(stackNdx); if (!tmpStack.isHomeStack() && tmpStack.mFullscreen) { stack = tmpStack; break; } } } if (stack == null) { // We couldn't find a stack to restore the task to. Possible if are restoring recents // before an application stack is created...Go ahead and create one on the default // display. stack = createStackOnDisplay(getNextStackId(), Display.DEFAULT_DISPLAY); // Restore home stack to top. moveHomeStack(true, "restoreRecentTask"); if (DEBUG_RECENTS) Slog.v(TAG_RECENTS, "Created stack=" + stack + " for recents restoration."); } if (stack == null) { // What does this mean??? Not sure how we would get here... if (DEBUG_RECENTS) Slog.v(TAG_RECENTS, "Unable to find/create stack to restore recent task=" + task); return false; } stack.addTask(task, false, false); if (DEBUG_RECENTS) Slog.v(TAG_RECENTS, "Added restored task=" + task + " to stack=" + stack); final ArrayList<ActivityRecord> activities = task.mActivities; for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) { final ActivityRecord r = activities.get(activityNdx); mWindowManager.addAppToken(0, r.appToken, task.taskId, stack.mStackId, r.info.screenOrientation, r.fullscreen, (r.info.flags & ActivityInfo.FLAG_SHOW_FOR_ALL_USERS) != 0, r.userId, r.info.configChanges, task.voiceSession != null, r.mLaunchTaskBehind); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreRecentTaskLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
restoreRecentTaskLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public void refresh() { if (this.binding == null) { Log.d(Config.LOGTAG, "ConversationFragment.refresh() skipped updated because view binding was null"); return; } if (this.conversation != null && this.activity != null && this.activity.xmppConnectionService != null) { if (!activity.xmppConnectionService.isConversationStillOpen(this.conversation)) { activity.onConversationArchived(this.conversation); return; } } this.refresh(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: refresh File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
refresh
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private MediaPackage addContentToMediaPackage(MediaPackage mp, String elementId, URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor) { logger.info("Adding element of type {} to mediapackage {}", type, mp); MediaPackageElement mpe = mp.add(uri, type, flavor); mpe.setIdentifier(elementId); return mp; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addContentToMediaPackage 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
addContentToMediaPackage
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public long getStartRow() { return startRow; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStartRow File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
getStartRow
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
protected Logger getLogger() { return logger; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogger File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
getLogger
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
public String getPackageForIntentSender(IIntentSender sender) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageForIntentSender File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getPackageForIntentSender
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
String getStartedUserState(int userId) { final UserState userState = mUserController.getStartedUserState(userId); return UserState.stateToString(userState.state); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStartedUserState 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
getStartedUserState
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public AdapterService getService() { if (mService != null && mService.isAvailable()) { return mService; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getService File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
getService
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0