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
|
@Deprecated // since 2.7
@Override
public Class<?> getParameterSource() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParameterSource
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
|
getParameterSource
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean shouldDisableNonVrUiLocked() {
return mVrController.shouldDisableNonVrUiLocked();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldDisableNonVrUiLocked
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
|
shouldDisableNonVrUiLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<PasspointConfiguration> getProviderConfigs(int callingUid,
boolean privileged) {
List<PasspointConfiguration> configs = new ArrayList<>();
for (Map.Entry<String, PasspointProvider> entry : mProviders.entrySet()) {
PasspointProvider provider = entry.getValue();
if (privileged || callingUid == provider.getCreatorUid()) {
if (provider.isFromSuggestion()) {
continue;
}
configs.add(provider.getConfig());
}
}
return configs;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviderConfigs
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
|
getProviderConfigs
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isValidNetworkSpecifier(WifiNetworkSpecifier specifier) {
PatternMatcher ssidPatternMatcher = specifier.ssidPatternMatcher;
Pair<MacAddress, MacAddress> bssidPatternMatcher = specifier.bssidPatternMatcher;
if (ssidPatternMatcher == null || bssidPatternMatcher == null) {
return false;
}
if (ssidPatternMatcher.getPath() == null || bssidPatternMatcher.first == null
|| bssidPatternMatcher.second == null) {
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isValidNetworkSpecifier
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
isValidNetworkSpecifier
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<String> getValidUsagesList() {
List<String> list = new ArrayList<>();
list.add(WRAP_USAGE);
list.add(UWRAP_USAGE);
list.add(DECRYPT_USAGE);
list.add(ENCRYPT_USAGE);
list.add(VERIFY_USAGE);
list.add(SIGN_USAGE);
return list;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValidUsagesList
File: base/common/src/main/java/com/netscape/certsrv/key/SymKeyGenerationRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getValidUsagesList
|
base/common/src/main/java/com/netscape/certsrv/key/SymKeyGenerationRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setNotificationPolicy(String pkg, Policy policy) {
enforcePolicyAccess(pkg, "setNotificationPolicy");
final long identity = Binder.clearCallingIdentity();
try {
mZenModeHelper.setNotificationPolicy(policy);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNotificationPolicy
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
setNotificationPolicy
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
void handleApplicationCrashInner(String eventType, ProcessRecord r, String processName,
ApplicationErrorReport.CrashInfo crashInfo) {
EventLog.writeEvent(EventLogTags.AM_CRASH, Binder.getCallingPid(),
UserHandle.getUserId(Binder.getCallingUid()), processName,
r == null ? -1 : r.info.flags,
crashInfo.exceptionClassName,
crashInfo.exceptionMessage,
crashInfo.throwFileName,
crashInfo.throwLineNumber);
addErrorToDropBox(eventType, r, processName, null, null, null, null, null, crashInfo);
crashApplication(r, crashInfo);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleApplicationCrashInner
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
|
handleApplicationCrashInner
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@SuppressWarnings({"PMD.AvoidCatchingThrowable", "PMD.AvoidInstanceofChecksInCatchClause"})
public void handle(HttpExchange pExchange) throws IOException {
if (requestHandler == null) {
throw new IllegalStateException("Handler not yet started");
}
JSONAware json = null;
URI uri = pExchange.getRequestURI();
ParsedUri parsedUri = new ParsedUri(uri,context);
try {
// Check access policy
InetSocketAddress address = pExchange.getRemoteAddress();
requestHandler.checkClientIPAccess(address.getHostName(),address.getAddress().getHostAddress());
String method = pExchange.getRequestMethod();
// Dispatch for the proper HTTP request method
if ("GET".equalsIgnoreCase(method)) {
setHeaders(pExchange);
json = executeGetRequest(parsedUri);
} else if ("POST".equalsIgnoreCase(method)) {
setHeaders(pExchange);
json = executePostRequest(pExchange, parsedUri);
} else if ("OPTIONS".equalsIgnoreCase(method)) {
performCorsPreflightCheck(pExchange);
} else {
throw new IllegalArgumentException("HTTP Method " + method + " is not supported.");
}
} catch (Throwable exp) {
json = requestHandler.handleThrowable(
exp instanceof RuntimeMBeanException ? ((RuntimeMBeanException) exp).getTargetException() : exp);
} finally {
sendResponse(pExchange,parsedUri,json);
}
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2014-0168
- Severity: MEDIUM
- CVSS Score: 6.8
Description: Enchanced policy wr to origin handling. The Origin: can now be checked on the server side, too.
Function: handle
File: agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
Repository: jolokia
Fixed Code:
@Override
@SuppressWarnings({"PMD.AvoidCatchingThrowable", "PMD.AvoidInstanceofChecksInCatchClause"})
public void handle(HttpExchange pExchange) throws IOException {
if (requestHandler == null) {
throw new IllegalStateException("Handler not yet started");
}
JSONAware json = null;
URI uri = pExchange.getRequestURI();
ParsedUri parsedUri = new ParsedUri(uri,context);
try {
// Check access policy
InetSocketAddress address = pExchange.getRemoteAddress();
requestHandler.checkAccess(address.getHostName(), address.getAddress().getHostAddress(),
extractOriginOrReferer(pExchange));
String method = pExchange.getRequestMethod();
// Dispatch for the proper HTTP request method
if ("GET".equalsIgnoreCase(method)) {
setHeaders(pExchange);
json = executeGetRequest(parsedUri);
} else if ("POST".equalsIgnoreCase(method)) {
setHeaders(pExchange);
json = executePostRequest(pExchange, parsedUri);
} else if ("OPTIONS".equalsIgnoreCase(method)) {
performCorsPreflightCheck(pExchange);
} else {
throw new IllegalArgumentException("HTTP Method " + method + " is not supported.");
}
} catch (Throwable exp) {
json = requestHandler.handleThrowable(
exp instanceof RuntimeMBeanException ? ((RuntimeMBeanException) exp).getTargetException() : exp);
} finally {
sendResponse(pExchange,parsedUri,json);
}
}
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
handle
|
agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 1
|
Analyze the following code function for security vulnerabilities
|
public SyncStatusInfo getSyncStatus(Account account, String authority, ComponentName cname) {
return getSyncStatusAsUser(account, authority, cname, UserHandle.getCallingUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSyncStatus
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
getSyncStatus
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onSendMmsComplete(int result, byte[] sendConfPdu) {
Rlog.e(TAG, "Unexpected onSendMmsComplete call with result: " + result);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSendMmsComplete
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
onSendMmsComplete
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addViolation(String propertyName, Integer index, String message) {
violationOccurred = true;
String messageTemplate = escapeEl(message);
context.buildConstraintViolationWithTemplate(messageTemplate)
.addPropertyNode(propertyName)
.addBeanNode().inIterable().atIndex(index)
.addConstraintViolation();
}
|
Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2020-11002
- Severity: HIGH
- CVSS Score: 9.0
Description: Disable message interpolation in ConstraintViolations by default (#3208)
Disable message interpolation in ConstraintViolations by default but allow enabling it explicitly with `SelfValidating#escapeExpressions()`.
Additionally, `ConstraintViolations` now provides a set of methods which take a map of message parameters for interpolation.
The message parameters will be escaped by default.
Refs #3153
Refs #3157
Function: addViolation
File: dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java
Repository: dropwizard
Fixed Code:
public void addViolation(String propertyName, Integer index, String message) {
addViolation(propertyName, index, message, Collections.emptyMap());
}
|
[
"CWE-74"
] |
CVE-2020-11002
|
HIGH
| 9
|
dropwizard
|
addViolation
|
dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java
|
d5a512f7abf965275f2a6b913ac4fe778e424242
| 1
|
Analyze the following code function for security vulnerabilities
|
protected T _deserializeWrappedValue(JsonParser p, DeserializationContext ctxt) throws IOException
{
// 23-Mar-2017, tatu: Let's specifically block recursive resolution to avoid
// either supporting nested arrays, or to cause infinite looping.
if (p.hasToken(JsonToken.START_ARRAY)) {
String msg = String.format(
"Cannot deserialize instance of %s out of %s token: nested Arrays not allowed with %s",
ClassUtil.nameOf(_valueClass), JsonToken.START_ARRAY,
"DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS");
@SuppressWarnings("unchecked")
T result = (T) ctxt.handleUnexpectedToken(getValueType(ctxt), p.currentToken(), p, msg);
return result;
}
return (T) deserialize(p, ctxt);
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2022-42003
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix #3590
Function: _deserializeWrappedValue
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
Fixed Code:
protected T _deserializeWrappedValue(JsonParser p, DeserializationContext ctxt) throws IOException
{
// 23-Mar-2017, tatu: Let's specifically block recursive resolution to avoid
// either supporting nested arrays, or to cause infinite looping.
if (p.hasToken(JsonToken.START_ARRAY)) {
@SuppressWarnings("unchecked")
T result = (T) handleNestedArrayForSingle(p, ctxt);
return result;
}
return (T) deserialize(p, ctxt);
}
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_deserializeWrappedValue
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 1
|
Analyze the following code function for security vulnerabilities
|
private static Proxy proxyFromHostPort(Proxy.Type type, String hostPortString) {
try {
String[] hostPort = hostPortString.split(":");
String host = hostPort[0];
int port = Integer.parseInt(hostPort[1]);
return new Proxy(type, InetSocketAddress.createUnresolved(host, port));
} catch (NumberFormatException|ArrayIndexOutOfBoundsException e) {
Log.d(TAG, "Unable to parse proxy " + hostPortString + " " + e);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: proxyFromHostPort
File: core/java/android/net/PacProxySelector.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3763
|
MEDIUM
| 5
|
android
|
proxyFromHostPort
|
core/java/android/net/PacProxySelector.java
|
ec2fc50d202d975447211012997fe425496c849c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initialize() {
synchronized (mLock) {
loadConfigurationLocked();
loadBaseStateLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initialize
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
|
initialize
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void doSaveAs(String fileextension) throws IOException {
boolean ownXmlFormat = fileextension.equals(Program.getInstance().getExtension());
JFileChooser fileChooser = createSaveFileChooser(!ownXmlFormat);
String fileName = chooseFileName(ownXmlFormat, filters.get(fileextension), fileChooser);
String extension = fileextensions.get(fileChooser.getFileFilter());
if (fileName == null) {
return; // If the filechooser has been closed without saving
}
if (!fileName.endsWith("." + extension)) {
fileName += "." + extension;
}
File fileToSave = new File(fileName);
Config.getInstance().setSaveFileHome(fileToSave.getParent());
if (extension.equals(Program.getInstance().getExtension())) {
file = fileToSave;
setFileName(file.getName());
save();
}
else {
lastExportFile = fileToSave;
doExportAs(extension, fileToSave);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doSaveAs
File: umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
Repository: umlet
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000548
|
MEDIUM
| 6.8
|
umlet
|
doSaveAs
|
umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java
|
e1c4cc6ae692cc8d1c367460dbf79343e996f9bd
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public Set<String> getNotificationSubscribers(String channelId) {
return ((List<String>) Optional.ofNullable(((Sysprop) pc.read(channelId))).
orElse(new Sysprop()).getProperties().getOrDefault("emails", Collections.emptyList())).
stream().collect(Collectors.toSet());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNotificationSubscribers
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
|
getNotificationSubscribers
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String renderMarkdown(String markdown) {
Project project ;
if (getPage() instanceof ProjectPage)
project = ((ProjectPage) getPage()).getProject();
else
project = null;
MarkdownManager manager = OneDev.getInstance(MarkdownManager.class);
return manager.process(manager.render(markdown), project, blobRenderContext);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderMarkdown
File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21242
|
HIGH
| 7.5
|
theonedev/onedev
|
renderMarkdown
|
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Mono<ActionExecutionResult> executeParameterized(APIConnection connection,
ExecuteActionDTO executeActionDTO,
DatasourceConfiguration datasourceConfiguration,
ActionConfiguration actionConfiguration) {
Boolean smartJsonSubstitution;
final List<Property> properties = actionConfiguration.getPluginSpecifiedTemplates();
List<Map.Entry<String, String>> parameters = new ArrayList<>();
if (CollectionUtils.isEmpty(properties)) {
// In case the smart json substitution configuration is missing, default to true
smartJsonSubstitution = true;
// Since properties is not empty, we are guaranteed to find the first property.
} else if (properties.get(SMART_JSON_SUBSTITUTION_INDEX) != null) {
Object ssubValue = properties.get(SMART_JSON_SUBSTITUTION_INDEX).getValue();
if (ssubValue instanceof Boolean) {
smartJsonSubstitution = (Boolean) ssubValue;
} else if (ssubValue instanceof String) {
smartJsonSubstitution = Boolean.parseBoolean((String) ssubValue);
} else {
smartJsonSubstitution = true;
}
} else {
smartJsonSubstitution = true;
}
// Smartly substitute in actionConfiguration.body and replace all the bindings with values.
if (TRUE.equals(smartJsonSubstitution)) {
// Do smart replacements in JSON body
if (actionConfiguration.getBody() != null) {
// First extract all the bindings in order
List<String> mustacheKeysInOrder = MustacheHelper.extractMustacheKeysInOrder(actionConfiguration.getBody());
// Replace all the bindings with a ? as expected in a prepared statement.
String updatedBody = MustacheHelper.replaceMustacheWithPlaceholder(actionConfiguration.getBody(), mustacheKeysInOrder);
try {
updatedBody = (String) smartSubstitutionOfBindings(updatedBody,
mustacheKeysInOrder,
executeActionDTO.getParams(),
parameters);
} catch (AppsmithPluginException e) {
ActionExecutionResult errorResult = new ActionExecutionResult();
errorResult.setIsExecutionSuccess(false);
errorResult.setErrorInfo(e);
errorResult.setStatusCode(AppsmithPluginError.PLUGIN_ERROR.getAppErrorCode().toString());
return Mono.just(errorResult);
}
actionConfiguration.setBody(updatedBody);
}
}
prepareConfigurationsForExecution(executeActionDTO, actionConfiguration, datasourceConfiguration);
// If the action is paginated, update the configurations to update the correct URL.
if (actionConfiguration.getPaginationType() != null &&
PaginationType.URL.equals(actionConfiguration.getPaginationType()) &&
executeActionDTO.getPaginationField() != null) {
updateDatasourceConfigurationForPagination(actionConfiguration, datasourceConfiguration, executeActionDTO.getPaginationField());
updateActionConfigurationForPagination(actionConfiguration, executeActionDTO.getPaginationField());
}
// Filter out any empty headers
if (actionConfiguration.getHeaders() != null && !actionConfiguration.getHeaders().isEmpty()) {
List<Property> headerList = actionConfiguration.getHeaders().stream()
.filter(header -> !org.springframework.util.StringUtils.isEmpty(header.getKey()))
.collect(Collectors.toList());
actionConfiguration.setHeaders(headerList);
}
return this.executeCommon(connection, datasourceConfiguration, actionConfiguration, parameters);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeParameterized
File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
Repository: appsmithorg/appsmith
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-38298
|
HIGH
| 8.8
|
appsmithorg/appsmith
|
executeParameterized
|
app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
|
c59351ef94f9780c2a1ffc991e29b9272ab9fe64
| 0
|
Analyze the following code function for security vulnerabilities
|
private void fetchNodeInfo(ProxiedResourceHelper proxiedResourceHelper, String nodeId, Path nodeDir) {
try (var threadDumpFile = new FileOutputStream(nodeDir.resolve("thread-dump.txt").toFile())) {
final ProxiedResource.NodeResponse<SystemThreadDumpResponse> dump = proxiedResourceHelper.doNodeApiCall(nodeId,
RemoteSystemResource.class, RemoteSystemResource::threadDump, Function.identity(), CALL_TIMEOUT
);
if (dump.entity().isPresent()) {
threadDumpFile.write(dump.entity().get().threadDump().getBytes(StandardCharsets.UTF_8));
}
} catch (Exception e) {
LOG.warn("Failed to get threadDump from node <{}>", nodeId, e);
}
try (var nodeMetricsFile = new FileOutputStream(nodeDir.resolve("metrics.json").toFile())) {
final ProxiedResource.NodeResponse<MetricsSummaryResponse> metrics = proxiedResourceHelper.doNodeApiCall(nodeId,
RemoteMetricsResource.class, c -> c.byNamespace("org"), Function.identity(), CALL_TIMEOUT
);
if (metrics.entity().isPresent()) {
objectMapper.writerWithDefaultPrettyPrinter().writeValue(nodeMetricsFile, metrics.entity().get());
}
} catch (Exception e) {
LOG.warn("Failed to get metrics from node <{}>", nodeId, e);
}
try (var systemStatsFile = new FileOutputStream(nodeDir.resolve("system-stats.json").toFile())) {
final ProxiedResource.NodeResponse<SystemStats> statsResponse = proxiedResourceHelper.doNodeApiCall(nodeId,
RemoteSystemStatsResource.class, RemoteSystemStatsResource::systemStats, Function.identity(), CALL_TIMEOUT
);
if (statsResponse.entity().isPresent()) {
objectMapper.writerWithDefaultPrettyPrinter().writeValue(systemStatsFile, statsResponse.entity().get());
}
} catch (Exception e) {
LOG.warn("Failed to get system stats from node <{}>", nodeId, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fetchNodeInfo
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-41044
|
LOW
| 3.8
|
Graylog2/graylog2-server
|
fetchNodeInfo
|
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
|
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
| 0
|
Analyze the following code function for security vulnerabilities
|
Collection<V> values();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: values
File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
values
|
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void startAnimation() {
if (mAnimator != null) {
mAnimator.start();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startAnimation
File: core/java/com/android/internal/app/ChooserActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-254",
"CWE-19"
] |
CVE-2016-3752
|
HIGH
| 7.5
|
android
|
startAnimation
|
core/java/com/android/internal/app/ChooserActivity.java
|
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public void setPopupZoomerForTest(PopupZoomer popupZoomer) {
mPopupZoomer = popupZoomer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPopupZoomerForTest
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
|
setPopupZoomerForTest
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Traverser<File> fileTraverser() {
return Traverser.forTree(FILE_TREE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fileTraverser
File: android/guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2023-2976
|
HIGH
| 7.1
|
google/guava
|
fileTraverser
|
android/guava/src/com/google/common/io/Files.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresApi(api = Build.VERSION_CODES.M)
public static BiometricPrompt.CryptoObject getCryptoObject() {
return cryptoObject;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCryptoObject
File: app/src/main/java/com/nextcloud/talk/utils/SecurityUtils.java
Repository: nextcloud/talk-android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-22473
|
LOW
| 2.1
|
nextcloud/talk-android
|
getCryptoObject
|
app/src/main/java/com/nextcloud/talk/utils/SecurityUtils.java
|
12cb7e423bcb3cc8def9a41d3e4a9bb75738b6a9
| 0
|
Analyze the following code function for security vulnerabilities
|
void setLaunchSource(int uid) {
mLaunchingActivity.setWorkSource(new WorkSource(uid));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLaunchSource
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
|
setLaunchSource
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Unstable
public void readAddedUpdatedAndRemovedObjectsFromForm(EditForm eform, XWikiContext context) throws XWikiException
{
// We add the new objects that have been submitted in the form, before filling them with their values.
Map<String, List<Integer>> objectsToAdd = eform.getObjectsToAdd();
for (String className : objectsToAdd.keySet()) {
DocumentReference classReference = resolveClassReference(className);
List<Integer> classIds = objectsToAdd.get(className);
for (Integer classId : classIds) {
// we ensure that the object has not been added yet, for example because of the update or create.
getXObject(classReference, classId, true, context);
}
}
ObjectPolicyType objectPolicy = eform.getObjectPolicy();
if (objectPolicy == null || objectPolicy.equals(ObjectPolicyType.UPDATE)) {
readObjectsFromForm(eform, context);
} else if (objectPolicy.equals(ObjectPolicyType.UPDATE_OR_CREATE)) {
readObjectsFromFormUpdateOrCreate(eform, context);
}
// remove xobjects
Map<String, List<Integer>> objectsToRemove = eform.getObjectsToRemove();
for (String className : objectsToRemove.keySet()) {
DocumentReference classReference = resolveClassReference(className);
List<Integer> classIds = objectsToRemove.get(className);
for (Integer classId : classIds) {
BaseObject xObject = getXObject(classReference, classId);
if (xObject != null) {
removeXObject(xObject);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readAddedUpdatedAndRemovedObjectsFromForm
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
|
readAddedUpdatedAndRemovedObjectsFromForm
|
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
|
@Deprecated(since = "3.0M3")
public void setAuthor(String author)
{
setAuthorReference(userStringToReference(author));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAuthor
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
|
setAuthor
|
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
|
@RequiresPermissions("user:edit")
@PostMapping("/edit")
@ResponseBody
public Result update(User user) {
// 如果密码不为空,给加密一下再保存
if (!StringUtils.isEmpty(user.getPassword())) {
user.setPassword(new BCryptPasswordEncoder().encode(user.getPassword()));
} else {
user.setPassword(null);
}
// 如果邮件接收通知没有勾选,user对象里的属性就是null,手动设置成false
if (user.getEmailNotification() == null) user.setEmailNotification(false);
userService.update(user);
return success();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
update
|
src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void killProcessesForRemovedTask(ArrayList<Object> procsToKill) {
synchronized (ActivityManagerService.this) {
for (int i = 0; i < procsToKill.size(); i++) {
final WindowProcessController wpc =
(WindowProcessController) procsToKill.get(i);
final ProcessRecord pr = (ProcessRecord) wpc.mOwner;
if (pr.mState.getSetSchedGroup() == ProcessList.SCHED_GROUP_BACKGROUND
&& pr.mReceivers.numberOfCurReceivers() == 0) {
pr.killLocked("remove task", ApplicationExitInfo.REASON_USER_REQUESTED,
ApplicationExitInfo.SUBREASON_REMOVE_TASK, true);
} else {
// We delay killing processes that are not in the background or running a
// receiver.
pr.setWaitingToKill("remove task");
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killProcessesForRemovedTask
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
|
killProcessesForRemovedTask
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(sender.asBinder());
data.writeInt(sourceUid);
data.writeString(tag);
mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
data.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: noteAlarmFinish
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
noteAlarmFinish
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public long getMinRoamingDownlinkBandwidth() {
return mMinRoamingDownlinkBandwidth;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinRoamingDownlinkBandwidth
File: framework/java/android/net/wifi/hotspot2/pps/Policy.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21240
|
MEDIUM
| 5.5
|
android
|
getMinRoamingDownlinkBandwidth
|
framework/java/android/net/wifi/hotspot2/pps/Policy.java
|
69119d1d3102e27b6473c785125696881bce9563
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void init(final Hints hints) {
init();
if (hints != null) {
// This will trigger fireConfigurationChanged()
Hints.putSystemDefault(hints);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: init
File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
init
|
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
public static synchronized void clearInitialContext() throws NamingException {
if (context != null) {
context.close();
}
context = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearInitialContext
File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
clearInitialContext
|
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
setOauthBasePath(basePath);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBasePath
File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setBasePath
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean changeMessageDeliveryStatus(String packetID, int new_status) {
ContentValues cv = new ContentValues();
cv.put(ChatConstants.DELIVERY_STATUS, new_status);
Uri rowuri = Uri.parse("content://" + ChatProvider.AUTHORITY + "/"
+ ChatProvider.TABLE_NAME);
return mContentResolver.update(rowuri, cv,
ChatConstants.PACKET_ID + " = ? AND " +
ChatConstants.DELIVERY_STATUS + " != " + ChatConstants.DS_ACKED + " AND " +
ChatConstants.DIRECTION + " = " + ChatConstants.OUTGOING,
new String[] { packetID }) > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: changeMessageDeliveryStatus
File: src/org/yaxim/androidclient/service/SmackableImp.java
Repository: ge0rg/yaxim
The code follows secure coding practices.
|
[
"CWE-20",
"CWE-346"
] |
CVE-2017-5589
|
MEDIUM
| 4.3
|
ge0rg/yaxim
|
changeMessageDeliveryStatus
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ResourceInfo findResource(LibraryInfo library,
String resourceName,
String localePrefix,
boolean compressable,
FacesContext ctx) {
resourceName = trimLeadingSlash(resourceName);
ContractInfo [] outContract = new ContractInfo[1];
outContract[0] = null;
String basePath = findPathConsideringContracts(library, resourceName,
localePrefix, outContract, ctx);
if (null == basePath) {
if (library != null) {
// PENDING(fcaputo) no need to iterate over the contracts, if we have a library
basePath = library.getPath(localePrefix) + '/' + resourceName;
} else {
if (localePrefix == null) {
basePath = getBaseResourcePath() + '/' + resourceName;
} else {
basePath = getBaseResourcePath()
+ '/'
+ localePrefix
+ '/'
+ resourceName;
}
}
// first check to see if the resource exists, if not, return null. Let
// the caller decide what to do.
try {
if (ctx.getExternalContext().getResource(basePath) == null) {
return null;
}
} catch (MalformedURLException e) {
throw new FacesException(e);
}
}
// we got to hear, so we know the resource exists (either as a directory
// or file)
Set<String> resourcePaths =
ctx.getExternalContext().getResourcePaths(basePath);
// if getResourcePaths returns null or an empty set, this means that we have
// a non-directory resource, therefor, this resource isn't versioned.
ClientResourceInfo value;
if (resourcePaths == null || resourcePaths.size() == 0) {
if (library != null) {
value = new ClientResourceInfo(library,
outContract[0],
resourceName,
null,
compressable,
resourceSupportsEL(resourceName, library.getName(), ctx),
ctx.isProjectStage(ProjectStage.Development),
cacheTimestamp);
} else {
value = new ClientResourceInfo(outContract[0],
resourceName,
null,
localePrefix,
this,
compressable,
resourceSupportsEL(resourceName, null, ctx),
ctx.isProjectStage(ProjectStage.Development),
cacheTimestamp);
}
} else {
// ok, subdirectories exist, so find the latest 'version' directory
VersionInfo version = getVersion(resourcePaths, true);
if (version == null && LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING,
"jsf.application.resource.unable_to_determine_resource_version.",
resourceName);
}
if (library != null) {
value = new ClientResourceInfo(library,
outContract[0],
resourceName,
version,
compressable,
resourceSupportsEL(resourceName, library.getName(), ctx),
ctx.isProjectStage(ProjectStage.Development),
cacheTimestamp);
} else {
value = new ClientResourceInfo(outContract[0],
resourceName,
version,
localePrefix,
this,
compressable,
resourceSupportsEL(resourceName, null, ctx),
ctx.isProjectStage(ProjectStage.Development),
cacheTimestamp);
}
}
if (value.isCompressable()) {
value = handleCompression(value);
}
return value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findResource
File: impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-6950
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
findResource
|
impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
|
cefbb9447e7be560e59da2da6bd7cb93776f7741
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void setMaster(boolean master) {
CmsVersion.master = master;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMaster
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-29784
|
MEDIUM
| 5
|
sanluan/PublicCMS
|
setMaster
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
|
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getAppShellTitle() {
return appShellTitle;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppShellTitle
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
getAppShellTitle
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
public void checkAccount() {
if (mCurrentAccount >= mAccountsOfType.length) {
sendResult();
return;
}
final IAccountAuthenticator accountAuthenticator = mAuthenticator;
if (accountAuthenticator == null) {
// It is possible that the authenticator has died, which is indicated by
// mAuthenticator being set to null. If this happens then just abort.
// There is no need to send back a result or error in this case since
// that already happened when mAuthenticator was cleared.
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "checkAccount: aborting session since we are no longer"
+ " connected to the authenticator, " + toDebugString());
}
return;
}
try {
accountAuthenticator.hasFeatures(this, mAccountsOfType[mCurrentAccount], mFeatures);
} catch (RemoteException e) {
onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, "remote exception");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAccount
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
|
checkAccount
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void removeAdministrators(Context context, Collection collection) throws SQLException, AuthorizeException {
// Check authorisation - Must be an Admin of the parent community to delete Admin Group
AuthorizeUtil.authorizeRemoveAdminGroup(context, collection);
Group admins = collection.getAdministrators();
// just return if there is no administrative group.
if (admins == null) {
return;
}
// Remove the link to the collection table.
collection.setAdmins(null);
context.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, collection.getID(),
null, getIdentifiers(context, collection)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeAdministrators
File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
removeAdministrators
|
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getOffsetToLeftOf(int offset) {
return getOffsetToLeftRightOf(offset, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOffsetToLeftOf
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getOffsetToLeftOf
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setUser(User user) {
delegatedUserHolder.set(user);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUser
File: modules/kernel/src/main/java/org/opencastproject/kernel/security/SecurityServiceSpringImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2020-5206
|
MEDIUM
| 6.4
|
opencast
|
setUser
|
modules/kernel/src/main/java/org/opencastproject/kernel/security/SecurityServiceSpringImpl.java
|
b157e1fb3b35991ca7bf59f0730329fbe7ce82e8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setItemGroupAndItemMetaWithUnitTypesExpected() {
this.unsetTypeExpected();
this.setTypeExpected(1, TypeNames.INT);// crf_id
this.setTypeExpected(2, TypeNames.INT);// crf_version_id
this.setTypeExpected(3, TypeNames.INT);// item_group_id
this.setTypeExpected(4, TypeNames.INT);// item_id
this.setTypeExpected(5, TypeNames.INT);// response_set_id
this.setTypeExpected(6, TypeNames.STRING);// crf_version_oid
this.setTypeExpected(7, TypeNames.STRING);// item_group_oid
this.setTypeExpected(8, TypeNames.STRING);// item_oid
this.setTypeExpected(9, TypeNames.STRING); // item_group_name
this.setTypeExpected(10, TypeNames.STRING);// item_name
this.setTypeExpected(11, TypeNames.INT);// item_data_type_id
this.setTypeExpected(12, TypeNames.STRING);// item_header
this.setTypeExpected(13, TypeNames.STRING);// left_item_text
this.setTypeExpected(14, TypeNames.STRING);// right_item_text
this.setTypeExpected(15, TypeNames.BOOL);// item_required
this.setTypeExpected(16, TypeNames.STRING);// regexp
this.setTypeExpected(17, TypeNames.STRING);// regexp_error_msg
this.setTypeExpected(18, TypeNames.STRING);// width_decimal
this.setTypeExpected(19, TypeNames.INT);// response_type_id
this.setTypeExpected(20, TypeNames.STRING);// options_text
this.setTypeExpected(21, TypeNames.STRING);// options_values
this.setTypeExpected(22, TypeNames.STRING);// response_label
this.setTypeExpected(23, TypeNames.STRING);// item_group_header
this.setTypeExpected(24,TypeNames.BOOL);//is Repeating?
this.setTypeExpected(25, TypeNames.STRING);// item_description
this.setTypeExpected(26, TypeNames.INT);// section_id
this.setTypeExpected(27, TypeNames.STRING); // question_number_label
this.setTypeExpected(28, TypeNames.STRING);// mu_oid
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setItemGroupAndItemMetaWithUnitTypesExpected
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
setItemGroupAndItemMetaWithUnitTypesExpected
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
public AntiSamyPattern getCommonRegularExpressions(String name) {
return commonRegularExpressions.get(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommonRegularExpressions
File: src/main/java/org/owasp/validator/html/Policy.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-14735
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
getCommonRegularExpressions
|
src/main/java/org/owasp/validator/html/Policy.java
|
82da009e733a989a57190cd6aa1b6824724f6d36
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateAccountAuthentication() throws AccountNotFoundException {
Bundle response = new Bundle();
response.putString(AccountManager.KEY_ACCOUNT_NAME, mAccount.name);
response.putString(AccountManager.KEY_ACCOUNT_TYPE, mAccount.type);
response.putString(AccountManager.KEY_AUTHTOKEN, webViewPassword);
mAccountMgr.setPassword(mAccount, webViewPassword);
// remove managed clients for this account to enforce creation with fresh credentials
OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, this);
OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(ocAccount);
setAccountAuthenticatorResult(response);
Intent intent = new Intent();
intent.putExtras(response);
setResult(RESULT_OK, intent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAccountAuthentication
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
updateAccountAuthentication
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Exported(visibility = 3)
public String getUserName() {
String userName = "anonymous";
if (userId != null) {
User user = User.get(userId, false);
if (user != null)
userName = user.getDisplayName();
}
return userName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserName
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2067
|
LOW
| 3.5
|
jenkinsci/jenkins
|
getUserName
|
core/src/main/java/hudson/model/Cause.java
|
5d57c855f3147bfc5e7fda9252317b428a700014
| 0
|
Analyze the following code function for security vulnerabilities
|
public IntentBuilder setForFingerprint(boolean forFingerprint) {
mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, forFingerprint);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setForFingerprint
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
setForFingerprint
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addStateMonitorCallback(IKeyguardStateCallback callback) {
synchronized (this) {
mKeyguardStateCallbacks.add(callback);
try {
callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure());
callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser());
callback.onInputRestrictedStateChanged(mInputRestricted);
callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust(
KeyguardUpdateMonitor.getCurrentUser()));
} catch (RemoteException e) {
Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addStateMonitorCallback
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
|
addStateMonitorCallback
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasGrantedPolicy(@NonNull ComponentName admin, int usesPolicy) {
throwIfParentInstance("hasGrantedPolicy");
if (mService != null) {
try {
return mService.hasGrantedPolicy(admin, usesPolicy, myUserId());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasGrantedPolicy
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
hasGrantedPolicy
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseDelegates(final List<Element> delegateList) throws GameParseException {
final DelegateList delegates = data.getDelegateList();
for (final Element current : delegateList) {
// load the class
final String className = current.getAttribute("javaClass");
final IDelegate delegate = xmlGameElementMapper.newDelegate(className)
.orElseThrow(() -> newGameParseException("Class <" + className + "> is not a delegate."));
final String name = current.getAttribute("name");
String displayName = current.getAttribute("display");
if (displayName == null) {
displayName = name;
}
delegate.initialize(name, displayName);
delegates.addDelegate(delegate);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDelegates
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
|
parseDelegates
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
public int countUsersWithRole(final String roleid) throws IOException {
update();
m_readLock.lock();
try {
final String[] users = _getUsersWithRole(roleid);
if (users == null) return 0;
return users.length;
} finally {
m_readLock.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: countUsersWithRole
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
countUsersWithRole
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean syncQueryPasspointIcon(long bssid, String fileName) {
return mWifiThreadRunner.call(
() -> mPasspointManager.queryPasspointIcon(bssid, fileName), false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: syncQueryPasspointIcon
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
|
syncQueryPasspointIcon
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) {
final boolean keyguardOn = keyguardOn();
final int keyCode = event.getKeyCode();
final int repeatCount = event.getRepeatCount();
final int metaState = event.getMetaState();
final int flags = event.getFlags();
final boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
final boolean canceled = event.isCanceled();
if (DEBUG_INPUT) {
Log.d(TAG, "interceptKeyTi keyCode=" + keyCode + " down=" + down + " repeatCount="
+ repeatCount + " keyguardOn=" + keyguardOn + " mHomePressed=" + mHomePressed
+ " canceled=" + canceled);
}
// If we think we might have a volume down & power key chord on the way
// but we're not sure, then tell the dispatcher to wait a little while and
// try again later before dispatching.
if (mScreenshotChordEnabled && (flags & KeyEvent.FLAG_FALLBACK) == 0) {
if (mScreenshotChordVolumeDownKeyTriggered && !mScreenshotChordPowerKeyTriggered) {
final long now = SystemClock.uptimeMillis();
final long timeoutTime = mScreenshotChordVolumeDownKeyTime
+ SCREENSHOT_CHORD_DEBOUNCE_DELAY_MILLIS;
if (now < timeoutTime) {
return timeoutTime - now;
}
}
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
&& mScreenshotChordVolumeDownKeyConsumed) {
if (!down) {
mScreenshotChordVolumeDownKeyConsumed = false;
}
return -1;
}
}
// Cancel any pending meta actions if we see any other keys being pressed between the down
// of the meta key and its corresponding up.
if (mPendingMetaAction && !KeyEvent.isMetaKey(keyCode)) {
mPendingMetaAction = false;
}
// First we always handle the home key here, so applications
// can never break it, although if keyguard is on, we do let
// it handle it, because that gives us the correct 5 second
// timeout.
if (keyCode == KeyEvent.KEYCODE_HOME) {
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
if (!down) {
cancelPreloadRecentApps();
mHomePressed = false;
if (mHomeConsumed) {
mHomeConsumed = false;
return -1;
}
if (canceled) {
Log.i(TAG, "Ignoring HOME; event canceled.");
return -1;
}
// If an incoming call is ringing, HOME is totally disabled.
// (The user is already on the InCallUI at this point,
// and his ONLY options are to answer or reject the call.)
TelecomManager telecomManager = getTelecommService();
if (telecomManager != null && telecomManager.isRinging()) {
Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
return -1;
}
// Delay handling home if a double-tap is possible.
if (mDoubleTapOnHomeBehavior != DOUBLE_TAP_HOME_NOTHING) {
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable); // just in case
mHomeDoubleTapPending = true;
mHandler.postDelayed(mHomeDoubleTapTimeoutRunnable,
ViewConfiguration.getDoubleTapTimeout());
return -1;
}
handleShortPressOnHome();
return -1;
}
// If a system window has focus, then it doesn't make sense
// right now to interact with applications.
WindowManager.LayoutParams attrs = win != null ? win.getAttrs() : null;
if (attrs != null) {
final int type = attrs.type;
if (type == WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM
|| type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
|| (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
// the "app" is keyguard, so give it the key
return 0;
}
final int typeCount = WINDOW_TYPES_WHERE_HOME_DOESNT_WORK.length;
for (int i=0; i<typeCount; i++) {
if (type == WINDOW_TYPES_WHERE_HOME_DOESNT_WORK[i]) {
// don't do anything, but also don't pass it to the app
return -1;
}
}
}
// Remember that home is pressed and handle special actions.
if (repeatCount == 0) {
mHomePressed = true;
if (mHomeDoubleTapPending) {
mHomeDoubleTapPending = false;
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable);
handleDoubleTapOnHome();
} else if (mLongPressOnHomeBehavior == LONG_PRESS_HOME_RECENT_SYSTEM_UI
|| mDoubleTapOnHomeBehavior == DOUBLE_TAP_HOME_RECENT_SYSTEM_UI) {
preloadRecentApps();
}
} else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
if (!keyguardOn) {
handleLongPressOnHome();
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
// Hijack modified menu keys for debugging features
final int chordBug = KeyEvent.META_SHIFT_ON;
if (down && repeatCount == 0) {
if (mEnableShiftMenuBugReports && (metaState & chordBug) == chordBug) {
Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT,
null, null, null, 0, null, null);
return -1;
} else if (SHOW_PROCESSES_ON_ALT_MENU &&
(metaState & KeyEvent.META_ALT_ON) == KeyEvent.META_ALT_ON) {
Intent service = new Intent();
service.setClassName(mContext, "com.android.server.LoadAverageService");
ContentResolver res = mContext.getContentResolver();
boolean shown = Settings.Global.getInt(
res, Settings.Global.SHOW_PROCESSES, 0) != 0;
if (!shown) {
mContext.startService(service);
} else {
mContext.stopService(service);
}
Settings.Global.putInt(
res, Settings.Global.SHOW_PROCESSES, shown ? 0 : 1);
return -1;
}
}
} else if (keyCode == KeyEvent.KEYCODE_SEARCH) {
if (down) {
if (repeatCount == 0) {
mSearchKeyShortcutPending = true;
mConsumeSearchKeyUp = false;
}
} else {
mSearchKeyShortcutPending = false;
if (mConsumeSearchKeyUp) {
mConsumeSearchKeyUp = false;
return -1;
}
}
return 0;
} else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
if (!keyguardOn) {
if (down && repeatCount == 0) {
preloadRecentApps();
} else if (!down) {
toggleRecentApps();
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_ASSIST) {
if (down) {
if (repeatCount == 0) {
mAssistKeyLongPressed = false;
} else if (repeatCount == 1) {
mAssistKeyLongPressed = true;
if (!keyguardOn) {
launchAssistLongPressAction();
}
}
} else {
if (mAssistKeyLongPressed) {
mAssistKeyLongPressed = false;
} else {
if (!keyguardOn) {
launchAssistAction();
}
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_VOICE_ASSIST) {
if (!down) {
Intent voiceIntent;
if (!keyguardOn) {
voiceIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
} else {
voiceIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, true);
}
startActivityAsUser(voiceIntent, UserHandle.CURRENT_OR_SELF);
}
} else if (keyCode == KeyEvent.KEYCODE_SYSRQ) {
if (down && repeatCount == 0) {
mHandler.post(mScreenshotRunnable);
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP
|| keyCode == KeyEvent.KEYCODE_BRIGHTNESS_DOWN) {
if (down) {
int direction = keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP ? 1 : -1;
// Disable autobrightness if it's on
int auto = Settings.System.getIntForUser(
mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
UserHandle.USER_CURRENT_OR_SELF);
if (auto != 0) {
Settings.System.putIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
UserHandle.USER_CURRENT_OR_SELF);
}
int min = mPowerManager.getMinimumScreenBrightnessSetting();
int max = mPowerManager.getMaximumScreenBrightnessSetting();
int step = (max - min + BRIGHTNESS_STEPS - 1) / BRIGHTNESS_STEPS * direction;
int brightness = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS,
mPowerManager.getDefaultScreenBrightnessSetting(),
UserHandle.USER_CURRENT_OR_SELF);
brightness += step;
// Make sure we don't go beyond the limits.
brightness = Math.min(max, brightness);
brightness = Math.max(min, brightness);
Settings.System.putIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, brightness,
UserHandle.USER_CURRENT_OR_SELF);
startActivityAsUser(new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG),
UserHandle.CURRENT_OR_SELF);
}
return -1;
} else if (KeyEvent.isMetaKey(keyCode)) {
if (down) {
mPendingMetaAction = true;
} else if (mPendingMetaAction) {
launchAssistAction(Intent.EXTRA_ASSIST_INPUT_HINT_KEYBOARD);
}
return -1;
}
// Shortcuts are invoked through Search+key, so intercept those here
// Any printing key that is chorded with Search should be consumed
// even if no shortcut was invoked. This prevents text from being
// inadvertently inserted when using a keyboard that has built-in macro
// shortcut keys (that emit Search+x) and some of them are not registered.
if (mSearchKeyShortcutPending) {
final KeyCharacterMap kcm = event.getKeyCharacterMap();
if (kcm.isPrintingKey(keyCode)) {
mConsumeSearchKeyUp = true;
mSearchKeyShortcutPending = false;
if (down && repeatCount == 0 && !keyguardOn) {
Intent shortcutIntent = mShortcutManager.getIntent(kcm, keyCode, metaState);
if (shortcutIntent != null) {
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(shortcutIntent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping shortcut key combination because "
+ "the activity to which it is registered was not found: "
+ "SEARCH+" + KeyEvent.keyCodeToString(keyCode), ex);
}
} else {
Slog.i(TAG, "Dropping unregistered shortcut key combination: "
+ "SEARCH+" + KeyEvent.keyCodeToString(keyCode));
}
}
return -1;
}
}
// Invoke shortcuts using Meta.
if (down && repeatCount == 0 && !keyguardOn
&& (metaState & KeyEvent.META_META_ON) != 0) {
final KeyCharacterMap kcm = event.getKeyCharacterMap();
if (kcm.isPrintingKey(keyCode)) {
Intent shortcutIntent = mShortcutManager.getIntent(kcm, keyCode,
metaState & ~(KeyEvent.META_META_ON
| KeyEvent.META_META_LEFT_ON | KeyEvent.META_META_RIGHT_ON));
if (shortcutIntent != null) {
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(shortcutIntent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping shortcut key combination because "
+ "the activity to which it is registered was not found: "
+ "META+" + KeyEvent.keyCodeToString(keyCode), ex);
}
return -1;
}
}
}
// Handle application launch keys.
if (down && repeatCount == 0 && !keyguardOn) {
String category = sApplicationLaunchKeyCategories.get(keyCode);
if (category != null) {
Intent intent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, category);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(intent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping application launch key because "
+ "the activity to which it is registered was not found: "
+ "keyCode=" + keyCode + ", category=" + category, ex);
}
return -1;
}
}
// Display task switcher for ALT-TAB.
if (down && repeatCount == 0 && keyCode == KeyEvent.KEYCODE_TAB) {
if (mRecentAppsHeldModifiers == 0 && !keyguardOn) {
final int shiftlessModifiers = event.getModifiers() & ~KeyEvent.META_SHIFT_MASK;
if (KeyEvent.metaStateHasModifiers(shiftlessModifiers, KeyEvent.META_ALT_ON)) {
mRecentAppsHeldModifiers = shiftlessModifiers;
showRecentApps(true);
return -1;
}
}
} else if (!down && mRecentAppsHeldModifiers != 0
&& (metaState & mRecentAppsHeldModifiers) == 0) {
mRecentAppsHeldModifiers = 0;
hideRecentApps(true, false);
}
// Handle keyboard language switching.
if (down && repeatCount == 0
&& (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
|| (keyCode == KeyEvent.KEYCODE_SPACE
&& (metaState & KeyEvent.META_CTRL_MASK) != 0))) {
int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
mWindowManagerFuncs.switchKeyboardLayout(event.getDeviceId(), direction);
return -1;
}
if (mLanguageSwitchKeyPressed && !down
&& (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
|| keyCode == KeyEvent.KEYCODE_SPACE)) {
mLanguageSwitchKeyPressed = false;
return -1;
}
if (isValidGlobalKey(keyCode)
&& mGlobalKeyManager.handleGlobalKey(mContext, keyCode, event)) {
return -1;
}
// Reserve all the META modifier combos for system behavior
if ((metaState & KeyEvent.META_META_ON) != 0) {
return -1;
}
// Let the application handle the key.
return 0;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2016-0812
- Severity: MEDIUM
- CVSS Score: 6.6
Description: DO NOT MERGE. Prevent recents from coming up when in SUW
Bug: 25229538
Change-Id: If4f276d3f7c04fd89011068d90a3c3c60593bc05
Function: interceptKeyBeforeDispatching
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
Fixed Code:
@Override
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) {
final boolean keyguardOn = keyguardOn();
final int keyCode = event.getKeyCode();
final int repeatCount = event.getRepeatCount();
final int metaState = event.getMetaState();
final int flags = event.getFlags();
final boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
final boolean canceled = event.isCanceled();
if (DEBUG_INPUT) {
Log.d(TAG, "interceptKeyTi keyCode=" + keyCode + " down=" + down + " repeatCount="
+ repeatCount + " keyguardOn=" + keyguardOn + " mHomePressed=" + mHomePressed
+ " canceled=" + canceled);
}
// If we think we might have a volume down & power key chord on the way
// but we're not sure, then tell the dispatcher to wait a little while and
// try again later before dispatching.
if (mScreenshotChordEnabled && (flags & KeyEvent.FLAG_FALLBACK) == 0) {
if (mScreenshotChordVolumeDownKeyTriggered && !mScreenshotChordPowerKeyTriggered) {
final long now = SystemClock.uptimeMillis();
final long timeoutTime = mScreenshotChordVolumeDownKeyTime
+ SCREENSHOT_CHORD_DEBOUNCE_DELAY_MILLIS;
if (now < timeoutTime) {
return timeoutTime - now;
}
}
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
&& mScreenshotChordVolumeDownKeyConsumed) {
if (!down) {
mScreenshotChordVolumeDownKeyConsumed = false;
}
return -1;
}
}
// Cancel any pending meta actions if we see any other keys being pressed between the down
// of the meta key and its corresponding up.
if (mPendingMetaAction && !KeyEvent.isMetaKey(keyCode)) {
mPendingMetaAction = false;
}
// First we always handle the home key here, so applications
// can never break it, although if keyguard is on, we do let
// it handle it, because that gives us the correct 5 second
// timeout.
if (keyCode == KeyEvent.KEYCODE_HOME) {
// If we have released the home key, and didn't do anything else
// while it was pressed, then it is time to go home!
if (!down) {
cancelPreloadRecentApps();
mHomePressed = false;
if (mHomeConsumed) {
mHomeConsumed = false;
return -1;
}
if (canceled) {
Log.i(TAG, "Ignoring HOME; event canceled.");
return -1;
}
// If an incoming call is ringing, HOME is totally disabled.
// (The user is already on the InCallUI at this point,
// and his ONLY options are to answer or reject the call.)
TelecomManager telecomManager = getTelecommService();
if (telecomManager != null && telecomManager.isRinging()) {
Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
return -1;
}
// Delay handling home if a double-tap is possible.
if (mDoubleTapOnHomeBehavior != DOUBLE_TAP_HOME_NOTHING) {
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable); // just in case
mHomeDoubleTapPending = true;
mHandler.postDelayed(mHomeDoubleTapTimeoutRunnable,
ViewConfiguration.getDoubleTapTimeout());
return -1;
}
handleShortPressOnHome();
return -1;
}
// If a system window has focus, then it doesn't make sense
// right now to interact with applications.
WindowManager.LayoutParams attrs = win != null ? win.getAttrs() : null;
if (attrs != null) {
final int type = attrs.type;
if (type == WindowManager.LayoutParams.TYPE_KEYGUARD_SCRIM
|| type == WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
|| (attrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0) {
// the "app" is keyguard, so give it the key
return 0;
}
final int typeCount = WINDOW_TYPES_WHERE_HOME_DOESNT_WORK.length;
for (int i=0; i<typeCount; i++) {
if (type == WINDOW_TYPES_WHERE_HOME_DOESNT_WORK[i]) {
// don't do anything, but also don't pass it to the app
return -1;
}
}
}
// Remember that home is pressed and handle special actions.
if (repeatCount == 0) {
mHomePressed = true;
if (mHomeDoubleTapPending) {
mHomeDoubleTapPending = false;
mHandler.removeCallbacks(mHomeDoubleTapTimeoutRunnable);
handleDoubleTapOnHome();
} else if (mLongPressOnHomeBehavior == LONG_PRESS_HOME_RECENT_SYSTEM_UI
|| mDoubleTapOnHomeBehavior == DOUBLE_TAP_HOME_RECENT_SYSTEM_UI) {
preloadRecentApps();
}
} else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
if (!keyguardOn) {
handleLongPressOnHome();
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_MENU) {
// Hijack modified menu keys for debugging features
final int chordBug = KeyEvent.META_SHIFT_ON;
if (down && repeatCount == 0) {
if (mEnableShiftMenuBugReports && (metaState & chordBug) == chordBug) {
Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT,
null, null, null, 0, null, null);
return -1;
} else if (SHOW_PROCESSES_ON_ALT_MENU &&
(metaState & KeyEvent.META_ALT_ON) == KeyEvent.META_ALT_ON) {
Intent service = new Intent();
service.setClassName(mContext, "com.android.server.LoadAverageService");
ContentResolver res = mContext.getContentResolver();
boolean shown = Settings.Global.getInt(
res, Settings.Global.SHOW_PROCESSES, 0) != 0;
if (!shown) {
mContext.startService(service);
} else {
mContext.stopService(service);
}
Settings.Global.putInt(
res, Settings.Global.SHOW_PROCESSES, shown ? 0 : 1);
return -1;
}
}
} else if (keyCode == KeyEvent.KEYCODE_SEARCH) {
if (down) {
if (repeatCount == 0) {
mSearchKeyShortcutPending = true;
mConsumeSearchKeyUp = false;
}
} else {
mSearchKeyShortcutPending = false;
if (mConsumeSearchKeyUp) {
mConsumeSearchKeyUp = false;
return -1;
}
}
return 0;
} else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
if (!keyguardOn) {
if (down && repeatCount == 0) {
preloadRecentApps();
} else if (!down) {
toggleRecentApps();
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_ASSIST) {
if (down) {
if (repeatCount == 0) {
mAssistKeyLongPressed = false;
} else if (repeatCount == 1) {
mAssistKeyLongPressed = true;
if (!keyguardOn) {
launchAssistLongPressAction();
}
}
} else {
if (mAssistKeyLongPressed) {
mAssistKeyLongPressed = false;
} else {
if (!keyguardOn) {
launchAssistAction();
}
}
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_VOICE_ASSIST) {
if (!down) {
Intent voiceIntent;
if (!keyguardOn) {
voiceIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
} else {
voiceIntent = new Intent(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
voiceIntent.putExtra(RecognizerIntent.EXTRA_SECURE, true);
}
startActivityAsUser(voiceIntent, UserHandle.CURRENT_OR_SELF);
}
} else if (keyCode == KeyEvent.KEYCODE_SYSRQ) {
if (down && repeatCount == 0) {
mHandler.post(mScreenshotRunnable);
}
return -1;
} else if (keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP
|| keyCode == KeyEvent.KEYCODE_BRIGHTNESS_DOWN) {
if (down) {
int direction = keyCode == KeyEvent.KEYCODE_BRIGHTNESS_UP ? 1 : -1;
// Disable autobrightness if it's on
int auto = Settings.System.getIntForUser(
mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
UserHandle.USER_CURRENT_OR_SELF);
if (auto != 0) {
Settings.System.putIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL,
UserHandle.USER_CURRENT_OR_SELF);
}
int min = mPowerManager.getMinimumScreenBrightnessSetting();
int max = mPowerManager.getMaximumScreenBrightnessSetting();
int step = (max - min + BRIGHTNESS_STEPS - 1) / BRIGHTNESS_STEPS * direction;
int brightness = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS,
mPowerManager.getDefaultScreenBrightnessSetting(),
UserHandle.USER_CURRENT_OR_SELF);
brightness += step;
// Make sure we don't go beyond the limits.
brightness = Math.min(max, brightness);
brightness = Math.max(min, brightness);
Settings.System.putIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, brightness,
UserHandle.USER_CURRENT_OR_SELF);
startActivityAsUser(new Intent(Intent.ACTION_SHOW_BRIGHTNESS_DIALOG),
UserHandle.CURRENT_OR_SELF);
}
return -1;
} else if (KeyEvent.isMetaKey(keyCode)) {
if (down) {
mPendingMetaAction = true;
} else if (mPendingMetaAction) {
launchAssistAction(Intent.EXTRA_ASSIST_INPUT_HINT_KEYBOARD);
}
return -1;
}
// Shortcuts are invoked through Search+key, so intercept those here
// Any printing key that is chorded with Search should be consumed
// even if no shortcut was invoked. This prevents text from being
// inadvertently inserted when using a keyboard that has built-in macro
// shortcut keys (that emit Search+x) and some of them are not registered.
if (mSearchKeyShortcutPending) {
final KeyCharacterMap kcm = event.getKeyCharacterMap();
if (kcm.isPrintingKey(keyCode)) {
mConsumeSearchKeyUp = true;
mSearchKeyShortcutPending = false;
if (down && repeatCount == 0 && !keyguardOn) {
Intent shortcutIntent = mShortcutManager.getIntent(kcm, keyCode, metaState);
if (shortcutIntent != null) {
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(shortcutIntent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping shortcut key combination because "
+ "the activity to which it is registered was not found: "
+ "SEARCH+" + KeyEvent.keyCodeToString(keyCode), ex);
}
} else {
Slog.i(TAG, "Dropping unregistered shortcut key combination: "
+ "SEARCH+" + KeyEvent.keyCodeToString(keyCode));
}
}
return -1;
}
}
// Invoke shortcuts using Meta.
if (down && repeatCount == 0 && !keyguardOn
&& (metaState & KeyEvent.META_META_ON) != 0) {
final KeyCharacterMap kcm = event.getKeyCharacterMap();
if (kcm.isPrintingKey(keyCode)) {
Intent shortcutIntent = mShortcutManager.getIntent(kcm, keyCode,
metaState & ~(KeyEvent.META_META_ON
| KeyEvent.META_META_LEFT_ON | KeyEvent.META_META_RIGHT_ON));
if (shortcutIntent != null) {
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(shortcutIntent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping shortcut key combination because "
+ "the activity to which it is registered was not found: "
+ "META+" + KeyEvent.keyCodeToString(keyCode), ex);
}
return -1;
}
}
}
// Handle application launch keys.
if (down && repeatCount == 0 && !keyguardOn) {
String category = sApplicationLaunchKeyCategories.get(keyCode);
if (category != null) {
Intent intent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, category);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivityAsUser(intent, UserHandle.CURRENT);
} catch (ActivityNotFoundException ex) {
Slog.w(TAG, "Dropping application launch key because "
+ "the activity to which it is registered was not found: "
+ "keyCode=" + keyCode + ", category=" + category, ex);
}
return -1;
}
}
// Display task switcher for ALT-TAB.
if (down && repeatCount == 0 && keyCode == KeyEvent.KEYCODE_TAB) {
if (mRecentAppsHeldModifiers == 0 && !keyguardOn && isUserSetupComplete()) {
final int shiftlessModifiers = event.getModifiers() & ~KeyEvent.META_SHIFT_MASK;
if (KeyEvent.metaStateHasModifiers(shiftlessModifiers, KeyEvent.META_ALT_ON)) {
mRecentAppsHeldModifiers = shiftlessModifiers;
showRecentApps(true);
return -1;
}
}
} else if (!down && mRecentAppsHeldModifiers != 0
&& (metaState & mRecentAppsHeldModifiers) == 0) {
mRecentAppsHeldModifiers = 0;
hideRecentApps(true, false);
}
// Handle keyboard language switching.
if (down && repeatCount == 0
&& (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
|| (keyCode == KeyEvent.KEYCODE_SPACE
&& (metaState & KeyEvent.META_CTRL_MASK) != 0))) {
int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
mWindowManagerFuncs.switchKeyboardLayout(event.getDeviceId(), direction);
return -1;
}
if (mLanguageSwitchKeyPressed && !down
&& (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
|| keyCode == KeyEvent.KEYCODE_SPACE)) {
mLanguageSwitchKeyPressed = false;
return -1;
}
if (isValidGlobalKey(keyCode)
&& mGlobalKeyManager.handleGlobalKey(mContext, keyCode, event)) {
return -1;
}
// Reserve all the META modifier combos for system behavior
if ((metaState & KeyEvent.META_META_ON) != 0) {
return -1;
}
// Let the application handle the key.
return 0;
}
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
interceptKeyBeforeDispatching
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 1
|
Analyze the following code function for security vulnerabilities
|
public Jooby charset(final Charset charset) {
this.charset = requireNonNull(charset, "Charset required.");
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: charset
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
charset
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean containsErrors() {
return !mErrors.isEmpty();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containsErrors
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
containsErrors
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CompletableFuture<PartitionedTopicMetadata> unsafeGetPartitionedTopicMetadataAsync(
PulsarService pulsar, TopicName topicName) {
CompletableFuture<PartitionedTopicMetadata> metadataFuture = new CompletableFuture();
// validates global-namespace contains local/peer cluster: if peer/local cluster present then lookup can
// serve/redirect request else fail partitioned-metadata-request so, client fails while creating
// producer/consumer
checkLocalOrGetPeerReplicationCluster(pulsar, topicName.getNamespaceObject())
.thenCompose(res -> pulsar.getBrokerService()
.fetchPartitionedTopicMetadataCheckAllowAutoCreationAsync(topicName))
.thenAccept(metadata -> {
if (log.isDebugEnabled()) {
log.debug("Total number of partitions for topic {} is {}", topicName,
metadata.partitions);
}
metadataFuture.complete(metadata);
}).exceptionally(ex -> {
metadataFuture.completeExceptionally(ex.getCause());
return null;
});
return metadataFuture;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unsafeGetPartitionedTopicMetadataAsync
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
unsafeGetPartitionedTopicMetadataAsync
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<DocumentHighlight> findDocumentHighlights(DOMDocument xmlDocument, Position position) {
return findDocumentHighlights(xmlDocument, position, NULL_CHECKER);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findDocumentHighlights
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
Repository: eclipse/lemminx
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
findDocumentHighlights
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
List<DictModelMany> queryManyDictByKeys(@Param("dictCodeList") List<String> dictCodeList, @Param("keys") List<String> keys);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryManyDictByKeys
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45207
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
queryManyDictByKeys
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
|
8632a835c23f558dfee3584d7658cc6a13ccec6f
| 0
|
Analyze the following code function for security vulnerabilities
|
public String toSqlWhere() {
if (filterExpr == null || filterExpr.isEmpty()) return null;
this.includeFields = new HashSet<>();
// 自动确定查询项
if (MODE_QUICK.equalsIgnoreCase(filterExpr.getString("type"))) {
JSONArray quickItems = buildQuickFilterItems(filterExpr.getString("quickFields"));
this.filterExpr.put("items", quickItems);
}
JSONArray items = filterExpr.getJSONArray("items");
items = items == null ? JSONUtils.EMPTY_ARRAY : items;
JSONObject values = filterExpr.getJSONObject("values");
values = values == null ? JSONUtils.EMPTY_OBJECT : values;
String equation = StringUtils.defaultIfBlank(filterExpr.getString("equation"), "OR");
Map<Integer, String> indexItemSqls = new LinkedHashMap<>();
int incrIndex = 1;
for (Object o : items) {
JSONObject item = (JSONObject) o;
Integer index = item.getInteger("index");
if (index == null) {
index = incrIndex++;
}
String itemSql = parseItem(item, values, rootEntity);
if (itemSql != null) {
indexItemSqls.put(index, itemSql.trim());
this.includeFields.add(item.getString("field"));
}
if (Application.devMode()) System.out.println("[dev] Parse item : " + item + " >> " + itemSql);
}
if (indexItemSqls.isEmpty()) return null;
String equationHold = equation;
if ((equation = validEquation(equation)) == null) {
throw new FilterParseException(Language.L("无效的高级表达式 : %s", equationHold));
}
if ("OR".equalsIgnoreCase(equation)) {
return "( " + StringUtils.join(indexItemSqls.values(), " or ") + " )";
} else if ("AND".equalsIgnoreCase(equation)) {
return "( " + StringUtils.join(indexItemSqls.values(), " and ") + " )";
} else {
// 高级表达式 eg. (1 AND 2) or (3 AND 4)
String[] tokens = equation.toLowerCase().split(" ");
List<String> itemSqls = new ArrayList<>();
for (String token : tokens) {
if (StringUtils.isBlank(token)) {
continue;
}
boolean hasRP = false; // the `)`
if (token.length() > 1) {
if (token.startsWith("(")) {
itemSqls.add("(");
token = token.substring(1);
} else if (token.endsWith(")")) {
hasRP = true;
token = token.substring(0, token.length() - 1);
}
}
if (NumberUtils.isDigits(token)) {
String itemSql = StringUtils.defaultIfBlank(indexItemSqls.get(Integer.valueOf(token)), "(9=9)");
itemSqls.add(itemSql);
} else if ("(".equals(token) || ")".equals(token) || "or".equals(token) || "and".equals(token)) {
itemSqls.add(token);
} else {
log.warn("Invalid equation token : " + token);
}
if (hasRP) {
itemSqls.add(")");
}
}
return "( " + StringUtils.join(itemSqls, " ") + " )";
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toSqlWhere
File: src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
toSqlWhere
|
src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void enableServiceAccount(ClientModel client) {
client.setServiceAccountsEnabled(true);
// Add dedicated user for this service account
if (realmManager.getSession().users().getServiceAccount(client) == null) {
String username = ServiceAccountConstants.SERVICE_ACCOUNT_USER_PREFIX + client.getClientId();
logger.debugf("Creating service account user '%s'", username);
// Don't use federation for service account user
UserModel user = realmManager.getSession().userLocalStorage().addUser(client.getRealm(), username);
user.setEnabled(true);
user.setEmail(username + "@placeholder.org");
user.setServiceAccountClientLink(client.getId());
}
// Add protocol mappers to retrieve clientId in access token
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_ID,
ServiceAccountConstants.CLIENT_ID, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
// Add protocol mappers to retrieve hostname and IP address of client in access token
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_HOST,
ServiceAccountConstants.CLIENT_HOST, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_ADDRESS,
ServiceAccountConstants.CLIENT_ADDRESS, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
}
|
Vulnerability Classification:
- CWE: CWE-798
- CVE: CVE-2019-14837
- Severity: MEDIUM
- CVSS Score: 6.4
Description: KEYCLOAK-10780 Stop creating placeholder e-mails for service accounts (#228)
Function: enableServiceAccount
File: services/src/main/java/org/keycloak/services/managers/ClientManager.java
Repository: keycloak
Fixed Code:
public void enableServiceAccount(ClientModel client) {
client.setServiceAccountsEnabled(true);
// Add dedicated user for this service account
if (realmManager.getSession().users().getServiceAccount(client) == null) {
String username = ServiceAccountConstants.SERVICE_ACCOUNT_USER_PREFIX + client.getClientId();
logger.debugf("Creating service account user '%s'", username);
// Don't use federation for service account user
UserModel user = realmManager.getSession().userLocalStorage().addUser(client.getRealm(), username);
user.setEnabled(true);
user.setServiceAccountClientLink(client.getId());
}
// Add protocol mappers to retrieve clientId in access token
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_ID_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_ID,
ServiceAccountConstants.CLIENT_ID, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
// Add protocol mappers to retrieve hostname and IP address of client in access token
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_HOST_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_HOST,
ServiceAccountConstants.CLIENT_HOST, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
if (client.getProtocolMapperByName(OIDCLoginProtocol.LOGIN_PROTOCOL, ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER) == null) {
logger.debugf("Creating service account protocol mapper '%s' for client '%s'", ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER, client.getClientId());
ProtocolMapperModel protocolMapper = UserSessionNoteMapper.createClaimMapper(ServiceAccountConstants.CLIENT_ADDRESS_PROTOCOL_MAPPER,
ServiceAccountConstants.CLIENT_ADDRESS,
ServiceAccountConstants.CLIENT_ADDRESS, "String",
true, true);
client.addProtocolMapper(protocolMapper);
}
}
|
[
"CWE-798"
] |
CVE-2019-14837
|
MEDIUM
| 6.4
|
keycloak
|
enableServiceAccount
|
services/src/main/java/org/keycloak/services/managers/ClientManager.java
|
9a7c1a91a59ab85e7f8889a505be04a71580777f
| 1
|
Analyze the following code function for security vulnerabilities
|
protected int decoderEnforceMaxConsecutiveEmptyDataFrames() {
return maxConsecutiveEmptyFrames;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: decoderEnforceMaxConsecutiveEmptyDataFrames
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
netty
|
decoderEnforceMaxConsecutiveEmptyDataFrames
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
public void waitForBroadcastIdle(PrintWriter pw) {
enforceCallingPermission(permission.DUMP, "waitForBroadcastIdle()");
while (true) {
boolean idle = true;
synchronized (this) {
for (BroadcastQueue queue : mBroadcastQueues) {
if (!queue.isIdle()) {
final String msg = "Waiting for queue " + queue + " to become idle...";
pw.println(msg);
pw.flush();
Slog.v(TAG, msg);
idle = false;
}
}
}
if (idle) {
final String msg = "All broadcast queues are idle!";
pw.println(msg);
pw.flush();
Slog.v(TAG, msg);
return;
} else {
SystemClock.sleep(1000);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: waitForBroadcastIdle
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
|
waitForBroadcastIdle
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public Filter rawFilter() {
return filter;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: rawFilter
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
rawFilter
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isAppBad(final String processName, final int uid) {
return ActivityManagerService.this.isAppBad(processName, uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAppBad
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
|
isAppBad
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
protected EntityReferenceSerializer<String> getDefaultEntityReferenceSerializer()
{
if (this.defaultEntityReferenceSerializer == null) {
this.defaultEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING);
}
return this.defaultEntityReferenceSerializer;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultEntityReferenceSerializer
File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29206
|
MEDIUM
| 5.4
|
xwiki/xwiki-platform
|
getDefaultEntityReferenceSerializer
|
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
|
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void getAccountByTypeAndFeatures(
IAccountManagerResponse response,
String accountType,
String[] features,
String opPackageName) {
int callingUid = Binder.getCallingUid();
mAppOpsManager.checkPackage(callingUid, opPackageName);
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "getAccount: accountType " + accountType
+ ", response " + response
+ ", features " + Arrays.toString(features)
+ ", caller's uid " + callingUid
+ ", pid " + Binder.getCallingPid());
}
if (response == null) throw new IllegalArgumentException("response is null");
if (accountType == null) throw new IllegalArgumentException("accountType is null");
int userId = UserHandle.getCallingUserId();
final long identityToken = clearCallingIdentity();
try {
UserAccounts userAccounts = getUserAccounts(userId);
if (ArrayUtils.isEmpty(features)) {
Account[] accountsWithManagedNotVisible = getAccountsFromCache(
userAccounts, accountType, callingUid, opPackageName,
true /* include managed not visible */);
handleGetAccountsResult(
response, accountsWithManagedNotVisible, opPackageName);
return;
}
IAccountManagerResponse retrieveAccountsResponse =
new IAccountManagerResponse.Stub() {
@Override
public void onResult(Bundle value) throws RemoteException {
Parcelable[] parcelables = value.getParcelableArray(
AccountManager.KEY_ACCOUNTS);
Account[] accounts = new Account[parcelables.length];
for (int i = 0; i < parcelables.length; i++) {
accounts[i] = (Account) parcelables[i];
}
handleGetAccountsResult(
response, accounts, opPackageName);
}
@Override
public void onError(int errorCode, String errorMessage)
throws RemoteException {
// Will not be called in this case.
}
};
new GetAccountsByTypeAndFeatureSession(
userAccounts,
retrieveAccountsResponse,
accountType,
features,
callingUid,
opPackageName,
true /* include managed not visible */).bind();
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAccountByTypeAndFeatures
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
|
getAccountByTypeAndFeatures
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean supports(Class<?> clazz) {
return ((this.supportJaxbElementClass && JAXBElement.class.isAssignableFrom(clazz)) ||
supportsInternal(clazz, this.checkForXmlRootElement));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: supports
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
|
supports
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Analyze the following code function for security vulnerabilities
|
public int callback(int dwControl, int dwEventType, Pointer lpEventData, Pointer lpContext) {
switch (dwControl) {
case Winsvc.SERVICE_CONTROL_STOP:
case Winsvc.SERVICE_CONTROL_SHUTDOWN:
reportStatus(Winsvc.SERVICE_STOP_PENDING, WinError.NO_ERROR, 5000);
synchronized (waitObject) {
waitObject.notifyAll();
}
break;
default:
break;
}
return WinError.NO_ERROR;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: callback
File: src/main/java/org/traccar/WindowsService.java
Repository: traccar
The code follows secure coding practices.
|
[
"CWE-428"
] |
CVE-2021-21292
|
LOW
| 1.9
|
traccar
|
callback
|
src/main/java/org/traccar/WindowsService.java
|
cc69a9907ac9878db3750aa14ffedb28626455da
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<ShortcutInfo> removeOrphans() {
final List<ShortcutInfo> removeList = new ArrayList<>(1);
forEachShortcut(si -> {
if (si.isAlive()) return;
removeList.add(si);
});
if (!removeList.isEmpty()) {
for (int i = removeList.size() - 1; i >= 0; i--) {
forceDeleteShortcutInner(removeList.get(i).getId());
}
}
return removeList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeOrphans
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
removeOrphans
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
private static ClientAuthenticationMethod firstSupportedMethod(final List<ClientAuthenticationMethod> metadataMethods) {
Optional<ClientAuthenticationMethod> firstSupported =
metadataMethods.stream().filter((m) -> SUPPORTED_METHODS.contains(m)).findFirst();
if (firstSupported.isPresent()) {
return firstSupported.get();
} else {
throw new TechnicalException("None of the Token endpoint provider metadata authentication methods are supported: "
+ metadataMethods);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: firstSupportedMethod
File: datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java
Repository: datahub-project/datahub
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2023-25558
|
HIGH
| 8.8
|
datahub-project/datahub
|
firstSupportedMethod
|
datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java
|
2a182f484677d056730d6b4e9f0143e67368359f
| 0
|
Analyze the following code function for security vulnerabilities
|
public X509Certificate getCertificate() {
return mCertificates.isEmpty() ? null : mCertificates.get(0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCertificate
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getCertificate
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURL(String space, String page, String action, String queryString)
{
return getURL(action, new String[] { space, page }, queryString);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getURL
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public Computer[] getComputers() {
Computer[] r = computers.values().toArray(new Computer[computers.size()]);
Arrays.sort(r,new Comparator<Computer>() {
final Collator collator = Collator.getInstance();
public int compare(Computer lhs, Computer rhs) {
if(lhs.getNode()==Jenkins.this) return -1;
if(rhs.getNode()==Jenkins.this) return 1;
return collator.compare(lhs.getDisplayName(), rhs.getDisplayName());
}
});
return r;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getComputers
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
|
getComputers
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getUserGroupAccessCondition( CurrentUserGroupInfo currentUserGroupInfo, String access )
{
if ( CollectionUtils.isEmpty( currentUserGroupInfo.getUserGroupUIDs() ) )
{
return "1=0";
}
String groupUids = "{" + String.join( ",", currentUserGroupInfo.getUserGroupUIDs() ) + "}";
return Stream.of(
jsonbFunction( HAS_USER_GROUP_IDS, groupUids ),
jsonbFunction( CHECK_USER_GROUPS_ACCESS, access, groupUids ) )
.collect( joining( " and ", "(", ")" ) );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserGroupAccessCondition
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
getUserGroupAccessCondition
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected List<? extends Block> getBlockTitle(RssMacroParameters parameters, String content,
MacroTransformationContext context)
{
List<? extends Block> blockTitle = super.getBlockTitle(parameters, content, context);
if (blockTitle == null) {
return generateBoxTitle("rsschanneltitle", getFeed());
} else {
return blockTitle;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBlockTitle
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
|
getBlockTitle
|
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
|
@Override
public String getCertInstallerPackage(ComponentName who) throws SecurityException {
final List<String> delegatePackages = getDelegatePackages(who, DELEGATION_CERT_INSTALL);
return delegatePackages.size() > 0 ? delegatePackages.get(0) : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCertInstallerPackage
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
|
getCertInstallerPackage
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public void send(final String content) {
try {
final URL url = new URL(req.getUrl());
if (this.isAsync) {
// Should use a thread pool instead
new Thread("SimpleHttpRequest-" + url.getHost()) {
@Override
public void run() {
try {
sendSync(content);
} catch (Throwable thrown) {
logger.error("send(): Error in asynchronous request on " + url, thrown);
}
}
}.start();
} else {
sendSync(content);
}
} catch (IOException e) {
logger.error(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: send
File: Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
send
|
Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void dropCreateDatabase(String database) throws SQLException {
if (! isValidPostgresIdentifier(database)) {
throw new IllegalArgumentException("Illegal character in database name: " + database);
}
try (Connection connection = getStandaloneConnection("postgres", true);
Statement statement = connection.createStatement()) {
statement.executeUpdate("DROP DATABASE IF EXISTS " + database); //NOSONAR
statement.executeUpdate("CREATE DATABASE " + database); //NOSONAR
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dropCreateDatabase
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
|
dropCreateDatabase
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@FrameIteratorSkip
private final long invokeExact_thunkArchetype_J(Object receiver, int argPlaceholder) {
return ComputedCalls.dispatchVirtual_J(jittedMethodAddress(receiver), vtableIndexArgument(receiver), receiver, argPlaceholder);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: invokeExact_thunkArchetype_J
File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
Repository: eclipse-openj9/openj9
The code follows secure coding practices.
|
[
"CWE-440",
"CWE-250"
] |
CVE-2021-41035
|
HIGH
| 7.5
|
eclipse-openj9/openj9
|
invokeExact_thunkArchetype_J
|
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
|
c6e0d9296ff9a3084965d83e207403de373c0bad
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ClickHouseNode apply(ClickHouseNodeSelector t) {
final ClickHouseNodeManager m = manager.get();
if (m != null) { // managed
return m.apply(m.getNodeSelector());
}
if (t != null && t != ClickHouseNodeSelector.EMPTY
&& (!t.matchAnyOfPreferredProtocols(protocol) || !t.matchAllPreferredTags(tags))) {
throw new IllegalArgumentException(ClickHouseUtils.format("%s expects a node rather than %s", t, this));
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: apply
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
apply
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void closeSystemDialogs(String reason) {
enforceNotIsolatedCaller("closeSystemDialogs");
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final long origId = Binder.clearCallingIdentity();
try {
synchronized (this) {
// Only allow this from foreground processes, so that background
// applications can't abuse it to prevent system UI from being shown.
if (uid >= FIRST_APPLICATION_UID) {
ProcessRecord proc;
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pid);
}
if (proc.curRawAdj > ProcessList.PERCEPTIBLE_APP_ADJ) {
Slog.w(TAG, "Ignoring closeSystemDialogs " + reason
+ " from background process " + proc);
return;
}
}
closeSystemDialogsLocked(reason);
}
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeSystemDialogs
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
|
closeSystemDialogs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void clear() {
adminConfiguration.clearTemplateCache();
clearTemplateCache();
clearTaskTemplateCache();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clear
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2020-20914
|
CRITICAL
| 9.8
|
sanluan/PublicCMS
|
clear
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
|
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setDefaultGuestRestrictions(Bundle restrictions) {
checkManageUsersPermission("setDefaultGuestRestrictions");
synchronized (mPackagesLock) {
mGuestRestrictions.clear();
mGuestRestrictions.putAll(restrictions);
writeUserListLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDefaultGuestRestrictions
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
setDefaultGuestRestrictions
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getProfileDescription() {
return profileDescription;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProfileDescription
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getProfileDescription
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileDataInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private <T extends Describable<T>>
Descriptor<T> findDescriptor(String shortClassName, Collection<? extends Descriptor<T>> descriptors) {
String name = '.'+shortClassName;
for (Descriptor<T> d : descriptors) {
if(d.clazz.getName().endsWith(name))
return d;
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findDescriptor
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
|
findDescriptor
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean check(EventJournalConfig c1, EventJournalConfig c2) {
boolean c1Disabled = c1 == null || !c1.isEnabled();
boolean c2Disabled = c2 == null || !c2.isEnabled();
return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null
&& nullSafeEqual(c1.getMapName(), c2.getMapName())
&& nullSafeEqual(c1.getCacheName(), c2.getCacheName())
&& nullSafeEqual(c1.getCapacity(), c2.getCapacity())
&& nullSafeEqual(c1.getTimeToLiveSeconds(), c2.getTimeToLiveSeconds()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
check
|
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
static public String getRelativePath(File file, File dir) {
String location = file.getAbsolutePath().substring(dir.getAbsolutePath().length());
return (location.startsWith(File.separator)) ? location.substring(1) : location;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRelativePath
File: main/src/com/google/refine/importing/ImportingUtilities.java
Repository: OpenRefine
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-19859
|
MEDIUM
| 4
|
OpenRefine
|
getRelativePath
|
main/src/com/google/refine/importing/ImportingUtilities.java
|
e243e73e4064de87a913946bd320fbbe246da656
| 0
|
Analyze the following code function for security vulnerabilities
|
private void onProvisionFullyManagedDeviceCompleted(
FullyManagedDeviceProvisioningParams provisioningParams) {}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onProvisionFullyManagedDeviceCompleted
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
|
onProvisionFullyManagedDeviceCompleted
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateResumedAppTrace(@Nullable ActivityRecord resumed) {
if (mTracedResumedActivity != null) {
Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER,
constructResumedTraceName(mTracedResumedActivity.packageName), 0);
}
if (resumed != null) {
Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER,
constructResumedTraceName(resumed.packageName), 0);
}
mTracedResumedActivity = resumed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateResumedAppTrace
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
|
updateResumedAppTrace
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void log(String s) {
Rlog.d(LOG_TAG, "[GsmSST] " + s);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: log
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
log
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
protected ManagedMap parseProperties(Node node) {
ManagedMap<String, String> properties = new ManagedMap<String, String>();
for (Node n : childElements(node)) {
String name = cleanNodeName(n);
String propertyName;
if (!"property".equals(name)) {
continue;
}
propertyName = getTextContent(n.getAttributes().getNamedItem("name")).trim();
String value = getTextContent(n);
properties.put(propertyName, value);
}
return properties;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseProperties
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
parseProperties
|
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void getShortcutIconFdAsync(int launcherUserId, @NonNull String callingPackage,
@NonNull String packageName, @NonNull String shortcutId, int userId,
@NonNull AndroidFuture<ParcelFileDescriptor> cb) {
Objects.requireNonNull(callingPackage, "callingPackage");
Objects.requireNonNull(packageName, "packageName");
Objects.requireNonNull(shortcutId, "shortcutId");
// Checks shortcuts in memory first
final ShortcutPackage p;
synchronized (mLock) {
throwIfUserLockedL(userId);
throwIfUserLockedL(launcherUserId);
getLauncherShortcutsLocked(callingPackage, userId, launcherUserId)
.attemptToRestoreIfNeededAndSave();
p = getUserShortcutsLocked(userId).getPackageShortcutsIfExists(packageName);
if (p == null) {
cb.complete(null);
return;
}
final ShortcutInfo shortcutInfo = p.findShortcutById(shortcutId);
if (shortcutInfo != null) {
cb.complete(getShortcutIconParcelFileDescriptor(p, shortcutInfo));
return;
}
}
// Otherwise check persisted shortcuts
getShortcutInfoAsync(launcherUserId, packageName, shortcutId, userId, si ->
cb.complete(getShortcutIconParcelFileDescriptor(p, si)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShortcutIconFdAsync
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
|
getShortcutIconFdAsync
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public <K, V> RemoteCache<K, V> getCache(String cacheName) {
return getCache(cacheName, configuration.forceReturnValues());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCache
File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
Repository: infinispan
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2017-15089
|
MEDIUM
| 6.5
|
infinispan
|
getCache
|
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
|
efc44b7b0a5dd4f44773808840dd9785cabcf21c
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getRequestCompressionLevel() {
return requestCompressionLevel;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestCompressionLevel
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
|
getRequestCompressionLevel
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiScenarioWithBLOBs buildSaveScenario(SaveApiScenarioRequest request) {
ApiScenarioWithBLOBs scenario = new ApiScenarioWithBLOBs();
scenario.setId(request.getId());
scenario.setName(request.getName());
scenario.setProjectId(request.getProjectId());
scenario.setCustomNum(request.getCustomNum());
if (StringUtils.equals(request.getTags(), "[]")) {
scenario.setTags("");
} else {
scenario.setTags(request.getTags());
}
scenario.setApiScenarioModuleId(request.getApiScenarioModuleId());
scenario.setModulePath(request.getModulePath());
scenario.setLevel(request.getLevel());
scenario.setPrincipal(request.getPrincipal());
scenario.setStepTotal(request.getStepTotal());
scenario.setUpdateTime(System.currentTimeMillis());
scenario.setDescription(request.getDescription());
scenario.setCreateUser(SessionUtils.getUserId());
scenario.setScenarioDefinition(JSON.toJSONString(request.getScenarioDefinition()));
Boolean isValidEnum = EnumUtils.isValidEnum(EnvironmentType.class, request.getEnvironmentType());
if (BooleanUtils.isTrue(isValidEnum)) {
scenario.setEnvironmentType(request.getEnvironmentType());
} else {
scenario.setEnvironmentType(EnvironmentType.JSON.toString());
}
scenario.setEnvironmentJson(request.getEnvironmentJson());
scenario.setEnvironmentGroupId(request.getEnvironmentGroupId());
if (StringUtils.isNotEmpty(request.getStatus())) {
scenario.setStatus(request.getStatus());
} else {
scenario.setStatus(ScenarioStatus.Underway.name());
}
if (StringUtils.isNotEmpty(request.getUserId())) {
scenario.setUserId(request.getUserId());
} else {
scenario.setUserId(SessionUtils.getUserId());
}
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || "default-module".equals(request.getApiScenarioModuleId())) {
ApiScenarioModuleExample example = new ApiScenarioModuleExample();
example.createCriteria().andProjectIdEqualTo(request.getProjectId()).andNameEqualTo("未规划场景");
List<ApiScenarioModule> modules = apiScenarioModuleMapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(modules)) {
scenario.setApiScenarioModuleId(modules.get(0).getId());
scenario.setModulePath(modules.get(0).getName());
}
}
saveFollows(scenario.getId(), request.getFollows());
return scenario;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildSaveScenario
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
buildSaveScenario
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public File getTempWorkDirFile() {
File tempDirFile = new File(getTempWorkDir());
if(!tempDirFile.exists()) {
tempDirFile.mkdirs();
}
return tempDirFile;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTempWorkDirFile
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
getTempWorkDirFile
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
|
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void pojo2jsonJson(TestContext context) throws Exception {
JsonObject j = new JsonObject().put("a", "b");
context.assertEquals("{\"a\":\"b\"}", PostgresClient.pojo2json(j));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pojo2jsonJson
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
|
pojo2jsonJson
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getFullName() {
return fullName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFullName
File: base/common/src/main/java/com/netscape/certsrv/account/Account.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getFullName
|
base/common/src/main/java/com/netscape/certsrv/account/Account.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private SC_HANDLE openServiceControlManager(String machine, int access) {
return ADVAPI_32.OpenSCManager(machine, null, access);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openServiceControlManager
File: src/main/java/org/traccar/WindowsService.java
Repository: traccar
The code follows secure coding practices.
|
[
"CWE-428"
] |
CVE-2021-21292
|
LOW
| 1.9
|
traccar
|
openServiceControlManager
|
src/main/java/org/traccar/WindowsService.java
|
cc69a9907ac9878db3750aa14ffedb28626455da
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onHardKeyboardStatusChange(boolean available);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onHardKeyboardStatusChange
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
|
onHardKeyboardStatusChange
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.