instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean sendMediaButton(String packageName, KeyEvent keyEvent) {
return mSessionCb.sendMediaButton(packageName, Binder.getCallingPid(),
Binder.getCallingUid(), false, keyEvent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendMediaButton
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
sendMediaButton
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
public int addOverrideApn(@NonNull ComponentName admin, @NonNull ApnSetting apnSetting) {
throwIfParentInstance("addOverrideApn");
if (mService != null) {
try {
return mService.addOverrideApn(admin, apnSetting);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOverrideApn
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
|
addOverrideApn
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSymmetricAlgorithmParams(String params) {
attributes.put(SYMMETRIC_ALGORITHM_PARAMS, params);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSymmetricAlgorithmParams
File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setSymmetricAlgorithmParams
|
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCredentialsProvider(CredentialsProvider credentialsProvider) {
this.credentialsProvider = credentialsProvider;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCredentialsProvider
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
|
setCredentialsProvider
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean readFullyOrNothing(InputStream in, byte[] buffer) throws IOException {
int bytesRead = 0;
do {
int count = in.read(buffer, bytesRead, buffer.length - bytesRead);
if (count < 0) {
if (bytesRead == 0) {
return false;
}
throw new EOFException();
}
bytesRead += count;
} while (bytesRead < buffer.length);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readFullyOrNothing
File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
readFullyOrNothing
|
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, Vector<Object>> getxWikiObjects()
{
Map<DocumentReference, List<BaseObject>> map = this.getDoc().getXObjects();
Map<String, Vector<Object>> resultmap = new HashMap<String, Vector<Object>>();
for (Map.Entry<DocumentReference, List<BaseObject>> entry : map.entrySet()) {
List<BaseObject> objects = entry.getValue();
if (objects != null) {
resultmap.put(getLocalEntityReferenceSerializer().serialize(entry.getKey()), getXObjects(objects));
}
}
return resultmap;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getxWikiObjects
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getxWikiObjects
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getAppointmentRequestId() {
return appointmentRequestId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppointmentRequestId
File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
Repository: openmrs/openmrs-module-appointmentscheduling
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2022-4727
|
MEDIUM
| 6.1
|
openmrs/openmrs-module-appointmentscheduling
|
getAppointmentRequestId
|
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
|
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void clearSoundLocked() {
mSoundNotificationKey = null;
long identity = Binder.clearCallingIdentity();
try {
final IRingtonePlayer player = mAudioManager.getRingtonePlayer();
if (player != null) {
player.stopAsync();
}
} catch (RemoteException e) {
} finally {
Binder.restoreCallingIdentity(identity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearSoundLocked
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
|
clearSoundLocked
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean has(String key) {
return this.map.containsKey(key);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: has
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
has
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Map<String, List<String>> buildResponseHeaders(Response response) {
Map<String, List<String>> responseHeaders = new HashMap<String, List<String>>();
for (Entry<String, List<Object>> entry: response.getHeaders().entrySet()) {
List<Object> values = entry.getValue();
List<String> headers = new ArrayList<String>();
for (Object o : values) {
headers.add(String.valueOf(o));
}
responseHeaders.put(entry.getKey(), headers);
}
return responseHeaders;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildResponseHeaders
File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
buildResponseHeaders
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setNASMigrationDoneAndResetDefault(int userId, boolean loadFromConfig) {
try {
sINM.setNASMigrationDoneAndResetDefault(userId, loadFromConfig);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNASMigrationDoneAndResetDefault
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
|
setNASMigrationDoneAndResetDefault
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public KBTemplate fetchByUUID_G(String uuid, long groupId,
boolean retrieveFromCache) {
Object[] finderArgs = new Object[] { uuid, groupId };
Object result = null;
if (retrieveFromCache) {
result = finderCache.getResult(FINDER_PATH_FETCH_BY_UUID_G,
finderArgs, this);
}
if (result instanceof KBTemplate) {
KBTemplate kbTemplate = (KBTemplate)result;
if (!Objects.equals(uuid, kbTemplate.getUuid()) ||
(groupId != kbTemplate.getGroupId())) {
result = null;
}
}
if (result == null) {
StringBundler query = new StringBundler(4);
query.append(_SQL_SELECT_KBTEMPLATE_WHERE);
boolean bindUuid = false;
if (uuid == null) {
query.append(_FINDER_COLUMN_UUID_G_UUID_1);
}
else if (uuid.equals(StringPool.BLANK)) {
query.append(_FINDER_COLUMN_UUID_G_UUID_3);
}
else {
bindUuid = true;
query.append(_FINDER_COLUMN_UUID_G_UUID_2);
}
query.append(_FINDER_COLUMN_UUID_G_GROUPID_2);
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
if (bindUuid) {
qPos.add(uuid);
}
qPos.add(groupId);
List<KBTemplate> list = q.list();
if (list.isEmpty()) {
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
finderArgs, list);
}
else {
KBTemplate kbTemplate = list.get(0);
result = kbTemplate;
cacheResult(kbTemplate);
if ((kbTemplate.getUuid() == null) ||
!kbTemplate.getUuid().equals(uuid) ||
(kbTemplate.getGroupId() != groupId)) {
finderCache.putResult(FINDER_PATH_FETCH_BY_UUID_G,
finderArgs, kbTemplate);
}
}
}
catch (Exception e) {
finderCache.removeResult(FINDER_PATH_FETCH_BY_UUID_G, finderArgs);
throw processException(e);
}
finally {
closeSession(session);
}
}
if (result instanceof List<?>) {
return null;
}
else {
return (KBTemplate)result;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fetchByUUID_G
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
|
fetchByUUID_G
|
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
|
@Override
ActivityRecord getActivity(Predicate<ActivityRecord> callback, boolean traverseTopToBottom,
ActivityRecord boundary) {
return callback.test(this) ? this : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActivity
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
|
getActivity
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private void syncSsaidTableOnStartLocked() {
// Verify that each user's packages and ssaid's are in sync.
for (UserInfo user : mUserManager.getAliveUsers()) {
// Get all uids for the user's packages.
final List<PackageInfo> packages;
try {
packages = mPackageManager.getInstalledPackages(
PackageManager.MATCH_UNINSTALLED_PACKAGES,
user.id).getList();
} catch (RemoteException e) {
throw new IllegalStateException("Package manager not available");
}
final Set<String> appUids = new HashSet<>();
for (PackageInfo info : packages) {
appUids.add(Integer.toString(info.applicationInfo.uid));
}
// Get all uids currently stored in the user's ssaid table.
final Set<String> ssaidUids = new HashSet<>(
getSettingsNamesLocked(SETTINGS_TYPE_SSAID, user.id));
ssaidUids.remove(SSAID_USER_KEY);
// Perform a set difference for the appUids and ssaidUids.
ssaidUids.removeAll(appUids);
// If there are ssaidUids left over they need to be removed from the table.
final SettingsState ssaidSettings = getSettingsLocked(SETTINGS_TYPE_SSAID,
user.id);
for (String uid : ssaidUids) {
ssaidSettings.deleteSettingLocked(uid);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: syncSsaidTableOnStartLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
syncSsaidTableOnStartLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private X509Certificate readCertificate(Parcel in) {
X509Certificate cert = null;
int len = in.readInt();
if (len > 0) {
try {
byte[] bytes = new byte[len];
in.readByteArray(bytes);
CertificateFactory cFactory = CertificateFactory.getInstance("X.509");
cert = (X509Certificate) cFactory
.generateCertificate(new ByteArrayInputStream(bytes));
} catch (CertificateException e) {
cert = null;
}
}
return cert;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readCertificate
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
readCertificate
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateOomLevelsForDisplay(int displayId) {
synchronized(ActivityManagerService.this) {
if (mWindowManager != null) {
mProcessList.applyDisplaySize(mWindowManager);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateOomLevelsForDisplay
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
|
updateOomLevelsForDisplay
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient configureApiKeys(Map<String, String> secrets) {
for (Map.Entry<String, Authentication> authEntry : authentications.entrySet()) {
Authentication auth = authEntry.getValue();
if (auth instanceof ApiKeyAuth) {
String name = authEntry.getKey();
// respect x-auth-id-alias property
name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name;
if (secrets.containsKey(name)) {
((ApiKeyAuth) auth).setApiKey(secrets.get(name));
}
}
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configureApiKeys
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
|
configureApiKeys
|
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
|
@Sessional
@Override
public Project initialize(String path) {
List<String> names = Splitter.on("/").omitEmptyStrings().trimResults().splitToList(path);
Project project = null;
for (String name: names) {
Project child;
if (project == null || !project.isNew()) {
child = find(project, name);
if (child == null) {
if (project == null && !SecurityUtils.canCreateRootProjects())
throw new UnauthorizedException("Not authorized to create root project");
if (project != null && !SecurityUtils.canCreateChildren(project))
throw new UnauthorizedException("Not authorized to create project under '" + project.getPath() + "'");
child = new Project();
child.setName(name);
child.setParent(project);
}
} else {
child = new Project();
child.setName(name);
child.setParent(project);
}
project = child;
}
Project parent = project.getParent();
while (parent != null && parent.isNew()) {
parent.setCodeManagement(false);
parent.setIssueManagement(false);
parent = parent.getParent();
}
return project;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initialize
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
|
initialize
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getStartElementName(StartElement startElement) {
return trim(startElement.getName().getLocalPart());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStartElementName
File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2017-2582
|
MEDIUM
| 4
|
keycloak
|
getStartElementName
|
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
|
0cb5ba0f6e83162d221681f47b470c3042eef237
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setTitle(String title)
{
getDoc().setTitle(title);
updateAuthor();
updateContentAuthor();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTitle
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
setTitle
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
private void gotKexInit(SSHPacket buf)
throws TransportException {
buf.rpos(buf.rpos() - 1);
final Proposal serverProposal = new Proposal(buf);
negotiatedAlgs = clientProposal.negotiate(serverProposal);
log.debug("Negotiated algorithms: {}", negotiatedAlgs);
for(AlgorithmsVerifier v: algorithmVerifiers) {
log.debug("Trying to verify algorithms with {}", v);
if(!v.verify(negotiatedAlgs)) {
throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
"Failed to verify negotiated algorithms `" + negotiatedAlgs + "`");
}
}
kex = Factory.Named.Util.create(transport.getConfig().getKeyExchangeFactories(),
negotiatedAlgs.getKeyExchangeAlgorithm());
transport.setHostKeyAlgorithm(Factory.Named.Util.create(transport.getConfig().getKeyAlgorithms(),
negotiatedAlgs.getSignatureAlgorithm()));
try {
kex.init(transport,
transport.getServerID(), transport.getClientID(),
serverProposal.getPacket().getCompactData(), clientProposal.getPacket().getCompactData());
} catch (GeneralSecurityException e) {
throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED, e);
}
}
|
Vulnerability Classification:
- CWE: CWE-354
- CVE: CVE-2023-48795
- Severity: MEDIUM
- CVSS Score: 5.9
Description: Implement OpenSSH strict key exchange extension
Function: gotKexInit
File: src/main/java/net/schmizz/sshj/transport/KeyExchanger.java
Repository: hierynomus/sshj
Fixed Code:
private void gotKexInit(SSHPacket buf)
throws TransportException {
buf.rpos(buf.rpos() - 1);
final Proposal serverProposal = new Proposal(buf);
gotStrictKexInfo(serverProposal);
negotiatedAlgs = clientProposal.negotiate(serverProposal);
log.debug("Negotiated algorithms: {}", negotiatedAlgs);
for(AlgorithmsVerifier v: algorithmVerifiers) {
log.debug("Trying to verify algorithms with {}", v);
if(!v.verify(negotiatedAlgs)) {
throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
"Failed to verify negotiated algorithms `" + negotiatedAlgs + "`");
}
}
kex = Factory.Named.Util.create(transport.getConfig().getKeyExchangeFactories(),
negotiatedAlgs.getKeyExchangeAlgorithm());
transport.setHostKeyAlgorithm(Factory.Named.Util.create(transport.getConfig().getKeyAlgorithms(),
negotiatedAlgs.getSignatureAlgorithm()));
try {
kex.init(transport,
transport.getServerID(), transport.getClientID(),
serverProposal.getPacket().getCompactData(), clientProposal.getPacket().getCompactData());
} catch (GeneralSecurityException e) {
throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED, e);
}
}
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
gotKexInit
|
src/main/java/net/schmizz/sshj/transport/KeyExchanger.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 1
|
Analyze the following code function for security vulnerabilities
|
private void checkMirrorLocalRepo(Repository repository, Iterable<Change<?>> changes) {
// TODO(minwoox): Provide an internal API for mirroring setup with a better UI(?) and check this there.
if (Project.REPO_META.equals(repository.name())) {
final Optional<String> notAllowedLocalRepo =
Streams.stream(changes)
.filter(change -> DefaultMetaRepository.PATH_MIRRORS.equals(change.path()))
.filter(change -> change.content() != null)
.map(change -> {
final Object content = change.content();
if (content != null && content instanceof JsonNode) {
final JsonNode node = (JsonNode) content;
if (!node.isArray()) {
return null;
}
for (JsonNode jsonNode : node) {
final JsonNode localRepoNode = jsonNode.get(MIRROR_LOCAL_REPO);
if (localRepoNode != null) {
final String localRepo = localRepoNode.textValue();
if (Project.isReservedRepoName(localRepo)) {
return localRepo;
}
}
}
}
return null;
}).filter(Objects::nonNull).findFirst();
if (notAllowedLocalRepo.isPresent()) {
throw new IllegalArgumentException("invalid " + MIRROR_LOCAL_REPO + ": " +
notAllowedLocalRepo.get());
}
}
}
|
Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2021-38388
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Address the comment by @ikhoon
Function: checkMirrorLocalRepo
File: server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
Repository: line/centraldogma
Fixed Code:
public static void checkMirrorLocalRepo(String repoName, Iterable<Change<?>> changes) {
// TODO(minwoox): Provide an internal API for mirroring setup with a better UI(?) and check this there.
if (Project.REPO_META.equals(repoName)) {
final Optional<String> notAllowedLocalRepo =
Streams.stream(changes)
.filter(change -> DefaultMetaRepository.PATH_MIRRORS.equals(change.path()))
.filter(change -> change.content() != null)
.map(change -> {
final Object content = change.content();
if (content instanceof JsonNode) {
final JsonNode node = (JsonNode) content;
if (!node.isArray()) {
return null;
}
for (JsonNode jsonNode : node) {
final JsonNode localRepoNode = jsonNode.get(MIRROR_LOCAL_REPO);
if (localRepoNode != null) {
final String localRepo = localRepoNode.textValue();
if (Project.isReservedRepoName(localRepo)) {
return localRepo;
}
}
}
}
return null;
}).filter(Objects::nonNull).findFirst();
if (notAllowedLocalRepo.isPresent()) {
throw new IllegalArgumentException("invalid " + MIRROR_LOCAL_REPO + ": " +
notAllowedLocalRepo.get());
}
}
}
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
checkMirrorLocalRepo
|
server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 1
|
Analyze the following code function for security vulnerabilities
|
private void setLockTaskPackagesLocked(int userHandle, List<String> packages) {
DevicePolicyData policy = getUserData(userHandle);
policy.mLockTaskPackages = packages;
// Store the settings persistently.
saveSettingsLocked(userHandle);
updateLockTaskPackagesLocked(packages, userHandle);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLockTaskPackagesLocked
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
|
setLockTaskPackagesLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "4.2M2")
public void addToZip(ZipOutputStream zos, boolean withVersions, XWikiContext context)
throws XWikiException, IOException
{
String zipname =
getDocumentReference().getLastSpaceReference().getName() + "/" + getDocumentReference().getName();
String language = getLanguage();
if (!StringUtils.isEmpty(language)) {
zipname += "." + language;
}
addToZip(zos, zipname, withVersions, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addToZip
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
|
addToZip
|
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 static String[] loadTextFromFile(File file, String[] defaultValue)
{
ArrayList<String> lines = new ArrayList<String>();
Scanner scanner = null;
try
{
scanner = new Scanner(file);
while (scanner.hasNextLine())
lines.add(scanner.nextLine());
}
catch (FileNotFoundException e)
{
return defaultValue;
}
finally
{
if (scanner != null)
scanner.close();
}
return lines.toArray(new String[lines.size()]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadTextFromFile
File: src/main/java/bspkrs/mmv/RemoteZipHandler.java
Repository: bspkrs/MCPMappingViewer
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4494
|
CRITICAL
| 9.8
|
bspkrs/MCPMappingViewer
|
loadTextFromFile
|
src/main/java/bspkrs/mmv/RemoteZipHandler.java
|
6e602746c96b4756c271d080dae7d22ad804a1bd
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object fromXML(File file, Object root) {
HierarchicalStreamReader reader = hierarchicalStreamDriver.createReader(file);
try {
return unmarshal(reader, root);
} finally {
reader.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromXML
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
fromXML
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean excludeURI(String uri) {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: excludeURI
File: dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
excludeURI
|
dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void logout(String tokenCookieName, String tokenCookieVal, HttpServletRequest request, HttpServletResponse response)
{
deleteCookie(tokenCookieName, response);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logout
File: src/main/java/com/mxgraph/online/AbsAuthServlet.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-601",
"CWE-918"
] |
CVE-2022-1767
|
MEDIUM
| 5
|
jgraph/drawio
|
logout
|
src/main/java/com/mxgraph/online/AbsAuthServlet.java
|
c63f3a04450f30798df47f9badbc74eb8a69fbdf
| 0
|
Analyze the following code function for security vulnerabilities
|
private String buildPropertiesPart(Map < String, Property<?>> props) {
StringBuilder sb = new StringBuilder();
if (props != null && !props.isEmpty()) {
// Loop over property
for (Property<?> property : props.values()) {
sb.append(" <" + PROPERTY_TAG + " " + PROPERTY_PARAMNAME + "=\"" + property.getName() + "\" ");
sb.append(PROPERTY_PARAMVALUE + "=\"" + escapeXML(property.asString()) + "\" ");
if (!(property instanceof PropertyString)) {
sb.append(PROPERTY_PARAMTYPE + "=\"" + property.getClass().getName() + "\"");
}
// Processing fixedValue is present
if (property.getFixedValues() != null && !property.getFixedValues().isEmpty()) {
sb.append(">\n");
sb.append(" <fixedValues>\n");
for (Object o : property.getFixedValues()) {
sb.append(" <value>" + CDATA_START + o.toString() + CDATA_END + "</value>\n");
}
sb.append(" </fixedValues>\n");
sb.append(" </property>\n");
} else {
sb.append("/>\n");
}
}
}
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildPropertiesPart
File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
Repository: ff4j
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-44262
|
CRITICAL
| 9.8
|
ff4j
|
buildPropertiesPart
|
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
|
991df72725f78adbc413d9b0fbb676201f1882e0
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public Notification buildUnstyled() {
if (mActions.size() > 0) {
mN.actions = new Action[mActions.size()];
mActions.toArray(mN.actions);
}
if (!mPersonList.isEmpty()) {
mN.extras.putParcelableArrayList(EXTRA_PEOPLE_LIST, mPersonList);
}
if (mN.bigContentView != null || mN.contentView != null
|| mN.headsUpContentView != null) {
mN.extras.putBoolean(EXTRA_CONTAINS_CUSTOM_VIEW, true);
}
return mN;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildUnstyled
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
buildUnstyled
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@CLIMethod(name="cancel-quiet-down")
public synchronized HttpRedirect doCancelQuietDown() {
checkPermission(ADMINISTER);
isQuietingDown = false;
getQueue().scheduleMaintenance();
return new HttpRedirect(".");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doCancelQuietDown
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doCancelQuietDown
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ApiScenarioWithBLOBs> selectByIdsWithBLOBs(List<String> ids) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andIdIn(ids);
return apiScenarioMapper.selectByExampleWithBLOBs(example);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectByIdsWithBLOBs
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
selectByIdsWithBLOBs
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
public void emphasizeUrl() {
Editable url = getText();
if (OmniboxUrlEmphasizer.hasEmphasisSpans(url) || hasFocus()) {
return;
}
if (url.length() < 1) {
return;
}
// We retrieve the domain and registry from the full URL (the url bar shows a simplified
// version of the URL).
Tab currentTab = mUrlBarDelegate.getCurrentTab();
if (currentTab == null || currentTab.getProfile() == null) return;
boolean isInternalPage = false;
try {
String tabUrl = currentTab.getUrl();
isInternalPage = UrlUtilities.isInternalScheme(new URI(tabUrl));
} catch (URISyntaxException e) {
// Ignore as this only is for applying color
}
OmniboxUrlEmphasizer.emphasizeUrl(url, getResources(), currentTab.getProfile(),
currentTab.getSecurityLevel(), isInternalPage,
mUseDarkColors, mUrlBarDelegate.shouldEmphasizeHttpsScheme());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: emphasizeUrl
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
|
emphasizeUrl
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
void abort(Call call) {
// Clear out any pending outgoing call data
final String callId = mCallIdMapper.getCallId(call);
// If still bound, tell the connection service to abort.
if (callId != null && isServiceValid("abort")) {
try {
logOutgoing("abort %s", callId);
mServiceInterface.abort(callId, Log.getExternalSession(TELECOM_ABBREVIATION));
} catch (RemoteException e) {
}
}
removeCall(call, new DisconnectCause(DisconnectCause.LOCAL));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: abort
File: src/com/android/server/telecom/ConnectionServiceWrapper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
abort
|
src/com/android/server/telecom/ConnectionServiceWrapper.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty("PKCS7CertChain")
public void setPkcs7CertChain(String chain) {
this.pkcs7CertChain = chain;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPkcs7CertChain
File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setPkcs7CertChain
|
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
void getLetterboxInnerBounds(Rect outBounds) {
mLetterboxUiController.getLetterboxInnerBounds(outBounds);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLetterboxInnerBounds
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
|
getLetterboxInnerBounds
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static CertSearchRequest fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element rootElement = document.getDocumentElement();
return fromDOM(rootElement);
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-2414
- Severity: HIGH
- CVSS Score: 7.5
Description: Disable access to external entities when parsing XML
This reduces the vulnerability of XML parsers to XXE (XML external
entity) injection.
The best way to prevent XXE is to stop using XML altogether, which we do
plan to do. Until that happens I consider it worthwhile to tighten the
security here though.
Function: fromXML
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
Fixed Code:
public static CertSearchRequest fromXML(String xml) throws Exception {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
Element rootElement = document.getDocumentElement();
return fromDOM(rootElement);
}
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
fromXML
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 1
|
Analyze the following code function for security vulnerabilities
|
protected String encodeSecret(String secret) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-512");
byte[] bytes = digest.digest(secret.getBytes(StandardCharsets.UTF_8));
return new String(Base64.getEncoder().encode(bytes), StandardCharsets.UTF_8);
} catch (Exception x) {
throw new IllegalArgumentException(x);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encodeSecret
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
encodeSecret
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void dumpCursor(Cursor cursor, StringBuilder sb) {
sb.append(">>>>> Dumping cursor ").append(cursor).append('\n');
if (cursor != null) {
int startPos = cursor.getPosition();
cursor.moveToPosition(-1);
while (cursor.moveToNext()) {
dumpCurrentRow(cursor, sb);
}
cursor.moveToPosition(startPos);
}
sb.append("<<<<<\n");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpCursor
File: core/java/android/database/DatabaseUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2023-40121
|
MEDIUM
| 5.5
|
android
|
dumpCursor
|
core/java/android/database/DatabaseUtils.java
|
3287ac2d2565dc96bf6177967f8e3aed33954253
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void createRestrictedDirectory(File directory) throws IOException {
createRestrictedFile(directory, true, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createRestrictedDirectory
File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
createRestrictedDirectory
|
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
|
2ab070cdac087bd208f64fa8138bb709f8d7680c
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getRequestedPasswordMinimumLowerCase(int userId) {
return getDevicePolicyManager().getPasswordMinimumLowerCase(null, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestedPasswordMinimumLowerCase
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
getRequestedPasswordMinimumLowerCase
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkAndStartDownloadWebPagesForOfflineReadingPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&
checkSelfPermission(Manifest.permission.FOREGROUND_SERVICE) == PackageManager.PERMISSION_GRANTED) {
Log.v("Permission error","You have permission");
startDownloadWebPagesForOfflineReading();
} else {
Log.e("Permission error","Asking for permission");
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.FOREGROUND_SERVICE}, REQUEST_CODE_PERMISSION_DOWNLOAD_WEB_ARCHIVE);
}
} else { //you dont need to worry about these stuff below api level 23
Log.v("Permission error","You already have the permission");
startDownloadWebPagesForOfflineReading();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAndStartDownloadWebPagesForOfflineReadingPermission
File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
Repository: nextcloud/news-android
The code follows secure coding practices.
|
[
"CWE-829"
] |
CVE-2021-41256
|
MEDIUM
| 5.8
|
nextcloud/news-android
|
checkAndStartDownloadWebPagesForOfflineReadingPermission
|
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
|
05449cb666059af7de2302df9d5c02997a23df85
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDataManagementLabel(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getDataManagementLabel");
synchronized (mTransports) {
final IBackupTransport transport = mTransports.get(transportName);
if (transport != null) {
try {
final String text = transport.dataManagementLabel();
if (MORE_DEBUG) Slog.d(TAG, "getDataManagementLabel() returning " + text);
return text;
} catch (RemoteException e) {
/* fall through to return null */
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDataManagementLabel
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
|
getDataManagementLabel
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() {
enforceNotIsolatedCaller("getProcessesInErrorState");
// assume our apps are happy - lazy create the list
final List<ActivityManager.ProcessErrorStateInfo>[] errList = new List[1];
final int callingUid = Binder.getCallingUid();
final boolean allUsers = ActivityManager.checkUidPermission(INTERACT_ACROSS_USERS_FULL,
callingUid) == PackageManager.PERMISSION_GRANTED;
int userId = UserHandle.getUserId(callingUid);
final boolean hasDumpPermission = ActivityManager.checkUidPermission(
android.Manifest.permission.DUMP, callingUid) == PackageManager.PERMISSION_GRANTED;
synchronized (mProcLock) {
// iterate across all processes
mProcessList.forEachLruProcessesLOSP(false, app -> {
if (!allUsers && app.userId != userId) {
return;
}
if (!hasDumpPermission && app.info.uid != callingUid) {
return;
}
final ProcessErrorStateRecord errState = app.mErrorState;
final boolean crashing = errState.isCrashing();
final boolean notResponding = errState.isNotResponding();
if ((app.getThread() != null) && (crashing || notResponding)) {
// This one's in trouble, so we'll generate a report for it
// crashes are higher priority (in case there's a crash *and* an anr)
ActivityManager.ProcessErrorStateInfo report = null;
if (crashing) {
report = errState.getCrashingReport();
} else if (notResponding) {
report = errState.getNotRespondingReport();
}
if (report != null) {
if (errList[0] == null) {
errList[0] = new ArrayList<>(1);
}
errList[0].add(report);
} else {
Slog.w(TAG, "Missing app error report, app = " + app.processName +
" crashing = " + crashing +
" notResponding = " + notResponding);
}
}
});
}
return errList[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProcessesInErrorState
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
|
getProcessesInErrorState
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Node> getNodes() {
return slaves;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNodes
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getNodes
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addCookie(Cookie arg0) {
// ignore
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCookie
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
addCookie
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private void processCachePut(MethodInvocationContext<?, ?> context, ValueWrapper wrapper, AnnotationValue<CachePut> cacheConfig, CacheOperation cacheOperation) {
String[] cacheNames = cacheOperation.getCachePutNames(cacheConfig);
CacheKeyGenerator keyGenerator = cacheOperation.getCachePutKeyGenerator(cacheConfig);
String[] parameterNames = cacheConfig.get(MEMBER_PARAMETERS, String[].class, StringUtils.EMPTY_STRING_ARRAY);
Object[] parameterValues = resolveParams(context, parameterNames);
boolean isAsync = cacheConfig.get(MEMBER_ASYNC, Boolean.class, false);
processCachePut(context, wrapper, cacheNames, keyGenerator, parameterValues, isAsync);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processCachePut
File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
processCachePut
|
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDefaultDocumentSyntax()
{
return this.xwiki.getDefaultDocumentSyntax();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultDocumentSyntax
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
|
getDefaultDocumentSyntax
|
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
|
private ParseException error(String message) {
int column=index-lineOffset;
int offset=isEndOfText()?index:index-1;
return new ParseException(message, offset, line, column-1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: error
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
error
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void memoryStore(Binder binder, Consumer<? super CacheBuilder<AsciiString, ByteBuf>> config) {
binder.bind(LOCAL_MEMORY_SESSION_CACHE_BINDING_KEY).toProvider(() -> {
CacheBuilder<AsciiString, ByteBuf> cacheBuilder = Types.cast(CacheBuilder.newBuilder());
cacheBuilder.removalListener(n -> n.getValue().release());
config.accept(cacheBuilder);
return cacheBuilder.build();
}).in(Scopes.SINGLETON);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: memoryStore
File: ratpack-session/src/main/java/ratpack/session/SessionModule.java
Repository: ratpack
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2019-11808
|
MEDIUM
| 4.3
|
ratpack
|
memoryStore
|
ratpack-session/src/main/java/ratpack/session/SessionModule.java
|
f2b63eb82dd71194319fd3945f5edf29b8f3a42d
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean requestPssLocked(ProcessRecord proc, int procState) {
if (mPendingPssProcesses.contains(proc)) {
return false;
}
if (mPendingPssProcesses.size() == 0) {
mBgHandler.sendEmptyMessage(COLLECT_PSS_BG_MSG);
}
if (DEBUG_PSS) Slog.d(TAG_PSS, "Requesting pss of: " + proc);
proc.pssProcState = procState;
proc.pssStatType = ProcessStats.ADD_PSS_INTERNAL_SINGLE;
mPendingPssProcesses.add(proc);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestPssLocked
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
|
requestPssLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getImageWidth(Object i) {
return ((Bitmap) i).getWidth();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getImageWidth
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
|
getImageWidth
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setPersistentIdentifier(String persistentIdentifier)
throws PresentationException, RecordNotFoundException, IndexUnreachableException {
synchronized (this) {
logger.trace("setPersistentIdentifier: {}", persistentIdentifier);
lastReceivedIdentifier = persistentIdentifier;
if (!PIValidator.validatePi(persistentIdentifier)) {
logger.warn("Invalid identifier '{}'.", persistentIdentifier);
reset();
return;
// throw new RecordNotFoundException("Illegal identifier: " + persistentIdentifier);
}
if (!"-".equals(persistentIdentifier) && (viewManager == null || !persistentIdentifier.equals(viewManager.getPi()))) {
long id = DataManager.getInstance().getSearchIndex().getIddocFromIdentifier(persistentIdentifier);
if (id > 0) {
if (topDocumentIddoc != id) {
topDocumentIddoc = id;
logger.trace("IDDOC found for {}: {}", persistentIdentifier, id);
}
} else {
logger.warn("No IDDOC for identifier '{}' found.", persistentIdentifier);
reset();
return;
// throw new RecordNotFoundException(new StringBuilder(persistentIdentifier).toString());
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPersistentIdentifier
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
setPersistentIdentifier
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String loadFulltext(String altoFilePath, String fulltextFilePath, boolean mergeLineBreakWords,
HttpServletRequest request)
throws AccessDeniedException, FileNotFoundException, IOException, IndexUnreachableException, DAOException, ViewerConfigurationException {
TextResourceBuilder builder = new TextResourceBuilder(BeanUtils.getRequest(), null);
if (altoFilePath != null) {
// ALTO file
try {
String alto = builder.getAltoDocument(FileTools.getBottomFolderFromPathString(altoFilePath),
FileTools.getFilenameFromPathString(altoFilePath));
if (alto != null) {
return ALTOTools.getFullText(alto, mergeLineBreakWords, request);
}
} catch (ContentNotFoundException e) {
throw new FileNotFoundException(e.getMessage());
} catch (ServiceNotAllowedException e) {
throw new AccessDeniedException("fulltextAccessDenied");
} catch (PresentationException e) {
logger.error(e.getMessage());
}
}
if (fulltextFilePath != null) {
// Plain full-text file
try {
String fulltext = builder.getFulltext(FileTools.getBottomFolderFromPathString(fulltextFilePath),
FileTools.getFilenameFromPathString(fulltextFilePath));
if (fulltext != null) {
return fulltext;
}
} catch (ContentNotFoundException e) {
throw new FileNotFoundException(e.getMessage());
} catch (ServiceNotAllowedException e) {
throw new AccessDeniedException("fulltextAccessDenied");
} catch (PresentationException e) {
logger.error(e.getMessage());
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadFulltext
File: goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-15124
|
MEDIUM
| 4
|
intranda/goobi-viewer-core
|
loadFulltext
|
goobi-viewer-core/src/main/java/io/goobi/viewer/controller/DataFileTools.java
|
44ceb8e2e7e888391e8a941127171d6366770df3
| 0
|
Analyze the following code function for security vulnerabilities
|
void getShortcutByIdsAsync(@NonNull final Set<String> ids,
@NonNull final Consumer<List<ShortcutInfo>> cb) {
if (!isAppSearchEnabled()) {
cb.accept(Collections.emptyList());
return;
}
runAsSystem(() -> fromAppSearch().thenAccept(session -> {
session.getByDocumentId(new GetByDocumentIdRequest.Builder(getPackageName())
.addIds(ids).build(), mShortcutUser.mExecutor,
new BatchResultCallback<String, GenericDocument>() {
@Override
public void onResult(
@NonNull AppSearchBatchResult<String, GenericDocument> result) {
final List<ShortcutInfo> ret = result.getSuccesses().values()
.stream().map(doc ->
ShortcutInfo.createFromGenericDocument(
mShortcutUser.getUserId(), doc))
.collect(Collectors.toList());
cb.accept(ret);
}
@Override
public void onSystemError(
@Nullable Throwable throwable) {
Slog.d(TAG, "Error retrieving shortcuts", throwable);
}
});
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShortcutByIdsAsync
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
getShortcutByIdsAsync
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void writeLegacyPermissionStateTEMP() {
mPermissionManagerServiceImpl.writeLegacyPermissionStateTEMP();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeLegacyPermissionStateTEMP
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
writeLegacyPermissionStateTEMP
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
void onCoreSettingsChange(Bundle settings) {
synchronized (mProcLock) {
mProcessList.updateCoreSettingsLOSP(settings);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCoreSettingsChange
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
|
onCoreSettingsChange
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void compatibleProjectKey(Map map, String name, String compatibleValue) {
if (map.get(name) == null || StringUtils.isBlank(map.get(name).toString())) {
// 如果配置里面缺陷对应平台的项目ID则,即使用旧数据的项目ID
map.put(name, compatibleValue);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compatibleProjectKey
File: test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
compatibleProjectKey
|
test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public static StartElement peekNextStartElement(XMLEventReader xmlEventReader) throws ParsingException {
try {
while (true) {
XMLEvent xmlEvent = xmlEventReader.peek();
if (xmlEvent == null || xmlEvent.isStartElement())
return (StartElement) xmlEvent;
else
xmlEvent = xmlEventReader.nextEvent();
}
} catch (XMLStreamException e) {
throw logger.parserException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: peekNextStartElement
File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2017-2582
|
MEDIUM
| 4
|
keycloak
|
peekNextStartElement
|
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
|
0cb5ba0f6e83162d221681f47b470c3042eef237
| 0
|
Analyze the following code function for security vulnerabilities
|
private String generateTooltipHtml(CmsListInfoBean infoBean) {
StringBuffer result = new StringBuffer();
result.append("<p><b>").append(CmsClientStringUtil.shortenString(infoBean.getTitle(), 70)).append("</b></p>");
if (infoBean.hasAdditionalInfo()) {
for (CmsAdditionalInfoBean additionalInfo : infoBean.getAdditionalInfo()) {
result.append("<p>").append(additionalInfo.getName()).append(": ");
// shorten the value to max 45 characters
result.append(CmsClientStringUtil.shortenString(additionalInfo.getValue(), 45)).append("</p>");
}
}
return result.toString();
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-31544
- Severity: MEDIUM
- CVSS Score: 5.4
Description: Fixed XSS issue in gallery result view (github issue #652).
Function: generateTooltipHtml
File: src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
Repository: alkacon/opencms-core
Fixed Code:
private String generateTooltipHtml(CmsListInfoBean infoBean) {
Element root = DOM.createElement("div");
appendDom(appendDom(root, "p"), "b").setInnerText(CmsClientStringUtil.shortenString(infoBean.getTitle(), 70));
if (infoBean.hasAdditionalInfo()) {
for (CmsAdditionalInfoBean additionalInfo : infoBean.getAdditionalInfo()) {
appendDom(root, "p").setInnerText(
additionalInfo.getName()
+ ":\u00a0"
+ CmsClientStringUtil.shortenString(additionalInfo.getValue(), 45));
}
}
return root.getInnerHTML();
}
|
[
"CWE-79"
] |
CVE-2023-31544
|
MEDIUM
| 5.4
|
alkacon/opencms-core
|
generateTooltipHtml
|
src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
|
21bfbeaf6b038e2c03bb421ce7f0933dd7a7633e
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationAsFloatEdgeCase04() throws Exception
{
// Just beyond the upper-bound of Duration.
String input = new BigInteger(Long.toString(Long.MAX_VALUE)).add(BigInteger.ONE) + ".0";
Duration value = READER.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
.readValue(input);
assertEquals(Long.MIN_VALUE, value.getSeconds()); // We've turned a positive number into negative duration!
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationAsFloatEdgeCase04
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationAsFloatEdgeCase04
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<Action> getActions() {
// add all the transient actions, too
List<Action> actions = new Vector<Action>(super.getActions());
actions.addAll(transientActions);
// return the read only list to cause a failure on plugins who try to add an action here
return Collections.unmodifiableList(actions);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActions
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-2058
|
MEDIUM
| 6.5
|
jenkinsci/jenkins
|
getActions
|
core/src/main/java/hudson/model/AbstractProject.java
|
b6b2a367a7976be80a799c6a49fa6c58d778b50e
| 0
|
Analyze the following code function for security vulnerabilities
|
public AwBrowserContext getAwBrowserContext() {
return mBrowserContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAwBrowserContext
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
getAwBrowserContext
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getString(String secureSettingKey, int userHandle) {
try {
return getLockSettings().getString(secureSettingKey, null, userHandle);
} catch (RemoteException re) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getString
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
getString
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<KBTemplate> findAll(int start, int end) {
return findAll(start, end, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findAll
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
|
findAll
|
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
|
private int getTxCurrentMa() {
return getResources().getInteger(R.integer.config_bluetooth_tx_cur_ma);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTxCurrentMa
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
getTxCurrentMa
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String parseRef(String content, String cascadingValue) {
String[] fieldAndEntity = content.split("\\.");
if (fieldAndEntity.length != 2 || !MetadataHelper.checkAndWarnField(fieldAndEntity[1], fieldAndEntity[0])) {
return null;
}
final Entity entity = MetadataHelper.getEntity(fieldAndEntity[1]);
final Field field = entity.getField(fieldAndEntity[0]);
List<String> sqls = new ArrayList<>();
// 字段附加过滤条件
JSONObject fieldFilter = getFieldDataFilter(field);
if (ParseHelper.validAdvFilter(fieldFilter)) {
String s = new AdvFilterParser(fieldFilter).toSqlWhere();
if (StringUtils.isNotBlank(s)) sqls.add(s);
}
// 父级级联字段
if (hasFieldCascadingField(field) && ID.isId(cascadingValue)) {
String cascadingFieldParent = field.getExtraAttrs().getString("_cascadingFieldParent");
String cascadingFieldChild = field.getExtraAttrs().getString("_cascadingFieldChild");
if (StringUtils.isNotBlank(cascadingFieldParent)) {
String[] fs = cascadingFieldParent.split(MetadataHelper.SPLITER_RE);
sqls.add(String.format("%s = '%s'", fs[1], cascadingValue));
}
if (StringUtils.isNotBlank(cascadingFieldChild)) {
String[] fs = cascadingFieldChild.split(MetadataHelper.SPLITER_RE);
Entity refEntity = entity.getField(fs[0]).getReferenceEntity();
String s = String.format("exists (select %s from %s where ^%s = %s and %s = '%s')",
fs[1], refEntity.getName(),
field.getReferenceEntity().getPrimaryField().getName(), fs[1],
refEntity.getPrimaryField().getName(), cascadingValue);
sqls.add(s);
}
}
return sqls.isEmpty() ? null
: "( " + StringUtils.join(sqls, " and ") + " )";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseRef
File: src/main/java/com/rebuild/core/support/general/ProtocolFilterParser.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
parseRef
|
src/main/java/com/rebuild/core/support/general/ProtocolFilterParser.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public VerifyCredentialResponse verifyTiedProfileChallenge(String password, boolean isPattern,
long challenge, int userId) throws RemoteException {
checkPasswordReadPermission(userId);
if (!isManagedProfileWithUnifiedLock(userId)) {
throw new RemoteException("User id must be managed profile with unified lock");
}
final int parentProfileId = mUserManager.getProfileParent(userId).id;
// Unlock parent by using parent's challenge
final VerifyCredentialResponse parentResponse = isPattern
? doVerifyPattern(password, true, challenge, parentProfileId)
: doVerifyPassword(password, true, challenge, parentProfileId);
if (parentResponse.getResponseCode() != VerifyCredentialResponse.RESPONSE_OK) {
// Failed, just return parent's response
return parentResponse;
}
try {
// Unlock work profile, and work profile with unified lock must use password only
return doVerifyPassword(getDecryptedPasswordForTiedProfile(userId), true,
challenge,
userId);
} catch (UnrecoverableKeyException | InvalidKeyException | KeyStoreException
| NoSuchAlgorithmException | NoSuchPaddingException
| InvalidAlgorithmParameterException | IllegalBlockSizeException
| BadPaddingException | CertificateException | IOException e) {
Slog.e(TAG, "Failed to decrypt child profile key", e);
throw new RemoteException("Unable to get tied profile token");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyTiedProfileChallenge
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
verifyTiedProfileChallenge
|
services/core/java/com/android/server/LockSettingsService.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Person parsePerson(TypedXmlPullParser parser)
throws IOException, XmlPullParserException {
CharSequence name = ShortcutService.parseStringAttribute(parser, ATTR_PERSON_NAME);
String uri = ShortcutService.parseStringAttribute(parser, ATTR_PERSON_URI);
String key = ShortcutService.parseStringAttribute(parser, ATTR_PERSON_KEY);
boolean isBot = ShortcutService.parseBooleanAttribute(parser, ATTR_PERSON_IS_BOT);
boolean isImportant = ShortcutService.parseBooleanAttribute(parser,
ATTR_PERSON_IS_IMPORTANT);
Person.Builder builder = new Person.Builder();
builder.setName(name).setUri(uri).setKey(key).setBot(isBot).setImportant(isImportant);
return builder.build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parsePerson
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
parsePerson
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public XWikiDeletedDocument getDeletedDocument(String fullname, String locale, int index, XWikiContext context)
throws XWikiException
{
return getDeletedDocument(index, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeletedDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getDeletedDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
private void collectContainerLog(String namespace, String podName, String containerName,
@Nullable String logEndMessage, TaskLogger jobLogger) {
Thread thread = Thread.currentThread();
AtomicReference<Boolean> abortError = new AtomicReference<>(false);
AtomicReference<Instant> lastInstantRef = new AtomicReference<>(null);
AtomicBoolean endOfLogSeenRef = new AtomicBoolean(false);
while (true) {
Commandline kubectl = newKubeCtl();
kubectl.addArgs("logs", podName, "-c", containerName, "-n", namespace, "--follow", "--timestamps=true");
if (lastInstantRef.get() != null)
kubectl.addArgs("--since-time=" + DateTimeFormatter.ISO_INSTANT.format(lastInstantRef.get()));
class Logger extends LineConsumer {
private final String sessionId = UUID.randomUUID().toString();
@Override
public void consume(String line) {
if (line.contains("rpc error:") && line.contains("No such container:")
|| line.contains("Unable to retrieve container logs for")) {
logger.debug(line);
} else if (logEndMessage != null && line.contains(logEndMessage)) {
endOfLogSeenRef.set(true);
String lastLogMessage = StringUtils.substringBefore(line, logEndMessage);
if (StringUtils.substringAfter(lastLogMessage, " ").length() != 0)
consume(lastLogMessage);
} else if (line.startsWith("Error from server") || line.startsWith("error:")) {
jobLogger.error(line);
if (!abortError.get()) {
abortError.set(true);
thread.interrupt();
}
} else if (line.contains(" ")) {
String timestamp = StringUtils.substringBefore(line, " ");
try {
Instant instant = Instant.from(DateTimeFormatter.ISO_INSTANT.parse(timestamp));
if (lastInstantRef.get() == null || lastInstantRef.get().isBefore(instant))
lastInstantRef.set(instant);
jobLogger.log(StringUtils.substringAfter(line, " "), sessionId);
} catch (DateTimeParseException e) {
jobLogger.log(line, sessionId);
}
} else {
jobLogger.log(line, sessionId);
}
}
};
try {
kubectl.execute(new Logger(), new Logger()).checkReturnCode();
} catch (Exception e) {
if (!abortError.get())
throw ExceptionUtils.unchecked(e);
}
if (logEndMessage == null || endOfLogSeenRef.get() || abortError.get() != null) {
break;
} else {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: collectContainerLog
File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-610"
] |
CVE-2022-39206
|
CRITICAL
| 9.9
|
theonedev/onedev
|
collectContainerLog
|
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
|
0052047a5b5095ac6a6b4a73a522d0272fec3a22
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void destroy() {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroy
File: sa-token-starter/sa-token-spring-boot-starter/src/main/java/cn/dev33/satoken/filter/SaServletFilter.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
destroy
|
sa-token-starter/sa-token-spring-boot-starter/src/main/java/cn/dev33/satoken/filter/SaServletFilter.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
void addUser(int userId) {
mUsers.add(userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addUser
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
|
addUser
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void copyToDir(Directory in, Directory out)
throws DirectoryException {
for (String fileName : in.getFiles(true)) {
copyToDir(in, out, fileName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyToDir
File: brut.j.dir/src/main/java/brut/directory/DirUtil.java
Repository: iBotPeaches/Apktool
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-21633
|
HIGH
| 7.8
|
iBotPeaches/Apktool
|
copyToDir
|
brut.j.dir/src/main/java/brut/directory/DirUtil.java
|
d348c43b24a9de350ff6e5bd610545a10c1fc712
| 0
|
Analyze the following code function for security vulnerabilities
|
void cleanupAnimatingExitWindow() {
// TODO(b/205335975): WindowManagerService#tryStartExitingAnimation starts an exit animation
// and set #mAnimationExit. After the exit animation finishes, #onExitAnimationDone shall
// be called, but there seems to be a case that #onExitAnimationDone is not triggered, so
// a windows stuck in the animatingExit status.
if (mAnimatingExit && shouldFinishAnimatingExit()) {
ProtoLog.w(WM_DEBUG_APP_TRANSITIONS, "Clear window stuck on animatingExit status: %s",
this);
onExitAnimationDone();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanupAnimatingExitWindow
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
|
cleanupAnimatingExitWindow
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
static Task getRootTask(IBinder token) {
final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r != null) {
return r.getRootTask();
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRootTask
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
|
getRootTask
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<Pair<Account, String>> invalidateAuthTokenLocked(UserAccounts accounts, String accountType,
String authToken) {
// TODO Move to AccountsDB
List<Pair<Account, String>> results = new ArrayList<>();
Cursor cursor = accounts.accountsDb.findAuthtokenForAllAccounts(accountType, authToken);
try {
while (cursor.moveToNext()) {
String authTokenId = cursor.getString(0);
String accountName = cursor.getString(1);
String authTokenType = cursor.getString(2);
accounts.accountsDb.deleteAuthToken(authTokenId);
results.add(Pair.create(new Account(accountName, accountType), authTokenType));
}
} finally {
cursor.close();
}
return results;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: invalidateAuthTokenLocked
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
invalidateAuthTokenLocked
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void handleRemoved(long deviceId, int fingerId, int groupId) {
ClientMonitor client = mCurrentClient;
if (client != null && client.onRemoved(fingerId, groupId)) {
removeClient(client);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleRemoved
File: services/core/java/com/android/server/fingerprint/FingerprintService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
handleRemoved
|
services/core/java/com/android/server/fingerprint/FingerprintService.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeOnNetworkUpdateListener(@NonNull OnNetworkUpdateListener listener) {
if (listener == null) {
Log.wtf(TAG, "removeOnNetworkUpdateListener: listener must not be null");
return;
}
mListeners.remove(listener);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeOnNetworkUpdateListener
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
removeOnNetworkUpdateListener
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<String> getCrossProfileWidgetProviders(ComponentName admin,
String callerPackageName) {
CallerIdentity caller;
if (isPermissionCheckFlagEnabled()) {
caller = getCallerIdentity(admin, callerPackageName);
} else {
caller = getCallerIdentity(admin);
}
ActiveAdmin activeAdmin;
if (isPermissionCheckFlagEnabled()) {
EnforcingAdmin enforcingAdmin = enforceCanQueryAndGetEnforcingAdmin(
admin,
MANAGE_DEVICE_POLICY_PROFILE_INTERACTION,
caller.getPackageName(),
caller.getUserId());
activeAdmin = enforcingAdmin.getActiveAdmin();
} else {
Objects.requireNonNull(admin, "ComponentName is null");
Preconditions.checkCallAuthorization(isProfileOwner(caller));
synchronized (getLockObject()) {
activeAdmin = getProfileOwnerLocked(caller.getUserId());
}
}
synchronized (getLockObject()) {
if (activeAdmin.crossProfileWidgetProviders == null
|| activeAdmin.crossProfileWidgetProviders.isEmpty()) {
return null;
}
if (mInjector.binderIsCallingUidMyUid()) {
return new ArrayList<>(activeAdmin.crossProfileWidgetProviders);
} else {
return activeAdmin.crossProfileWidgetProviders;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCrossProfileWidgetProviders
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
getCrossProfileWidgetProviders
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldBeResumed(ActivityRecord activeActivity) {
return shouldMakeActive(activeActivity) && isFocusable()
&& getTaskFragment().getVisibility(activeActivity)
== TASK_FRAGMENT_VISIBILITY_VISIBLE
&& canResumeByCompat();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldBeResumed
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
|
shouldBeResumed
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
ArraySet<String> getAllowedPackageAssociations() {
return mAllowedPackageAssociations;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllowedPackageAssociations
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
|
getAllowedPackageAssociations
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private int calculatePanelHeightShade() {
int emptyBottomMargin = mNotificationStackScroller.getEmptyBottomMargin();
int maxHeight = mNotificationStackScroller.getHeight() - emptyBottomMargin
- mTopPaddingAdjustment;
maxHeight += mNotificationStackScroller.getTopPaddingOverflow();
return maxHeight;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calculatePanelHeightShade
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
calculatePanelHeightShade
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setInvertFilter(boolean value) {
invertFilter = value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInvertFilter
File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
setInvertFilter
|
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isJsonMime(String mime) {
String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isJsonMime
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/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
|
isJsonMime
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void uploadFile(String uploadKey) {
mCurrentUpload = mPendingUploads.get(uploadKey);
if (mCurrentUpload != null) {
/// Check account existence
if (!accountManager.exists(mCurrentUpload.getAccount())) {
Log_OC.w(TAG, "Account " + mCurrentUpload.getAccount().name +
" does not exist anymore -> cancelling all its uploads");
cancelUploadsForAccount(mCurrentUpload.getAccount());
return;
}
/// OK, let's upload
mUploadsStorageManager.updateDatabaseUploadStart(mCurrentUpload);
notifyUploadStart(mCurrentUpload);
sendBroadcastUploadStarted(mCurrentUpload);
RemoteOperationResult uploadResult = null;
try {
/// prepare client object to send the request to the ownCloud server
if (mCurrentAccount == null || !mCurrentAccount.equals(mCurrentUpload.getAccount())) {
mCurrentAccount = mCurrentUpload.getAccount();
mStorageManager = new FileDataStorageManager(mCurrentAccount, getContentResolver());
} // else, reuse storage manager from previous operation
// always get client from client manager, to get fresh credentials in case of update
OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, this);
// // If parent folder is encrypted, upload file encrypted
// OCFile parent = mStorageManager.getFileByPath(mCurrentUpload.getFile().getParentRemotePath());
// if (parent.isEncrypted()) {
// UploadEncryptedFileOperation uploadEncryptedFileOperation =
// new UploadEncryptedFileOperation(parent, mCurrentUpload);
//
// uploadResult = uploadEncryptedFileOperation.execute(mUploadClient, mStorageManager);
// } else {
/// perform the regular upload
uploadResult = mCurrentUpload.execute(mUploadClient, mStorageManager);
// }
} catch (Exception e) {
Log_OC.e(TAG, "Error uploading", e);
uploadResult = new RemoteOperationResult(e);
} finally {
Pair<UploadFileOperation, String> removeResult;
if (mCurrentUpload.wasRenamed()) {
removeResult = mPendingUploads.removePayload(
mCurrentAccount.name,
mCurrentUpload.getOldFile().getRemotePath()
);
// TODO: grant that name is also updated for mCurrentUpload.getOCUploadId
} else {
removeResult = mPendingUploads.removePayload(mCurrentAccount.name,
mCurrentUpload.getDecryptedRemotePath());
}
mUploadsStorageManager.updateDatabaseUploadResult(uploadResult, mCurrentUpload);
/// notify result
notifyUploadResult(mCurrentUpload, uploadResult);
sendBroadcastUploadFinished(mCurrentUpload, uploadResult, removeResult.second);
}
// generate new Thumbnail
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, mCurrentAccount);
File file = new File(mCurrentUpload.getOriginalStoragePath());
String remoteId = mCurrentUpload.getFile().getRemoteId();
task.execute(new ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uploadFile
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2021-32695
|
MEDIUM
| 4.3
|
nextcloud/android
|
uploadFile
|
src/main/java/com/owncloud/android/files/services/FileUploader.java
|
97d6f2954c879f3bfebcd241993147bced5fd50b
| 0
|
Analyze the following code function for security vulnerabilities
|
private void readDescriptorPackage(Element packageElement)
{
NodeList children = packageElement.getChildNodes();
for (int i = 0; i < children.getLength(); ++i) {
Node node = children.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
if (element.getTagName().equals(XarModel.ELEMENT_INFOS)) {
readDescriptorInfos(element);
} else if (element.getTagName().equals(XarModel.ELEMENT_FILES)) {
readDescriptorFiles(element);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readDescriptorPackage
File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-27480
|
HIGH
| 7.7
|
xwiki/xwiki-platform
|
readDescriptorPackage
|
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
|
e3527b98fdd8dc8179c24dc55e662b2c55199434
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setHeader(String name, String value)
{
this.response.setHeader(name, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeader
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-601"
] |
CVE-2022-23618
|
MEDIUM
| 5.8
|
xwiki/xwiki-platform
|
setHeader
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
|
5251c02080466bf9fb55288f04a37671108f8096
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isBuildBlocked() {
return getCauseOfBlockage()!=null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isBuildBlocked
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
isBuildBlocked
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean needPendingStatus() {
return handshakeState != HandshakeState.NOT_STARTED && !isDestroyed()
&& (handshakeState != HandshakeState.FINISHED || engineClosed);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: needPendingStatus
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
needPendingStatus
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendBroadcastUploadFinished(
UploadFileOperation upload,
RemoteOperationResult uploadResult,
String unlinkedFromRemotePath
) {
Intent end = new Intent(getUploadFinishMessage());
end.putExtra(EXTRA_REMOTE_PATH, upload.getRemotePath()); // real remote
// path, after
// possible
// automatic
// renaming
if (upload.wasRenamed()) {
end.putExtra(EXTRA_OLD_REMOTE_PATH, upload.getOldFile().getRemotePath());
}
end.putExtra(EXTRA_OLD_FILE_PATH, upload.getOriginalStoragePath());
end.putExtra(ACCOUNT_NAME, upload.getUser().getAccountName());
end.putExtra(EXTRA_UPLOAD_RESULT, uploadResult.isSuccess());
if (unlinkedFromRemotePath != null) {
end.putExtra(EXTRA_LINKED_TO_PATH, unlinkedFromRemotePath);
}
end.setPackage(getPackageName());
localBroadcastManager.sendBroadcast(end);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendBroadcastUploadFinished
File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-39210
|
MEDIUM
| 5.5
|
nextcloud/android
|
sendBroadcastUploadFinished
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
public void readObjectsFromForm(EditForm eform, XWikiContext context) throws XWikiException
{
for (DocumentReference reference : getXObjects().keySet()) {
List<BaseObject> oldObjects = getXObjects(reference);
BaseObjects newObjects = new BaseObjects();
while (newObjects.size() < oldObjects.size()) {
newObjects.add(null);
}
for (int i = 0; i < oldObjects.size(); i++) {
BaseObject oldobject = oldObjects.get(i);
if (oldobject != null) {
BaseClass baseclass = oldobject.getXClass(context);
BaseObject newobject = (BaseObject) baseclass.fromMap(
eform.getObject(
LOCAL_REFERENCE_SERIALIZER.serialize(baseclass.getDocumentReference()) + "_" + i),
oldobject);
newobject.setNumber(oldobject.getNumber());
newobject.setGuid(oldobject.getGuid());
newobject.setOwnerDocument(this);
newObjects.set(newobject.getNumber(), newobject);
}
}
getXObjects().put(reference, newObjects);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readObjectsFromForm
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
|
readObjectsFromForm
|
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
|
@Override
public boolean isUidActive(int uid, String callingPackage) {
if (!hasUsageStatsPermission(callingPackage)) {
enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
"isUidActive");
}
synchronized (mProcLock) {
if (isUidActiveLOSP(uid)) {
return true;
}
}
return mInternal.isPendingTopUid(uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isUidActive
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
|
isUidActive
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SCM newInstance(StaplerRequest staplerRequest, JSONObject jsonObject) throws FormException {
return super.newInstance(staplerRequest, jsonObject);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newInstance
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices.
|
[
"CWE-255"
] |
CVE-2013-6372
|
LOW
| 2.1
|
jenkinsci/subversion-plugin
|
newInstance
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
@edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_GC")
public void doGc(StaplerResponse rsp) throws IOException {
checkPermission(Jenkins.ADMINISTER);
System.gc();
rsp.setStatus(HttpServletResponse.SC_OK);
rsp.setContentType("text/plain");
rsp.getWriter().println("GCed");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doGc
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doGc
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
static int[] appendInts(int[] cur, int[] add) {
if (add == null) return cur;
if (cur == null) return add;
final int N = add.length;
for (int i=0; i<N; i++) {
cur = appendInt(cur, add[i]);
}
return cur;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendInts
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
appendInts
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean enableWriteAheadLogging() {
synchronized (mLock) {
throwIfNotOpenLocked();
if ((mConfigurationLocked.openFlags & ENABLE_WRITE_AHEAD_LOGGING) != 0) {
return true;
}
if (isReadOnlyLocked()) {
// WAL doesn't make sense for readonly-databases.
// TODO: True, but connection pooling does still make sense...
return false;
}
if (mConfigurationLocked.isInMemoryDb()) {
Log.i(TAG, "can't enable WAL for memory databases.");
return false;
}
// make sure this database has NO attached databases because sqlite's write-ahead-logging
// doesn't work for databases with attached databases
if (mHasAttachedDbsLocked) {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "this database: " + mConfigurationLocked.label
+ " has attached databases. can't enable WAL.");
}
return false;
}
mConfigurationLocked.openFlags |= ENABLE_WRITE_AHEAD_LOGGING;
try {
mConnectionPoolLocked.reconfigure(mConfigurationLocked);
} catch (RuntimeException ex) {
mConfigurationLocked.openFlags &= ~ENABLE_WRITE_AHEAD_LOGGING;
throw ex;
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableWriteAheadLogging
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
enableWriteAheadLogging
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkQuota() {
QuotaService quotaService = CommonBeanFactory.getBean(QuotaService.class);
if (quotaService != null) {
quotaService.checkAPIAutomationQuota();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkQuota
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
checkQuota
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeStringResponse(VaadinResponse response, String contentType,
String reponseString) throws IOException {
response.setContentType(contentType);
final OutputStream out = response.getOutputStream();
final PrintWriter outWriter = new PrintWriter(
new BufferedWriter(new OutputStreamWriter(out, "UTF-8")));
outWriter.print(reponseString);
outWriter.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeStringResponse
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
writeStringResponse
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
79b37b8ea2bcb4718237821773959dcfbccf31e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public UIComponent createComponent(String componentType) throws FacesException {
notNull(COMPONENT_TYPE, componentType);
return createComponentApplyAnnotations(FacesContext.getCurrentInstance(), componentType, null, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createComponent
File: impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-14371
|
MEDIUM
| 5
|
eclipse-ee4j/mojarra
|
createComponent
|
impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
|
1b434748d9239f42eae8aa7d37d7a0930c061e24
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.