instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onDetachedFromWindow() {
setListening(false);
mHost.getUserInfoController().remListener(this);
mHost.getNetworkController().removeEmergencyListener(this);
super.onDetachedFromWindow();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDetachedFromWindow
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3886
|
HIGH
| 7.2
|
android
|
onDetachedFromWindow
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
|
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override public void handle(HttpExchange httpExchange) {
String token = getToken(httpExchange.getRequestURI().getPath());
String currentUsersHomeDir = System.getProperty("user.home");
String settingsTomlPath = String.valueOf(Paths.get(currentUsersHomeDir, ".ballerina", SETTINGS_TOML_FILE));
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(settingsTomlPath);
String str = "[central]\naccesstoken=\"" + token + "\"";
outputStream.write(str.getBytes(StandardCharsets.UTF_8));
} catch (FileNotFoundException e) {
throw ErrorUtil.createCommandException("Settings.toml file could not be found: " + settingsTomlPath);
} catch (IOException e) {
throw ErrorUtil.createCommandException(
"error occurred while writing to the Settings.toml file: " + e.getMessage());
} finally {
try {
if (outputStream != null) {
outputStream.close();
}
} catch (IOException e) {
errStream.println("error occurred while closing the output stream: " + e.getMessage());
}
}
outStream.println("token updated");
OutputStream os = null;
try {
String response = "<svg xmlns=\"http://www.w3.org/2000/svg\"/>";
httpExchange.getResponseHeaders()
.put(HttpHeaders.CONTENT_TYPE, Collections.singletonList("image/svg+xml"));
httpExchange.sendResponseHeaders(HttpURLConnection.HTTP_OK,
response.getBytes(StandardCharsets.UTF_8).length);
os = httpExchange.getResponseBody();
os.write(response.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw ErrorUtil
.createCommandException("error occurred while generating the response: " + e.getMessage());
} finally {
try {
if (os != null) {
os.close();
}
} catch (IOException e) {
errStream.println("error occurred while closing the output stream: " + e.getMessage());
}
}
}
|
Vulnerability Classification:
- CWE: CWE-306
- CVE: CVE-2021-32700
- Severity: MEDIUM
- CVSS Score: 5.8
Description: Fix central connection
Function: handle
File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/TokenUpdater.java
Repository: ballerina-platform/ballerina-lang
Fixed Code:
@Override public void handle(HttpExchange httpExchange) {
String token = getToken(httpExchange.getRequestURI().getPath());
String currentUsersHomeDir = System.getProperty("user.home");
String settingsTomlPath = String.valueOf(Paths.get(currentUsersHomeDir, ".ballerina", SETTINGS_TOML_FILE));
FileOutputStream outputStream = null;
try {
outputStream = new FileOutputStream(settingsTomlPath);
String str = "[central]\naccesstoken=\"" + token + "\"";
outputStream.write(str.getBytes(StandardCharsets.UTF_8));
} catch (FileNotFoundException e) {
throw ErrorUtil.createCommandException("Settings.toml file could not be found: " + settingsTomlPath);
} catch (IOException e) {
throw ErrorUtil.createCommandException(
"error occurred while writing to the Settings.toml file: " + e.getMessage());
} finally {
try {
if (outputStream != null) {
outputStream.close();
}
} catch (IOException e) {
errStream.println("error occurred while closing the output stream: " + e.getMessage());
}
}
outStream.println("token updated");
OutputStream os = null;
try {
String response = "<svg xmlns=\"http://www.w3.org/2000/svg\"/>";
httpExchange.getResponseHeaders()
.put(HttpHeaders.CONTENT_TYPE, Collections.singletonList("image/svg+xml"));
httpExchange.sendResponseHeaders(HttpsURLConnection.HTTP_OK,
response.getBytes(StandardCharsets.UTF_8).length);
os = httpExchange.getResponseBody();
os.write(response.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
throw ErrorUtil
.createCommandException("error occurred while generating the response: " + e.getMessage());
} finally {
try {
if (os != null) {
os.close();
}
} catch (IOException e) {
errStream.println("error occurred while closing the output stream: " + e.getMessage());
}
}
}
|
[
"CWE-306"
] |
CVE-2021-32700
|
MEDIUM
| 5.8
|
ballerina-platform/ballerina-lang
|
handle
|
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/TokenUpdater.java
|
4609ffee1744ecd16aac09303b1783bf0a525816
| 1
|
Analyze the following code function for security vulnerabilities
|
private static void awsConfigXmlGenerator(XmlGenerator gen, AwsConfig c) {
if (c == null) {
return;
}
gen.open("aws", "enabled", c.isEnabled())
.node("access-key", c.getAccessKey())
.node("secret-key", c.getSecretKey())
.node("iam-role", c.getIamRole())
.node("region", c.getRegion())
.node("host-header", c.getHostHeader())
.node("security-group-name", c.getSecurityGroupName())
.node("tag-key", c.getTagKey())
.node("tag-value", c.getTagValue())
.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: awsConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
awsConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setFeedFactory(RomeFeedFactory romeFeedFactory)
{
this.romeFeedFactory = romeFeedFactory;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFeedFactory
File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29202
|
CRITICAL
| 9
|
xwiki/xwiki-platform
|
setFeedFactory
|
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
|
5c7ebe47c2897e92d8f04fe2e15027e84dc3ec03
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
@Deprecated
public Builder setCredentialStore(CredentialStore credentialStore) {
Preconditions.checkArgument(credentialDataStore == null);
this.credentialStore = credentialStore;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCredentialStore
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-7692
|
MEDIUM
| 6.4
|
googleapis/google-oauth-java-client
|
setCredentialStore
|
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
|
13433cd7dd06267fc261f0b1d4764f8e3432c824
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_TIME_UPDATE:
handleTimeUpdate();
break;
case MSG_BATTERY_UPDATE:
handleBatteryUpdate((BatteryStatus) msg.obj);
break;
case MSG_SIM_STATE_CHANGE:
handleSimStateChange(msg.arg1, msg.arg2, (State) msg.obj);
break;
case MSG_RINGER_MODE_CHANGED:
handleRingerModeChange(msg.arg1);
break;
case MSG_PHONE_STATE_CHANGED:
handlePhoneStateChanged((String) msg.obj);
break;
case MSG_DEVICE_PROVISIONED:
handleDeviceProvisioned();
break;
case MSG_DPM_STATE_CHANGED:
handleDevicePolicyManagerStateChanged();
break;
case MSG_USER_SWITCHING:
handleUserSwitching(msg.arg1, (IRemoteCallback) msg.obj);
break;
case MSG_USER_SWITCH_COMPLETE:
handleUserSwitchComplete(msg.arg1);
break;
case MSG_KEYGUARD_RESET:
handleKeyguardReset();
break;
case MSG_KEYGUARD_BOUNCER_CHANGED:
handleKeyguardBouncerChanged(msg.arg1);
break;
case MSG_BOOT_COMPLETED:
handleBootCompleted();
break;
case MSG_USER_INFO_CHANGED:
handleUserInfoChanged(msg.arg1);
break;
case MSG_REPORT_EMERGENCY_CALL_ACTION:
handleReportEmergencyCallAction();
break;
case MSG_STARTED_GOING_TO_SLEEP:
handleStartedGoingToSleep(msg.arg1);
break;
case MSG_FINISHED_GOING_TO_SLEEP:
handleFinishedGoingToSleep(msg.arg1);
break;
case MSG_STARTED_WAKING_UP:
handleStartedWakingUp();
break;
case MSG_FACE_UNLOCK_STATE_CHANGED:
handleFaceUnlockStateChanged(msg.arg1 != 0, msg.arg2);
break;
case MSG_SIM_SUBSCRIPTION_INFO_CHANGED:
handleSimSubscriptionInfoChanged();
break;
case MSG_AIRPLANE_MODE_CHANGED:
handleAirplaneModeChanged();
break;
case MSG_SERVICE_STATE_CHANGE:
handleServiceStateChange(msg.arg1, (ServiceState) msg.obj);
break;
case MSG_SCREEN_TURNED_ON:
handleScreenTurnedOn();
break;
case MSG_SCREEN_TURNED_OFF:
handleScreenTurnedOff();
break;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleMessage
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
handleMessage
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void handleQuorumFunction(XmlGenerator gen, QuorumConfig quorumConfig) {
if (quorumConfig.getQuorumFunctionImplementation() instanceof ProbabilisticQuorumFunction) {
ProbabilisticQuorumFunction qf = (ProbabilisticQuorumFunction) quorumConfig.getQuorumFunctionImplementation();
long acceptableHeartbeatPause = qf.getAcceptableHeartbeatPauseMillis();
double threshold = qf.getSuspicionThreshold();
int maxSampleSize = qf.getMaxSampleSize();
long minStdDeviation = qf.getMinStdDeviationMillis();
long firstHeartbeatEstimate = qf.getHeartbeatIntervalMillis();
gen.open("probabilistic-quorum", "acceptable-heartbeat-pause-millis", acceptableHeartbeatPause,
"suspicion-threshold", threshold,
"max-sample-size", maxSampleSize,
"min-std-deviation-millis", minStdDeviation,
"heartbeat-interval-millis", firstHeartbeatEstimate);
gen.close();
} else if (quorumConfig.getQuorumFunctionImplementation() instanceof RecentlyActiveQuorumFunction) {
RecentlyActiveQuorumFunction qf = (RecentlyActiveQuorumFunction) quorumConfig.getQuorumFunctionImplementation();
gen.open("recently-active-quorum", "heartbeat-tolerance-millis", qf.getHeartbeatToleranceMillis());
gen.close();
} else {
gen.node("quorum-function-class-name", classNameOrImplClass(quorumConfig.getQuorumFunctionClassName(),
quorumConfig.getQuorumFunctionImplementation()));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleQuorumFunction
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
handleQuorumFunction
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public String includeForm(String topic, boolean pre) throws XWikiException
{
String result = this.xwiki.include(topic, true, getXWikiContext());
if (pre) {
String includerSyntax = this.xwiki.getCurrentContentSyntaxId(null, this.context);
if (includerSyntax != null && Syntax.XWIKI_1_0.toIdString().equals(includerSyntax)) {
result = "{pre}" + result + "{/pre}";
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: includeForm
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
|
includeForm
|
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 Slave.JnlpJar doJnlpJars(StaplerRequest req) {
return new Slave.JnlpJar(req.getRestOfPath().substring(1));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doJnlpJars
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doJnlpJars
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private static GateKeeperResponse createRetryResponse(int timeout) {
GateKeeperResponse response = new GateKeeperResponse(RESPONSE_RETRY);
response.mTimeout = timeout;
return response;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createRetryResponse
File: core/java/android/service/gatekeeper/GateKeeperResponse.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2017-0806
|
HIGH
| 9.3
|
android
|
createRetryResponse
|
core/java/android/service/gatekeeper/GateKeeperResponse.java
|
b87c968e5a41a1a09166199bf54eee12608f3900
| 0
|
Analyze the following code function for security vulnerabilities
|
public void registerCallback(KeyguardUpdateMonitorCallback callback) {
if (DEBUG) Log.v(TAG, "*** register callback for " + callback);
// Prevent adding duplicate callbacks
for (int i = 0; i < mCallbacks.size(); i++) {
if (mCallbacks.get(i).get() == callback) {
if (DEBUG) Log.e(TAG, "Object tried to add another callback",
new Exception("Called by"));
return;
}
}
mCallbacks.add(new WeakReference<KeyguardUpdateMonitorCallback>(callback));
removeCallback(null); // remove unused references
sendUpdates(callback);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerCallback
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
registerCallback
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setP4MaterialView(P4MaterialViewConfig view) {
resetCachedIdentityAttributes();
this.view = view;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setP4MaterialView
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
setP4MaterialView
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
private String verifyAnonymousUser(Method method,
HttpServletRequest request) {
if (!getSecurityTarget(method)
.isAnnotationPresent(AnonymousAllowed.class)
|| cannotAccessMethod(method, request)) {
return "Anonymous access is not allowed";
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyAnonymousUser
File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31406
|
LOW
| 1.9
|
vaadin/flow
|
verifyAnonymousUser
|
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
|
3fe644cab2cffa5b86316dbe71b11df1083861a9
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
boolean dumpActiveInstruments(PrintWriter pw, String dumpPackage, boolean needSep) {
final int size = mActiveInstrumentation.size();
if (size > 0) {
boolean printed = false;
for (int i = 0; i < size; i++) {
ActiveInstrumentation ai = mActiveInstrumentation.get(i);
if (dumpPackage != null && !ai.mClass.getPackageName().equals(dumpPackage)
&& !ai.mTargetInfo.packageName.equals(dumpPackage)) {
continue;
}
if (!printed) {
if (needSep) {
pw.println();
}
pw.println(" Active instrumentation:");
printed = true;
needSep = true;
}
pw.print(" Instrumentation #"); pw.print(i); pw.print(": ");
pw.println(ai);
ai.dump(pw, " ");
}
}
return needSep;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpActiveInstruments
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
dumpActiveInstruments
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean unzipNonStrict(File zipFile, VFSContainer targetDir, Identity identity, boolean versioning) {
boolean unzipped = false;
try(InputStream in = new FileInputStream(zipFile);
InputStream bin = new BufferedInputStream(in, FileUtils.BSIZE)) {
unzipped = unzipNonStrict(bin, targetDir, identity, versioning);
} catch(IOException e) {
handleIOException("", e);
}
return unzipped;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unzipNonStrict
File: src/main/java/org/olat/core/util/ZipUtil.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
unzipNonStrict
|
src/main/java/org/olat/core/util/ZipUtil.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getExceptionMessage(Throwable pException) {
String message = pException.getLocalizedMessage();
return pException.getClass().getName() + (message != null ? " : " + message : "");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExceptionMessage
File: agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
getExceptionMessage
|
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean startBinderTracking() throws RemoteException {
synchronized (this) {
mBinderTransactionTrackingEnabled = true;
// TODO: hijacking SET_ACTIVITY_WATCHER, but should be changed to its own
// permission (same as profileControl).
if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires permission "
+ android.Manifest.permission.SET_ACTIVITY_WATCHER);
}
for (int i = 0; i < mLruProcesses.size(); i++) {
ProcessRecord process = mLruProcesses.get(i);
if (!processSanityChecksLocked(process)) {
continue;
}
try {
process.thread.startBinderTracking();
} catch (RemoteException e) {
Log.v(TAG, "Process disappared");
}
}
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startBinderTracking
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
|
startBinderTracking
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private Map<String, CWLElement> getOutputs(JsonNode cwlDoc) {
if (cwlDoc != null) {
// For all version workflow inputs/outputs and draft steps
if (cwlDoc.has(OUTPUTS)) {
return getInputsOutputs(cwlDoc.get(OUTPUTS));
}
// Outputs are not gathered for v1 steps
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOutputs
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-41110
|
HIGH
| 7.5
|
common-workflow-language/cwlviewer
|
getOutputs
|
src/main/java/org/commonwl/view/cwl/CWLService.java
|
f6066f09edb70033a2ce80200e9fa9e70a5c29de
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setReachedStepAndPage(SubmissionInfo subInfo, int step,
int page) throws SQLException, AuthorizeException, IOException
{
if (!subInfo.isInWorkflow() && subInfo.getSubmissionItem() != null)
{
WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();
wi.setStageReached(step);
wi.setPageReached(page);
wi.update();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReachedStepAndPage
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31194
|
HIGH
| 7.2
|
DSpace
|
setReachedStepAndPage
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
|
d1dd7d23329ef055069759df15cfa200c8e3
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean injectIsMainActivity(@NonNull ComponentName activity, int userId) {
final long start = getStatStartTime();
try {
if (activity == null) {
wtf("null activity detected");
return false;
}
if (DUMMY_MAIN_ACTIVITY.equals(activity.getClassName())) {
return true;
}
final List<ResolveInfo> resolved = queryActivities(
getMainActivityIntent(), activity.getPackageName(), activity, userId);
return resolved.size() > 0;
} finally {
logDurationStat(Stats.CHECK_LAUNCHER_ACTIVITY, start);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectIsMainActivity
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
|
injectIsMainActivity
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String substituteContextPath(String htmlContent, String context) {
if (m_contextSearch == null) {
m_contextSearch = "([^\\w/])" + context;
m_contextReplace = "$1" + CmsStringUtil.escapePattern(CmsStringUtil.MACRO_OPENCMS_CONTEXT) + "/";
}
return substitutePerl(htmlContent, m_contextSearch, m_contextReplace, "g");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: substituteContextPath
File: src/org/opencms/util/CmsStringUtil.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
substituteContextPath
|
src/org/opencms/util/CmsStringUtil.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String performSyntaxConversion(String content, DocumentReference source, Syntax currentSyntaxId,
Syntax targetSyntax) throws XWikiException
{
try {
XDOM dom = parseContent(currentSyntaxId, content, source);
return renderXDOM(dom, targetSyntax);
} catch (Exception e) {
throw new XWikiException(XWikiException.MODULE_XWIKI_RENDERING, XWikiException.ERROR_XWIKI_UNKNOWN,
"Failed to convert document to syntax [" + targetSyntax + "]", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performSyntaxConversion
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-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
performSyntaxConversion
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public AuthorizationCodeFlow build() {
return new AuthorizationCodeFlow(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: build
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-7692
|
MEDIUM
| 6.4
|
googleapis/google-oauth-java-client
|
build
|
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
|
13433cd7dd06267fc261f0b1d4764f8e3432c824
| 0
|
Analyze the following code function for security vulnerabilities
|
void destroy() {
try {
if (sDebug) Slog.d(TAG, "destroy()");
throwIfDestroyed();
mDialog.dismiss();
mDestroyed = true;
} finally {
mOverlayControl.showOverlays();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
destroy
|
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
void setSurface(Surface surface) {
if (mVirtualDisplay != null) {
mVirtualDisplay.setSurface(surface);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSurface
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
setSurface
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void showBouncerIfKeyguard() {
if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) {
showBouncer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showBouncerIfKeyguard
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
|
showBouncerIfKeyguard
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private Territory getTerritory(final Element element, final String attribute, final boolean mustFind)
throws GameParseException {
return getValidatedObject(element, attribute, mustFind, data.getMap()::getTerritory, "territory");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTerritory
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
getTerritory
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean handleJid(Invite invite) {
List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid(), invite.account);
if (invite.isAction(XmppUri.ACTION_JOIN)) {
Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid());
if (muc != null) {
switchToConversation(muc, invite.getBody());
return true;
} else {
showJoinConferenceDialog(invite.getJid().asBareJid().toString());
return false;
}
} else if (contacts.size() == 0) {
showCreateContactDialog(invite.getJid().toString(), invite);
return false;
} else if (contacts.size() == 1) {
Contact contact = contacts.get(0);
if (!invite.isSafeSource() && invite.hasFingerprints()) {
displayVerificationWarningDialog(contact, invite);
} else {
if (invite.hasFingerprints()) {
if (xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints())) {
Toast.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show();
}
}
if (invite.account != null) {
xmppConnectionService.getShortcutService().report(contact);
}
switchToConversation(contact, invite.getBody());
}
return true;
} else {
if (mMenuSearchView != null) {
mMenuSearchView.expandActionView();
mSearchEditText.setText("");
mSearchEditText.append(invite.getJid().toString());
filter(invite.getJid().toString());
} else {
mInitialSearchValue.push(invite.getJid().toString());
}
return true;
}
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2018-18467
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Do not insert text shared over XMPP uri when already drafting message
XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to
directly share a message with a specific contact. Previously the text was
always appended to the message currently in draft. The message was never send
automatically. Essentially those links where treated like normal text share
intents (for example when sharing a URL from the browser) but without the
contact selection.
There is a concern (CVE-2018-18467) that when this URI is invoked automatically
and the user is currently drafting a long message to that particular contact
the text could be inserted in the draft field (input box) without the user
noticing.
To circumvent that the text shared over XMPP uris that contain a particular
contact is now appended only if the draft box is currently empty.
Sharing text normally (**with** manual contact selection) is still treated the
same; meaning the shared text will be appended to the current draft. This is
intended behaviour to make the
'Hey I have this cool link here;' *open browser*, *share link* - secenario
work.
Function: handleJid
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
Fixed Code:
private boolean handleJid(Invite invite) {
List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid(), invite.account);
if (invite.isAction(XmppUri.ACTION_JOIN)) {
Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid());
if (muc != null) {
switchToConversationDoNotAppend(muc, invite.getBody());
return true;
} else {
showJoinConferenceDialog(invite.getJid().asBareJid().toString());
return false;
}
} else if (contacts.size() == 0) {
showCreateContactDialog(invite.getJid().toString(), invite);
return false;
} else if (contacts.size() == 1) {
Contact contact = contacts.get(0);
if (!invite.isSafeSource() && invite.hasFingerprints()) {
displayVerificationWarningDialog(contact, invite);
} else {
if (invite.hasFingerprints()) {
if (xmppConnectionService.verifyFingerprints(contact, invite.getFingerprints())) {
Toast.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show();
}
}
if (invite.account != null) {
xmppConnectionService.getShortcutService().report(contact);
}
switchToConversationDoNotAppend(contact, invite.getBody());
}
return true;
} else {
if (mMenuSearchView != null) {
mMenuSearchView.expandActionView();
mSearchEditText.setText("");
mSearchEditText.append(invite.getJid().toString());
filter(invite.getJid().toString());
} else {
mInitialSearchValue.push(invite.getJid().toString());
}
return true;
}
}
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
handleJid
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 1
|
Analyze the following code function for security vulnerabilities
|
private void updateDozingState() {
Trace.beginSection("StatusBar#updateDozingState");
boolean animate = !mDozing && mDozeServiceHost.shouldAnimateWakeup();
mNotificationPanel.setDozing(mDozing, animate);
mStackScroller.setDark(mDozing, animate, mWakeUpTouchLocation);
mScrimController.setDozing(mDozing);
mKeyguardIndicationController.setDozing(mDozing);
mNotificationPanel.setDark(mDozing, animate);
updateQsExpansionEnabled();
mDozeScrimController.setDozing(mDozing, animate);
updateRowStates();
Trace.endSection();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateDozingState
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
|
updateDozingState
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) {
String destination = computeDestination(request);
if (!isDefined(destination)) {
throwHttpNotFoundError();
}
redirectService(request, response, destination);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doPost
File: core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
doPost
|
core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpHeaders set(CharSequence name, Object value) {
headers.setObject(name, value);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: set
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
set
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CiphertextHeader decode(final byte[] data) throws EncodingException
{
final ByteBuffer bb = ByteBuffer.wrap(data);
bb.order(ByteOrder.BIG_ENDIAN);
final int length = bb.getInt();
if (length < 0) {
throw new EncodingException("Invalid ciphertext header length: " + length);
}
final byte[] nonce;
int nonceLen = 0;
try {
nonceLen = bb.getInt();
nonce = new byte[nonceLen];
bb.get(nonce);
} catch (IndexOutOfBoundsException | BufferUnderflowException e) {
throw new EncodingException("Invalid nonce length: " + nonceLen);
}
String keyName = null;
if (length > nonce.length + 8) {
final byte[] b;
int keyLen = 0;
try {
keyLen = bb.getInt();
b = new byte[keyLen];
bb.get(b);
keyName = new String(b);
} catch (IndexOutOfBoundsException | BufferUnderflowException e) {
throw new EncodingException("Invalid key length: " + keyLen);
}
}
return new CiphertextHeader(nonce, keyName);
}
|
Vulnerability Classification:
- CWE: CWE-770
- CVE: CVE-2020-7226
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Define new ciphertext header format.
New format does not allocate any memory until HMAC check passes, which
guards against untrusted input. All encryption components have been
updated to use the new header, while preserving backward compatibility
to decrypt messages encrypted with the old format. The decoding process
for the old header has been hardened to impose reasonable limits on header
fields: nonce sizes up to 255 bytes, key names up to 500 bytes.
Fixes #52.
Function: decode
File: src/main/java/org/cryptacular/CiphertextHeader.java
Repository: vt-middleware/cryptacular
Fixed Code:
public static CiphertextHeader decode(final byte[] data) throws EncodingException
{
final ByteBuffer bb = ByteBuffer.wrap(data);
bb.order(ByteOrder.BIG_ENDIAN);
final int length = bb.getInt();
if (length < 0) {
throw new EncodingException("Bad ciphertext header");
}
final byte[] nonce;
int nonceLen = 0;
try {
nonceLen = bb.getInt();
if (nonceLen > MAX_NONCE_LEN) {
throw new EncodingException("Bad ciphertext header: maximum nonce length exceeded");
}
nonce = new byte[nonceLen];
bb.get(nonce);
} catch (IndexOutOfBoundsException | BufferUnderflowException e) {
throw new EncodingException("Bad ciphertext header");
}
String keyName = null;
if (length > nonce.length + 8) {
final byte[] b;
int keyLen = 0;
try {
keyLen = bb.getInt();
if (keyLen > MAX_KEYNAME_LEN) {
throw new EncodingException("Bad ciphertext header: maximum key length exceeded");
}
b = new byte[keyLen];
bb.get(b);
keyName = new String(b);
} catch (IndexOutOfBoundsException | BufferUnderflowException e) {
throw new EncodingException("Bad ciphertext header");
}
}
return new CiphertextHeader(nonce, keyName);
}
|
[
"CWE-770"
] |
CVE-2020-7226
|
MEDIUM
| 5
|
vt-middleware/cryptacular
|
decode
|
src/main/java/org/cryptacular/CiphertextHeader.java
|
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
| 1
|
Analyze the following code function for security vulnerabilities
|
private String getPath(Long id) {
ProjectFacade facade = cache.get(id);
if (facade != null) {
if (facade.getParentId() != null) {
String parentPath = getPath(facade.getParentId());
if (parentPath != null)
return parentPath + "/" + facade.getName();
else
return null;
} else {
return facade.getName();
}
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPath
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
getPath
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate107(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String key = element.elementTextTrim("key");
if (key.equals("SYSTEM")) {
Element valueElement = element.element("value");
if (valueElement != null) {
var gitConfigElement = valueElement.element("gitConfig");
gitConfigElement.setName("gitLocation");
var clazz = gitConfigElement.attributeValue("class").replace(
"io.onedev.server.git.config.",
"io.onedev.server.git.location.");
gitConfigElement.addAttribute("class", clazz);
var curlConfigElement = valueElement.element("curlConfig");
curlConfigElement.setName("curlLocation");
clazz = curlConfigElement.attributeValue("class").replace(
"io.onedev.server.git.config.",
"io.onedev.server.git.location.");
curlConfigElement.addAttribute("class", clazz);
}
} else if (key.equals("SSO_CONNECTORS")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element connectorElement: valueElement.elements()) {
if (connectorElement.getName().contains("OpenIdConnector")) {
Element issuerUrlElement = connectorElement.element("issuerUrl");
issuerUrlElement.setName("configurationDiscoveryUrl");
issuerUrlElement.setText(issuerUrlElement.getText().trim() + "/.well-known/openid-configuration");
}
}
}
} else if (key.equals("JOB_EXECUTORS")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element executorElement: valueElement.elements()) {
if (executorElement.getName().contains("KubernetesExecutor")) {
executorElement.addElement("cpuRequest").setText("250m");
executorElement.addElement("memoryRequest").setText("256Mi");
}
}
}
} else if (key.equals("PERFORMANCE")) {
Element valueElement = element.element("value");
if (valueElement != null) {
int cpuIntensiveTaskConcurrency;
try {
HardwareAbstractionLayer hardware = new SystemInfo().getHardware();
cpuIntensiveTaskConcurrency = hardware.getProcessor().getLogicalProcessorCount();
} catch (Exception e) {
cpuIntensiveTaskConcurrency = 4;
}
valueElement.addElement("cpuIntensiveTaskConcurrency")
.setText(String.valueOf(cpuIntensiveTaskConcurrency));
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Projects.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
element.addElement("gitPackConfig");
for (var branchProtectionElement: element.element("branchProtections").elements()) {
branchProtectionElement.setName("io.onedev.server.model.support.code.BranchProtection");
for (var fileProtectionElement: branchProtectionElement.element("fileProtections").elements())
fileProtectionElement.setName("io.onedev.server.model.support.code.FileProtection");
}
for (var tagProtectionElement: element.element("tagProtections").elements()) {
tagProtectionElement.setName("io.onedev.server.model.support.code.TagProtection");
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Agents.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element : dom.getRootElement().elements()) {
element.element("memory").detach();
Element cpuElement = element.element("cpu");
cpuElement.setName("cpus");
cpuElement.setText(String.valueOf(Integer.parseInt(cpuElement.getTextTrim())/1000));
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate107
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate107
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public static HgMaterial hgMaterial(String url) {
return hgMaterial(url, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hgMaterial
File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
hgMaterial
|
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void batchDelete(IssuesUpdateRequest request) {
if (request.getBatchDeleteAll()) {
IssuesRequest issuesRequest = new IssuesRequest();
issuesRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
issuesRequest.setProjectId(SessionUtils.getCurrentProjectId());
List<IssuesDao> issuesDaos = listByWorkspaceId(issuesRequest);
if (CollectionUtils.isNotEmpty(issuesDaos)) {
issuesDaos.parallelStream().forEach(issuesDao -> {
delete(issuesDao.getId());
});
}
} else {
if (CollectionUtils.isNotEmpty(request.getBatchDeleteIds())) {
request.getBatchDeleteIds().parallelStream().forEach(id -> delete(id));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: batchDelete
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
|
batchDelete
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object unmarshal(Source source) throws XmlMappingException {
return unmarshal(source, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-4152
|
MEDIUM
| 6.8
|
spring-projects/spring-framework
|
unmarshal
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getCharset(String mimeType) {
if (mimeType != null && mimeType.contains(";")) {
String[] parts = mimeType.split(";");
for (String part : parts) {
if (part.trim().startsWith("charset")) {
return part.split("=")[1];
}
}
}
return StandardCharsets.UTF_8.name();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCharset
File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2022-2466
|
CRITICAL
| 9.8
|
quarkusio/quarkus
|
getCharset
|
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
|
08e5c3106ce4bfb18b24a38514eeba6464668b07
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isTrustOnFirstUseSupported() {
return (getSupportedFeatures() & WIFI_FEATURE_TRUST_ON_FIRST_USE) != 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTrustOnFirstUseSupported
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
isTrustOnFirstUseSupported
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<OsuProvider, List<ScanResult>> getMatchingOsuProviders(
List<ScanResult> scanResults) {
if (scanResults == null) {
Log.e(TAG, "Attempt to retrieve OSU providers for a null ScanResult");
return new HashMap();
}
Map<OsuProvider, List<ScanResult>> osuProviders = new HashMap<>();
for (ScanResult scanResult : scanResults) {
if (!scanResult.isPasspointNetwork()) continue;
// Lookup OSU Providers ANQP element.
Map<Constants.ANQPElementType, ANQPElement> anqpElements = getANQPElements(scanResult);
if (!anqpElements.containsKey(Constants.ANQPElementType.HSOSUProviders)) {
continue;
}
HSOsuProvidersElement element =
(HSOsuProvidersElement) anqpElements.get(
Constants.ANQPElementType.HSOSUProviders);
for (OsuProviderInfo info : element.getProviders()) {
// Set null for OSU-SSID in the class because OSU-SSID is a factor for hotspot
// operator rather than service provider, which means it can be different for
// each hotspot operators.
OsuProvider provider = new OsuProvider((WifiSsid) null, info.getFriendlyNames(),
info.getServiceDescription(), info.getServerUri(),
info.getNetworkAccessIdentifier(), info.getMethodList());
List<ScanResult> matchingScanResults = osuProviders.get(provider);
if (matchingScanResults == null) {
matchingScanResults = new ArrayList<>();
osuProviders.put(provider, matchingScanResults);
}
matchingScanResults.add(scanResult);
}
}
return osuProviders;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMatchingOsuProviders
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
getMatchingOsuProviders
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public byte[] encode()
{
final SecretKey key = keyLookup != null ? keyLookup.apply(keyName) : null;
if (key == null) {
throw new IllegalStateException("Could not resolve secret key to generate header HMAC");
}
return encode(key);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encode
File: src/main/java/org/cryptacular/CiphertextHeaderV2.java
Repository: vt-middleware/cryptacular
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-7226
|
MEDIUM
| 5
|
vt-middleware/cryptacular
|
encode
|
src/main/java/org/cryptacular/CiphertextHeaderV2.java
|
00395c232cdc62d4292ce27999c026fc1f076b1d
| 0
|
Analyze the following code function for security vulnerabilities
|
@MediumTest
@Test
public void testSendConnectionEventNotNull() throws Exception {
IdPair ids = startAndMakeActiveIncomingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA);
assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState());
Bundle testBundle = new Bundle();
testBundle.putString(TEST_BUNDLE_KEY, "TEST");
ArgumentCaptor<Bundle> bundleArgumentCaptor = ArgumentCaptor.forClass(Bundle.class);
mConnectionServiceFixtureA.sendConnectionEvent(ids.mConnectionId, TEST_EVENT, testBundle);
verify(mInCallServiceFixtureX.getTestDouble(), timeout(TEST_TIMEOUT))
.onConnectionEvent(eq(ids.mCallId), eq(TEST_EVENT), bundleArgumentCaptor.capture());
assert (bundleArgumentCaptor.getValue().containsKey(TEST_BUNDLE_KEY));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testSendConnectionEventNotNull
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
|
testSendConnectionEventNotNull
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public List<String> getFiles(@QueryParam("changedFilesOnly") boolean changedFilesOnly, @Context SecurityContext securityContext) {
if (!securityContext.isUserInRole(Authentication.ROLE_FILESYSTEM_EDITOR)) {
throw new ForbiddenException("FILESYSTEM EDITOR role is required for enumerating files.");
}
try {
return Files.find(etcFolder, 4, (path, basicFileAttributes) -> isSupportedExtension(path), FileVisitOption.FOLLOW_LINKS)
.map(p -> etcFolder.relativize(p).toString())
.filter(p -> !changedFilesOnly || !doesFileExistAndMatchContentsWithEtcPristine(p))
.sorted()
.collect(Collectors.toList());
} catch (IOException e) {
throw new RuntimeException("Failed to enumerate files in path: " + etcFolder, e);
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-40315
- Severity: HIGH
- CVSS Score: 8.0
Description: NMS-15702: Only members of ROLE_ADMIN can view/edit users.xml
Function: getFiles
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
Repository: OpenNMS/opennms
Fixed Code:
@GET
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public List<String> getFiles(@QueryParam("changedFilesOnly") boolean changedFilesOnly, @Context SecurityContext securityContext) {
if (!securityContext.isUserInRole(Authentication.ROLE_FILESYSTEM_EDITOR)) {
throw new ForbiddenException("FILESYSTEM EDITOR role is required for enumerating files.");
}
try {
return Files.find(etcFolder, 4, (path, basicFileAttributes) -> isSupportedExtension(path), FileVisitOption.FOLLOW_LINKS)
.filter(p -> !p.equals(USERS_XML) || securityContext.isUserInRole(Authentication.ROLE_ADMIN))
.map(p -> etcFolder.relativize(p).toString())
.filter(p -> !changedFilesOnly || !doesFileExistAndMatchContentsWithEtcPristine(p, securityContext))
.sorted()
.collect(Collectors.toList());
} catch (IOException e) {
throw new RuntimeException("Failed to enumerate files in path: " + etcFolder, e);
}
}
|
[
"CWE-Other"
] |
CVE-2023-40315
|
HIGH
| 8
|
OpenNMS/opennms
|
getFiles
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
|
201301e067329ababa3c0671ded5c4c43347d4a8
| 1
|
Analyze the following code function for security vulnerabilities
|
public static CharSource asCharSource(File file, Charset charset) {
return asByteSource(file).asCharSource(charset);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: asCharSource
File: 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
|
asCharSource
|
guava/src/com/google/common/io/Files.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getDisableHashBasedSearches() {
return myDisableHashBasedSearches;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDisableHashBasedSearches
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
getDisableHashBasedSearches
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M2")
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-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
updateObjectsFromRequest
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void animateKeyguardStatusBarIn(long duration) {
mKeyguardStatusBar.setVisibility(View.VISIBLE);
mKeyguardStatusBar.setAlpha(0f);
ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
anim.addUpdateListener(mStatusBarAnimateAlphaListener);
anim.setDuration(duration);
anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
anim.start();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: animateKeyguardStatusBarIn
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
animateKeyguardStatusBarIn
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getMtePolicy(String callerPackageName) {
final CallerIdentity caller = getCallerIdentity(callerPackageName);
if (isPermissionCheckFlagEnabled()) {
enforcePermission(MANAGE_DEVICE_POLICY_MTE, caller.getPackageName(),
UserHandle.USER_ALL);
} else {
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller)
|| isProfileOwnerOfOrganizationOwnedDevice(caller)
|| isSystemUid(caller));
}
synchronized (getLockObject()) {
// TODO(b/261999445): Remove
ActiveAdmin admin;
if (isHeadlessFlagEnabled()) {
admin =
getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked();
} else {
admin =
getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked(
UserHandle.USER_SYSTEM);
}
return admin != null
? admin.mtePolicy
: DevicePolicyManager.MTE_NOT_CONTROLLED_BY_POLICY;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMtePolicy
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
|
getMtePolicy
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
void openInputChannel(InputChannel outInputChannel) {
if (mInputChannel != null) {
throw new IllegalStateException("Window already has an input channel.");
}
String name = getName();
mInputChannel = mWmService.mInputManager.createInputChannel(name);
mInputChannelToken = mInputChannel.getToken();
mInputWindowHandle.setToken(mInputChannelToken);
mWmService.mInputToWindowMap.put(mInputChannelToken, this);
if (outInputChannel != null) {
mInputChannel.copyTo(outInputChannel);
} else {
// If the window died visible, we setup a fake input channel, so that taps
// can still detected by input monitor channel, and we can relaunch the app.
// Create fake event receiver that simply reports all events as handled.
mDeadWindowEventReceiver = new DeadWindowEventReceiver(mInputChannel);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openInputChannel
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
openInputChannel
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void overridePendingAppTransitionInPlace(String packageName, int anim) {
synchronized(mWindowMap) {
mAppTransition.overrideInPlaceAppTransition(packageName, anim);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: overridePendingAppTransitionInPlace
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
overridePendingAppTransitionInPlace
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "14.0RC1")
public void setContentAuthorReference(DocumentReference contentAuthorReference)
{
if (contentAuthorReference == null) {
this.authors.setContentAuthor(GuestUserReference.INSTANCE);
} else {
if (contentAuthorReference.getName().equals(XWikiRightService.GUEST_USER)) {
LOGGER.warn("A reference to XWikiGuest user has been set instead of null. This is probably a mistake.",
new Exception("See stack trace"));
}
UserReference user = this.getUserReferenceDocumentReferenceResolver().resolve(contentAuthorReference);
this.authors.setContentAuthor(user);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setContentAuthorReference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
setContentAuthorReference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeClearSslPreferences(long nativeContentViewCoreImpl);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeClearSslPreferences
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
|
nativeClearSslPreferences
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public GitVersion version() {
CommandLine gitVersion = git().withArgs("version");
String gitVersionString = gitVersion.runOrBomb(new NamedProcessTag("git version check")).outputAsString();
return GitVersion.parse(gitVersionString);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: version
File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
version
|
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<E> getResult() {
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResult
File: src/main/java/com/github/pagehelper/Page.java
Repository: pagehelper/Mybatis-PageHelper
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-28111
|
HIGH
| 7.5
|
pagehelper/Mybatis-PageHelper
|
getResult
|
src/main/java/com/github/pagehelper/Page.java
|
554a524af2d2b30d09505516adc412468a84d8fa
| 0
|
Analyze the following code function for security vulnerabilities
|
public HttpRequest queryEncoding(final String encoding) {
this.queryEncoding = encoding;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryEncoding
File: src/main/java/jodd/http/HttpRequest.java
Repository: oblac/jodd-http
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2022-29631
|
MEDIUM
| 5
|
oblac/jodd-http
|
queryEncoding
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getValidNotBeforeFrom() {
return validNotBeforeFrom;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValidNotBeforeFrom
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getValidNotBeforeFrom
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean defaultUseProxySelector() {
return Boolean.getBoolean(ASYNC_CLIENT + "useProxySelector");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: defaultUseProxySelector
File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7398
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
defaultUseProxySelector
|
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
|
a894583921c11c3b01f160ada36a8bb9d5158e96
| 0
|
Analyze the following code function for security vulnerabilities
|
private void maybeSendUserPresentBroadcast() {
if (mSystemReady && mLockPatternUtils.isLockScreenDisabled(
KeyguardUpdateMonitor.getCurrentUser())) {
// Lock screen is disabled because the user has set the preference to "None".
// In this case, send out ACTION_USER_PRESENT here instead of in
// handleKeyguardDone()
sendUserPresentBroadcast();
} else if (mSystemReady && shouldWaitForProvisioning()) {
// Skipping the lockscreen because we're not yet provisioned, but we still need to
// notify the StrongAuthTracker that it's now safe to run trust agents, in case the
// user sets a credential later.
mLockPatternUtils.userPresent(KeyguardUpdateMonitor.getCurrentUser());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeSendUserPresentBroadcast
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
maybeSendUserPresentBroadcast
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setVisible(boolean visible) {
if (getSectionState().visible != visible) {
getSectionState().visible = visible;
markAsDirty();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVisible
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
|
setVisible
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getConcatFunctionSQL(Column[] columns) {
return getConcatFunctionSQL(columns, "(", ")", " || ");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConcatFunctionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getConcatFunctionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
public void upsert(String table, String id, Object entity, Handler<AsyncResult<String>> replyHandler) {
client.getConnection(conn -> save(conn, table, id, entity,
/* returnId */ true, /* upsert */ true, /* convertEntity */ true, closeAndHandleResult(conn, replyHandler)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: upsert
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
upsert
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public String getURL(String fullname, String action, String queryString, String anchor, XWikiContext context)
{
return getURL(getCurrentMixedDocumentReferenceResolver().resolve(fullname), action, queryString, anchor,
context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isMember(final Context context, final String groupName) throws SQLException {
return isMember(context, findByName(context, groupName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMember
File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
isMember
|
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isCPULauncherEnabled() {
return Boolean.parseBoolean(getProperty(TS_CPU_LAUNCHER_ENABLE, "false"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCPULauncherEnabled
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
isCPULauncherEnabled
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CharSequence safeCharSequence(CharSequence cs) {
if (cs == null) return cs;
if (cs.length() > MAX_CHARSEQUENCE_LENGTH) {
cs = cs.subSequence(0, MAX_CHARSEQUENCE_LENGTH);
}
if (cs instanceof Parcelable) {
Log.e(TAG, "warning: " + cs.getClass().getCanonicalName()
+ " instance is a custom Parcelable and not allowed in Notification");
return cs.toString();
}
return removeTextSizeSpans(cs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: safeCharSequence
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
safeCharSequence
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean hasUsageStatsPermission(String callingPackage, int callingUid, int callingPid) {
final int mode = mAppOpsService.noteOperation(AppOpsManager.OP_GET_USAGE_STATS,
callingUid, callingPackage, null, false, "", false).getOpMode();
if (mode == AppOpsManager.MODE_DEFAULT) {
return checkPermission(Manifest.permission.PACKAGE_USAGE_STATS, callingPid, callingUid)
== PackageManager.PERMISSION_GRANTED;
}
return mode == AppOpsManager.MODE_ALLOWED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasUsageStatsPermission
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
hasUsageStatsPermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private static byte[] readInputStream(InputStream i) throws IOException {
ByteArrayOutputStream b = new ByteArrayOutputStream();
copy(i, b);
return b.toByteArray();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readInputStream
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
|
readInputStream
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean testIsSystemReady() {
// no need to synchronize(this) just to read & return the value
return mSystemReady;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testIsSystemReady
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
testIsSystemReady
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isFocusedNodeEditable() {
return mFocusedNodeEditable;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFocusedNodeEditable
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
isFocusedNodeEditable
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private XWikiContext getXWikiContext()
{
if (this.xcontextProvider == null) {
this.xcontextProvider = Utils.getComponent(XWikiContext.TYPE_PROVIDER);
}
return this.xcontextProvider.get();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXWikiContext
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getXWikiContext
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getContentType() {
return getHeader(CONTENT_TYPE_HEADER);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentType
File: src/java/winstone/WinstoneResponse.java
Repository: jenkinsci/winstone
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2011-4344
|
LOW
| 2.6
|
jenkinsci/winstone
|
getContentType
|
src/java/winstone/WinstoneResponse.java
|
410ed3001d51c689cf59085b7417466caa2ded7b
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean scanArgs(String[] args, String value) {
if (args != null) {
for (String arg : args) {
if (value.equals(arg)) {
return true;
}
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scanArgs
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
scanArgs
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@OnStartup
public void onStartup(final PlaceRequest place) {
this.place = place;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStartup
File: jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
Repository: kiegroup/jbpm-wb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-6465
|
LOW
| 3.5
|
kiegroup/jbpm-wb
|
onStartup
|
jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
|
4818204506e8e94645b52adb9426bedfa9ffdd04
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresApi(Build.VERSION_CODES.S)
public void setDecoratedIdentityPrefix(@Nullable String decoratedIdentityPrefix) {
if (!SdkLevel.isAtLeastS()) {
throw new UnsupportedOperationException();
}
if (!TextUtils.isEmpty(decoratedIdentityPrefix) && !decoratedIdentityPrefix.endsWith("!")) {
throw new IllegalArgumentException(
"Decorated identity prefix must be delimited by '!'");
}
mDecoratedIdentityPrefix = decoratedIdentityPrefix;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDecoratedIdentityPrefix
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
setDecoratedIdentityPrefix
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void getByIdNullConnection(TestContext context) {
postgresClientNullConnection().get(FOO, StringPojo.class, "sql", true, false, context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByIdNullConnection
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
getByIdNullConnection
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public AsciiString generateSessionId() {
ThreadLocalRandom random = ThreadLocalRandom.current();
UUID uuid = new UUID(random.nextLong(), random.nextLong());
return AsciiString.of(uuid.toString());
}
|
Vulnerability Classification:
- CWE: CWE-338
- CVE: CVE-2019-11808
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Use UUID directly for generating session IDs
Function: generateSessionId
File: ratpack-session/src/main/java/ratpack/session/internal/DefaultSessionIdGenerator.java
Repository: ratpack
Fixed Code:
public AsciiString generateSessionId() {
return AsciiString.cached(UUID.randomUUID().toString());
}
|
[
"CWE-338"
] |
CVE-2019-11808
|
MEDIUM
| 4.3
|
ratpack
|
generateSessionId
|
ratpack-session/src/main/java/ratpack/session/internal/DefaultSessionIdGenerator.java
|
f2b63eb82dd71194319fd3945f5edf29b8f3a42d
| 1
|
Analyze the following code function for security vulnerabilities
|
private void saveState(Bundle state) {
// We have no accounts so there is nothing to compose, and therefore, nothing to save.
if (mAccounts == null || mAccounts.length == 0) {
return;
}
// The framework is happy to save and restore the selection but only if it also saves and
// restores the contents of the edit text. That's a lot of text to put in a bundle so we do
// this manually.
View focus = getCurrentFocus();
if (focus != null && focus instanceof EditText) {
EditText focusEditText = (EditText) focus;
state.putInt(EXTRA_FOCUS_SELECTION_START, focusEditText.getSelectionStart());
state.putInt(EXTRA_FOCUS_SELECTION_END, focusEditText.getSelectionEnd());
}
final List<ReplyFromAccount> replyFromAccounts = mFromSpinner.getReplyFromAccounts();
final int selectedPos = mFromSpinner.getSelectedItemPosition();
final ReplyFromAccount selectedReplyFromAccount = (replyFromAccounts != null
&& replyFromAccounts.size() > 0 && replyFromAccounts.size() > selectedPos) ?
replyFromAccounts.get(selectedPos) : null;
if (selectedReplyFromAccount != null) {
state.putString(EXTRA_SELECTED_REPLY_FROM_ACCOUNT, selectedReplyFromAccount.serialize()
.toString());
state.putParcelable(Utils.EXTRA_ACCOUNT, selectedReplyFromAccount.account);
} else {
state.putParcelable(Utils.EXTRA_ACCOUNT, mAccount);
}
if (mDraftId == UIProvider.INVALID_MESSAGE_ID && mRequestId !=0) {
// We don't have a draft id, and we have a request id,
// save the request id.
state.putInt(EXTRA_REQUEST_ID, mRequestId);
}
// We want to restore the current mode after a pause
// or rotation.
int mode = getMode();
state.putInt(EXTRA_ACTION, mode);
final Message message = createMessage(selectedReplyFromAccount, mRefMessage, mode,
removeComposingSpans(mBodyView.getText()));
if (mDraft != null) {
message.id = mDraft.id;
message.serverId = mDraft.serverId;
message.uri = mDraft.uri;
}
state.putParcelable(EXTRA_MESSAGE, message);
if (mRefMessage != null) {
state.putParcelable(EXTRA_IN_REFERENCE_TO_MESSAGE, mRefMessage);
} else if (message.appendRefMessageContent) {
// If we have no ref message but should be appending
// ref message content, we have orphaned quoted text. Save it.
state.putCharSequence(EXTRA_QUOTED_TEXT, mQuotedTextView.getQuotedTextIfIncluded());
}
state.putBoolean(EXTRA_SHOW_CC, mCcBccView.isCcVisible());
state.putBoolean(EXTRA_SHOW_BCC, mCcBccView.isBccVisible());
state.putBoolean(EXTRA_RESPONDED_INLINE, mRespondedInline);
state.putBoolean(EXTRA_SAVE_ENABLED, mSave != null && mSave.isEnabled());
state.putParcelableArrayList(
EXTRA_ATTACHMENT_PREVIEWS, mAttachmentsView.getAttachmentPreviews());
state.putParcelable(EXTRA_VALUES, mExtraValues);
state.putBoolean(EXTRA_TEXT_CHANGED, mTextChanged);
// On configuration changes, we don't actually need to parse the body html ourselves because
// the framework can correctly restore the body EditText to its exact original state.
state.putBoolean(EXTRA_SKIP_PARSING_BODY, isChangingConfigurations());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveState
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
saveState
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean canBeLaunchedOnDisplay(int displayId) {
return mAtmService.mTaskSupervisor.canPlaceEntityOnDisplay(displayId, launchedFromPid,
launchedFromUid, info);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canBeLaunchedOnDisplay
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
|
canBeLaunchedOnDisplay
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setUserIsMonkey(boolean userIsMonkey) {
synchronized (this) {
synchronized (mPidsSelfLocked) {
final int callingPid = Binder.getCallingPid();
ProcessRecord precessRecord = mPidsSelfLocked.get(callingPid);
if (precessRecord == null) {
throw new SecurityException("Unknown process: " + callingPid);
}
if (precessRecord.instrumentationUiAutomationConnection == null) {
throw new SecurityException("Only an instrumentation process "
+ "with a UiAutomation can call setUserIsMonkey");
}
}
mUserIsMonkey = userIsMonkey;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserIsMonkey
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
setUserIsMonkey
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final int startActivityWithConfig(IApplicationThread caller, String callingPackage,
String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo,
String resultWho, int requestCode, int startFlags, Configuration config,
Bundle bOptions, int userId) {
assertPackageMatchesCallingUid(callingPackage);
enforceNotIsolatedCaller("startActivityWithConfig");
userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId,
"startActivityWithConfig");
// TODO: Switch to user app stacks here.
return getActivityStartController().obtainStarter(intent, "startActivityWithConfig")
.setCaller(caller)
.setCallingPackage(callingPackage)
.setCallingFeatureId(callingFeatureId)
.setResolvedType(resolvedType)
.setResultTo(resultTo)
.setResultWho(resultWho)
.setRequestCode(requestCode)
.setStartFlags(startFlags)
.setGlobalConfiguration(config)
.setActivityOptions(bOptions)
.setUserId(userId)
.execute();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityWithConfig
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
startActivityWithConfig
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public Cursor query(SQLiteDatabase db, String[] projectionIn,
String selection, String[] selectionArgs, String groupBy,
String having, String sortOrder, String limit, CancellationSignal cancellationSignal) {
if (mTables == null) {
return null;
}
final String sql;
final String unwrappedSql = buildQuery(
projectionIn, selection, groupBy, having,
sortOrder, limit);
if (mStrict && selection != null && selection.length() > 0) {
// Validate the user-supplied selection to detect syntactic anomalies
// in the selection string that could indicate a SQL injection attempt.
// The idea is to ensure that the selection clause is a valid SQL expression
// by compiling it twice: once wrapped in parentheses and once as
// originally specified. An attacker cannot create an expression that
// would escape the SQL expression while maintaining balanced parentheses
// in both the wrapped and original forms.
// NOTE: The ordering of the below operations is important; we must
// execute the wrapped query to ensure the untrusted clause has been
// fully isolated.
// Validate the unwrapped query
db.validateSql(unwrappedSql, cancellationSignal); // will throw if query is invalid
// Execute wrapped query for extra protection
final String wrappedSql = buildQuery(projectionIn, "(" + selection + ")", groupBy,
having, sortOrder, limit);
sql = wrappedSql;
} else {
// Execute unwrapped query
sql = unwrappedSql;
}
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Performing query: " + sql);
}
return db.rawQueryWithFactory(
mFactory, sql, selectionArgs,
SQLiteDatabase.findEditTable(mTables),
cancellationSignal); // will throw if query is invalid
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2018-9493
- Severity: LOW
- CVSS Score: 2.1
Description: DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.
Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks. This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.
Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
(cherry picked from commit 506994268bc4fa07d8798b7737a2952f74b8fd04)
Function: query
File: core/java/android/database/sqlite/SQLiteQueryBuilder.java
Repository: android
Fixed Code:
public Cursor query(SQLiteDatabase db, String[] projectionIn,
String selection, String[] selectionArgs, String groupBy,
String having, String sortOrder, String limit, CancellationSignal cancellationSignal) {
if (mTables == null) {
return null;
}
final String sql;
final String unwrappedSql = buildQuery(
projectionIn, selection, groupBy, having,
sortOrder, limit);
if (mStrict && selection != null && selection.length() > 0) {
// Validate the user-supplied selection to detect syntactic anomalies
// in the selection string that could indicate a SQL injection attempt.
// The idea is to ensure that the selection clause is a valid SQL expression
// by compiling it twice: once wrapped in parentheses and once as
// originally specified. An attacker cannot create an expression that
// would escape the SQL expression while maintaining balanced parentheses
// in both the wrapped and original forms.
// NOTE: The ordering of the below operations is important; we must
// execute the wrapped query to ensure the untrusted clause has been
// fully isolated.
// Validate the unwrapped query
db.validateSql(unwrappedSql, cancellationSignal); // will throw if query is invalid
// Execute wrapped query for extra protection
final String wrappedSql = buildQuery(projectionIn, wrap(selection), groupBy,
having, sortOrder, limit);
sql = wrappedSql;
} else {
// Execute unwrapped query
sql = unwrappedSql;
}
final String[] sqlArgs = selectionArgs;
if (Log.isLoggable(TAG, Log.DEBUG)) {
if (Build.IS_DEBUGGABLE) {
Log.d(TAG, sql + " with args " + Arrays.toString(sqlArgs));
} else {
Log.d(TAG, sql);
}
}
return db.rawQueryWithFactory(
mFactory, sql, sqlArgs,
SQLiteDatabase.findEditTable(mTables),
cancellationSignal); // will throw if query is invalid
}
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
query
|
core/java/android/database/sqlite/SQLiteQueryBuilder.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 1
|
Analyze the following code function for security vulnerabilities
|
private void broadcastIntentToCrossProfileManifestReceivers(
Intent intent, UserHandle userHandle, boolean requiresPermission) {
final int userId = userHandle.getIdentifier();
try {
final List<ResolveInfo> receivers = mIPackageManager.queryIntentReceivers(
intent, /* resolvedType= */ null,
STOCK_PM_FLAGS, userId).getList();
for (ResolveInfo receiver : receivers) {
final String packageName = receiver.getComponentInfo().packageName;
if (checkCrossProfilePackagePermissions(packageName, userId,
requiresPermission)
|| checkModifyQuietModePermission(packageName, userId)) {
Slogf.i(LOG_TAG, "Sending %s broadcast to %s.", intent.getAction(),
packageName);
final Intent packageIntent = new Intent(intent)
.setComponent(receiver.getComponentInfo().getComponentName())
.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
mContext.sendBroadcastAsUser(packageIntent, userHandle);
}
}
} catch (RemoteException ex) {
Slogf.w(LOG_TAG, "Cannot get list of broadcast receivers for %s because: %s.",
intent.getAction(), ex);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: broadcastIntentToCrossProfileManifestReceivers
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
|
broadcastIntentToCrossProfileManifestReceivers
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void performAuditoryFeedbackForAccessibilityIfNeed() {
if (!isGlobalAccessibilityGestureEnabled()) {
return;
}
AudioManager audioManager = (AudioManager) mContext.getSystemService(
Context.AUDIO_SERVICE);
if (audioManager.isSilentMode()) {
return;
}
Ringtone ringTone = RingtoneManager.getRingtone(mContext,
Settings.System.DEFAULT_NOTIFICATION_URI);
ringTone.setStreamType(AudioManager.STREAM_MUSIC);
ringTone.play();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performAuditoryFeedbackForAccessibilityIfNeed
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
performAuditoryFeedbackForAccessibilityIfNeed
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isDefaultSpace(String space) {
return DEFAULT_SPACE.equalsIgnoreCase(getSpaceId(space));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDefaultSpace
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
|
isDefaultSpace
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public void startLaunchTransitionTimeout() {
mHandler.sendEmptyMessageDelayed(MSG_LAUNCH_TRANSITION_TIMEOUT,
LAUNCH_TRANSITION_TIMEOUT_MS);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startLaunchTransitionTimeout
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
|
startLaunchTransitionTimeout
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUserUnlocked() {
inflateCameraPreview();
updateCameraVisibility();
updateLeftAffordance();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserUnlocked
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onUserUnlocked
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void updateNull(@Positive int columnIndex) throws SQLException {
checkColumnIndex(columnIndex);
String columnTypeName = getPGType(columnIndex);
updateValue(columnIndex, new NullObject(columnTypeName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateNull
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
updateNull
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder setRequestTimeoutInMs(int requestTimeoutInMs) {
this.requestTimeoutInMs = requestTimeoutInMs;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequestTimeoutInMs
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
setRequestTimeoutInMs
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onServiceConnected(ComponentName component, IBinder service) {
if (DEBUG) Slog.v(TAG, "Connected to transport " + component);
final String name = component.flattenToShortString();
try {
IBackupTransport transport = IBackupTransport.Stub.asInterface(service);
registerTransport(transport.name(), name, transport);
EventLog.writeEvent(EventLogTags.BACKUP_TRANSPORT_LIFECYCLE, name, 1);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to register transport " + component);
EventLog.writeEvent(EventLogTags.BACKUP_TRANSPORT_LIFECYCLE, name, 0);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onServiceConnected
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
|
onServiceConnected
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean useEvaluateJavascript() {
return android.os.Build.VERSION.SDK_INT >= 19;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useEvaluateJavascript
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
|
useEvaluateJavascript
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onUidIdle(int uid, boolean disabled) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUidIdle
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40092
|
MEDIUM
| 5.5
|
android
|
onUidIdle
|
services/core/java/com/android/server/pm/ShortcutService.java
|
a5e55363e69b3c84d3f4011c7b428edb1a25752c
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Object getFilter() {
return filter;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFilter
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2021-33609
|
MEDIUM
| 4
|
vaadin/framework
|
getFilter
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected int getCipherBlockSize() {
return AES_BLOCK_SIZE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCipherBlockSize
File: src/main/java/org/conscrypt/OpenSSLCipher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2461
|
HIGH
| 7.6
|
android
|
getCipherBlockSize
|
src/main/java/org/conscrypt/OpenSSLCipher.java
|
1638945d4ed9403790962ec7abed1b7a232a9ff8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public float getMaxTranslationDistance() {
return (float) Math.hypot(getWidth(), getHeight());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxTranslationDistance
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
getMaxTranslationDistance
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void backgroundAllowlistUid(final int uid) {
if (Binder.getCallingUid() != Process.SYSTEM_UID) {
throw new SecurityException("Only the OS may call backgroundAllowlistUid()");
}
if (DEBUG_BACKGROUND_CHECK) {
Slog.i(TAG, "Adding uid " + uid + " to bg uid allowlist");
}
synchronized (this) {
synchronized (mProcLock) {
final int num = mBackgroundAppIdAllowlist.length;
int[] newList = new int[num + 1];
System.arraycopy(mBackgroundAppIdAllowlist, 0, newList, 0, num);
newList[num] = UserHandle.getAppId(uid);
mBackgroundAppIdAllowlist = newList;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: backgroundAllowlistUid
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
backgroundAllowlistUid
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // since 2.6
public JavaType getReferencedType() { return null; }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReferencedType
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
|
getReferencedType
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override public void opChanged(int op, int uid, String packageName) {
if (op == AppOpsManager.OP_RUN_IN_BACKGROUND && packageName != null) {
if (mAppOpsService.checkOperation(op, uid, packageName)
!= AppOpsManager.MODE_ALLOWED) {
runInBackgroundDisabled(uid);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: opChanged
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
opChanged
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
void onParentChanged(ConfigurationContainer newParent, ConfigurationContainer oldParent) {
super.onParentChanged(newParent, oldParent);
setDrawnStateEvaluated(false /*evaluated*/);
getDisplayContent().reapplyMagnificationSpec();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onParentChanged
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
onParentChanged
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(CssHeaderItem.forReference(new BrandLogoCssResourceReference()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderHead
File: server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2022-39208
|
HIGH
| 7.5
|
theonedev/onedev
|
renderHead
|
server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java
|
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setStatusBar(StatusBar bar) {
mStatusBar = bar;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setStatusBar
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
setStatusBar
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.