instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private boolean setBackoffLocked(Account account, int userId, String providerName,
long nextSyncTime, long nextDelay) {
boolean changed = false;
for (AccountInfo accountInfo : mAccounts.values()) {
if (account != null && !account.equals(accountInfo.accountAndUser.account)
&& userId != accountInfo.accountAndUser.userId) {
continue;
}
for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) {
if (providerName != null
&& !providerName.equals(authorityInfo.target.provider)) {
continue;
}
if (authorityInfo.backoffTime != nextSyncTime
|| authorityInfo.backoffDelay != nextDelay) {
authorityInfo.backoffTime = nextSyncTime;
authorityInfo.backoffDelay = nextDelay;
changed = true;
}
}
}
return changed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBackoffLocked
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
setBackoffLocked
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isLogoutEnabled() {
if (!mHasFeature) {
return false;
}
synchronized (getLockObject()) {
ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked();
return (deviceOwner != null) && deviceOwner.isLogoutEnabled;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isLogoutEnabled
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
|
isLogoutEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthAuthorizationCodeFlow(String code) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).useAuthorizationCodeFlow(code);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthAuthorizationCodeFlow
File: samples/openapi3/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
|
setOauthAuthorizationCodeFlow
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ProgramWorkflow getWorkflow(Integer id) {
for (Program p : Context.getProgramWorkflowService().getAllPrograms()) {
for (ProgramWorkflow w : p.getAllWorkflows()) {
if (w.getProgramWorkflowId().equals(id)) {
return w;
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWorkflow
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
getWorkflow
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract SmsTracker getNewSubmitPduTracker(String destinationAddress, String scAddress,
String message, SmsHeader smsHeader, int encoding,
PendingIntent sentIntent, PendingIntent deliveryIntent, boolean lastPart,
AtomicInteger unsentPartCount, AtomicBoolean anyPartFailed, Uri messageUri,
String fullMessageText);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNewSubmitPduTracker
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
getNewSubmitPduTracker
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
private void errorLog(String msg) {
Log.e(TAG, msg);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: errorLog
File: src/com/android/bluetooth/btservice/AdapterState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
errorLog
|
src/com/android/bluetooth/btservice/AdapterState.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public double doubleValue() {
return bigDecimalValue().doubleValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doubleValue
File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
Repository: eclipse-ee4j/parsson
The code follows secure coding practices.
|
[
"CWE-834"
] |
CVE-2023-4043
|
HIGH
| 7.5
|
eclipse-ee4j/parsson
|
doubleValue
|
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
|
84764ffbe3d0376da242b27a9a526138d0dfb8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
public PrivateKey key() {
return key;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: key
File: handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
key
|
handler/src/main/java/io/netty/handler/ssl/util/SelfSignedCertificate.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateResources() {
// Update the quick setting tiles
if (mQSPanel != null) {
mQSPanel.updateResources();
}
loadDimens();
if (mNotificationPanel != null) {
mNotificationPanel.updateResources();
}
if (mBrightnessMirrorController != null) {
mBrightnessMirrorController.updateResources();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateResources
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
updateResources
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void useSslProtocol(String protocol)
throws NoSuchAlgorithmException, KeyManagementException
{
useSslProtocol(protocol, new TrustEverythingTrustManager());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useSslProtocol
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
useSslProtocol
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isListenerPackage(String packageName) {
if (packageName == null) {
return false;
}
// TODO: clean up locking object later
synchronized (mNotificationList) {
for (final ManagedServiceInfo serviceInfo : mServices) {
if (packageName.equals(serviceInfo.component.getPackageName())) {
return true;
}
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isListenerPackage
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
isListenerPackage
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Set<Locale> getLocales(DocumentReference documentReference, Locale entityLocale)
throws XWikiException, SolrIndexerException
{
XWikiContext xcontext = this.xcontextProvider.get();
return getLocales(xcontext.getWiki().getDocument(documentReference, xcontext), entityLocale);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocales
File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-312",
"CWE-200"
] |
CVE-2023-50719
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getLocales
|
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
|
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
| 0
|
Analyze the following code function for security vulnerabilities
|
public WebClient getWebClient(WebClient.Builder webClientBuilder, APIConnection apiConnection,
String reqContentType, ObjectMapper objectMapper,
ExchangeStrategies EXCHANGE_STRATEGIES, RequestCaptureFilter requestCaptureFilter) {
// Right before building the webclient object, we populate it with whatever mutation the APIConnection object demands
if (apiConnection != null) {
webClientBuilder.filter(apiConnection);
}
if (MediaType.MULTIPART_FORM_DATA_VALUE.equals(reqContentType)) {
webClientBuilder.filter(new BufferingFilter());
}
webClientBuilder.filter(requestCaptureFilter);
return webClientBuilder.exchangeStrategies(EXCHANGE_STRATEGIES).build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWebClient
File: app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-4096
|
MEDIUM
| 6.5
|
appsmithorg/appsmith
|
getWebClient
|
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
|
769719ccfe667f059fe0b107a19ec9feb90f2e40
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onWakefulnessChanged(int wakefulness) {
ActivityManagerService.this.onWakefulnessChanged(wakefulness);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onWakefulnessChanged
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
|
onWakefulnessChanged
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getCaptionFileUrlDirectory() {
return defaultTextTrackUrl + "/textTrack/";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCaptionFileUrlDirectory
File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
Repository: bigbluebutton
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-12443
|
HIGH
| 7.5
|
bigbluebutton
|
getCaptionFileUrlDirectory
|
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
|
b21ca8355a57286a1e6df96984b3a4c57679a463
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isGeofenceSupported() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isGeofenceSupported
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
isGeofenceSupported
|
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setInsecure(Object connection, boolean insecure) {
if (insecure) {
if (connection instanceof HttpsURLConnection) {
HttpsURLConnection conn = (HttpsURLConnection)connection;
try {
TrustModifier.relaxHostChecking(conn);
} catch (Exception ex) {
com.codename1.io.Log.e(ex);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInsecure
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
setInsecure
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void sendPing(byte[] data, final ChannelExceptionHandler<AbstractHttp2StreamSinkChannel> exceptionHandler) {
sendPing(data, exceptionHandler, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendPing
File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-214"
] |
CVE-2021-3859
|
HIGH
| 7.5
|
undertow-io/undertow
|
sendPing
|
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void mergeWithInternalWifiConfiguration(
WifiConfiguration internalConfig, WifiConfiguration externalConfig) {
if (externalConfig.SSID != null) {
internalConfig.SSID = externalConfig.SSID;
}
if (externalConfig.BSSID != null) {
internalConfig.BSSID = externalConfig.BSSID.toLowerCase();
}
internalConfig.hiddenSSID = externalConfig.hiddenSSID;
if (externalConfig.preSharedKey != null
&& !externalConfig.preSharedKey.equals(PASSWORD_MASK)) {
internalConfig.preSharedKey = externalConfig.preSharedKey;
}
// Modify only wep keys are present in the provided configuration. This is a little tricky
// because there is no easy way to tell if the app is actually trying to null out the
// existing keys or not.
if (externalConfig.wepKeys != null) {
boolean hasWepKey = false;
for (int i = 0; i < internalConfig.wepKeys.length; i++) {
if (externalConfig.wepKeys[i] != null
&& !externalConfig.wepKeys[i].equals(PASSWORD_MASK)) {
internalConfig.wepKeys[i] = externalConfig.wepKeys[i];
hasWepKey = true;
}
}
if (hasWepKey) {
internalConfig.wepTxKeyIndex = externalConfig.wepTxKeyIndex;
}
}
if (externalConfig.FQDN != null) {
internalConfig.FQDN = externalConfig.FQDN;
}
if (externalConfig.providerFriendlyName != null) {
internalConfig.providerFriendlyName = externalConfig.providerFriendlyName;
}
if (externalConfig.roamingConsortiumIds != null) {
internalConfig.roamingConsortiumIds = externalConfig.roamingConsortiumIds.clone();
}
mergeSecurityParamsListWithInternalWifiConfiguration(internalConfig, externalConfig);
mergeDppSecurityParamsWithInternalWifiConfiguration(internalConfig, externalConfig);
// Copy over the |IpConfiguration| parameters if set.
if (externalConfig.getIpConfiguration() != null) {
IpConfiguration.IpAssignment ipAssignment = externalConfig.getIpAssignment();
if (ipAssignment != IpConfiguration.IpAssignment.UNASSIGNED) {
internalConfig.setIpAssignment(ipAssignment);
if (ipAssignment == IpConfiguration.IpAssignment.STATIC) {
internalConfig.setStaticIpConfiguration(
new StaticIpConfiguration(externalConfig.getStaticIpConfiguration()));
}
}
IpConfiguration.ProxySettings proxySettings = externalConfig.getProxySettings();
if (proxySettings != IpConfiguration.ProxySettings.UNASSIGNED) {
internalConfig.setProxySettings(proxySettings);
if (proxySettings == IpConfiguration.ProxySettings.PAC
|| proxySettings == IpConfiguration.ProxySettings.STATIC) {
internalConfig.setHttpProxy(new ProxyInfo(externalConfig.getHttpProxy()));
}
}
}
internalConfig.allowAutojoin = externalConfig.allowAutojoin;
// Copy over the |WifiEnterpriseConfig| parameters if set.
if (externalConfig.enterpriseConfig != null) {
internalConfig.enterpriseConfig.copyFromExternal(
externalConfig.enterpriseConfig, PASSWORD_MASK);
}
// Copy over any metered information.
internalConfig.meteredHint = externalConfig.meteredHint;
internalConfig.meteredOverride = externalConfig.meteredOverride;
internalConfig.trusted = externalConfig.trusted;
internalConfig.oemPaid = externalConfig.oemPaid;
internalConfig.oemPrivate = externalConfig.oemPrivate;
internalConfig.dbsSecondaryInternet = externalConfig.dbsSecondaryInternet;
internalConfig.carrierMerged = externalConfig.carrierMerged;
internalConfig.restricted = externalConfig.restricted;
// Copy over macRandomizationSetting
internalConfig.macRandomizationSetting = externalConfig.macRandomizationSetting;
internalConfig.carrierId = externalConfig.carrierId;
internalConfig.isHomeProviderNetwork = externalConfig.isHomeProviderNetwork;
internalConfig.subscriptionId = externalConfig.subscriptionId;
internalConfig.setSubscriptionGroup(externalConfig.getSubscriptionGroup());
internalConfig.getNetworkSelectionStatus()
.setConnectChoice(externalConfig.getNetworkSelectionStatus().getConnectChoice());
internalConfig.getNetworkSelectionStatus().setConnectChoiceRssi(
externalConfig.getNetworkSelectionStatus().getConnectChoiceRssi());
internalConfig.setBssidAllowlist(externalConfig.getBssidAllowlistInternal());
internalConfig.setRepeaterEnabled(externalConfig.isRepeaterEnabled());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: mergeWithInternalWifiConfiguration
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
|
mergeWithInternalWifiConfiguration
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean validateAndRegister(TestUtils testUtils, boolean useLiveValidation, boolean isModal,
AbstractRegistrationPage registrationPage)
{
if (useLiveValidation) {
registrationPage.triggerLiveValidation();
if (!registrationPage.getValidationFailureMessages().isEmpty()) {
return false;
}
boolean result = tryToRegister(testUtils, registrationPage, isModal);
assertTrue(registrationPage.getValidationFailureMessages().isEmpty(),
"LiveValidation did not show a failure message but clicking on the register button did.");
return result;
}
return tryToRegister(testUtils, registrationPage, isModal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateAndRegister
File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2024-21650
|
CRITICAL
| 9.8
|
xwiki/xwiki-platform
|
validateAndRegister
|
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
|
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiUser checkAuth(String username, String password, String rememberme) throws XWikiException
{
XWikiUser user =
this.context.getWiki().getAuthService().checkAuth(username, password, rememberme, this.context);
if (user.isDisabled(this.context)) {
this.context.put(XWikiContext.INACTIVE_USER_REFERENCE, user.getUserReference());
user = null;
}
return user;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAuth
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
checkAuth
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthScope(String scope) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).setScope(scope);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthScope
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
|
setOauthScope
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String escapeChar(char c) {
if (c < 0x10) {
return "\\u000" + Integer.toHexString(c);
} else if (c < 0x100) {
return "\\u00" + Integer.toHexString(c);
} else if (c < 0x1000) {
return "\\u0" + Integer.toHexString(c);
}
return "\\u" + Integer.toHexString(c);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: escapeChar
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
|
escapeChar
|
varexport/src/main/java/com/indeed/util/varexport/Variable.java
|
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
| 0
|
Analyze the following code function for security vulnerabilities
|
private static @ColorInt int calculateContrastColor(Context ctx, @ColorInt int rawColor,
@ColorInt int accentColor, @ColorInt int backgroundColor, boolean nightMode) {
int color;
if (rawColor == COLOR_DEFAULT) {
color = accentColor;
if (color == COLOR_INVALID) {
color = ContrastColorUtil.resolveDefaultColor(ctx, backgroundColor, nightMode);
}
} else {
color = ContrastColorUtil.resolveContrastColor(ctx, rawColor, backgroundColor,
nightMode);
}
return flattenAlpha(color, backgroundColor);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calculateContrastColor
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
calculateContrastColor
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getPriority() {
if (mNotificationChannel.getImportance() <= IMPORTANCE_LOW
&& mNotificationChannel.getImportance() > IMPORTANCE_UNSPECIFIED) {
return ACTION_MUTE;
} else {
if (mNotificationChannel.isImportantConversation()) {
return ACTION_FAVORITE;
}
}
return ACTION_DEFAULT;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPriority
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
getPriority
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean scan(boolean complete) throws IOException {
boolean next;
do {
try {
next = false;
switch (fScannerState) {
case STATE_CONTENT: {
fBeginLineNumber = fCurrentEntity.getLineNumber();
fBeginColumnNumber = fCurrentEntity.getColumnNumber();
fBeginCharacterOffset = fCurrentEntity.getCharacterOffset();
int c = fCurrentEntity.read();
if (c == '<') {
setScannerState(STATE_MARKUP_BRACKET);
continue;
}
if (c == '&') {
if (fTextarea || fTitle) {
scanEntityRef(fStringBuffer, true);
continue;
}
fStringBuffer.clear();
fStringBuffer.append('&');
}
else if (c == -1) {
if (fReportErrors) {
fErrorReporter.reportError("HTML1007", null);
}
throw new EOFException();
}
else {
fCurrentEntity.rewind();
fStringBuffer.clear();
}
scanCharacters(fStringBuffer, -1);
break;
} // case STATE_CONTENT
case STATE_MARKUP_BRACKET: {
int delimiter = -1;
int c = fCurrentEntity.read();
if (c == '/') {
String ename = scanName(true);
if (ename != null) {
if (ename.equalsIgnoreCase(fElementName)) {
if (fCurrentEntity.read() == '>') {
ename = modifyName(ename, fNamesElems);
if (fDocumentHandler != null && fElementCount >= fElementDepth) {
fQName.setValues(null, ename, ename, null);
if (DEBUG_CALLBACKS) {
System.out.println("endElement("+fQName+")");
}
fEndLineNumber = fCurrentEntity.getLineNumber();
fEndColumnNumber = fCurrentEntity.getColumnNumber();
fEndCharacterOffset = fCurrentEntity.getCharacterOffset();
fDocumentHandler.endElement(fQName, locationAugs());
}
setScanner(fContentScanner);
setScannerState(STATE_CONTENT);
return true;
}
fCurrentEntity.rewind();
}
fStringBuffer.clear();
fStringBuffer.append("</");
fStringBuffer.append(ename);
}
else {
fStringBuffer.clear();
fStringBuffer.append("</");
}
}
else {
fStringBuffer.clear();
fStringBuffer.append('<');
appendChar(fStringBuffer, c);
}
scanCharacters(fStringBuffer, delimiter);
setScannerState(STATE_CONTENT);
break;
} // case STATE_MARKUP_BRACKET
} // switch
} // try
catch (EOFException e) {
setScanner(fContentScanner);
if (fCurrentEntityStack.empty()) {
setScannerState(STATE_END_DOCUMENT);
}
else {
fCurrentEntity = (CurrentEntity)fCurrentEntityStack.pop();
setScannerState(STATE_CONTENT);
}
return true;
}
} // do
while (next || complete);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scan
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
scan
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setOauthAuthorizationCodeFlow(String code) {
for (Authentication auth : authentications.values()) {
if (auth instanceof OAuth) {
((OAuth) auth).useAuthorizationCodeFlow(code);
return this;
}
}
throw new RuntimeException("No OAuth2 authentication configured!");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOauthAuthorizationCodeFlow
File: samples/client/petstore/java/resteasy/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
|
setOauthAuthorizationCodeFlow
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean installApk(FileMetadata info, String installerPackage, InputStream instream) {
boolean okay = true;
if (DEBUG) Slog.d(TAG, "Installing from backup: " + info.packageName);
// The file content is an .apk file. Copy it out to a staging location and
// attempt to install it.
File apkFile = new File(mDataDir, info.packageName);
try {
FileOutputStream apkStream = new FileOutputStream(apkFile);
byte[] buffer = new byte[32 * 1024];
long size = info.size;
while (size > 0) {
long toRead = (buffer.length < size) ? buffer.length : size;
int didRead = instream.read(buffer, 0, (int)toRead);
if (didRead >= 0) mBytes += didRead;
apkStream.write(buffer, 0, didRead);
size -= didRead;
}
apkStream.close();
// make sure the installer can read it
apkFile.setReadable(true, false);
// Now install it
Uri packageUri = Uri.fromFile(apkFile);
mInstallObserver.reset();
mPackageManager.installPackage(packageUri, mInstallObserver,
PackageManager.INSTALL_REPLACE_EXISTING | PackageManager.INSTALL_FROM_ADB,
installerPackage);
mInstallObserver.waitForCompletion();
if (mInstallObserver.getResult() != PackageManager.INSTALL_SUCCEEDED) {
// The only time we continue to accept install of data even if the
// apk install failed is if we had already determined that we could
// accept the data regardless.
if (mPackagePolicies.get(info.packageName) != RestorePolicy.ACCEPT) {
okay = false;
}
} else {
// Okay, the install succeeded. Make sure it was the right app.
boolean uninstall = false;
if (!mInstallObserver.mPackageName.equals(info.packageName)) {
Slog.w(TAG, "Restore stream claimed to include apk for "
+ info.packageName + " but apk was really "
+ mInstallObserver.mPackageName);
// delete the package we just put in place; it might be fraudulent
okay = false;
uninstall = true;
} else {
try {
PackageInfo pkg = mPackageManager.getPackageInfo(info.packageName,
PackageManager.GET_SIGNATURES);
if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_ALLOW_BACKUP) == 0) {
Slog.w(TAG, "Restore stream contains apk of package "
+ info.packageName + " but it disallows backup/restore");
okay = false;
} else {
// So far so good -- do the signatures match the manifest?
Signature[] sigs = mManifestSignatures.get(info.packageName);
if (signaturesMatch(sigs, pkg)) {
// If this is a system-uid app without a declared backup agent,
// don't restore any of the file data.
if ((pkg.applicationInfo.uid < Process.FIRST_APPLICATION_UID)
&& (pkg.applicationInfo.backupAgentName == null)) {
Slog.w(TAG, "Installed app " + info.packageName
+ " has restricted uid and no agent");
okay = false;
}
} else {
Slog.w(TAG, "Installed app " + info.packageName
+ " signatures do not match restore manifest");
okay = false;
uninstall = true;
}
}
} catch (NameNotFoundException e) {
Slog.w(TAG, "Install of package " + info.packageName
+ " succeeded but now not found");
okay = false;
}
}
// If we're not okay at this point, we need to delete the package
// that we just installed.
if (uninstall) {
mDeleteObserver.reset();
mPackageManager.deletePackage(mInstallObserver.mPackageName,
mDeleteObserver, 0);
mDeleteObserver.waitForCompletion();
}
}
} catch (IOException e) {
Slog.e(TAG, "Unable to transcribe restored apk for install");
okay = false;
} finally {
apkFile.delete();
}
return okay;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: installApk
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
|
installApk
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAuthenticated(HttpServletRequest req) {
return getAuthUser(req) != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAuthenticated
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
|
isAuthenticated
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("mLock")
private void updateTimesLocked() {
final long now = injectCurrentTimeMillis();
final long prevLastResetTime = mRawLastResetTime.get();
long newLastResetTime = prevLastResetTime;
if (newLastResetTime == 0) { // first launch.
// TODO Randomize??
newLastResetTime = now;
} else if (now < newLastResetTime) {
// Clock rewound.
if (isClockValid(now)) {
Slog.w(TAG, "Clock rewound");
// TODO Randomize??
newLastResetTime = now;
}
} else if ((newLastResetTime + mResetInterval) <= now) {
final long offset = newLastResetTime % mResetInterval;
newLastResetTime = ((now / mResetInterval) * mResetInterval) + offset;
}
mRawLastResetTime.set(newLastResetTime);
if (prevLastResetTime != newLastResetTime) {
scheduleSaveBaseState();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateTimesLocked
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
updateTimesLocked
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected List<String> getPossibleViewNames(String baseName) {
List<String> names = new ArrayList<String>();
for (Facet f : WebApp.get(Jenkins.getInstance().servletContext).facets) {
if (f instanceof JellyCompatibleFacet) {
JellyCompatibleFacet jcf = (JellyCompatibleFacet) f;
for (String ext : jcf.getScriptExtensions())
names.add(baseName +ext);
}
}
return names;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPossibleViewNames
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getPossibleViewNames
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
doRequest("POST", request, response);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doPost
File: src/main/java/com/mxgraph/online/ExportProxyServlet.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-3398
|
HIGH
| 7.5
|
jgraph/drawio
|
doPost
|
src/main/java/com/mxgraph/online/ExportProxyServlet.java
|
064729fec4262f9373d9fdcafda0be47cd18dd50
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isCompatible(JoinConfig c1, JoinConfig c2) {
return c1 == c2 || !(c1 == null || c2 == null)
&& isCompatible(c1.getMulticastConfig(), c2.getMulticastConfig())
&& isCompatible(c1.getTcpIpConfig(), c2.getTcpIpConfig())
&& new AwsConfigChecker().check(c1.getAwsConfig(), c2.getAwsConfig())
&& new DiscoveryConfigChecker().check(c1.getDiscoveryConfig(), c2.getDiscoveryConfig());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCompatible
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
isCompatible
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static long parseDirectiveValueAsSeconds(@Nullable String value) {
if (value == null) {
return -1;
}
try {
final long converted = Long.parseLong(value);
return converted >= 0 ? converted : -1;
} catch (NumberFormatException e) {
return -1;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDirectiveValueAsSeconds
File: core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
parseDirectiveValueAsSeconds
|
core/src/main/java/com/linecorp/armeria/internal/ArmeriaHttpUtil.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
public static MediaType getMediaType(HttpHeaders httpHeaders) {
String contentType = getContentType(httpHeaders);
try {
return MediaType.valueOf(contentType);
} catch (IllegalArgumentException e) {
MarshallingFormat format = MarshallingFormat.fromType(contentType);
switch (format) {
case JAXB:
return MediaType.APPLICATION_XML_TYPE;
case XSTREAM:
return MediaType.APPLICATION_XML_TYPE;
case JSON:
return MediaType.APPLICATION_JSON_TYPE;
default:
return MediaType.APPLICATION_XML_TYPE;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMediaType
File: kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
Repository: kiegroup/droolsjbpm-integration
The code follows secure coding practices.
|
[
"CWE-260"
] |
CVE-2016-7043
|
MEDIUM
| 5
|
kiegroup/droolsjbpm-integration
|
getMediaType
|
kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
|
e916032edd47aa46d15f3a11909b4804ee20a7e8
| 0
|
Analyze the following code function for security vulnerabilities
|
public Thread newThread(Runnable r) {
final Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newThread
File: src/net/sourceforge/plantuml/security/SURL.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
newThread
|
src/net/sourceforge/plantuml/security/SURL.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setParamMessage(String value) {
m_paramMessage = value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setParamMessage
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
setParamMessage
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseLeftoverJournals() {
for (File f : mJournalDir.listFiles()) {
if (mJournal == null || f.compareTo(mJournal) != 0) {
// This isn't the current journal, so it must be a leftover. Read
// out the package names mentioned there and schedule them for
// backup.
RandomAccessFile in = null;
try {
Slog.i(TAG, "Found stale backup journal, scheduling");
in = new RandomAccessFile(f, "r");
while (true) {
String packageName = in.readUTF();
if (MORE_DEBUG) Slog.i(TAG, " " + packageName);
dataChangedImpl(packageName);
}
} catch (EOFException e) {
// no more data; we're done
} catch (Exception e) {
Slog.e(TAG, "Can't read " + f, e);
} finally {
// close/delete the file
try { if (in != null) in.close(); } catch (IOException e) {}
f.delete();
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseLeftoverJournals
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
|
parseLeftoverJournals
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test (expected = BadRequestException.class)
public void deleteDatapointsBadRequest() throws Exception {
HttpQuery query = NettyMocks.deleteQuery(tsdb,
"/api/query?start=1356998400&m=sum:sys.cpu.user", "");
rpc.execute(tsdb, query);
assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus());
final String json =
query.response().getContent().toString(Charset.forName("UTF-8"));
assertTrue(json.contains("Deleting data is not enabled"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteDatapointsBadRequest
File: test/tsd/TestQueryRpc.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
deleteDatapointsBadRequest
|
test/tsd/TestQueryRpc.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected boolean isValidFragment(String fragmentName) {
if (ChooseLockGenericFragment.class.getName().equals(fragmentName)) return true;
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isValidFragment
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2018-9501
|
HIGH
| 7.2
|
android
|
isValidFragment
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
private File getFile(String... path) {
File result = baseDir;
for (String p : path) {
result = new File(result, p);
}
return result;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2023-35946
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Fix dependency cache path traversal vulnerability
Gradle leverages the protection added to prevent ZipSlip for any path
computation inside a Gradle cache.
See https://github.com/gradle/gradle/security/advisories/GHSA-2h6c-rv6q-494v
Function: getFile
File: subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
Repository: gradle
Fixed Code:
private File getFile(String... path) {
String composedPath;
if (path.length == 1) {
composedPath = path[0];
} else {
// We need to ignore empty Strings as this is what "new File(parent, path)" was doing for "path" empty.
composedPath = Arrays.stream(path)
.filter(((Predicate<String>) String::isEmpty).negate())
.collect(Collectors.joining(File.separator));
}
return new File(baseDir, ZipSlip.safeZipEntryName(trimLeadingSlash(composedPath)));
}
|
[
"CWE-22"
] |
CVE-2023-35946
|
MEDIUM
| 5.5
|
gradle
|
getFile
|
subprojects/core/src/main/java/org/gradle/internal/resource/local/DefaultPathKeyFileStore.java
|
859eae2b2acf751ae7db3c9ffefe275aa5da0d5d
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public long size() throws IOException {
if (!file.isFile()) {
throw new FileNotFoundException(file.toString());
}
return file.length();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: size
File: android/guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2023-2976
|
HIGH
| 7.1
|
google/guava
|
size
|
android/guava/src/com/google/common/io/Files.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 0
|
Analyze the following code function for security vulnerabilities
|
void startConfirmationTimeout(int token, FullParams params) {
if (MORE_DEBUG) Slog.d(TAG, "Posting conf timeout msg after "
+ TIMEOUT_FULL_CONFIRMATION + " millis");
Message msg = mBackupHandler.obtainMessage(MSG_FULL_CONFIRMATION_TIMEOUT,
token, 0, params);
mBackupHandler.sendMessageDelayed(msg, TIMEOUT_FULL_CONFIRMATION);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startConfirmationTimeout
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
|
startConfirmationTimeout
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean hasLockdownAdminConfiguredNetworks(ComponentName who) {
if (!mHasFeature) {
return false;
}
CallerIdentity caller = getCallerIdentity(who);
if (isPermissionCheckFlagEnabled()) {
enforcePermission(MANAGE_DEVICE_POLICY_WIFI, who.getPackageName(),
UserHandle.USER_ALL);
} else {
Preconditions.checkNotNull(who, "ComponentName is null");
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller)
|| isProfileOwnerOfOrganizationOwnedDevice(caller));
}
return mInjector.binderWithCleanCallingIdentity(() ->
mInjector.settingsGlobalGetInt(Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN, 0) > 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasLockdownAdminConfiguredNetworks
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
|
hasLockdownAdminConfiguredNetworks
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
throws RemoteException {
if (code == SYSPROPS_TRANSACTION) {
// We need to tell all apps about the system property change.
ArrayList<IBinder> procs = new ArrayList<IBinder>();
synchronized(this) {
final int NP = mProcessNames.getMap().size();
for (int ip=0; ip<NP; ip++) {
SparseArray<ProcessRecord> apps = mProcessNames.getMap().valueAt(ip);
final int NA = apps.size();
for (int ia=0; ia<NA; ia++) {
ProcessRecord app = apps.valueAt(ia);
if (app.thread != null) {
procs.add(app.thread.asBinder());
}
}
}
}
int N = procs.size();
for (int i=0; i<N; i++) {
Parcel data2 = Parcel.obtain();
try {
procs.get(i).transact(IBinder.SYSPROPS_TRANSACTION, data2, null,
Binder.FLAG_ONEWAY);
} catch (RemoteException e) {
}
data2.recycle();
}
}
try {
return super.onTransact(code, data, reply, flags);
} catch (RuntimeException e) {
// The activity manager only throws certain exceptions intentionally, so let's
// log all others.
if (!(e instanceof SecurityException
|| e instanceof IllegalArgumentException
|| e instanceof IllegalStateException)) {
Slog.wtf(TAG, "Activity Manager Crash."
+ " UID:" + Binder.getCallingUid()
+ " PID:" + Binder.getCallingPid()
+ " TRANS:" + code, e);
}
throw e;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTransact
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
|
onTransact
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private String toString(Element ele) {
StringBuilder eleAsString = new StringBuilder("<" + ele.getNodeName());
NamedNodeMap attributes = ele.getAttributes();
Node attribute;
for (int i = 0; i < attributes.getLength(); i++) {
attribute = attributes.item(i);
String name = attribute.getNodeName();
String value = attribute.getNodeValue();
eleAsString.append(" ");
eleAsString.append(HTMLEntityEncoder.htmlEntityEncode(name));
eleAsString.append("=\"");
eleAsString.append(HTMLEntityEncoder.htmlEntityEncode(value));
eleAsString.append("\"");
}
if (ele.hasChildNodes()) {
eleAsString.append(">");
} else {
eleAsString.append("/>");
}
return eleAsString.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-28367
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
toString
|
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
|
0199e7e194dba5e7d7197703f43ebe22401e61ae
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationWithTypeInfo03() throws Exception
{
String prefix = "[\"" + Duration.class.getName() + "\",";
ObjectMapper mapper = newMapper();
mapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, false);
mapper.addMixIn(TemporalAmount.class, MockObjectConfiguration.class);
TemporalAmount value = mapper.readValue(prefix + "13498837]", TemporalAmount.class);
assertNotNull("The value should not be null.", value);
assertTrue("The value should be a Duration.", value instanceof Duration);
assertEquals("The value is not correct.", Duration.ofSeconds(13498L, 837000000), value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationWithTypeInfo03
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationWithTypeInfo03
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProcessMemoryInfo
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getProcessMemoryInfo
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
protected SecurityDesc getSecurity() {
return security;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSecurity
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.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
|
getSecurity
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean scheduleBuild(int quietPeriod, Cause c, Action... actions) {
return scheduleBuild2(quietPeriod,c,actions)!=null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleBuild
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
|
scheduleBuild
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String[] getPackageList() {
int size = pkgList.size();
if (size == 0) {
return null;
}
String list[] = new String[size];
for (int i=0; i<pkgList.size(); i++) {
list[i] = pkgList.keyAt(i);
}
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageList
File: services/core/java/com/android/server/am/ProcessRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
getPackageList
|
services/core/java/com/android/server/am/ProcessRecord.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getStudyEventAndFormMetaOC1_3Sql(int parentStudyId, int studyId, boolean isIncludedSite) {
return "select sed.ordinal as definition_order, edc.ordinal as crf_order, edc.crf_id, cv.crf_version_id,"
+ " sed.oc_oid as definition_oid, cv.oc_oid as cv_oid,"
+ " sed.description, sed.category, cv.description as version_description, cv.revision_notes,"
+ " crf.oc_oid as crf_oid, edc.null_values, edc.default_version_id, edc.electronic_signature,"
+ " edc.double_entry, edc.hide_crf, edc.participant_form,edc.allow_anonymous_submission,edc.submission_url,case when edc_tag.active is null then false else edc_tag.active end, edc.source_data_verification_code"
+ " from " + this.studyEventAndFormMetaTables()
+ this.studyEventAndFormMetaCondition(parentStudyId, studyId, isIncludedSite);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStudyEventAndFormMetaOC1_3Sql
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
|
getStudyEventAndFormMetaOC1_3Sql
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Bitmap createImageThumbnail(InputStream data) {
try {
Bitmap bitmap = BitmapFactory.decodeStream(data);
return bitmap;
} catch (OutOfMemoryError oome) {
LogUtils.d(Logging.LOG_TAG, "createImageThumbnail failed with " + oome.getMessage());
return null;
} catch (Exception e) {
LogUtils.d(Logging.LOG_TAG, "createImageThumbnail failed with " + e.getMessage());
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createImageThumbnail
File: provider_src/com/android/email/provider/AttachmentProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3918
|
MEDIUM
| 4.3
|
android
|
createImageThumbnail
|
provider_src/com/android/email/provider/AttachmentProvider.java
|
6b2b0bd7c771c698f11d7be89c2c57c8722c7454
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
formLayout.setElementCssClass("o_sel_bulk_assessment_data");
// hide data input field in case the element does not have any score, passed or comment field enabled
BulkAssessmentSettings settings = new BulkAssessmentSettings(courseNode);
boolean onlyReturnFiles = (!settings.isHasScore() && !settings.isHasPassed() && !settings.isHasUserComment());
setFormTitle("data.title");
if (!onlyReturnFiles) {
setFormDescription("data.description");
}
setFormContextHelp("... create a bulk assessment for submission tasks");
String dataVal = "";
if(savedDatas != null && StringHelper.containsNonWhitespace(savedDatas.getDataBackupFile())) {
VFSLeaf file = VFSManager.olatRootLeaf(savedDatas.getDataBackupFile());
try(InputStream in = file.getInputStream()) {
dataVal = IOUtils.toString(in, StandardCharsets.UTF_8);
} catch (IOException e) {
logError("", e);
}
}
dataEl = uifactory.addTextAreaElement("data", "data", -1, 6, 60, true, false, dataVal, formLayout);
dataEl.showLabel(false);
String[] values = new String[] {translate("form.step3.delimiter.tab"),translate("form.step3.delimiter.comma")};
delimiter = uifactory.addRadiosVertical("delimiter", "form.step3.delimiter", formLayout, keys, values);
// preset delimiter type to first appearance of either tab or comma when data is available, default to tab for no data
int firstComma = dataVal.indexOf(',');
int firstTab = dataVal.indexOf('\t');
if (firstComma > -1 && (firstTab == -1 || firstTab > firstComma )) {
delimiter.select("comma", true);
} else {
delimiter.select("tab", true);
}
String[] statusValues = new String[] {
translate("form.step3.status.assessed"), translate("form.step3.status.review"),
translate("form.step3.status.dont.change")
};
statusEl = uifactory.addRadiosVertical("form.step3.status", "form.step3.status", formLayout, statusKeys, statusValues);
statusEl.select(statusKeys[statusKeys.length - 1], true);
String[] visibilityValues = new String[] {
translate("form.step3.visibility.visible"), translate("form.step3.visibility.notvisible"),
translate("form.step3.visibility.dont.change")
};
visibilityEl = uifactory.addRadiosVertical("form.step3.visibility", "form.step3.visibility", formLayout, visibilityKeys, visibilityValues);
visibilityEl.select(visibilityKeys[visibilityKeys.length - 1], true);
if(courseNode instanceof GTACourseNode) {
String[] submissionValues = new String[] {
translate("form.step3.submission.accept"), translate("form.step3.submission.dont.change")
};
acceptSubmissionEl = uifactory.addRadiosVertical("form.step3.submission", "form.step3.submission", formLayout, submissionKeys, submissionValues);
acceptSubmissionEl.select(submissionKeys[submissionKeys.length - 1], true);
acceptSubmissionEl.setHelpTextKey("form.step3.submission.help", null);
}
// hide data input field in case the element does not have any score, passed or comment field enabled
if (onlyReturnFiles) {
dataEl.setVisible(false);
delimiter.setVisible(false);
}
// return files only when configured
if(settings.isHasReturnFiles()) {
returnFileEl = uifactory.addFileElement(getWindowControl(), "returnfiles", "return.files", formLayout);
Set<String> mimes = new HashSet<>();
mimes.add(WebappHelper.getMimeType("file.zip"));
returnFileEl.limitToMimeType(mimes, "return.mime", null);
if(savedDatas != null && StringHelper.containsNonWhitespace(savedDatas.getReturnFiles())) {
targetArchive = VFSManager.olatRootLeaf(savedDatas.getReturnFiles());
if(targetArchive.exists()) {
returnFileEl.setInitialFile(((LocalFileImpl)targetArchive).getBasefile());
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initForm
File: src/main/java/org/olat/course/assessment/bulk/DataStepForm.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
initForm
|
src/main/java/org/olat/course/assessment/bulk/DataStepForm.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void init() {
logger.info("init main form");
checkBoxList = new ArrayList<>();
xrayCmd = new XrayCmd();
try {
Path dbPath = Paths.get("super-xray.db");
if (Files.exists(dbPath)) {
byte[] data = Files.readAllBytes(dbPath);
db = DB.parseDB(data);
} else {
db = new DB();
db.setLastXrayPath(null);
}
} catch (Exception ex) {
ex.printStackTrace();
}
reloadConfig(true, false);
logger.info("init look up config button");
lookupConfigButton.addActionListener(e -> {
String t;
if (LANG == CHINESE) {
t = "查看配置文件";
} else {
t = "Lookup Config";
}
JFrame frame = new JFrame(t);
frame.setContentPane(new LookupConfigForm().lookupConfigPanel);
frame.pack();
frame.setVisible(true);
});
logger.info("init look up cmd button");
lookupCmdButton.addActionListener(e ->
JOptionPane.showMessageDialog(null, xrayCmd.buildCmd()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: init
File: src/main/java/com/chaitin/xray/form/MainForm.java
Repository: 4ra1n/super-xray
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-41958
|
HIGH
| 7.8
|
4ra1n/super-xray
|
init
|
src/main/java/com/chaitin/xray/form/MainForm.java
|
4d0d59663596db03f39d7edd2be251d48b52dcfc
| 0
|
Analyze the following code function for security vulnerabilities
|
private void handleTextNode(Node node, Map<String, Object> elementMap) {
Object text = "";
int nodeType = node.getNodeType();
switch (nodeType) {
case Node.TEXT_NODE:
text = normalizeText(node.getNodeValue());
break;
case Node.CDATA_SECTION_NODE:
text = normalizeText(((CharacterData) node).getData());
break;
default:
break;
}
// If the text is valid ...
if (!StringUtils.isEmpty(text.toString())) {
// We check if we have already collected some text previously
Object previousText = elementMap.get("_text");
if (previousText != null) {
// If we just have a "_text" key than we need to collect to a List
text = Arrays.asList(previousText.toString(), text);
}
elementMap.put("_text", text);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleTextNode
File: src/main/java/apoc/load/Xml.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000820
|
HIGH
| 7.5
|
neo4j-contrib/neo4j-apoc-procedures
|
handleTextNode
|
src/main/java/apoc/load/Xml.java
|
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
| 0
|
Analyze the following code function for security vulnerabilities
|
private synchronized void isFileExisting(RoutingContext context, String file, Handler<AsyncResult<Boolean>> resultHandler) {
FileSystem fs = context.vertx().fileSystem();
wrapInTCCLSwitch(() -> fs.exists(file, resultHandler));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFileExisting
File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
Repository: vert-x3/vertx-web
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-12542
|
HIGH
| 7.5
|
vert-x3/vertx-web
|
isFileExisting
|
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
|
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<Pattern> getAllowedRegexps(Map<String, AntiSamyPattern> commonRegularExpressions1, Element ele) {
List<Pattern> allowedRegExp = new ArrayList<Pattern>();
for (Element regExpNode : getGrandChildrenByTagName(ele, "regexp-list", "regexp")) {
String regExpName = getAttributeValue(regExpNode, "name");
String value = getAttributeValue(regExpNode, "value");
if (regExpName != null && regExpName.length() > 0) {
allowedRegExp.add(commonRegularExpressions1.get(regExpName).getPattern());
} else {
allowedRegExp.add(Pattern.compile(REGEXP_BEGIN + value + REGEXP_END));
}
}
return allowedRegExp;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2017-14735
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Issue #10 (#15)
* upgraded batik-css version
removed redundant regex beginning/end markers
updated policies to contain new url validation which is sensitive to
html5 colon entity
* removed test code
Function: getAllowedRegexps
File: src/main/java/org/owasp/validator/html/Policy.java
Repository: nahsra/antisamy
Fixed Code:
private static List<Pattern> getAllowedRegexps(Map<String, AntiSamyPattern> commonRegularExpressions1, Element ele) {
List<Pattern> allowedRegExp = new ArrayList<Pattern>();
for (Element regExpNode : getGrandChildrenByTagName(ele, "regexp-list", "regexp")) {
String regExpName = getAttributeValue(regExpNode, "name");
String value = getAttributeValue(regExpNode, "value");
if (regExpName != null && regExpName.length() > 0) {
allowedRegExp.add(commonRegularExpressions1.get(regExpName).getPattern());
} else {
allowedRegExp.add(Pattern.compile(value));
}
}
return allowedRegExp;
}
|
[
"CWE-79"
] |
CVE-2017-14735
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
getAllowedRegexps
|
src/main/java/org/owasp/validator/html/Policy.java
|
82da009e733a989a57190cd6aa1b6824724f6d36
| 1
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public Builder setContentText(CharSequence text) {
mN.extras.putCharSequence(EXTRA_TEXT, safeCharSequence(text));
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setContentText
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setContentText
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
if (s.isEmpty()) {
errorSavingKeys();
} else {
requireDialog().dismiss();
Intent intentExisting = new Intent();
intentExisting.putExtra(SUCCESS, true);
intentExisting.putExtra(ARG_POSITION, requireArguments().getInt(ARG_POSITION));
getTargetFragment().onActivityResult(getTargetRequestCode(),
SETUP_ENCRYPTION_RESULT_CODE, intentExisting);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPostExecute
File: src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-212"
] |
CVE-2021-32658
|
LOW
| 2.1
|
nextcloud/android
|
onPostExecute
|
src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.java
|
355f3c745b464b741b20a3b96597303490c26333
| 0
|
Analyze the following code function for security vulnerabilities
|
private int runSetAppLink() {
int userId = UserHandle.USER_OWNER;
String opt;
while ((opt = nextOption()) != null) {
if (opt.equals("--user")) {
userId = Integer.parseInt(nextOptionData());
if (userId < 0) {
System.err.println("Error: user must be >= 0");
return 1;
}
} else {
System.err.println("Error: unknown option: " + opt);
showUsage();
return 1;
}
}
// Package name to act on; required
final String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified.");
showUsage();
return 1;
}
// State to apply; {always|ask|never|undefined}, required
final String modeString = nextArg();
if (modeString == null) {
System.err.println("Error: no app link state specified.");
showUsage();
return 1;
}
final int newMode;
switch (modeString.toLowerCase()) {
case "undefined":
newMode = INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED;
break;
case "always":
newMode = INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS;
break;
case "ask":
newMode = INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK;
break;
case "always-ask":
newMode = INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK;
break;
case "never":
newMode = INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER;
break;
default:
System.err.println("Error: unknown app link state '" + modeString + "'");
return 1;
}
try {
final PackageInfo info = mPm.getPackageInfo(pkg, 0, userId);
if (info == null) {
System.err.println("Error: package " + pkg + " not found.");
return 1;
}
if ((info.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_HAS_DOMAIN_URLS) == 0) {
System.err.println("Error: package " + pkg + " does not handle web links.");
return 1;
}
if (!mPm.updateIntentVerificationStatus(pkg, newMode, userId)) {
System.err.println("Error: unable to update app link status for " + pkg);
return 1;
}
} catch (Exception e) {
System.err.println(e.toString());
System.err.println(PM_NOT_RUNNING_ERR);
return 1;
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runSetAppLink
File: cmds/pm/src/com/android/commands/pm/Pm.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3833
|
HIGH
| 9.3
|
android
|
runSetAppLink
|
cmds/pm/src/com/android/commands/pm/Pm.java
|
4e4743a354e26467318b437892a9980eb9b8328a
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean supportsLanguage(String language) {
return languages.contains(language);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: supportsLanguage
File: h2/src/main/org/h2/server/web/WebServer.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
supportsLanguage
|
h2/src/main/org/h2/server/web/WebServer.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private InstallArgs createInstallArgs(InstallParams params) {
if (params.move != null) {
return new MoveInstallArgs(params);
} else if (installOnExternalAsec(params.installFlags) || params.isForwardLocked()) {
return new AsecInstallArgs(params);
} else {
return new FileInstallArgs(params);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createInstallArgs
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
|
createInstallArgs
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public LibraryInfo findLibrary(String libraryName,
String localePrefix,
String contract, FacesContext ctx) {
String path;
if (localePrefix == null) {
path = getBasePath(contract) + '/' + libraryName;
} else {
path = getBasePath(contract)
+ '/'
+ localePrefix
+ '/'
+ libraryName;
}
Set<String> resourcePaths =
ctx.getExternalContext().getResourcePaths(path);
// it could be possible that there exists an empty directory
// that is representing the library, but if it's empty, treat it
// as non-existant and return null.
if (resourcePaths != null && !resourcePaths.isEmpty()) {
VersionInfo version = getVersion(resourcePaths, false);
return new LibraryInfo(libraryName, version, localePrefix, contract, this);
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findLibrary
File: impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-6950
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
findLibrary
|
impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
|
cefbb9447e7be560e59da2da6bd7cb93776f7741
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addPeriodicSync(Account account, String authority, Bundle extras,
long pollFrequency) {
if (account == null) {
throw new IllegalArgumentException("Account must not be null");
}
if (TextUtils.isEmpty(authority)) {
throw new IllegalArgumentException("Authority must not be empty.");
}
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
int userId = UserHandle.getCallingUserId();
if (pollFrequency < 60) {
Slog.w(TAG, "Requested poll frequency of " + pollFrequency
+ " seconds being rounded up to 60 seconds.");
pollFrequency = 60;
}
long defaultFlex = SyncStorageEngine.calculateDefaultFlexTime(pollFrequency);
long identityToken = clearCallingIdentity();
try {
SyncStorageEngine.EndPoint info =
new SyncStorageEngine.EndPoint(account, authority, userId);
getSyncManager().getSyncStorageEngine()
.updateOrAddPeriodicSync(info,
pollFrequency,
defaultFlex,
extras);
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPeriodicSync
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
addPeriodicSync
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
public final boolean isTypeOrSuperTypeOf(Class<?> clz) {
return (_class == clz) || _class.isAssignableFrom(clz);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTypeOrSuperTypeOf
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
|
isTypeOrSuperTypeOf
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Intent createLauncherIntent(Context context) {
final Intent intent = new Intent(context, StartConversationActivity.class);
intent.setAction(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
return intent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createLauncherIntent
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
createLauncherIntent
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<BaseObject> updateObjectsFromRequest(String className, XWikiContext context) throws XWikiException
{
return updateObjectsFromRequest(className, "", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateObjectsFromRequest
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
updateObjectsFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean onlyVrUiModeChanged(int changes, Configuration lastReportedConfig) {
final Configuration currentConfig = getConfiguration();
return changes == CONFIG_UI_MODE && (isInVrUiMode(currentConfig)
!= isInVrUiMode(lastReportedConfig));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onlyVrUiModeChanged
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
|
onlyVrUiModeChanged
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addSelectionListener(SelectionListener listener) {
addListener(SelectionEvent.class, listener, SELECTION_CHANGE_METHOD);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addSelectionListener
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
|
addSelectionListener
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getPackageProcessState(String packageName, String callingPackage)
throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageProcessState
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getPackageProcessState
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public void requestStart(VaadinRequest request, VaadinResponse response) {
if (!initialized) {
throw new IllegalStateException(
"Can not process requests before init() has been called");
}
setCurrentInstances(request, response);
request.setAttribute(REQUEST_START_TIME_ATTRIBUTE, System.nanoTime());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestStart
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
requestStart
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> preValidation(boolean authoritative) {
checkTopicLevelPolicyEnable();
if (topicName.isPartitioned()) {
return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED,
"Not allowed to set/get topic policy for a partition"));
}
if (topicName.isGlobal()) {
validateGlobalNamespaceOwnership(namespaceName);
}
return checkTopicExistsAsync(topicName).thenCompose(exist -> {
if (!exist) {
throw new RestException(Status.NOT_FOUND, "Topic not found");
} else {
return getPartitionedTopicMetadataAsync(topicName, false, false)
.thenCompose(metadata -> {
if (metadata.partitions > 0) {
return validateTopicOwnershipAsync(TopicName.get(topicName.toString()
+ TopicName.PARTITIONED_TOPIC_SUFFIX + 0), authoritative);
} else {
return validateTopicOwnershipAsync(topicName, authoritative);
}
});
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: preValidation
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
preValidation
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private void debugQuery(QueryType queryType, QueryParametersBase parameters) {
log.debug("Query type '{}', Parameters '{}'", queryType, parameters); //$NON-NLS-1$
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: debugQuery
File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
Repository: oVirt/ovirt-engine
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2024-0822
|
HIGH
| 7.5
|
oVirt/ovirt-engine
|
debugQuery
|
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
|
036f617316f6d7077cd213eb613eb4816e33d1fc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getImportName() {
return importName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getImportName
File: services/src/main/java/org/keycloak/theme/ClassLoaderTheme.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-3856
|
MEDIUM
| 4.3
|
keycloak
|
getImportName
|
services/src/main/java/org/keycloak/theme/ClassLoaderTheme.java
|
73f0474008e1bebd0733e62a22aceda9e5de6743
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAppShellTitle(String appShellTitle) {
this.appShellTitle = appShellTitle;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAppShellTitle
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
setAppShellTitle
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void setStyleParams() throws Exception {
assertPlotParam("style", "linespoint");
assertPlotParam("style", "points");
assertPlotParam("style", "circles");
assertPlotParam("style", "dots");
assertInvalidPlotParam("style", "dots%20[33:system(%20");
}
|
Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2023-36812
- Severity: CRITICAL
- CVSS Score: 9.8
Description: Improved fix for #2261.
Regular expressions wouldn't catch the newlines or possibly other
control characters. Now we'll use the TAG validation code to make
sure the inputs are only plain ASCII printables first.
Fixes CVE-2018-12972, CVE-2020-35476
Function: setStyleParams
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
Fixed Code:
@Test
public void setStyleParams() throws Exception {
assertPlotParam("style", "linespoint");
assertPlotParam("style", "points");
assertPlotParam("style", "circles");
assertPlotParam("style", "dots");
assertInvalidPlotParam("style", "dots%20%0a[33:system(%20");
assertInvalidPlotParam("style", "%3Bsystem%20%22cat%20/home/ubuntuvm/secret.txt%20%3E/tmp/secret.txt%22%20%22\"");
}
|
[
"CWE-74"
] |
CVE-2023-36812
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
setStyleParams
|
test/tsd/TestGraphHandler.java
|
07c4641471c6f5c2ab5aab615969e97211eb50d9
| 1
|
Analyze the following code function for security vulnerabilities
|
public static void copyBytesAtOffset(byte[] dst, byte[] src, int offset)
{
if (dst == null)
{
throw new NullPointerException("dst == null");
}
if (src == null)
{
throw new NullPointerException("src == null");
}
if (offset < 0)
{
throw new IllegalArgumentException("offset hast to be >= 0");
}
if ((src.length + offset) > dst.length)
{
throw new IllegalArgumentException("src length + offset must not be greater than size of destination");
}
for (int i = 0; i < src.length; i++)
{
dst[offset + i] = src[i];
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyBytesAtOffset
File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-470"
] |
CVE-2018-1000613
|
HIGH
| 7.5
|
bcgit/bc-java
|
copyBytesAtOffset
|
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
|
4092ede58da51af9a21e4825fbad0d9a3ef5a223
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public boolean addAllowlistedRestrictedPermission(@NonNull String packageName,
@NonNull String permissionName,
@PackageManager.PermissionWhitelistFlags int allowlistFlags) {
try {
return mPermissionManager.addAllowlistedRestrictedPermission(packageName,
permissionName, allowlistFlags, mContext.getUserId());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAllowlistedRestrictedPermission
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
addAllowlistedRestrictedPermission
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static JSONObject toJSONObject(String string, XMLParserConfiguration config) throws JSONException {
return toJSONObject(new StringReader(string), config);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toJSONObject
File: src/main/java/org/json/XML.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2022-45688
|
HIGH
| 7.5
|
stleary/JSON-java
|
toJSONObject
|
src/main/java/org/json/XML.java
|
f566a1d9ee1f8139357017dc6c7def1da19cd8d4
| 0
|
Analyze the following code function for security vulnerabilities
|
public PendingIntent getContentIntent() {
return mContentIntent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentIntent
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getContentIntent
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
void logBackupComplete(String packageName) {
if (packageName.equals(PACKAGE_MANAGER_SENTINEL)) return;
synchronized (mEverStoredApps) {
if (!mEverStoredApps.add(packageName)) return;
RandomAccessFile out = null;
try {
out = new RandomAccessFile(mEverStored, "rws");
out.seek(out.length());
out.writeUTF(packageName);
} catch (IOException e) {
Slog.e(TAG, "Can't log backup of " + packageName + " to " + mEverStored);
} finally {
try { if (out != null) out.close(); } catch (IOException e) {}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logBackupComplete
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
|
logBackupComplete
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTempFolderPath() {
return tempFolderPath;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTempFolderPath
File: samples/client/petstore/java/okhttp-gson/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
|
getTempFolderPath
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<IssuesDao> relateList(IssuesRequest request) {
return extIssuesMapper.getIssues(request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: relateList
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
|
relateList
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void flushGraphics() {
if (myView != null) {
myView.flushGraphics();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: flushGraphics
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
flushGraphics
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@CalledByNative
public boolean hasFocus() {
return mContainerView.hasFocus();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasFocus
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
|
hasFocus
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<String> setMeteredDataDisabledPackages(ComponentName who, List<String> packageNames) {
Objects.requireNonNull(who);
Objects.requireNonNull(packageNames);
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller) || isProfileOwner(caller),
"Admin %s does not own the profile", caller.getComponentName());
if (!mHasFeature) {
return packageNames;
}
synchronized (getLockObject()) {
final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller);
return mInjector.binderWithCleanCallingIdentity(() -> {
final List<String> excludedPkgs = removeInvalidPkgsForMeteredDataRestriction(
caller.getUserId(), packageNames);
admin.meteredDisabledPackages = packageNames;
pushMeteredDisabledPackages(caller.getUserId());
saveSettingsLocked(caller.getUserId());
return excludedPkgs;
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMeteredDataDisabledPackages
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
|
setMeteredDataDisabledPackages
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public PersistableBundle deepCopy() {
return new PersistableBundle(this, /* deep */ true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deepCopy
File: core/java/android/os/PersistableBundle.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40074
|
MEDIUM
| 5.5
|
android
|
deepCopy
|
core/java/android/os/PersistableBundle.java
|
40e4ea759743737958dde018f3606d778f7a53f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void close() {
synchronized (this) {
if (mOpen) {
mOpen = false;
if (mOwnsNative) {
nativeDestroy(mNative);
}
}
}
}
|
Vulnerability Classification:
- CWE: CWE-415
- CVE: CVE-2023-40103
- Severity: HIGH
- CVSS Score: 7.8
Description: [res] Better native pointer tracking in Java
Make sure we clear the native pointers when freeing them,
so any race condition that calls into it gets a null instead
of calling into already freed object
Bug: 197260547
Test: build + unit tests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7c2f195cfc8c02403d61a394213398d13584a5de)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b9ef411d0f480ee59d73601cce7fb40335a7d389)
Merged-In: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed
Change-Id: I817dc2f5ef24e1fafeba3ce4c1c440abe70ad3ed
Function: close
File: core/java/android/content/res/StringBlock.java
Repository: android
Fixed Code:
@Override
public void close() {
synchronized (this) {
if (mOpen) {
mOpen = false;
if (mOwnsNative) {
nativeDestroy(mNative);
}
mNative = 0;
}
}
}
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
close
|
core/java/android/content/res/StringBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 1
|
Analyze the following code function for security vulnerabilities
|
private Element nextStreamElement() {
// It is important the we check if the queue is empty before removing an element from it
if (queue.isEmpty()) {
shouldBundleAndDefer = true;
}
Element packet = null;
try {
packet = queue.take();
}
catch (InterruptedException e) {
if (!queue.isShutdown()) {
// Users shouldn't try to interrupt the packet writer thread
LOGGER.log(Level.WARNING, "Packet writer thread was interrupted. Don't do that. Use disconnect() instead.", e);
}
}
return packet;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nextStreamElement
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
|
nextStreamElement
|
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override public int compare(final OnmsUser a, final OnmsUser b) {
return a.getUsername().compareTo(b.getUsername());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compare
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-0872
|
HIGH
| 8
|
OpenNMS/opennms
|
compare
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java
|
34ab169a74b2bc489ab06d0dbf33fee1ed94c93c
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isPendingBroadcastProcessLocked(int pid) {
return mPendingBroadcast != null && mPendingBroadcast.curApp.pid == pid;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPendingBroadcastProcessLocked
File: services/core/java/com/android/server/am/BroadcastQueue.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
isPendingBroadcastProcessLocked
|
services/core/java/com/android/server/am/BroadcastQueue.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
private CrossProfileDomainInfo getCrossProfileDomainPreferredLpr(Intent intent,
String resolvedType, int flags, int sourceUserId, int parentUserId) {
if (!sUserManager.hasUserRestriction(UserManager.ALLOW_PARENT_PROFILE_APP_LINKING,
sourceUserId)) {
return null;
}
List<ResolveInfo> resultTargetUser = mActivities.queryIntent(intent,
resolvedType, flags, parentUserId);
if (resultTargetUser == null || resultTargetUser.isEmpty()) {
return null;
}
CrossProfileDomainInfo result = null;
int size = resultTargetUser.size();
for (int i = 0; i < size; i++) {
ResolveInfo riTargetUser = resultTargetUser.get(i);
// Intent filter verification is only for filters that specify a host. So don't return
// those that handle all web uris.
if (riTargetUser.handleAllWebDataURI) {
continue;
}
String packageName = riTargetUser.activityInfo.packageName;
PackageSetting ps = mSettings.mPackages.get(packageName);
if (ps == null) {
continue;
}
long verificationState = getDomainVerificationStatusLPr(ps, parentUserId);
int status = (int)(verificationState >> 32);
if (result == null) {
result = new CrossProfileDomainInfo();
result.resolveInfo =
createForwardingResolveInfo(new IntentFilter(), sourceUserId, parentUserId);
result.bestDomainVerificationStatus = status;
} else {
result.bestDomainVerificationStatus = bestDomainVerificationStatus(status,
result.bestDomainVerificationStatus);
}
}
// Don't consider matches with status NEVER across profiles.
if (result != null && result.bestDomainVerificationStatus
== INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER) {
return null;
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCrossProfileDomainPreferredLpr
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
|
getCrossProfileDomainPreferredLpr
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public int translatePixelForDPI(int pixel) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, pixel,
getContext().getResources().getDisplayMetrics());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: translatePixelForDPI
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
translatePixelForDPI
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private void blockNumber(String phoneNumber) throws Exception {
blockNumberWithAnswer(phoneNumber, new Answer<Bundle>() {
@Override
public Bundle answer(InvocationOnMock invocation) throws Throwable {
Bundle bundle = new Bundle();
bundle.putInt(BlockedNumberContract.RES_BLOCK_STATUS,
BlockedNumberContract.STATUS_BLOCKED_IN_LIST);
return bundle;
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: blockNumber
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
blockNumber
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getCurrentTransport() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getCurrentTransport");
if (MORE_DEBUG) Slog.v(TAG, "... getCurrentTransport() returning " + mCurrentTransport);
return mCurrentTransport;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentTransport
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
|
getCurrentTransport
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
public void decode(ResResource res, Directory inDir, Directory outDir, Map<String, String> resFileMapping)
throws AndrolibException {
ResFileValue fileValue = (ResFileValue) res.getValue();
String inFilePath = fileValue.toString();
String inFileName = fileValue.getStrippedPath();
String outResName = res.getFilePath();
String typeName = res.getResSpec().getType().getName();
String ext = null;
String outFileName;
int extPos = inFileName.lastIndexOf(".");
if (extPos == -1) {
outFileName = outResName;
} else {
ext = inFileName.substring(extPos).toLowerCase();
outFileName = outResName + ext;
}
String outFilePath = "res/" + outFileName;
if (!inFilePath.equals(outFilePath)) {
resFileMapping.put(inFilePath, outFilePath);
}
LOGGER.fine("Decoding file " + inFilePath + " to " + outFilePath);
try {
if (typeName.equals("raw")) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
if (typeName.equals("font") && !".xml".equals(ext)) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
if (typeName.equals("drawable") || typeName.equals("mipmap")) {
if (inFileName.toLowerCase().endsWith(".9" + ext)) {
outFileName = outResName + ".9" + ext;
// check for htc .r.9.png
if (inFileName.toLowerCase().endsWith(".r.9" + ext)) {
outFileName = outResName + ".r.9" + ext;
}
// check for raw 9patch images
for (String extension : RAW_9PATCH_IMAGE_EXTENSIONS) {
if (inFileName.toLowerCase().endsWith("." + extension)) {
copyRaw(inDir, outDir, inFilePath, outFileName);
return;
}
}
// check for xml 9 patches which are just xml files
if (inFileName.toLowerCase().endsWith(".xml")) {
decode(inDir, inFilePath, outDir, outFileName, "xml");
return;
}
try {
decode(inDir, inFilePath, outDir, outFileName, "9patch");
return;
} catch (CantFind9PatchChunkException ex) {
LOGGER.log(Level.WARNING, String.format(
"Cant find 9patch chunk in file: \"%s\". Renaming it to *.png.", inFileName
), ex);
outDir.removeFile(outFileName);
outFileName = outResName + ext;
}
}
// check for raw image
for (String extension : RAW_IMAGE_EXTENSIONS) {
if (inFileName.toLowerCase().endsWith("." + extension)) {
copyRaw(inDir, outDir, inFilePath, outFileName);
return;
}
}
if (!".xml".equals(ext)) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
}
decode(inDir, inFilePath, outDir, outFileName, "xml");
} catch (RawXmlEncounteredException ex) {
// If we got an error to decode XML, lets assume the file is in raw format.
// This is a large assumption, that might increase runtime, but will save us for situations where
// XSD files are AXML`d on aapt1, but left in plaintext in aapt2.
decode(inDir, inFilePath, outDir, outFileName, "raw");
} catch (AndrolibException ex) {
LOGGER.log(Level.SEVERE, String.format(
"Could not decode file, replacing by FALSE value: %s",
inFileName), ex);
res.replace(new ResBoolValue(false, 0, null));
}
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2024-21633
- Severity: HIGH
- CVSS Score: 7.8
Description: Prevent arbitrary file writes with malicious resource names. (#3484)
* refactor: rename sanitize function
* fix: expose getDir
* fix: safe handling of untrusted resource names
- fixes: GHSA-2hqv-2xv4-5h5w
* test: sample file for GHSA-2hqv-2xv4-5h5w
* refactor: avoid detection of absolute files for resource check
* chore: enable info mode on gradle
* test: skip test on windows
* chore: debug windows handling
* fix: normalize entry with file separators
* fix: normalize filepath after cleansing
* chore: Android paths are not OS specific
* refactor: use java.nio for path traversal checking
* chore: align path separator on Windows for Zip files
* chore: rework towards basic directory traversal
* chore: remove '--info' on build.yml
Function: decode
File: brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java
Repository: iBotPeaches/Apktool
Fixed Code:
public void decode(ResResource res, Directory inDir, Directory outDir, Map<String, String> resFileMapping)
throws AndrolibException {
ResFileValue fileValue = (ResFileValue) res.getValue();
String inFilePath = fileValue.toString();
String inFileName = fileValue.getStrippedPath();
String typeName = res.getResSpec().getType().getName();
String outResName = res.getFilePath();
if (BrutIO.detectPossibleDirectoryTraversal(outResName)) {
outResName = inFileName;
LOGGER.warning(String.format(
"Potentially malicious file path: %s, using instead %s", res.getFilePath(), outResName
));
}
String ext = null;
String outFileName;
int extPos = inFileName.lastIndexOf(".");
if (extPos == -1) {
outFileName = outResName;
} else {
ext = inFileName.substring(extPos).toLowerCase();
outFileName = outResName + ext;
}
String outFilePath = "res/" + outFileName;
if (!inFilePath.equals(outFilePath)) {
resFileMapping.put(inFilePath, outFilePath);
}
LOGGER.fine("Decoding file " + inFilePath + " to " + outFilePath);
try {
if (typeName.equals("raw")) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
if (typeName.equals("font") && !".xml".equals(ext)) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
if (typeName.equals("drawable") || typeName.equals("mipmap")) {
if (inFileName.toLowerCase().endsWith(".9" + ext)) {
outFileName = outResName + ".9" + ext;
// check for htc .r.9.png
if (inFileName.toLowerCase().endsWith(".r.9" + ext)) {
outFileName = outResName + ".r.9" + ext;
}
// check for raw 9patch images
for (String extension : RAW_9PATCH_IMAGE_EXTENSIONS) {
if (inFileName.toLowerCase().endsWith("." + extension)) {
copyRaw(inDir, outDir, inFilePath, outFileName);
return;
}
}
// check for xml 9 patches which are just xml files
if (inFileName.toLowerCase().endsWith(".xml")) {
decode(inDir, inFilePath, outDir, outFileName, "xml");
return;
}
try {
decode(inDir, inFilePath, outDir, outFileName, "9patch");
return;
} catch (CantFind9PatchChunkException ex) {
LOGGER.log(Level.WARNING, String.format(
"Cant find 9patch chunk in file: \"%s\". Renaming it to *.png.", inFileName
), ex);
outDir.removeFile(outFileName);
outFileName = outResName + ext;
}
}
// check for raw image
for (String extension : RAW_IMAGE_EXTENSIONS) {
if (inFileName.toLowerCase().endsWith("." + extension)) {
copyRaw(inDir, outDir, inFilePath, outFileName);
return;
}
}
if (!".xml".equals(ext)) {
decode(inDir, inFilePath, outDir, outFileName, "raw");
return;
}
}
decode(inDir, inFilePath, outDir, outFileName, "xml");
} catch (RawXmlEncounteredException ex) {
// If we got an error to decode XML, lets assume the file is in raw format.
// This is a large assumption, that might increase runtime, but will save us for situations where
// XSD files are AXML`d on aapt1, but left in plaintext in aapt2.
decode(inDir, inFilePath, outDir, outFileName, "raw");
} catch (AndrolibException ex) {
LOGGER.log(Level.SEVERE, String.format(
"Could not decode file, replacing by FALSE value: %s",
inFileName), ex);
res.replace(new ResBoolValue(false, 0, null));
}
}
|
[
"CWE-22"
] |
CVE-2024-21633
|
HIGH
| 7.8
|
iBotPeaches/Apktool
|
decode
|
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/decoder/ResFileDecoder.java
|
d348c43b24a9de350ff6e5bd610545a10c1fc712
| 1
|
Analyze the following code function for security vulnerabilities
|
private native int nativeGetNavigationHistory(long nativeContentViewCoreImpl, Object context);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeGetNavigationHistory
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
|
nativeGetNavigationHistory
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void forceStopPackage(final String packageName, int userId) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forceStopPackage
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
forceStopPackage
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void main(String args[]) {
if (args.length != 1) {
System.out.println("usage : java SAMLUtils <host_name>");
return;
}
System.out.println(generateSourceID(args[0]));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: main
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
|
main
|
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
|
7c18543d126e8a567b83bb4535631825aaa9d742
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.