instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private void removeComponent(Object item) {
Component component = activeComponents.remove(item);
if (component != null) {
getGrid().removeExtensionComponent(component);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeComponent
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
removeComponent
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public static File buildNonUniqueFile(File parent, String mimeType, String displayName) {
final String[] parts = splitFileName(mimeType, displayName);
return buildFile(parent, parts[0], parts[1]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildNonUniqueFile
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
buildNonUniqueFile
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder setProxyServerSelector(ProxyServerSelector proxyServerSelector) {
this.proxyServerSelector = proxyServerSelector;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProxyServerSelector
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
|
setProxyServerSelector
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean copyDocument(String docname, String targetdocname, String wikilocale) throws XWikiException
{
return this.copyDocument(docname, targetdocname, null, null, wikilocale, false, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
copyDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
void postWindowRemoveStartingWindowCleanup(WindowState win) {
// TODO: Something smells about the code below...Is there a better way?
if (mStartingWindow == win) {
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Notify removed startingWindow %s", win);
removeStartingWindow();
} else if (mChildren.size() == 0) {
// If this is the last window and we had requested a starting transition window,
// well there is no point now.
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Nulling last startingData");
mStartingData = null;
if (mVisibleSetFromTransferredStartingWindow) {
// We set the visible state to true for the token from a transferred starting
// window. We now reset it back to false since the starting window was the last
// window in the token.
setVisible(false);
}
} else if (mChildren.size() == 1 && mStartingSurface != null && !isRelaunching()) {
// If this is the last window except for a starting transition window,
// we need to get rid of the starting transition.
ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Last window, removing starting window %s", win);
removeStartingWindow();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postWindowRemoveStartingWindowCleanup
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
postWindowRemoveStartingWindowCleanup
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getName() {
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getName
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
getName
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startLockTaskMode(IBinder token) {
synchronized (this) {
final ActivityRecord r = ActivityRecord.forTokenLocked(token);
if (r == null) {
return;
}
final TaskRecord task = r.task;
if (task != null) {
startLockTaskModeLocked(task);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startLockTaskMode
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
startLockTaskMode
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
private Collection<Principal> getAllGroupsForUser(
ISessionManager sessionManager, String username)
throws RepositoryLoginException, RepositoryException {
ArrayList<Principal> listGroups = new ArrayList<Principal>();
ISession session = sessionManager.getSession(docbase);
try {
String queryStr =
"select group_name from dm_group where any i_all_users_names = '"
+ username + "'";
IQuery query = clientX.getQuery();
query.setDQL(queryStr);
ICollection collecGroups = query.execute(session,
IQuery.EXECUTE_READ_QUERY);
try {
while (collecGroups.next()) {
String groupName = collecGroups.getString("group_name");
String groupNamespace = getGroupNamespace(session, groupName);
if (groupNamespace != null) {
listGroups.add(new Principal(PrincipalType.UNKNOWN, groupNamespace,
groupName, CaseSensitivityType.EVERYTHING_CASE_SENSITIVE));
} else {
LOGGER.warning("Skipping group " + groupName
+ " with null namespace");
}
}
// process special group dm_world
listGroups.add(new Principal(PrincipalType.UNKNOWN,
connector.getGoogleLocalNamespace(), "dm_world",
CaseSensitivityType.EVERYTHING_CASE_SENSITIVE));
} finally {
collecGroups.close();
}
} finally {
sessionManager.release(session);
}
return listGroups;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllGroupsForUser
File: projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
Repository: AnantLabs/google-enterprise-connector-dctm
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2014-125083
|
MEDIUM
| 5.2
|
AnantLabs/google-enterprise-connector-dctm
|
getAllGroupsForUser
|
projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
|
6fba04f18ab7764002a1da308e7cd9712b501cb7
| 0
|
Analyze the following code function for security vulnerabilities
|
final Object getLockObject() {
if (ENABLE_LOCK_GUARD) {
final long start = mStatLogger.getTime();
LockGuard.guard(LockGuard.INDEX_DPMS);
mStatLogger.logDurationStat(Stats.LOCK_GUARD_GUARD, start);
}
return mLockDoNoUseDirectly;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockObject
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
|
getLockObject
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "11.8RC1")
public MergeResult merge(XWikiDocument previousDocument, XWikiDocument newDocument,
MergeConfiguration configuration, XWikiContext context)
{
MergeManager mergeManager = Utils.getComponent(MergeManager.class);
MergeDocumentResult mergeDocumentResult =
mergeManager.mergeDocument(previousDocument, newDocument, this, configuration);
MergeResult mergeResult = new MergeResult();
mergeResult.getLog().addAll(mergeDocumentResult.getLog());
mergeResult.setModified(mergeResult.isModified() || mergeDocumentResult.isModified());
if (!configuration.isProvidedVersionsModifiables())
{
this.apply((XWikiDocument) mergeDocumentResult.getMergeResult());
}
return mergeResult;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: merge
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
|
merge
|
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
|
public float getSecondaryHorizontal(int offset, boolean clamped) {
boolean trailing = primaryIsTrailingPrevious(offset);
return getHorizontal(offset, !trailing, clamped);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSecondaryHorizontal
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getSecondaryHorizontal
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void composeMailto(Context context, Account account, Uri mailto) {
final Intent intent = new Intent(Intent.ACTION_VIEW, mailto);
intent.setPackage(context.getPackageName());
intent.putExtra(EXTRA_FROM_EMAIL_TASK, true);
intent.putExtra(Utils.EXTRA_ACCOUNT, account);
if (mailto != null) {
intent.setData(Utils.normalizeUri(mailto));
}
context.startActivity(intent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: composeMailto
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
composeMailto
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ClickHouseNode of(URI uri, ClickHouseNode template) {
String host = ClickHouseChecker.nonNull(uri, "URI").getHost();
String scheme = ClickHouseChecker.nonEmpty(uri.getScheme(), "Protocol");
if (template == null) {
template = DEFAULT;
}
if (ClickHouseChecker.isNullOrEmpty(host)) {
host = template.getHost();
}
Map<String, String> params = new LinkedHashMap<>(template.options);
parseDatabase(uri.getPath(), params);
ClickHouseUtils.extractParameters(uri.getRawQuery(), params);
ClickHouseProtocol protocol = ClickHouseProtocol.fromUriScheme(scheme);
int port = extract(scheme, uri.getPort(), protocol, params);
ClickHouseCredentials credentials = extract(uri.getRawUserInfo(), params, template.credentials);
Set<String> tags = new LinkedHashSet<>(template.tags);
parseTags(uri.getRawFragment(), tags);
// TODO allow to define scope of client option
for (String key : new String[] {
ClickHouseClientOption.LOAD_BALANCING_POLICY.getKey(),
ClickHouseClientOption.LOAD_BALANCING_TAGS.getKey(),
ClickHouseClientOption.FAILOVER.getKey(),
ClickHouseClientOption.NODE_DISCOVERY_INTERVAL.getKey(),
ClickHouseClientOption.NODE_DISCOVERY_LIMIT.getKey(),
ClickHouseClientOption.HEALTH_CHECK_INTERVAL.getKey(),
ClickHouseClientOption.NODE_GROUP_SIZE.getKey(),
ClickHouseClientOption.CHECK_ALL_NODES.getKey()
}) {
if (template.options.containsKey(key)) {
params.remove(key);
}
}
return new ClickHouseNode(host, protocol, port, credentials, params, tags);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: of
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
|
of
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final native void setThreadPriority(int tid, int priority)
throws IllegalArgumentException, SecurityException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setThreadPriority
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
setThreadPriority
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Materials multipleMaterials() {
Materials materials = new Materials();
materials.add(svnMaterial("http://svnurl"));
materials.add(hgMaterial("http://hgurl", "hgdir"));
materials.add(dependencyMaterial("cruise", "dev"));
return materials;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: multipleMaterials
File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
multipleMaterials
|
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public abstract int containedTypeCount();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containedTypeCount
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
|
containedTypeCount
|
src/main/java/com/fasterxml/jackson/databind/JavaType.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean onlyHasDefaultChannel(String pkg, int uid) {
try {
return sINM.onlyHasDefaultChannel(pkg, uid);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onlyHasDefaultChannel
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
onlyHasDefaultChannel
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
NeededUriGrants checkGrantUriPermissionFromIntentLocked(int callingUid,
String targetPkg, Intent intent, int mode, NeededUriGrants needed, int targetUserId) {
if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION,
"Checking URI perm to data=" + (intent != null ? intent.getData() : null)
+ " clip=" + (intent != null ? intent.getClipData() : null)
+ " from " + intent + "; flags=0x"
+ Integer.toHexString(intent != null ? intent.getFlags() : 0));
if (targetPkg == null) {
throw new NullPointerException("targetPkg");
}
if (intent == null) {
return null;
}
Uri data = intent.getData();
ClipData clip = intent.getClipData();
if (data == null && clip == null) {
return null;
}
// Default userId for uris in the intent (if they don't specify it themselves)
int contentUserHint = intent.getContentUserHint();
if (contentUserHint == UserHandle.USER_CURRENT) {
contentUserHint = UserHandle.getUserId(callingUid);
}
final IPackageManager pm = AppGlobals.getPackageManager();
int targetUid;
if (needed != null) {
targetUid = needed.targetUid;
} else {
try {
targetUid = pm.getPackageUid(targetPkg, MATCH_DEBUG_TRIAGED_MISSING,
targetUserId);
} catch (RemoteException ex) {
return null;
}
if (targetUid < 0) {
if (DEBUG_URI_PERMISSION) Slog.v(TAG_URI_PERMISSION,
"Can't grant URI permission no uid for: " + targetPkg
+ " on user " + targetUserId);
return null;
}
}
if (data != null) {
GrantUri grantUri = GrantUri.resolve(contentUserHint, data);
targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, mode,
targetUid);
if (targetUid > 0) {
if (needed == null) {
needed = new NeededUriGrants(targetPkg, targetUid, mode);
}
needed.add(grantUri);
}
}
if (clip != null) {
for (int i=0; i<clip.getItemCount(); i++) {
Uri uri = clip.getItemAt(i).getUri();
if (uri != null) {
GrantUri grantUri = GrantUri.resolve(contentUserHint, uri);
targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, mode,
targetUid);
if (targetUid > 0) {
if (needed == null) {
needed = new NeededUriGrants(targetPkg, targetUid, mode);
}
needed.add(grantUri);
}
} else {
Intent clipIntent = clip.getItemAt(i).getIntent();
if (clipIntent != null) {
NeededUriGrants newNeeded = checkGrantUriPermissionFromIntentLocked(
callingUid, targetPkg, clipIntent, mode, needed, targetUserId);
if (newNeeded != null) {
needed = newNeeded;
}
}
}
}
}
return needed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkGrantUriPermissionFromIntentLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
checkGrantUriPermissionFromIntentLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate33(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Projects.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
for (Element branchProtectionElement: element.element("branchProtections").elements()) {
branchProtectionElement.element("noCreation").setName("preventCreation");
branchProtectionElement.element("noDeletion").setName("preventDeletion");
branchProtectionElement.element("noForcedPush").setName("preventForcedPush");
}
for (Element tagProtectionElement: element.element("tagProtections").elements()) {
tagProtectionElement.element("noCreation").setName("preventCreation");
tagProtectionElement.element("noDeletion").setName("preventDeletion");
tagProtectionElement.element("noUpdate").setName("preventUpdate");
}
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate33
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate33
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public ClientConfig getClientConfig() {
return clientConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClientConfig
File: samples/client/petstore/java/okhttp-gson-parcelableModel/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
|
getClientConfig
|
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void commentImpl(String comment) {
xmlNode.appendChild(getDocument().createComment(comment));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: commentImpl
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
commentImpl
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
protected synchronized TransportConnectionState unregisterConnectionState(ConnectionId connectionId) {
return connectionStateRegister.unregisterConnectionState(connectionId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unregisterConnectionState
File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
Repository: apache/activemq
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-3576
|
MEDIUM
| 5
|
apache/activemq
|
unregisterConnectionState
|
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
|
00921f2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation) {
if (mHasNavigationBar) {
// For a basic navigation bar, when we are in portrait mode we place
// the navigation bar to the bottom.
if (!mNavigationBarCanMove || fullWidth < fullHeight) {
return fullHeight - mNavigationBarHeightForRotation[rotation];
}
}
return fullHeight;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNonDecorDisplayHeight
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
getNonDecorDisplayHeight
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermissions("user:list")
@GetMapping("/list")
public String list(@RequestParam(defaultValue = "1") Integer pageNo, String username, Model model) {
// username= SecurityUtil.sanitizeInput(username);
IPage<User> iPage = userService.selectAll(pageNo, username);
model.addAttribute("page", iPage);
model.addAttribute("username", username);
return "admin/user/list";
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2022-23391
- Severity: MEDIUM
- CVSS Score: 4.3
Description: 修复了一部分页面上输入框的xss注入
https://github.com/atjiu/pybbs/issues/171
Function: list
File: src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
Repository: atjiu/pybbs
Fixed Code:
@RequiresPermissions("user:list")
@GetMapping("/list")
public String list(@RequestParam(defaultValue = "1") Integer pageNo, String username, Model model) {
if (username != null) username = username.replace("\"", "").replace("'", "");
// username= SecurityUtil.sanitizeInput(username);
IPage<User> iPage = userService.selectAll(pageNo, username);
model.addAttribute("page", iPage);
model.addAttribute("username", username);
return "admin/user/list";
}
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
list
|
src/main/java/co/yiiu/pybbs/controller/admin/UserAdminController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 1
|
Analyze the following code function for security vulnerabilities
|
public void gotoPage(List<String> spaces, String page, String action, String queryString)
{
gotoPage(getURL(spaces, page, action, queryString));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: gotoPage
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
|
gotoPage
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
void setLoaders(@NonNull List<ResourcesLoader> newLoaders) {
Objects.requireNonNull(newLoaders, "newLoaders");
final ArrayList<ApkAssets> apkAssets = new ArrayList<>();
for (int i = 0; i < mApkAssets.length; i++) {
// Filter out the previous loader apk assets.
if (!mApkAssets[i].isForLoader()) {
apkAssets.add(mApkAssets[i]);
}
}
if (!newLoaders.isEmpty()) {
// Filter so that assets provided by multiple loaders are only included once
// in the final assets list. The last appearance of the ApkAssets dictates its load
// order.
final int loaderStartIndex = apkAssets.size();
final ArraySet<ApkAssets> uniqueLoaderApkAssets = new ArraySet<>();
for (int i = newLoaders.size() - 1; i >= 0; i--) {
final List<ApkAssets> currentLoaderApkAssets = newLoaders.get(i).getApkAssets();
for (int j = currentLoaderApkAssets.size() - 1; j >= 0; j--) {
final ApkAssets loaderApkAssets = currentLoaderApkAssets.get(j);
if (uniqueLoaderApkAssets.add(loaderApkAssets)) {
apkAssets.add(loaderStartIndex, loaderApkAssets);
}
}
}
}
mLoaders = newLoaders.toArray(new ResourcesLoader[0]);
setApkAssets(apkAssets.toArray(new ApkAssets[0]), true /* invalidate_caches */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLoaders
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
setLoaders
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSkinPreference(String preference)
{
return this.xwiki.getSkinPreference(preference, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSkinPreference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getSkinPreference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
static boolean isPrimitiveType(char typecode) {
return !(typecode == '[' || typecode == 'L');
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPrimitiveType
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
isPrimitiveType
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSocketConfigurator(SocketConfigurator socketConfigurator) {
this.socketConf = socketConfigurator;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSocketConfigurator
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
setSocketConfigurator
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean shouldUseAppThemeSnapshot() {
return !mEnableRecentsScreenshot || forAllWindows(WindowState::isSecureLocked,
true /* topToBottom */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldUseAppThemeSnapshot
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
shouldUseAppThemeSnapshot
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onTextContextMenuItem(int id) {
if (id == android.R.id.paste) {
ClipboardManager clipboard = (ClipboardManager) getContext()
.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clipData = clipboard.getPrimaryClip();
if (clipData != null) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < clipData.getItemCount(); i++) {
builder.append(clipData.getItemAt(i).coerceToText(getContext()));
}
String pasteString = OmniboxViewUtil.sanitizeTextForPaste(builder.toString());
int min = 0;
int max = getText().length();
if (isFocused()) {
final int selStart = getSelectionStart();
final int selEnd = getSelectionEnd();
min = Math.max(0, Math.min(selStart, selEnd));
max = Math.max(0, Math.max(selStart, selEnd));
}
Selection.setSelection(getText(), max);
getText().replace(min, max, pasteString);
mIsPastedText = true;
return true;
}
}
if (mOriginalUrlLocation == null || mFormattedUrlLocation == null) {
return super.onTextContextMenuItem(id);
}
int selectedStartIndex = getSelectionStart();
int selectedEndIndex = getSelectionEnd();
// If we are copying/cutting the full previously formatted URL, reset the URL
// text before initiating the TextViews handling of the context menu.
String currentText = getText().toString();
if (selectedStartIndex == 0
&& (id == android.R.id.cut || id == android.R.id.copy)
&& currentText.startsWith(mFormattedUrlLocation)
&& selectedEndIndex >= mFormattedUrlLocation.length()) {
String newText = mOriginalUrlLocation
+ currentText.substring(mFormattedUrlLocation.length());
selectedEndIndex = selectedEndIndex - mFormattedUrlLocation.length()
+ mOriginalUrlLocation.length();
setIgnoreTextChangesForAutocomplete(true);
setText(newText);
setSelection(0, selectedEndIndex);
boolean retVal = super.onTextContextMenuItem(id);
if (getText().toString().equals(newText)) {
setText(currentText);
setSelection(getText().length());
}
setIgnoreTextChangesForAutocomplete(false);
return retVal;
}
return super.onTextContextMenuItem(id);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTextContextMenuItem
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
onTextContextMenuItem
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
private ShortcutUser loadUserLocked(@UserIdInt int userId) {
try (ResilientAtomicFile file = getUserFile(userId)) {
FileInputStream in = null;
try {
if (DEBUG || DEBUG_REBOOT) {
Slog.d(TAG, "Loading from " + file);
}
in = file.openRead();
if (in == null) {
if (DEBUG || DEBUG_REBOOT) {
Slog.d(TAG, "Not found " + file);
}
return null;
}
return loadUserInternal(userId, in, /* forBackup= */ false);
} catch (Exception e) {
// Remove corrupted file and retry.
file.failRead(in, e);
return loadUserLocked(userId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadUserLocked
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
|
loadUserLocked
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void cleanup(boolean closeall) {
int size = fCurrentEntityStack.size();
if (size > 0) {
// current entity is not the original, so close it
if (fCurrentEntity != null) {
fCurrentEntity.closeQuietly();
}
// close remaining streams
for (int i = closeall ? 0 : 1; i < size; i++) {
fCurrentEntity = (CurrentEntity) fCurrentEntityStack.pop();
fCurrentEntity.closeQuietly();
}
}
else if (closeall && fCurrentEntity != null) {
fCurrentEntity.closeQuietly();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanup
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
cleanup
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforceDebuggable(ApplicationInfo info) {
if (!Build.IS_DEBUGGABLE && (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
throw new SecurityException("Process not debuggable: " + info.packageName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceDebuggable
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
|
enforceDebuggable
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String nextFieldName() throws IOException
{
if (_parsingContext.inObject() && _currToken != JsonToken.FIELD_NAME) {
_numTypesValid = NR_UNKNOWN;
if (_tokenIncomplete) {
_skipIncomplete();
}
_tokenInputTotal = _currInputProcessed + _inputPtr;
_binaryValue = null;
_tagValue = -1;
// completed the whole Object?
if (!_parsingContext.expectMoreValues()) {
_parsingContext = _parsingContext.getParent();
_currToken = JsonToken.END_OBJECT;
return null;
}
// inlined "_decodeFieldName()"
if (_inputPtr >= _inputEnd) {
loadMoreGuaranteed();
}
final int ch = _inputBuffer[_inputPtr++];
final int type = ((ch >> 5) & 0x7);
// offline non-String cases, as they are expected to be rare
if (type != CBORConstants.MAJOR_TYPE_TEXT) {
if (ch == -1) { // end-of-object, common
if (!_parsingContext.hasExpectedLength()) {
_parsingContext = _parsingContext.getParent();
_currToken = JsonToken.END_OBJECT;
return null;
}
_reportUnexpectedBreak();
}
_decodeNonStringName(ch);
_currToken = JsonToken.FIELD_NAME;
return getText();
}
final int lenMarker = ch & 0x1F;
String name;
if (lenMarker <= 23) {
if (lenMarker == 0) {
name = "";
} else {
name = _findDecodedFromSymbols(lenMarker);
if (name != null) {
_inputPtr += lenMarker;
} else {
name = _decodeShortName(lenMarker);
name = _addDecodedToSymbols(lenMarker, name);
}
}
} else {
final int actualLen = _decodeExplicitLength(lenMarker);
if (actualLen < 0) {
name = _decodeChunkedName();
} else {
name = _decodeLongerName(actualLen);
}
}
_parsingContext.setCurrentName(name);
_currToken = JsonToken.FIELD_NAME;
return name;
}
// otherwise just fall back to default handling; should occur rarely
return (nextToken() == JsonToken.FIELD_NAME) ? getCurrentName() : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nextFieldName
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-28491
|
MEDIUM
| 5
|
FasterXML/jackson-dataformats-binary
|
nextFieldName
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
void writeBroadcastsToProtoLocked(ProtoOutputStream proto) {
if (mRegisteredReceivers.size() > 0) {
Iterator it = mRegisteredReceivers.values().iterator();
while (it.hasNext()) {
ReceiverList r = (ReceiverList)it.next();
r.dumpDebug(proto, ActivityManagerServiceDumpBroadcastsProto.RECEIVER_LIST);
}
}
mReceiverResolver.dumpDebug(proto, ActivityManagerServiceDumpBroadcastsProto.RECEIVER_RESOLVER);
for (BroadcastQueue q : mBroadcastQueues) {
q.dumpDebug(proto, ActivityManagerServiceDumpBroadcastsProto.BROADCAST_QUEUE);
}
for (int user=0; user<mStickyBroadcasts.size(); user++) {
long token = proto.start(ActivityManagerServiceDumpBroadcastsProto.STICKY_BROADCASTS);
proto.write(StickyBroadcastProto.USER, mStickyBroadcasts.keyAt(user));
for (Map.Entry<String, ArrayList<Intent>> ent
: mStickyBroadcasts.valueAt(user).entrySet()) {
long actionToken = proto.start(StickyBroadcastProto.ACTIONS);
proto.write(StickyBroadcastProto.StickyAction.NAME, ent.getKey());
for (Intent intent : ent.getValue()) {
intent.dumpDebug(proto, StickyBroadcastProto.StickyAction.INTENTS,
false, true, true, false);
}
proto.end(actionToken);
}
proto.end(token);
}
long handlerToken = proto.start(ActivityManagerServiceDumpBroadcastsProto.HANDLER);
proto.write(ActivityManagerServiceDumpBroadcastsProto.MainHandler.HANDLER, mHandler.toString());
mHandler.getLooper().dumpDebug(proto,
ActivityManagerServiceDumpBroadcastsProto.MainHandler.LOOPER);
proto.end(handlerToken);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeBroadcastsToProtoLocked
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
|
writeBroadcastsToProtoLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate21(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Projects.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
for (Element branchProtectionElement: element.element("branchProtections").elements()) {
branchProtectionElement.element("branch").setName("branches");
for (Element fileProtectionElement: branchProtectionElement.element("fileProtections").elements()) {
fileProtectionElement.element("path").setName("paths");
}
}
for (Element tagProtectionElement: element.element("tagProtections").elements()) {
tagProtectionElement.element("tag").setName("tags");
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("LICENSE")) {
element.element("value").addAttribute("class", "io.onedev.commons.utils.license.LicenseDetail");
}
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate21
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate21
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object forward(String path) {
try {
HttpServletResponse response = (HttpServletResponse)SaManager.getSaTokenContextOrSecond().getResponse().getSource();
request.getRequestDispatcher(path).forward(request, response);
return null;
} catch (ServletException | IOException e) {
throw new SaTokenException(e).setCode(SaServletErrorCode.CODE_20001);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: forward
File: sa-token-starter/sa-token-jakarta-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
forward
|
sa-token-starter/sa-token-jakarta-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
@Override
public void save(Project project) {
save(project, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: save
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
save
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context)
throws XWikiException
{
return searchDocumentReferences(wheresql, nb, start, "", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchDocumentReferences
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
searchDocumentReferences
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateLeftAffordanceIcon() {
IconState state = mLeftButton.getIcon();
mLeftAffordanceView.setVisibility(!mDozing && state.isVisible ? View.VISIBLE : View.GONE);
mLeftAffordanceView.setImageDrawable(state.drawable, state.tint);
mLeftAffordanceView.setContentDescription(state.contentDescription);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLeftAffordanceIcon
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
updateLeftAffordanceIcon
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
@Deprecated
public BubbleMetadata.Builder createShortcutBubble(@NonNull String shortcutId) {
if (!TextUtils.isEmpty(shortcutId)) {
// If shortcut id is set, we don't use these if they were previously set.
mPendingIntent = null;
mIcon = null;
}
mShortcutId = shortcutId;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createShortcutBubble
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
createShortcutBubble
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setDeviceIdleWhitelist(int[] allAppids, int[] exceptIdleAppids) {
synchronized (ActivityManagerService.this) {
mDeviceIdleWhitelist = allAppids;
mDeviceIdleExceptIdleWhitelist = exceptIdleAppids;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDeviceIdleWhitelist
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
|
setDeviceIdleWhitelist
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isDrawFinishedLw() {
return mHasSurface && !mDestroying &&
(mWinAnimator.mDrawState == COMMIT_DRAW_PENDING
|| mWinAnimator.mDrawState == READY_TO_SHOW
|| mWinAnimator.mDrawState == HAS_DRAWN);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDrawFinishedLw
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
isDrawFinishedLw
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean doesFileExistAndMatchContentsWithEtcPristine(String file) {
final java.nio.file.Path etcPath = ensureFileIsAllowed(file);
final java.nio.file.Path etcPristinePath = etcPristineFolder.resolve(file);
if (!Files.exists(etcPristinePath)) {
return false;
}
try (Reader pathReader = Files.newBufferedReader(etcPath);
Reader etcPristineReader = Files.newBufferedReader(etcPristinePath)) {
return IOUtils.contentEqualsIgnoreEOL(pathReader, etcPristineReader);
} catch (IOException e) {
throw new InternalServerErrorException(e);
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-40315
- Severity: HIGH
- CVSS Score: 8.0
Description: NMS-15702: Only members of ROLE_ADMIN can view/edit users.xml
Function: doesFileExistAndMatchContentsWithEtcPristine
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
Repository: OpenNMS/opennms
Fixed Code:
public boolean doesFileExistAndMatchContentsWithEtcPristine(String file, final SecurityContext securityContext) {
final java.nio.file.Path etcPath = ensureFileIsAllowed(file, securityContext);
final java.nio.file.Path etcPristinePath = etcPristineFolder.resolve(file);
if (!Files.exists(etcPristinePath)) {
return false;
}
try (Reader pathReader = Files.newBufferedReader(etcPath);
Reader etcPristineReader = Files.newBufferedReader(etcPristinePath)) {
return IOUtils.contentEqualsIgnoreEOL(pathReader, etcPristineReader);
} catch (IOException e) {
throw new InternalServerErrorException(e);
}
}
|
[
"CWE-Other"
] |
CVE-2023-40315
|
HIGH
| 8
|
OpenNMS/opennms
|
doesFileExistAndMatchContentsWithEtcPristine
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
|
201301e067329ababa3c0671ded5c4c43347d4a8
| 1
|
Analyze the following code function for security vulnerabilities
|
public static ActivityOptions makeTaskLaunchBehind() {
final ActivityOptions opts = new ActivityOptions();
opts.mAnimationType = ANIM_LAUNCH_TASK_BEHIND;
return opts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeTaskLaunchBehind
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
makeTaskLaunchBehind
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setConnectionRecoveryTriggeringCondition(Predicate<ShutdownSignalException> connectionRecoveryTriggeringCondition) {
this.connectionRecoveryTriggeringCondition = connectionRecoveryTriggeringCondition;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setConnectionRecoveryTriggeringCondition
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
setConnectionRecoveryTriggeringCondition
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean performShowLocked() {
if (!showToCurrentUser()) {
if (DEBUG_VISIBILITY) Slog.w(TAG, "hiding " + this + ", belonging to " + mOwnerUid);
clearPolicyVisibilityFlag(VISIBLE_FOR_USER);
return false;
}
logPerformShow("performShow on ");
final int drawState = mWinAnimator.mDrawState;
if ((drawState == HAS_DRAWN || drawState == READY_TO_SHOW) && mActivityRecord != null) {
if (mAttrs.type != TYPE_APPLICATION_STARTING) {
mActivityRecord.onFirstWindowDrawn(this);
} else {
mActivityRecord.onStartingWindowDrawn();
}
}
if (mWinAnimator.mDrawState != READY_TO_SHOW || !isReadyForDisplay()) {
return false;
}
logPerformShow("Showing ");
mWmService.enableScreenIfNeededLocked();
mWinAnimator.applyEnterAnimationLocked();
// Force the show in the next prepareSurfaceLocked() call.
mWinAnimator.mLastAlpha = -1;
ProtoLog.v(WM_DEBUG_ANIM, "performShowLocked: mDrawState=HAS_DRAWN in %s", this);
mWinAnimator.mDrawState = HAS_DRAWN;
mWmService.scheduleAnimationLocked();
if (mHidden) {
mHidden = false;
final DisplayContent displayContent = getDisplayContent();
for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowState c = mChildren.get(i);
if (c.mWinAnimator.mSurfaceController != null) {
c.performShowLocked();
// It hadn't been shown, which means layout not performed on it, so now we
// want to make sure to do a layout. If called from within the transaction
// loop, this will cause it to restart with a new layout.
if (displayContent != null) {
displayContent.setLayoutNeeded();
}
}
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performShowLocked
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
performShowLocked
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int stringWidth(Object nativeFont, String str) {
float w = (nativeFont == null ? this.defaultFont
: (Paint) ((NativeFont) nativeFont).font).measureText(str);
if (w - (int) w > 0) {
return (int) (w + 1);
}
return (int) w;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stringWidth
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
stringWidth
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void navigationStateChanged(int flags) {
if ((flags & INVALIDATE_TYPE_TITLE) != 0) {
for (TabObserver observer : mObservers) observer.onTitleUpdated(Tab.this);
}
if ((flags & INVALIDATE_TYPE_URL) != 0) {
for (TabObserver observer : mObservers) observer.onUrlUpdated(Tab.this);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: navigationStateChanged
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
navigationStateChanged
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void updateObject(
int columnIndex, @Nullable Object x, int scale) throws SQLException {
this.updateObject(columnIndex, x);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateObject
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
updateObject
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean maybeMigrateSettingsForRenamedAuthorities() {
boolean writeNeeded = false;
ArrayList<AuthorityInfo> authoritiesToRemove = new ArrayList<AuthorityInfo>();
final int N = mAuthorities.size();
for (int i = 0; i < N; i++) {
AuthorityInfo authority = mAuthorities.valueAt(i);
// skip this authority if it doesn't target a provider
if (authority.target.target_service) {
continue;
}
// skip this authority if it isn't one of the renamed ones
final String newAuthorityName = sAuthorityRenames.get(authority.target.provider);
if (newAuthorityName == null) {
continue;
}
// remember this authority so we can remove it later. we can't remove it
// now without messing up this loop iteration
authoritiesToRemove.add(authority);
// this authority isn't enabled, no need to copy it to the new authority name since
// the default is "disabled"
if (!authority.enabled) {
continue;
}
// if we already have a record of this new authority then don't copy over the settings
EndPoint newInfo =
new EndPoint(authority.target.account,
newAuthorityName,
authority.target.userId);
if (getAuthorityLocked(newInfo, "cleanup") != null) {
continue;
}
AuthorityInfo newAuthority =
getOrCreateAuthorityLocked(newInfo, -1 /* ident */, false /* doWrite */);
newAuthority.enabled = true;
writeNeeded = true;
}
for (AuthorityInfo authorityInfo : authoritiesToRemove) {
removeAuthorityLocked(
authorityInfo.target.account,
authorityInfo.target.userId,
authorityInfo.target.provider,
false /* doWrite */);
writeNeeded = true;
}
return writeNeeded;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeMigrateSettingsForRenamedAuthorities
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
maybeMigrateSettingsForRenamedAuthorities
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Set<String> getSupportedClientKeyTypes(byte[] clientCertificateTypes) {
Set<String> result = new HashSet<String>(clientCertificateTypes.length);
for (byte keyTypeCode : clientCertificateTypes) {
String keyType = getClientKeyType(keyTypeCode);
if (keyType == null) {
// Unsupported client key type -- ignore
continue;
}
result.add(keyType);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSupportedClientKeyTypes
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
getSupportedClientKeyTypes
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isOperatorConsideredNonRoaming(ServiceState s) {
String operatorNumeric = s.getOperatorNumeric();
String[] numericArray = mPhone.getContext().getResources().getStringArray(
com.android.internal.R.array.config_operatorConsideredNonRoaming);
if (numericArray.length == 0 || operatorNumeric == null) {
return false;
}
for (String numeric : numericArray) {
if (operatorNumeric.startsWith(numeric)) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOperatorConsideredNonRoaming
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
|
isOperatorConsideredNonRoaming
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeStructure(Element design, DesignContext designContext) {
if (getColumns().isEmpty()) {
return;
}
Element tableElement = design.appendElement("table");
Element colGroup = tableElement.appendElement("colgroup");
getColumns().forEach(column -> column
.writeDesign(colGroup.appendElement("col"), designContext));
// Always write thead. Reads correctly when there no header rows
getHeader().writeDesign(tableElement.appendElement("thead"),
designContext);
if (designContext.shouldWriteData(this)) {
Element bodyElement = tableElement.appendElement("tbody");
writeData(bodyElement, designContext);
}
if (getFooter().getRowCount() > 0) {
getFooter().writeDesign(tableElement.appendElement("tfoot"),
designContext);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeStructure
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
writeStructure
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public Jooby port(final int port) {
this.port = port;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: port
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
|
port
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateCpuStatsNow() {
synchronized (mProcessCpuTracker) {
mProcessCpuMutexFree.set(false);
final long now = SystemClock.uptimeMillis();
boolean haveNewCpuStats = false;
if (MONITOR_CPU_USAGE &&
mLastCpuTime.get() < (now-MONITOR_CPU_MIN_TIME)) {
mLastCpuTime.set(now);
haveNewCpuStats = true;
mProcessCpuTracker.update();
//Slog.i(TAG, mProcessCpu.printCurrentState());
//Slog.i(TAG, "Total CPU usage: "
// + mProcessCpu.getTotalCpuPercent() + "%");
// Slog the cpu usage if the property is set.
if ("true".equals(SystemProperties.get("events.cpu"))) {
int user = mProcessCpuTracker.getLastUserTime();
int system = mProcessCpuTracker.getLastSystemTime();
int iowait = mProcessCpuTracker.getLastIoWaitTime();
int irq = mProcessCpuTracker.getLastIrqTime();
int softIrq = mProcessCpuTracker.getLastSoftIrqTime();
int idle = mProcessCpuTracker.getLastIdleTime();
int total = user + system + iowait + irq + softIrq + idle;
if (total == 0) total = 1;
EventLog.writeEvent(EventLogTags.CPU,
((user+system+iowait+irq+softIrq) * 100) / total,
(user * 100) / total,
(system * 100) / total,
(iowait * 100) / total,
(irq * 100) / total,
(softIrq * 100) / total);
}
}
long[] cpuSpeedTimes = mProcessCpuTracker.getLastCpuSpeedTimes();
final BatteryStatsImpl bstats = mBatteryStatsService.getActiveStatistics();
synchronized(bstats) {
synchronized(mPidsSelfLocked) {
if (haveNewCpuStats) {
if (mOnBattery) {
int perc = bstats.startAddingCpuLocked();
int totalUTime = 0;
int totalSTime = 0;
final int N = mProcessCpuTracker.countStats();
for (int i=0; i<N; i++) {
ProcessCpuTracker.Stats st = mProcessCpuTracker.getStats(i);
if (!st.working) {
continue;
}
ProcessRecord pr = mPidsSelfLocked.get(st.pid);
int otherUTime = (st.rel_utime*perc)/100;
int otherSTime = (st.rel_stime*perc)/100;
totalUTime += otherUTime;
totalSTime += otherSTime;
if (pr != null) {
BatteryStatsImpl.Uid.Proc ps = pr.curProcBatteryStats;
if (ps == null || !ps.isActive()) {
pr.curProcBatteryStats = ps = bstats.getProcessStatsLocked(
pr.info.uid, pr.processName);
}
ps.addCpuTimeLocked(st.rel_utime-otherUTime,
st.rel_stime-otherSTime);
ps.addSpeedStepTimes(cpuSpeedTimes);
pr.curCpuTime += (st.rel_utime+st.rel_stime) * 10;
} else {
BatteryStatsImpl.Uid.Proc ps = st.batteryStats;
if (ps == null || !ps.isActive()) {
st.batteryStats = ps = bstats.getProcessStatsLocked(
bstats.mapUid(st.uid), st.name);
}
ps.addCpuTimeLocked(st.rel_utime-otherUTime,
st.rel_stime-otherSTime);
ps.addSpeedStepTimes(cpuSpeedTimes);
}
}
bstats.finishAddingCpuLocked(perc, totalUTime,
totalSTime, cpuSpeedTimes);
}
}
}
if (mLastWriteTime < (now-BATTERY_STATS_TIME)) {
mLastWriteTime = now;
mBatteryStatsService.getActiveStatistics().writeAsyncLocked();
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateCpuStatsNow
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
|
updateCpuStatsNow
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setVrThread(int tid) {
enforceSystemHasVrFeature();
synchronized (mGlobalLock) {
final int pid = Binder.getCallingPid();
final WindowProcessController wpc = mProcessMap.getProcess(pid);
mVrController.setVrThreadLocked(tid, pid, wpc);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVrThread
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
|
setVrThread
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void add(final String key, final Object object) {
propertyValues.computeIfAbsent(key, k -> new ArrayList<>()).add(object);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: add
File: stroom-core-server/src/main/java/stroom/importexport/server/Config.java
Repository: gchq/stroom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
add
|
stroom-core-server/src/main/java/stroom/importexport/server/Config.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void finishHeavyWeightApp() {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: finishHeavyWeightApp() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
mAtmInternal.finishHeavyWeightApp();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishHeavyWeightApp
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
|
finishHeavyWeightApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void deleteByPojoDeleteFails(TestContext context) throws FieldException {
postgresClientQueryFails().delete(FOO, new SimplePojo(), context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteByPojoDeleteFails
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
|
deleteByPojoDeleteFails
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isScrimSrcModeEnabled() {
return mScrimSrcModeEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isScrimSrcModeEnabled
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
isScrimSrcModeEnabled
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("javadoc")
public void onAttachedToWindow() {
setAccessibilityState(mAccessibilityManager.isEnabled());
ScreenOrientationListener.getInstance().addObserver(this, mContext);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onAttachedToWindow
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
onAttachedToWindow
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull public String getEnrollmentSpecificId() {
throwIfParentInstance("getEnrollmentSpecificId");
if (mService == null) {
return "";
}
try {
return mService.getEnrollmentSpecificId(mContext.getPackageName());
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEnrollmentSpecificId
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
|
getEnrollmentSpecificId
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected IBillingSupport createBillingSupport() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createBillingSupport
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
createBillingSupport
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onServerCertificateAvailable(
int depth,
byte[] subjectBytes,
byte[] certHashBytes,
byte[] certBytes) {
synchronized (mLock) {
// OpenSSL default maximum depth is 100.
if (depth < 0 || depth > 100) {
mNetworkHal.logCallback("onServerCertificateAvailable: invalid depth " + depth);
return;
}
if (null == subjectBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: subject is null.");
return;
}
if (null == certHashBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: cert hash is null.");
return;
}
if (null == certBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: cert is null.");
return;
}
mNetworkHal.logCallback("onServerCertificateAvailable: "
+ " depth=" + depth
+ " subjectBytes size=" + subjectBytes.length
+ " certHashBytes size=" + certHashBytes.length
+ " certBytes size=" + certBytes.length);
if (0 == certHashBytes.length) return;
if (0 == certBytes.length) return;
String subject = byteArrayToString(subjectBytes);
if (null == subject) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: cannot convert subject bytes to string.");
return;
}
String certHash = byteArrayToString(certHashBytes);
if (null == subject) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: cannot convert cert hash bytes to string.");
return;
}
X509Certificate cert = null;
try {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
InputStream in = new ByteArrayInputStream(certBytes);
cert = (X509Certificate) certFactory.generateCertificate(in);
} catch (CertificateException e) {
cert = null;
mNetworkHal.logCallback(
"onServerCertificateAvailable: "
+ "Failed to get instance for CertificateFactory: " + e);
} catch (IllegalArgumentException e) {
cert = null;
mNetworkHal.logCallback(
"onServerCertificateAvailable: Failed to decode the data: " + e);
}
if (null == cert) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: Failed to read certificate.");
return;
}
mNetworkHal.logCallback("onServerCertificateAvailable:"
+ " depth=" + depth
+ " subject=" + subject
+ " certHash=" + certHash
+ " cert=" + cert);
mWifiMonitor.broadcastCertificationEvent(
mIfaceName, mFrameworkNetworkId, mSsid, depth, cert);
}
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21242
- Severity: CRITICAL
- CVSS Score: 9.8
Description: [TOFU] Validate full cert chains before displaying dialog
When a full chain including a Root CA is provided by the server,
perform a full validation of the chain before displaying the
TOFU dialog.
If validation passes: Display a TOFU dialog and ask the user if
they trust this network. Saying yes means that the Root can be
installed safely for that network. They might say no - this is
possible if an attacker creates a full chain they control which
results in a different SHA-256 (everything else looks correct).
If they say no, we stop the connection.
If validation fails: Display an error message saying that the
validation failed, we stop the connection and won't display the
TOFU dialog.
Use server certificate pinning for servers that send only a leaf
or a partial chain with no Root CA.
Additionally: clean up the debug logs to reduce the noise and
focus only on the important details.
Bug: 277824547
Test: atest InsecureEapNetworkHandler
Test: Connect to various Enterprise networks
Negative test: Confirm verification fails for invalid chains
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b0ee00ddf38bb677876a6cffb876e6f511e2c139)
Merged-In: I224c80e2787497634d3e68760122dac5f177585a
Change-Id: I224c80e2787497634d3e68760122dac5f177585a
Function: onServerCertificateAvailable
File: service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
Repository: android
Fixed Code:
@Override
public void onServerCertificateAvailable(
int depth,
byte[] subjectBytes,
byte[] certHashBytes,
byte[] certBytes) {
synchronized (mLock) {
// OpenSSL default maximum depth is 100.
if (depth < 0 || depth > 100) {
mNetworkHal.logCallback("onServerCertificateAvailable: invalid depth " + depth);
return;
}
if (null == subjectBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: subject is null.");
return;
}
if (null == certHashBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: cert hash is null.");
return;
}
if (null == certBytes) {
mNetworkHal.logCallback("onServerCertificateAvailable: cert is null.");
return;
}
mNetworkHal.logCallback("onServerCertificateAvailable: "
+ " depth=" + depth
+ " subjectBytes size=" + subjectBytes.length
+ " certHashBytes size=" + certHashBytes.length
+ " certBytes size=" + certBytes.length);
if (0 == certHashBytes.length) return;
if (0 == certBytes.length) return;
String subject = byteArrayToString(subjectBytes);
if (null == subject) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: cannot convert subject bytes to string.");
return;
}
String certHash = byteArrayToString(certHashBytes);
if (null == subject) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: cannot convert cert hash bytes to string.");
return;
}
X509Certificate cert = null;
try {
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
InputStream in = new ByteArrayInputStream(certBytes);
cert = (X509Certificate) certFactory.generateCertificate(in);
} catch (CertificateException e) {
cert = null;
mNetworkHal.logCallback(
"onServerCertificateAvailable: "
+ "Failed to get instance for CertificateFactory: " + e);
} catch (IllegalArgumentException e) {
cert = null;
mNetworkHal.logCallback(
"onServerCertificateAvailable: Failed to decode the data: " + e);
}
if (null == cert) {
mNetworkHal.logCallback(
"onServerCertificateAvailable: Failed to read certificate.");
return;
}
mNetworkHal.logCallback("onServerCertificateAvailable:"
+ " depth=" + depth
+ " subject=" + subject
+ " certHash=" + certHash
+ " cert=" + cert);
mWifiMonitor.broadcastCertificationEvent(
mIfaceName, mFrameworkNetworkId, mSsid, depth,
new CertificateEventInfo(cert, certHash));
}
}
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
onServerCertificateAvailable
|
service/java/com/android/server/wifi/SupplicantStaNetworkCallbackAidlImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 1
|
Analyze the following code function for security vulnerabilities
|
void updateOrientationListenerLp() {
if (!mOrientationListener.canDetectOrientation()) {
// If sensor is turned off or nonexistent for some reason
return;
}
//Could have been invoked due to screen turning on or off or
//change of the currently visible window's orientation
if (localLOGV) Slog.v(TAG, "mScreenOnEarly=" + mScreenOnEarly
+ ", mAwake=" + mAwake + ", mCurrentAppOrientation=" + mCurrentAppOrientation
+ ", mOrientationSensorEnabled=" + mOrientationSensorEnabled);
boolean disable = true;
if (mScreenOnEarly && mAwake) {
if (needSensorRunningLp()) {
disable = false;
//enable listener if not already enabled
if (!mOrientationSensorEnabled) {
mOrientationListener.enable();
if(localLOGV) Slog.v(TAG, "Enabling listeners");
mOrientationSensorEnabled = true;
}
}
}
//check if sensors need to be disabled
if (disable && mOrientationSensorEnabled) {
mOrientationListener.disable();
if(localLOGV) Slog.v(TAG, "Disabling listeners");
mOrientationSensorEnabled = false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateOrientationListenerLp
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
updateOrientationListenerLp
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAccessibilityState(boolean state) {
if (!state) {
setInjectedAccessibility(false);
mNativeAccessibilityAllowed = false;
mTouchExplorationEnabled = false;
} else {
boolean useScriptInjection = isDeviceAccessibilityScriptInjectionEnabled();
setInjectedAccessibility(useScriptInjection);
mNativeAccessibilityAllowed = !useScriptInjection;
mTouchExplorationEnabled = mAccessibilityManager.isTouchExplorationEnabled();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAccessibilityState
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
setAccessibilityState
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public Date parseDate(String str) {
try {
return dateFormat.parse(str);
} catch (java.text.ParseException e) {
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDate
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
parseDate
|
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
void bindPaymentServiceLocked(int userId, ComponentName service) {
unbindPaymentServiceLocked();
Log.d(TAG, "Binding to payment service " + service + " for userid:" + userId);
Intent intent = new Intent(HostApduService.SERVICE_INTERFACE);
intent.setComponent(service);
if (mContext.bindServiceAsUser(intent, mPaymentConnection,
Context.BIND_AUTO_CREATE | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS,
UserHandle.of(userId))) {
mPaymentServiceBound = true;
mPaymentServiceUserId = userId;
mLastBoundPaymentServiceName = service;
} else {
Log.e(TAG, "Could not bind (persistent) payment service.");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindPaymentServiceLocked
File: src/com/android/nfc/cardemulation/HostEmulationManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35671
|
MEDIUM
| 5.5
|
android
|
bindPaymentServiceLocked
|
src/com/android/nfc/cardemulation/HostEmulationManager.java
|
745632835f3d97513a9c2a96e56e1dc06c4e4176
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String getAppRoleName(String applicationName) {
return ApplicationConstants.APPLICATION_DOMAIN + UserCoreConstants.DOMAIN_SEPARATOR + applicationName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppRoleName
File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
Repository: wso2/carbon-identity-framework
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-42646
|
MEDIUM
| 6.4
|
wso2/carbon-identity-framework
|
getAppRoleName
|
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
|
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final int startActivityAsUser(IApplicationThread caller, String callingPackage,
Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) {
enforceNotIsolatedCaller("startActivity");
userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId,
false, ALLOW_FULL_ONLY, "startActivity", null);
// TODO: Switch to user app stacks here.
return mStackSupervisor.startActivityMayWait(caller, -1, callingPackage, intent,
resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
profilerInfo, null, null, options, false, userId, null, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityAsUser
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
startActivityAsUser
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setResetPasswordToken(ComponentName admin, byte[] token) {
if (!mHasFeature || !mLockPatternUtils.hasSecureLockScreen()) {
return false;
}
if (token == null || token.length < 32) {
throw new IllegalArgumentException("token must be at least 32-byte long");
}
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
synchronized (getLockObject()) {
final int userHandle = caller.getUserId();
DevicePolicyData policy = getUserData(userHandle);
return mInjector.binderWithCleanCallingIdentity(() -> {
if (policy.mPasswordTokenHandle != 0) {
mLockPatternUtils.removeEscrowToken(policy.mPasswordTokenHandle, userHandle);
}
policy.mPasswordTokenHandle = mLockPatternUtils.addEscrowToken(token,
userHandle, /*EscrowTokenStateChangeCallback*/ null);
saveSettingsLocked(userHandle);
return policy.mPasswordTokenHandle != 0;
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setResetPasswordToken
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
|
setResetPasswordToken
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
final StandardTemplateParams reset() {
mViewType = VIEW_TYPE_UNSPECIFIED;
mHeaderless = false;
mHideAppName = false;
mHideTitle = false;
mHideSubText = false;
mHideTime = false;
mHideActions = false;
mHideProgress = false;
mHideSnoozeButton = false;
mHideLeftIcon = false;
mHideRightIcon = false;
mPromotedPicture = null;
mCallStyleActions = false;
mAllowTextWithProgress = false;
mTitleViewId = R.id.title;
mTextViewId = R.id.text;
title = null;
text = null;
summaryText = null;
headerTextSecondary = null;
maxRemoteInputHistory = Style.MAX_REMOTE_INPUT_HISTORY_LINES;
allowColorization = true;
mHighlightExpander = false;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reset
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
reset
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearLightsLocked() {
// light
mLights.clear();
updateLightsLocked();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearLightsLocked
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
|
clearLightsLocked
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public void gotoPage(String space, String page, String action, String queryString)
{
gotoPage(Collections.singletonList(space), page, action, queryString);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: gotoPage
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
|
gotoPage
|
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 <V> Column<T, V> addColumn(ValueProvider<T, V> valueProvider,
AbstractRenderer<? super T, ? super V> renderer) {
return addColumn(valueProvider, ValueProvider.identity(), renderer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addColumn
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
addColumn
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDebugApp(
String packageName, boolean waitForDebugger, boolean persistent)
throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeString(packageName);
data.writeInt(waitForDebugger ? 1 : 0);
data.writeInt(persistent ? 1 : 0);
mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDebugApp
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
setDebugApp
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDistinct(boolean distinct) {
mDistinct = distinct;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDistinct
File: core/java/android/database/sqlite/SQLiteQueryBuilder.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
setDistinct
|
core/java/android/database/sqlite/SQLiteQueryBuilder.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseAlliances(final Element root) throws GameParseException {
final AllianceTracker allianceTracker = data.getAllianceTracker();
final Collection<PlayerId> players = data.getPlayerList().getPlayers();
for (final Element current : getChildren("alliance", root)) {
final PlayerId p1 = getPlayerId(current, "player", true);
final String alliance = current.getAttribute("alliance");
allianceTracker.addToAlliance(p1, alliance);
}
// if relationships aren't initialized based on relationshipInitialize we use the alliances to set the relationships
if (getSingleChild("relationshipInitialize", root, true) == null) {
final RelationshipTracker relationshipTracker = data.getRelationshipTracker();
final RelationshipTypeList relationshipTypeList = data.getRelationshipTypeList();
// iterate through all players to get known allies and enemies
for (final PlayerId currentPlayer : players) {
// start with all players as enemies
// start with no players as allies
final Set<PlayerId> allies = allianceTracker.getAllies(currentPlayer);
final Set<PlayerId> enemies = new HashSet<>(players);
enemies.removeAll(allies);
// remove self from enemieslist (in case of free-for-all)
enemies.remove(currentPlayer);
// remove self from allieslist (in case you are a member of an alliance)
allies.remove(currentPlayer);
// At this point enemies and allies should be set for this player.
for (final PlayerId alliedPLayer : allies) {
relationshipTracker.setRelationship(currentPlayer, alliedPLayer,
relationshipTypeList.getDefaultAlliedRelationship());
}
for (final PlayerId enemyPlayer : enemies) {
relationshipTracker.setRelationship(currentPlayer, enemyPlayer,
relationshipTypeList.getDefaultWarRelationship());
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseAlliances
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
|
parseAlliances
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void executePOSTDuplicates() throws Exception {
final DataPoints[] datapoints = new DataPoints[1];
datapoints[0] = new MockDataPoints().getMock();
when(query_result.runAsync()).thenReturn(
Deferred.fromResult(datapoints));
final HttpQuery query = NettyMocks.postQuery(tsdb,"/api/query",
"{\"start\":\"1h-ago\",\"queries\":" +
"[{\"metric\":\"sys.cpu.user\",\"aggregator\":\"sum\"},"
+ "{\"metric\":\"sys.cpu.user\",\"aggregator\":\"sum\"}]}");
NettyMocks.mockChannelFuture(query);
rpc.execute(tsdb, query);
final String json =
query.response().getContent().toString(Charset.forName("UTF-8"));
assertTrue(json.contains("\"metric\":\"system.cpu.user\""));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executePOSTDuplicates
File: test/tsd/TestQueryRpc.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
executePOSTDuplicates
|
test/tsd/TestQueryRpc.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) {
return mFocusedStack.getDumpActivitiesLocked(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDumpActivitiesLocked
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
|
getDumpActivitiesLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected KBTemplate removeImpl(KBTemplate kbTemplate) {
kbTemplate = toUnwrappedModel(kbTemplate);
Session session = null;
try {
session = openSession();
if (!session.contains(kbTemplate)) {
kbTemplate = (KBTemplate)session.get(KBTemplateImpl.class,
kbTemplate.getPrimaryKeyObj());
}
if (kbTemplate != null) {
session.delete(kbTemplate);
}
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
if (kbTemplate != null) {
clearCache(kbTemplate);
}
return kbTemplate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeImpl
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
removeImpl
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
@DeleteMapping("{id}")
public Result delete(@PathVariable Integer id) {
User user = getApiUser();
Topic topic = topicService.selectById(id);
ApiAssert.isTrue(topic.getUserId().equals(user.getId()), "谁给你的权限删除别人的话题的?");
topicService.delete(topic);
return success();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: delete
File: src/main/java/co/yiiu/pybbs/controller/api/TopicApiController.java
Repository: atjiu/pybbs
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-23391
|
MEDIUM
| 4.3
|
atjiu/pybbs
|
delete
|
src/main/java/co/yiiu/pybbs/controller/api/TopicApiController.java
|
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
| 0
|
Analyze the following code function for security vulnerabilities
|
public File downloadFileFromResponse(Response response) throws ApiException {
try {
File file = prepareDownloadFile(response);
Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
return file;
} catch (IOException e) {
throw new ApiException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: downloadFileFromResponse
File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
downloadFileFromResponse
|
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
long getProtoFieldId() {
return ACTIVITY;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProtoFieldId
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
getProtoFieldId
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String check(Method method, HttpServletRequest request) {
if (request.getUserPrincipal() != null) {
return verifyAuthenticatedUser(method, request);
} else {
return verifyAnonymousUser(method, request);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: check
File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31406
|
LOW
| 1.9
|
vaadin/flow
|
check
|
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
|
3fe644cab2cffa5b86316dbe71b11df1083861a9
| 0
|
Analyze the following code function for security vulnerabilities
|
final void dumpGraphicsHardwareUsage(FileDescriptor fd,
PrintWriter pw, String[] args) {
ArrayList<ProcessRecord> procs = collectProcesses(pw, 0, false, args);
if (procs == null) {
pw.println("No process found for: " + args[0]);
return;
}
long uptime = SystemClock.uptimeMillis();
long realtime = SystemClock.elapsedRealtime();
pw.println("Applications Graphics Acceleration Info:");
pw.println("Uptime: " + uptime + " Realtime: " + realtime);
for (int i = procs.size() - 1 ; i >= 0 ; i--) {
ProcessRecord r = procs.get(i);
if (r.thread != null) {
pw.println("\n** Graphics info for pid " + r.pid + " [" + r.processName + "] **");
pw.flush();
try {
TransferPipe tp = new TransferPipe();
try {
r.thread.dumpGfxInfo(tp.getWriteFd(), args);
tp.go(fd);
} finally {
tp.kill();
}
} catch (IOException e) {
pw.println("Failure while dumping the app: " + r);
pw.flush();
} catch (RemoteException e) {
pw.println("Got a RemoteException while dumping the app " + r);
pw.flush();
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpGraphicsHardwareUsage
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
|
dumpGraphicsHardwareUsage
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
@Nullable String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo,
String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo,
Bundle bOptions, int userId) {
return mActivityTaskManager.startActivityAndWait(caller, callingPackage,
callingFeatureId, intent, resolvedType, resultTo, resultWho, requestCode,
startFlags, profilerInfo, bOptions, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityAndWait
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
|
startActivityAndWait
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public XmlGraphMLReader source(ExportConfig.NodeConfig sourceConfig) {
this.source = sourceConfig;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: source
File: core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
Repository: neo4j/apoc
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-23926
|
HIGH
| 8.1
|
neo4j/apoc
|
source
|
core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
|
3202b421b21973b2f57a43b33c88f3f6901cfd2a
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean injectIsSafeModeEnabled() {
final long token = injectClearCallingIdentity();
try {
return IWindowManager.Stub
.asInterface(ServiceManager.getService(Context.WINDOW_SERVICE))
.isSafeModeEnabled();
} catch (RemoteException e) {
return false; // Shouldn't happen though.
} finally {
injectRestoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectIsSafeModeEnabled
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
|
injectIsSafeModeEnabled
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void logd(String s) {
Log.d(getTag(), s);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logd
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
|
logd
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DataSource createNewDataSource(Map<String, ?> params) throws IOException {
String refName = (String) JNDI_REFNAME.lookUp(params);
try {
return (DataSource) GeoTools.getInitialContext().lookup(refName);
} catch (Exception e) {
throw new DataSourceException("Could not find the specified data source in JNDI", e);
}
}
|
Vulnerability Classification:
- CWE: CWE-917
- CVE: CVE-2022-24818
- Severity: HIGH
- CVSS Score: 7.5
Description: [GEOT-7115] Streamline JNDI lookups
Function: createNewDataSource
File: modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
Repository: geotools
Fixed Code:
@Override
public DataSource createNewDataSource(Map<String, ?> params) throws IOException {
String refName = (String) JNDI_REFNAME.lookUp(params);
try {
return (DataSource) GeoTools.jndiLookup(refName);
} catch (Exception e) {
throw new DataSourceException("Could not find the specified data source in JNDI", e);
}
}
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
createNewDataSource
|
modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 1
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public int createNewObject(String className, XWikiContext context) throws XWikiException
{
return createXObject(
getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()),
context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createNewObject
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
createNewObject
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
void stopAssociationLocked(int sourceUid, String sourceProcess, int targetUid,
ComponentName targetComponent) {
if (!mTrackingAssociations) {
return;
}
ArrayMap<ComponentName, SparseArray<ArrayMap<String, Association>>> components
= mAssociations.get(targetUid);
if (components == null) {
return;
}
SparseArray<ArrayMap<String, Association>> sourceUids = components.get(targetComponent);
if (sourceUids == null) {
return;
}
ArrayMap<String, Association> sourceProcesses = sourceUids.get(sourceUid);
if (sourceProcesses == null) {
return;
}
Association ass = sourceProcesses.get(sourceProcess);
if (ass == null || ass.mNesting <= 0) {
return;
}
ass.mNesting--;
if (ass.mNesting == 0) {
long uptime = SystemClock.uptimeMillis();
ass.mTime += uptime - ass.mStartTime;
ass.mStateTimes[ass.mLastState-ActivityManager.MIN_PROCESS_STATE]
+= uptime - ass.mLastStateUptime;
ass.mLastState = ActivityManager.MAX_PROCESS_STATE + 2;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopAssociationLocked
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
|
stopAssociationLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void completeStage(final Stage stage, final JobResult jobResult) {
final StageResult stageResult = completeAllJobs(stage, jobResult);
updateResultInTransaction(stage, stageResult);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: completeStage
File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-697"
] |
CVE-2022-39308
|
MEDIUM
| 5.9
|
gocd
|
completeStage
|
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
|
236d4baf92e6607f2841c151c855adcc477238b8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkIfSomeAreApproved() {
if (!isVoiceOnlyCall) {
if (cameraEnumerator.getDeviceNames().length == 0) {
binding.cameraButton.setVisibility(View.GONE);
}
if (cameraEnumerator.getDeviceNames().length > 1) {
binding.switchSelfVideoButton.setVisibility(View.VISIBLE);
}
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
if (!videoOn) {
onCameraClick();
}
} else {
binding.cameraButton.getHierarchy().setPlaceholderImage(R.drawable.ic_videocam_off_white_24px);
binding.cameraButton.setAlpha(0.7f);
binding.switchSelfVideoButton.setVisibility(View.GONE);
}
}
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_MICROPHONE)) {
if (!microphoneOn) {
onMicrophoneClick();
}
} else {
binding.microphoneButton.getHierarchy().setPlaceholderImage(R.drawable.ic_mic_off_white_24px);
}
if (!isConnectionEstablished()) {
fetchSignalingSettings();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkIfSomeAreApproved
File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
Repository: nextcloud/talk-android
The code follows secure coding practices.
|
[
"CWE-732",
"CWE-200"
] |
CVE-2022-41926
|
MEDIUM
| 5.5
|
nextcloud/talk-android
|
checkIfSomeAreApproved
|
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
|
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
final PackageInfo getPackageInfoWithSignatures(String packageName, @UserIdInt int userId) {
return getPackageInfo(packageName, userId, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageInfoWithSignatures
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
|
getPackageInfoWithSignatures
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private byte[] hexToByteArray(String digits) {
final int bytes = digits.length() / 2;
if (2*bytes != digits.length()) {
throw new IllegalArgumentException("Hex string must have an even number of digits");
}
byte[] result = new byte[bytes];
for (int i = 0; i < digits.length(); i += 2) {
result[i/2] = (byte) Integer.parseInt(digits.substring(i, i+2), 16);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hexToByteArray
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
hexToByteArray
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<DeletedDocument> wrapDeletedDocuments(XWikiDeletedDocument[] deletedDocuments)
{
if (deletedDocuments == null || deletedDocuments.length == 0) {
return Collections.emptyList();
}
List<DeletedDocument> result = new ArrayList<>(deletedDocuments.length);
for (XWikiDeletedDocument deletedDocument : deletedDocuments) {
result.add(new DeletedDocument(deletedDocument, this.context));
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wrapDeletedDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
wrapDeletedDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.