instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private Stream<Tuple3<URI, RpkiObject, ValidationResult>> getManifestEntry(URI manifestUri,
Map.Entry<String, byte[]> entry) {
URI location = manifestUri.resolve(entry.getKey());
ValidationResult temporary = ValidationResult.withLocation(new ValidationLocation(location));
Optional<RpkiObject> object = storage.readTx(tx -> rpkiObjects.findBySha256(tx, entry.getValue()));
temporary.rejectIfFalse(object.isPresent(), VALIDATOR_MANIFEST_ENTRY_FOUND, manifestUri.toASCIIString());
Optional<RpkiObject> rpkiObject = object.flatMap(obj -> {
boolean hashMatches = Arrays.equals(obj.getSha256(), entry.getValue());
temporary.rejectIfFalse(hashMatches, VALIDATOR_MANIFEST_ENTRY_HASH_MATCHES, entry.getKey());
return hashMatches ? object : Optional.empty();
});
if(validationConfig.isStrictValidation())
return rpkiObject.map(ro -> Stream.of(new Tuple3<>(location, ro, temporary)))
.orElseThrow(() -> new StrictValidationException("Failed to get Manifest entry"));
else {
return rpkiObject.map(ro -> Stream.of(new Tuple3<>(location, ro, temporary)))
.orElse(Stream.empty());
}
}
|
Vulnerability Classification:
- CWE: CWE-295
- CVE: CVE-2020-16162
- Severity: MEDIUM
- CVSS Score: 5.0
Description: More test for manifest entry not found.
Rename strict exception to manifest entry exception to short circuit.
Handle this exception.
Function: getManifestEntry
File: rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
Repository: RIPE-NCC/rpki-validator-3
Fixed Code:
private Stream<Tuple3<URI, RpkiObject, ValidationResult>> getManifestEntry(URI manifestUri,
Map.Entry<String, byte[]> entry) {
URI location = manifestUri.resolve(entry.getKey());
ValidationResult temporary = ValidationResult.withLocation(new ValidationLocation(location));
Optional<RpkiObject> object = storage.readTx(tx -> rpkiObjects.findBySha256(tx, entry.getValue()));
temporary.rejectIfFalse(object.isPresent(), VALIDATOR_MANIFEST_ENTRY_FOUND, manifestUri.toASCIIString());
Optional<RpkiObject> rpkiObject = object.flatMap(obj -> {
boolean hashMatches = Arrays.equals(obj.getSha256(), entry.getValue());
temporary.rejectIfFalse(hashMatches, VALIDATOR_MANIFEST_ENTRY_HASH_MATCHES, entry.getKey());
return hashMatches ? object : Optional.empty();
});
if(validationConfig.isStrictValidation())
return rpkiObject.map(ro -> Stream.of(new Tuple3<>(location, ro, temporary)))
.orElseThrow(() ->
new ManifestEntryException("Failed to get manifest entry "+entry.getKey(), temporary));
else {
return rpkiObject.map(ro -> Stream.of(new Tuple3<>(location, ro, temporary)))
.orElse(Stream.empty());
}
}
|
[
"CWE-295"
] |
CVE-2020-16162
|
MEDIUM
| 5
|
RIPE-NCC/rpki-validator-3
|
getManifestEntry
|
rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
|
3cbf34fed7c0ca00574644a5b5b06f1b54a3f5dc
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerBuilder annotatedService(String pathPrefix, Object service,
Function<? super HttpService, ? extends HttpService> decorator,
Iterable<?> exceptionHandlersAndConverters) {
virtualHostTemplate.annotatedService(pathPrefix, service, decorator, exceptionHandlersAndConverters);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: annotatedService
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
annotatedService
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean convertFromTranslucent(IBinder token) {
final long origId = Binder.clearCallingIdentity();
try {
synchronized (this) {
final ActivityRecord r = ActivityRecord.isInStackLocked(token);
if (r == null) {
return false;
}
final boolean translucentChanged = r.changeWindowTranslucency(true);
if (translucentChanged) {
r.task.stack.releaseBackgroundResources(r);
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
}
mWindowManager.setAppFullscreen(token, true);
return translucentChanged;
}
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertFromTranslucent
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
convertFromTranslucent
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean addPermission(PermissionInfo permissionInfo, boolean async) {
return mPermissionManagerServiceImpl.addPermission(permissionInfo, async);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPermission
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
|
addPermission
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTransferProgress(
long progressRate,
long totalTransferredSoFar,
long totalToTransfer,
String fileName
) {
String key = buildRemoteName(mCurrentUpload.getAccount().name, mCurrentUpload.getFile().getRemotePath());
OnDatatransferProgressListener boundListener = mBoundListeners.get(key);
if (boundListener != null) {
boundListener.onTransferProgress(progressRate, totalTransferredSoFar, totalToTransfer, fileName);
}
Context context = MainApp.getAppContext();
if (context != null) {
ResultCode cancelReason = null;
Connectivity connectivity = connectivityService.getConnectivity();
if (mCurrentUpload.isWifiRequired() && !connectivity.isWifi()) {
cancelReason = ResultCode.DELAYED_FOR_WIFI;
} else if (mCurrentUpload.isChargingRequired() && !powerManagementService.getBattery().isCharging()) {
cancelReason = ResultCode.DELAYED_FOR_CHARGING;
} else if (!mCurrentUpload.isIgnoringPowerSaveMode() && powerManagementService.isPowerSavingEnabled()) {
cancelReason = ResultCode.DELAYED_IN_POWER_SAVE_MODE;
}
if (cancelReason != null) {
cancel(
mCurrentUpload.getAccount().name,
mCurrentUpload.getFile().getRemotePath(),
cancelReason
);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTransferProgress
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
onTransferProgress
|
src/main/java/com/owncloud/android/files/services/FileUploader.java
|
c01fa0b17050cdcf77a468cc22f4071eae29d464
| 0
|
Analyze the following code function for security vulnerabilities
|
public Client getHttpClient() {
return httpClient;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHttpClient
File: samples/client/petstore/java/jersey2-java8-localdatetime/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
|
getHttpClient
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void hang(final IBinder who, boolean allowRestart) {
if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires permission "
+ android.Manifest.permission.SET_ACTIVITY_WATCHER);
}
final IBinder.DeathRecipient death = new DeathRecipient() {
@Override
public void binderDied() {
synchronized (this) {
notifyAll();
}
}
};
try {
who.linkToDeath(death, 0);
} catch (RemoteException e) {
Slog.w(TAG, "hang: given caller IBinder is already dead.");
return;
}
synchronized (this) {
Watchdog.getInstance().setAllowRestart(allowRestart);
Slog.i(TAG, "Hanging system process at request of pid " + Binder.getCallingPid());
synchronized (death) {
while (who.isBinderAlive()) {
try {
death.wait();
} catch (InterruptedException e) {
}
}
}
Watchdog.getInstance().setAllowRestart(true);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hang
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
|
hang
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void syncAllPluginIssueAttachment(Project project, IssueSyncRequest syncIssuesResult) {
// todo 所有平台改造完之后删除
if (!StringUtils.equals(project.getPlatform(), IssuesManagePlatform.Jira.name())) {
return;
}
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
try {
AttachmentModuleRelationMapper batchAttachmentModuleRelationMapper = sqlSession.getMapper(AttachmentModuleRelationMapper.class);
Platform platform = platformPluginService.getPlatform(project.getPlatform(), project.getWorkspaceId());
Map<String, List<io.metersphere.xpack.track.dto.PlatformAttachment>> attachmentMap = syncIssuesResult.getAttachmentMap();
if (MapUtils.isNotEmpty(attachmentMap)) {
for (String issueId : attachmentMap.keySet()) {
// 查询我们平台的附件
Set<String> jiraAttachmentSet = new HashSet<>();
List<FileAttachmentMetadata> allMsAttachments = getIssueFileAttachmentMetadata(issueId);
Set<String> attachmentsNameSet = allMsAttachments.stream()
.map(FileAttachmentMetadata::getName)
.collect(Collectors.toSet());
List<io.metersphere.xpack.track.dto.PlatformAttachment> syncAttachments = attachmentMap.get(issueId);
for (io.metersphere.xpack.track.dto.PlatformAttachment syncAttachment : syncAttachments) {
String fileName = syncAttachment.getFileName();
String fileKey = syncAttachment.getFileKey();
if (!attachmentsNameSet.contains(fileName)) {
jiraAttachmentSet.add(fileName);
saveAttachmentModuleRelation(platform, issueId, fileName, fileKey, batchAttachmentModuleRelationMapper);
}
}
// 删除Jira中不存在的附件
deleteSyncAttachment(batchAttachmentModuleRelationMapper, jiraAttachmentSet, allMsAttachments);
}
}
} catch (Exception e) {
LogUtil.error(e);
} finally {
SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: syncAllPluginIssueAttachment
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
syncAllPluginIssueAttachment
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public ResourceList getResourceList() {
final Set<ResourceActivity> resourceActivities = getResourceActivities();
final List<ResourceList> resourceLists = new ArrayList<ResourceList>(1 + resourceActivities.size());
for (ResourceActivity activity : resourceActivities) {
if (activity != this && activity != null) {
// defensive infinite recursion and null check
resourceLists.add(activity.getResourceList());
}
}
return ResourceList.union(resourceLists);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResourceList
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
|
getResourceList
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Unstable
public boolean renameDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference,
boolean overwrite, List<DocumentReference> backlinkDocumentReferences,
List<DocumentReference> childDocumentReferences, XWikiContext context)
throws XWikiException
{
boolean result = false;
// if source and destination are same, no need to perform the rename.
if (!sourceDocumentReference.equals(targetDocumentReference)) {
XWikiDocument sourceDocument = this.getDocument(sourceDocumentReference, context);
XWikiDocument targetDocument = this.getDocument(targetDocumentReference, context);
ConfigurationSource xwikiproperties = Utils.getComponent(ConfigurationSource.class, "xwikiproperties");
boolean useAtomicRename = xwikiproperties.getProperty("refactoring.rename.useAtomicRename", Boolean.TRUE);
// Proceed on the rename only if the source document exists and if either the targetDoc does not exist or
// the overwritten is accepted.
if (!sourceDocument.isNew() && (overwrite || targetDocument.isNew())) {
if (!useAtomicRename) {
this.renameByCopyAndDelete(sourceDocument, targetDocumentReference, backlinkDocumentReferences,
childDocumentReferences, context);
result = true;
} else {
// Ensure that the current context contains the wiki reference of the source document.
WikiReference wikiReference = context.getWikiReference();
context.setWikiReference(sourceDocumentReference.getWikiReference());
// Step 1: Simulate creating a document and deleting a document from listeners point of view
// FIXME: currently modifications made by listeners won't be applied
XWikiDocument futureTargetDocument = sourceDocument.cloneRename(targetDocumentReference, context);
futureTargetDocument.setOriginalDocument(new XWikiDocument(targetDocumentReference));
beforeSave(futureTargetDocument, context);
XWikiDocument deletedDocument = beforeDelete(sourceDocument, context);
// Step 2: Perform atomic rename in DB
try {
this.getStore().renameXWikiDoc(sourceDocument, targetDocumentReference, context);
} finally {
context.setWikiReference(wikiReference);
}
// Step 3: Simulate a created document and a deleted document from listeners point of view
targetDocument = this.getDocument(targetDocumentReference, context);
afterDelete(deletedDocument, context);
afterSave(futureTargetDocument, context);
// Step 4: For each child document, update its parent reference.
// Step 5: For each backlink to rename, parse the backlink document and replace the links with
// the new name.
// Step 6: Refactor the relative links contained in the document to make sure they are relative
// to the new document's location.
this.updateLinksForRename(sourceDocument, targetDocumentReference, backlinkDocumentReferences,
childDocumentReferences, context);
result = true;
}
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renameDocument
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
|
renameDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void specialFilterContentForOnlineReport(String value) {
String specialXssStr = " exec |extractvalue|updatexml| insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 校验sql注释 不允许有sql注释
checkSqlAnnotation(value);
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
//value = value.replaceAll("/\\*.*\\*/"," ");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2022-47105
- Severity: CRITICAL
- CVSS Score: 9.8
Description: 修复 sql注入漏洞 #4393
Function: specialFilterContentForOnlineReport
File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
Repository: jeecgboot/jeecg-boot
Fixed Code:
public static void specialFilterContentForOnlineReport(String value) {
String specialXssStr = " exec |extractvalue|updatexml|geohash|gtid_subset|gtid_subtract| insert | delete | update | drop | chr | mid | master | truncate | char | declare |user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 校验sql注释 不允许有sql注释
checkSqlAnnotation(value);
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
//value = value.replaceAll("/\\*.*\\*/"," ");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
[
"CWE-89"
] |
CVE-2022-47105
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
specialFilterContentForOnlineReport
|
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
|
0fc374de4745eac52620eeb8caf6a7b76127529a
| 1
|
Analyze the following code function for security vulnerabilities
|
private void readPolicyXml(InputStream stream, boolean forRestore)
throws XmlPullParserException, NumberFormatException, IOException {
final XmlPullParser parser = Xml.newPullParser();
parser.setInput(stream, StandardCharsets.UTF_8.name());
while (parser.next() != END_DOCUMENT) {
mZenModeHelper.readXml(parser, forRestore);
mRankingHelper.readXml(parser, forRestore);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readPolicyXml
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
|
readPolicyXml
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addProfileOutput(ProfileOutput output) {
outputs.add(output);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addProfileOutput
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
addProfileOutput
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private String toNumberString() {
StringBuilder sb = new StringBuilder();
if (usingBytes) {
if (precision == 0) {
sb.append('0');
}
for (int i = precision - 1; i >= 0; i--) {
sb.append(bcdBytes[i]);
}
} else {
sb.append(Long.toHexString(bcdLong));
}
sb.append("E");
sb.append(scale);
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toNumberString
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
toNumberString
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
public void fetchProfiles(List<? extends ParaObject> objects) {
if (objects == null || objects.isEmpty()) {
return;
}
Map<String, String> authorids = new HashMap<String, String>(objects.size());
Map<String, Profile> authors = new HashMap<String, Profile>(objects.size());
for (ParaObject obj : objects) {
if (obj.getCreatorid() != null) {
authorids.put(obj.getId(), obj.getCreatorid());
}
}
List<String> ids = new ArrayList<String>(new HashSet<String>(authorids.values()));
if (ids.isEmpty()) {
return;
}
// read all post authors in batch
for (ParaObject author : pc.readAll(ids)) {
authors.put(author.getId(), (Profile) author);
}
// add system profile
authors.put(API_USER.getId(), API_USER);
// set author object for each post
for (ParaObject obj : objects) {
if (obj instanceof Post) {
((Post) obj).setAuthor(authors.get(authorids.get(obj.getId())));
} else if (obj instanceof Revision) {
((Revision) obj).setAuthor(authors.get(authorids.get(obj.getId())));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fetchProfiles
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
fetchProfiles
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
private void readFieldDescriptors(ObjectStreamClass cDesc)
throws ClassNotFoundException, IOException {
short numFields = input.readShort();
ObjectStreamField[] fields = new ObjectStreamField[numFields];
// We set it now, but each element will be inserted in the array further
// down
cDesc.setLoadFields(fields);
// Check ObjectOutputStream.writeFieldDescriptors
for (short i = 0; i < numFields; i++) {
char typecode = (char) input.readByte();
String fieldName = input.readUTF();
boolean isPrimType = ObjectStreamClass.isPrimitiveType(typecode);
String classSig;
if (isPrimType) {
classSig = String.valueOf(typecode);
} else {
// The spec says it is a UTF, but experience shows they dump
// this String using writeObject (unlike the field name, which
// is saved with writeUTF).
// And if resolveObject is enabled, the classSig may be modified
// so that the original class descriptor cannot be read
// properly, so it is disabled.
boolean old = enableResolve;
try {
enableResolve = false;
classSig = (String) readObject();
} finally {
enableResolve = old;
}
}
classSig = formatClassSig(classSig);
ObjectStreamField f = new ObjectStreamField(classSig, fieldName);
fields[i] = f;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readFieldDescriptors
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
readFieldDescriptors
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIntentSenderTargetedToPackage
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
isIntentSenderTargetedToPackage
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public void parseStyleElement(ApplContext ac, String input, URL url, int lineno) {
parseStyleElement(ac, new StringReader(input), null, null, url, lineno);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseStyleElement
File: org/w3c/css/css/StyleSheetParser.java
Repository: w3c/css-validator
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-4070
|
LOW
| 3.5
|
w3c/css-validator
|
parseStyleElement
|
org/w3c/css/css/StyleSheetParser.java
|
e5c09a9119167d3064db786d5f00d730b584a53b
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAllowExternalReferences(boolean theAllowExternalReferences) {
myModelConfig.setAllowExternalReferences(theAllowExternalReferences);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAllowExternalReferences
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
setAllowExternalReferences
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void start(boolean pLazy, String pUrl, boolean pSecured) {
start(pLazy);
AgentDetails details = backendManager.getAgentDetails();
details.setUrl(pUrl);
details.setSecured(pSecured);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: start
File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-1000129
|
MEDIUM
| 4.3
|
jolokia
|
start
|
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
|
5895d5c137c335e6b473e9dcb9baf748851bbc5f
| 0
|
Analyze the following code function for security vulnerabilities
|
private String convert(URL url) throws IOException, URISyntaxException
{
HttpEntity entity = fetch(url.toURI());
// Remove the content type parameters, such as the charset, so they don't influence the diff.
String contentType = StringUtils.substringBefore(entity.getContentType().getValue(), ";");
byte[] content = IOUtils.toByteArray(entity.getContent());
return String.format("data:%s;base64,%s", contentType, Base64.getEncoder().encodeToString(content));
}
|
Vulnerability Classification:
- CWE: CWE-918
- CVE: CVE-2023-48240
- Severity: HIGH
- CVSS Score: 8.8
Description: XWIKI-20818: Improve data URI converter
* Cache failures
* Properly dispose the caches
* Only send requests to trusted domains
* Only embed actual images
* Limit responses to 1MB
* Introduce configuration options for timeout, maximum size and if the
feature is enabled at all
* Add a UI test that checks that attachment embedding is working in
general
* Move to httpclient5
* Expose the cookie domains configuration in AuthenticationConfiguration
Function: convert
File: xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/src/main/java/org/xwiki/diff/xml/internal/DefaultDataURIConverter.java
Repository: xwiki/xwiki-platform
Fixed Code:
private String convert(URL url) throws IOException, URISyntaxException
{
if (!this.urlSecurityManager.isDomainTrusted(url)) {
throw new IOException(String.format("The URL [%s] is not trusted.", url));
}
ImageDownloader.DownloadResult downloadResult = this.imageDownloader.download(url.toURI());
return getDataURI(downloadResult.getContentType(), downloadResult.getData());
}
|
[
"CWE-918"
] |
CVE-2023-48240
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
convert
|
xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/src/main/java/org/xwiki/diff/xml/internal/DefaultDataURIConverter.java
|
bff0203e739b6e3eb90af5736f04278c73c2a8bb
| 1
|
Analyze the following code function for security vulnerabilities
|
public void writeI16(short i16) throws TException {
writeVarint32(intToZigZag(i16));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeI16
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
writeI16
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setProcessForeground(IBinder token, int pid, boolean isForeground) {
enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT,
"setProcessForeground()");
synchronized(this) {
boolean changed = false;
synchronized (mPidsSelfLocked) {
ProcessRecord pr = mPidsSelfLocked.get(pid);
if (pr == null && isForeground) {
Slog.w(TAG, "setProcessForeground called on unknown pid: " + pid);
return;
}
ForegroundToken oldToken = mForegroundProcesses.get(pid);
if (oldToken != null) {
oldToken.token.unlinkToDeath(oldToken, 0);
mForegroundProcesses.remove(pid);
if (pr != null) {
pr.forcingToForeground = null;
}
changed = true;
}
if (isForeground && token != null) {
ForegroundToken newToken = new ForegroundToken() {
@Override
public void binderDied() {
foregroundTokenDied(this);
}
};
newToken.pid = pid;
newToken.token = token;
try {
token.linkToDeath(newToken, 0);
mForegroundProcesses.put(pid, newToken);
pr.forcingToForeground = token;
changed = true;
} catch (RemoteException e) {
// If the process died while doing this, we will later
// do the cleanup with the process death link.
}
}
}
if (changed) {
updateOomAdjLocked();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProcessForeground
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
setProcessForeground
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isManagedKiosk() {
if (!mHasFeature) {
return false;
}
Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity())
|| hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS));
long id = mInjector.binderClearCallingIdentity();
try {
return isManagedKioskInternal();
} catch (RemoteException e) {
throw new IllegalStateException(e);
} finally {
mInjector.binderRestoreCallingIdentity(id);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isManagedKiosk
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
|
isManagedKiosk
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getSkinPreference(String preference, String defaultValue)
{
return this.xwiki.getSkinPreference(preference, defaultValue, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSkinPreference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getSkinPreference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getFetchDirection() throws SQLException {
checkClosed();
return fetchdirection;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFetchDirection
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
getFetchDirection
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String
findEncodingName(final int value)
{
EncodingType type = EncodingType.get(value);
if (type == null) { return null; }
assert type.value == value;
return type.name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findEncodingName
File: ext/java/nokogiri/Html4SaxParserContext.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-241"
] |
CVE-2022-29181
|
MEDIUM
| 6.4
|
sparklemotion/nokogiri
|
findEncodingName
|
ext/java/nokogiri/Html4SaxParserContext.java
|
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ContentType getContentType(EditorType editorType, ContentType def)
{
if (editorType != EditorType.PURE_TEXT) {
return ContentType.WIKI_TEXT;
}
return def;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentType
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-41046
|
MEDIUM
| 6.3
|
xwiki/xwiki-platform
|
getContentType
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
|
edc52579eeaab1b4514785c134044671a1ecd839
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setExpanded(boolean expanded) {
mExpanded = expanded;
mHeaderQsPanel.setExpanded(expanded);
updateEverything();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setExpanded
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3886
|
HIGH
| 7.2
|
android
|
setExpanded
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
|
6ca6cd5a50311d58a1b7bf8fbef3f9aa29eadcd5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIssuedBy(String issuedBy) {
this.issuedBy = issuedBy;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIssuedBy
File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setIssuedBy
|
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
void markCallAsActive(Call call) {
setCallState(call, CallState.ACTIVE);
if (call.getStartWithSpeakerphoneOn()) {
setAudioRoute(AudioState.ROUTE_SPEAKER);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: markCallAsActive
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
markCallAsActive
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<String> getAll(CharSequence name) {
return HeadersUtils.getAllAsString(headers, name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAll
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
getAll
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getBackspaceKeyCode() {
return DROID_IMPL_KEY_BACKSPACE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBackspaceKeyCode
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
|
getBackspaceKeyCode
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
static int getFreePort() {
try (ServerSocket s = new ServerSocket(0)) {
s.setReuseAddress(true);
return s.getLocalPort();
} catch (IOException e) {
throw new IllegalStateException(
"Unable to find a free port for running webpack", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFreePort
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
getFreePort
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected UserDirectoryService getUserDirectoryService() {
return userDirectoryService;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserDirectoryService
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-21318
|
MEDIUM
| 5.5
|
opencast
|
getUserDirectoryService
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int checkComponentPermission(String permission, int pid, int uid,
int owningUid, boolean exported) {
if (pid == MY_PID) {
return PackageManager.PERMISSION_GRANTED;
}
// If there is an explicit permission being checked, and this is coming from a process
// that has been denied access to that permission, then just deny. Ultimately this may
// not be quite right -- it means that even if the caller would have access for another
// reason (such as being the owner of the component it is trying to access), it would still
// fail. This also means the system and root uids would be able to deny themselves
// access to permissions, which... well okay. ¯\_(ツ)_/¯
if (permission != null) {
synchronized (sActiveProcessInfoSelfLocked) {
ProcessInfo procInfo = sActiveProcessInfoSelfLocked.get(pid);
if (procInfo != null && procInfo.deniedPermissions != null
&& procInfo.deniedPermissions.contains(permission)) {
return PackageManager.PERMISSION_DENIED;
}
}
}
return ActivityManager.checkComponentPermission(permission, uid,
owningUid, exported);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkComponentPermission
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
|
checkComponentPermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setComment(String comment)
{
this.comment = comment;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setComment
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
setComment
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object getSource() {
return request;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSource
File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
getSource
|
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
public User getMe() {
User u = User.current();
if (u == null)
throw new AccessDeniedException("/me is not available when not logged in");
return u;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMe
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
|
getMe
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized void cancelRowUpdates() throws SQLException {
checkClosed();
if (onInsertRow) {
throw new PSQLException(GT.tr("Cannot call cancelRowUpdates() when on the insert row."),
PSQLState.INVALID_CURSOR_STATE);
}
if (doingUpdates) {
doingUpdates = false;
clearRowBuffer(true);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelRowUpdates
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
cancelRowUpdates
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
@Override
public LegacyPermissionState getLegacyPermissionState(@AppIdInt int appId) {
return mPermissionManagerServiceImpl.getLegacyPermissionState(appId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLegacyPermissionState
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
|
getLegacyPermissionState
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
void finishRunningVoiceLocked() {
if (mRunningVoice != null) {
mRunningVoice = null;
mVoiceWakeLock.release();
updateSleepIfNeededLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishRunningVoiceLocked
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
finishRunningVoiceLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isEditing()
{
// get the XWiki context and look at the action. if it's "inline" or "edit", it's edit mode
XWikiContext context = getXWikiContext();
return "inline".equals(context.getAction()) || "edit".equals(context.getAction());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEditing
File: xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DefaultGadgetSource.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2021-32621
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
isEditing
|
xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/src/main/java/org/xwiki/rendering/internal/macro/dashboard/DefaultGadgetSource.java
|
bb7068bd911f91e5511f3cfb03276c7ac81100bc
| 0
|
Analyze the following code function for security vulnerabilities
|
private void persistOrUpdateMessage(Context context, int messageType, int errorCode) {
if (mMessageUri != null) {
updateMessageState(context, messageType, errorCode);
} else {
mMessageUri = persistSentMessageIfRequired(context, messageType, errorCode);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: persistOrUpdateMessage
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
persistOrUpdateMessage
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void addOnPermissionsChangeListener(IOnPermissionsChangeListener listener) {
mPermissionManagerServiceImpl.addOnPermissionsChangeListener(listener);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOnPermissionsChangeListener
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
|
addOnPermissionsChangeListener
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@AfterPermissionGranted(100)
private void onPermissionsGranted() {
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CALL)) {
if (!videoOn && !isVoiceOnlyCall) {
onCameraClick();
}
if (!microphoneOn) {
onMicrophoneClick();
}
if (!isVoiceOnlyCall) {
if (cameraEnumerator.getDeviceNames().length == 0) {
binding.cameraButton.setVisibility(View.GONE);
}
if (cameraEnumerator.getDeviceNames().length > 1) {
binding.switchSelfVideoButton.setVisibility(View.VISIBLE);
}
}
if (!isConnectionEstablished()) {
fetchSignalingSettings();
}
} else if (EffortlessPermissions.somePermissionPermanentlyDenied(this, PERMISSIONS_CALL)) {
checkIfSomeAreApproved();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPermissionsGranted
File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
Repository: nextcloud/talk-android
The code follows secure coding practices.
|
[
"CWE-732",
"CWE-200"
] |
CVE-2022-41926
|
MEDIUM
| 5.5
|
nextcloud/talk-android
|
onPermissionsGranted
|
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
|
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
| 0
|
Analyze the following code function for security vulnerabilities
|
final void set(CharSequence name, Iterable<String> values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
final int h = normalizedName.hashCode();
final int i = index(h);
remove0(h, i, normalizedName);
for (String v : values) {
requireNonNullElement(values, v);
add0(h, i, normalizedName, v);
}
}
|
Vulnerability Classification:
- CWE: CWE-74
- CVE: CVE-2019-16771
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Merge pull request from GHSA-35fr-h7jr-hh86
Motivation:
An `HttpService` can produce a malformed HTTP response when a user
specified a malformed HTTP header values, such as:
ResponseHeaders.of(HttpStatus.OK
"my-header", "foo\r\nbad-header: bar");
Modification:
- Add strict header value validation to `HttpHeadersBase`
- Add strict header name validation to `HttpHeaderNames.of()`, which is
used by `HttpHeadersBase`.
Result:
- It is not possible anymore to send a bad header value which can be
misused for sending additional headers or injecting arbitrary content.
Function: set
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
Fixed Code:
final void set(CharSequence name, Iterable<String> values) {
final AsciiString normalizedName = HttpHeaderNames.of(name);
requireNonNull(values, "values");
final int h = normalizedName.hashCode();
final int i = index(h);
remove0(h, i, normalizedName);
for (String v : values) {
requireNonNullElement(values, v);
add0(h, i, normalizedName, v);
}
}
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
set
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 1
|
Analyze the following code function for security vulnerabilities
|
public static void retryUpload(@NonNull Context context, @NonNull User user, @NonNull OCUpload upload) {
Intent i = new Intent(context, FileUploader.class);
i.putExtra(FileUploader.KEY_RETRY, true);
i.putExtra(FileUploader.KEY_USER, user);
i.putExtra(FileUploader.KEY_ACCOUNT, user.toPlatformAccount());
i.putExtra(FileUploader.KEY_RETRY_UPLOAD, upload);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(i);
} else {
context.startService(i);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: retryUpload
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
|
retryUpload
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isRtl() {
return getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRtl
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
|
isRtl
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
@Deprecated
public
static String readFirstLine(File file, Charset charset) throws IOException {
return asCharSource(file, charset).readFirstLine();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readFirstLine
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
readFirstLine
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void putCurrentEntryIntoMap(HierarchicalStreamReader reader, UnmarshallingContext context,
Map map, Map target) {
final Object key = readCompleteItem(reader, context, map);
final Object value = readCompleteItem(reader, context, map);
target.put(key, value);
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2021-43859
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Describe and fix CVE-2021-43859.
Function: putCurrentEntryIntoMap
File: xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
Repository: x-stream/xstream
Fixed Code:
protected void putCurrentEntryIntoMap(HierarchicalStreamReader reader, UnmarshallingContext context,
Map map, Map target) {
final Object key = readCompleteItem(reader, context, map);
final Object value = readCompleteItem(reader, context, map);
long now = System.currentTimeMillis();
target.put(key, value);
SecurityUtils.checkForCollectionDoSAttack(context, now);
}
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
putCurrentEntryIntoMap
|
xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 1
|
Analyze the following code function for security vulnerabilities
|
public void setSortBy(String sortBy) {
this.sortBy = sortBy;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSortBy
File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
setSortBy
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getPackageScreenCompatMode(String packageName) {
enforceNotIsolatedCaller("getPackageScreenCompatMode");
synchronized (this) {
return mCompatModePackages.getPackageScreenCompatModeLocked(packageName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPackageScreenCompatMode
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
|
getPackageScreenCompatMode
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
Rect getLastReportedBounds() {
final Rect bounds = getLastReportedConfiguration().windowConfiguration.getBounds();
return !bounds.isEmpty() ? bounds : getBounds();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLastReportedBounds
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
|
getLastReportedBounds
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public int getPasswordMinimumSymbols(@Nullable ComponentName admin, int userHandle) {
if (mService != null) {
try {
return mService.getPasswordMinimumSymbols(admin, userHandle, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordMinimumSymbols
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
|
getPasswordMinimumSymbols
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void copyBcdFrom(DecimalQuantity _other) {
DecimalQuantity_DualStorageBCD other = (DecimalQuantity_DualStorageBCD) _other;
setBcdToZero();
if (other.usingBytes) {
ensureCapacity(other.precision);
System.arraycopy(other.bcdBytes, 0, bcdBytes, 0, other.precision);
} else {
bcdLong = other.bcdLong;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyBcdFrom
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
copyBcdFrom
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
void prepareSurfaces() {
final boolean show = isVisible() || isAnimating(PARENTS,
ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS);
if (mSurfaceControl != null) {
if (show && !mLastSurfaceShowing) {
getSyncTransaction().show(mSurfaceControl);
} else if (!show && mLastSurfaceShowing) {
getSyncTransaction().hide(mSurfaceControl);
}
if (show) {
mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getSyncTransaction());
}
}
if (mThumbnail != null) {
mThumbnail.setShowing(getPendingTransaction(), show);
}
mLastSurfaceShowing = show;
super.prepareSurfaces();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepareSurfaces
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
|
prepareSurfaces
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void parse(final InputSource is) {
try {
final SAXParserFactory factory = SAXParserFactory.newInstance();
final SAXParser parser = factory.newSAXParser();
parser.parse(is, this);
} catch (final Exception e) {
throw new GsaConfigException("Failed to parse XML file.", e);
}
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-1000822
- Severity: HIGH
- CVSS Score: 7.5
Description: fix #1851 add FEATURE_SECURE_PROCESSING
Function: parse
File: src/main/java/org/codelibs/fess/util/GsaConfigParser.java
Repository: codelibs/fess
Fixed Code:
public void parse(final InputSource is) {
try {
final SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
final SAXParser parser = factory.newSAXParser();
parser.parse(is, this);
} catch (final Exception e) {
throw new GsaConfigException("Failed to parse XML file.", e);
}
}
|
[
"CWE-611"
] |
CVE-2018-1000822
|
HIGH
| 7.5
|
codelibs/fess
|
parse
|
src/main/java/org/codelibs/fess/util/GsaConfigParser.java
|
faa265b8d8f1c71e1bf3229fba5f8cc58a5611b7
| 1
|
Analyze the following code function for security vulnerabilities
|
public String getNodeDescription() {
return Messages.Hudson_NodeDescription();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNodeDescription
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
|
getNodeDescription
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public DomElement getPreviousElementSibling() {
DomNode node = getPreviousSibling();
while (node != null && !(node instanceof DomElement)) {
node = node.getPreviousSibling();
}
return (DomElement) node;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPreviousElementSibling
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
getPreviousElementSibling
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateStartedUserArrayLocked() {
int num = 0;
for (int i=0; i<mStartedUsers.size(); i++) {
UserState uss = mStartedUsers.valueAt(i);
// This list does not include stopping users.
if (uss.mState != UserState.STATE_STOPPING
&& uss.mState != UserState.STATE_SHUTDOWN) {
num++;
}
}
mStartedUserArray = new int[num];
num = 0;
for (int i=0; i<mStartedUsers.size(); i++) {
UserState uss = mStartedUsers.valueAt(i);
if (uss.mState != UserState.STATE_STOPPING
&& uss.mState != UserState.STATE_SHUTDOWN) {
mStartedUserArray[num] = mStartedUsers.keyAt(i);
num++;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateStartedUserArrayLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
updateStartedUserArrayLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
private <T> boolean internalSetRenderer(Renderer<T> renderer) {
Converter<? extends T, ?> converter;
if (isCompatibleWithProperty(renderer, getConverter())) {
// Use the existing converter (possibly none) if types
// compatible
converter = (Converter<? extends T, ?>) getConverter();
} else {
converter = ConverterUtil.getConverter(
renderer.getPresentationType(), getModelType(),
getSession());
}
setRenderer(renderer, converter);
return isCompatibleWithProperty(renderer, converter);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalSetRenderer
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
internalSetRenderer
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void saveThirdUser(SysUser sysUser) {
//保存用户
String userid = UUIDGenerator.generate();
sysUser.setId(userid);
baseMapper.insert(sysUser);
//获取第三方角色
SysRole sysRole = sysRoleMapper.selectOne(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleCode, "third_role"));
//保存用户角色
SysUserRole userRole = new SysUserRole();
userRole.setRoleId(sysRole.getId());
userRole.setUserId(userid);
sysUserRoleMapper.insert(userRole);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveThirdUser
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45208
|
MEDIUM
| 4.3
|
jeecgboot/jeecg-boot
|
saveThirdUser
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
|
51e2227bfe54f5d67b09411ee9a336750164e73d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isReplyNotificationAllowed() {
return isNotificationsAllowed() && CONF.emailsForRepliesAllowed();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isReplyNotificationAllowed
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
isReplyNotificationAllowed
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
private TrimAttributeCleanerTransformations getDefaultCleanerTransformations(HTMLCleanerConfiguration configuration)
{
TrimAttributeCleanerTransformations defaultTransformations = new TrimAttributeCleanerTransformations();
TagTransformation tt;
// note that we do not care here to use a TrimAttributeTagTransformation, since the attributes are not preserved
if (!isHTML5(configuration)) {
// These tags are not obsolete in HTML5.
tt = new TagTransformation(HTMLConstants.TAG_B, HTMLConstants.TAG_STRONG, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_I, HTMLConstants.TAG_EM, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_U, HTMLConstants.TAG_INS, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_S, HTMLConstants.TAG_DEL, false);
defaultTransformations.addTransformation(tt);
}
tt = new TagTransformation(HTMLConstants.TAG_STRIKE, HTMLConstants.TAG_DEL, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_CENTER, HTMLConstants.TAG_P, false);
tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_STYLE, "text-align:center");
defaultTransformations.addTransformation(tt);
if (isHTML5(configuration)) {
// Font tags are removed before the filters are applied in HTML5, we thus need a transformation here.
defaultTransformations.addTransformation(new FontTagTransformation());
// The tt-tag is obsolete in HTML5
tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_TT, HTMLConstants.TAG_SPAN);
tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_CLASS, "${class} monospace");
defaultTransformations.addTransformation(tt);
}
String restricted = configuration.getParameters().get(HTMLCleanerConfiguration.RESTRICTED);
if ("true".equalsIgnoreCase(restricted)) {
tt = new TagTransformation(HTMLConstants.TAG_SCRIPT, HTMLConstants.TAG_PRE, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_STYLE, HTMLConstants.TAG_PRE, false);
defaultTransformations.addTransformation(tt);
}
return defaultTransformations;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-29528
- Severity: CRITICAL
- CVSS Score: 9.0
Description: XCOMMONS-2568: Improve comment handling in HTMLCleaner (#306)
Function: getDefaultCleanerTransformations
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
Repository: xwiki/xwiki-commons
Fixed Code:
private TrimAttributeCleanerTransformations getDefaultCleanerTransformations(HTMLCleanerConfiguration configuration)
{
TrimAttributeCleanerTransformations defaultTransformations = new TrimAttributeCleanerTransformations();
TagTransformation tt;
// note that we do not care here to use a TrimAttributeTagTransformation, since the attributes are not preserved
if (!isHTML5(configuration)) {
// These tags are not obsolete in HTML5.
tt = new TagTransformation(HTMLConstants.TAG_B, HTMLConstants.TAG_STRONG, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_I, HTMLConstants.TAG_EM, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_U, HTMLConstants.TAG_INS, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_S, HTMLConstants.TAG_DEL, false);
defaultTransformations.addTransformation(tt);
}
tt = new TagTransformation(HTMLConstants.TAG_STRIKE, HTMLConstants.TAG_DEL, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_CENTER, HTMLConstants.TAG_P, false);
tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_STYLE, "text-align:center");
defaultTransformations.addTransformation(tt);
if (isHTML5(configuration)) {
// Font tags are removed before the filters are applied in HTML5, we thus need a transformation here.
defaultTransformations.addTransformation(new FontTagTransformation());
// The tt-tag is obsolete in HTML5
tt = new TrimAttributeTagTransformation(HTMLConstants.TAG_TT, HTMLConstants.TAG_SPAN);
tt.addAttributeTransformation(HTMLConstants.ATTRIBUTE_CLASS, "${class} monospace");
defaultTransformations.addTransformation(tt);
}
if (isRestricted(configuration)) {
tt = new TagTransformation(HTMLConstants.TAG_SCRIPT, HTMLConstants.TAG_PRE, false);
defaultTransformations.addTransformation(tt);
tt = new TagTransformation(HTMLConstants.TAG_STYLE, HTMLConstants.TAG_PRE, false);
defaultTransformations.addTransformation(tt);
}
return defaultTransformations;
}
|
[
"CWE-79"
] |
CVE-2023-29528
|
CRITICAL
| 9
|
xwiki/xwiki-commons
|
getDefaultCleanerTransformations
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
|
8ff1a9d7e5d7b45b690134a537d53dc05cae04ab
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith("jar:")) {
setURL(url, null);
return true;
}
// this will fail if dial permission isn't declared
if(url.startsWith("tel:")) {
if(parent.fireBrowserNavigationCallbacks(url)) {
try {
Intent dialer = new Intent(android.content.Intent.ACTION_DIAL, Uri.parse(url));
getContext().startActivity(dialer);
} catch(Throwable t) {}
}
return true;
}
// this will fail if dial permission isn't declared
if(url.startsWith("mailto:")) {
if(parent.fireBrowserNavigationCallbacks(url)) {
try {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse(url));
getContext().startActivity(emailIntent);
} catch(Throwable t) {}
}
return true;
}
return !parent.fireBrowserNavigationCallbacks(url);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldOverrideUrlLoading
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
|
shouldOverrideUrlLoading
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public File getUploaded(Long projectId) {
return new File(Bootstrap.getSiteDir(), "avatars/uploaded/projects/" + projectId + ".jpg");
}
|
Vulnerability Classification:
- CWE: CWE-552
- CVE: CVE-2022-39208
- Severity: HIGH
- CVSS Score: 7.5
Description: Fix security vulnerability issue regarding site/* access
Function: getUploaded
File: server-core/src/main/java/io/onedev/server/web/avatar/DefaultAvatarManager.java
Repository: theonedev/onedev
Fixed Code:
@Override
public File getUploaded(Long projectId) {
return new File(Bootstrap.getSiteDir(), "assets/avatars/uploaded/projects/" + projectId + ".jpg");
}
|
[
"CWE-552"
] |
CVE-2022-39208
|
HIGH
| 7.5
|
theonedev/onedev
|
getUploaded
|
server-core/src/main/java/io/onedev/server/web/avatar/DefaultAvatarManager.java
|
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
| 1
|
Analyze the following code function for security vulnerabilities
|
@Test
public void selectDistinctOn(TestContext context) throws IOException {
Async async = context.async();
final String tableDefiniton = "id UUID PRIMARY KEY , jsonb JSONB NOT NULL, distinct_test_field TEXT";
postgresClient = createTableWithPoLines(context, MOCK_POLINES_TABLE, tableDefiniton);
postgresClient.select("SELECT DISTINCT ON (jsonb->>'owner') * FROM mock_po_lines ORDER BY (jsonb->>'owner') DESC", select -> {
context.assertEquals(3, select.result().getResults().size());
async.complete();
});
async.awaitSuccess();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectDistinctOn
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
selectDistinctOn
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void cachePartitionLostListenerConfigXmlGenerator(XmlGenerator gen,
List<CachePartitionLostListenerConfig> configs) {
if (configs.isEmpty()) {
return;
}
gen.open("partition-lost-listeners");
for (CachePartitionLostListenerConfig c : configs) {
gen.node("partition-lost-listener", classNameOrImplClass(c.getClassName(), c.getImplementation()));
}
gen.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cachePartitionLostListenerConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
cachePartitionLostListenerConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Map<String, Object>> traceProcess(String processInstanceId) throws Exception {
Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例
Object property = PropertyUtils.getProperty(execution, "activityId");
String activityId = "";
if (property != null) {
activityId = property.toString();
}
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId)
.singleResult();
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
.getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点
List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>();
for (ActivityImpl activity : activitiList) {
boolean currentActiviti = false;
String id = activity.getId();
// 当前节点
if (id.equals(activityId)) {
currentActiviti = true;
}
Map<String, Object> activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti);
activityInfos.add(activityImageInfo);
}
return activityInfos;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: traceProcess
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-34601
|
CRITICAL
| 9.8
|
thinkgem/jeesite
|
traceProcess
|
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
|
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
| 0
|
Analyze the following code function for security vulnerabilities
|
private V fromFloat(K name, float value) {
try {
return valueConverter.convertFloat(value);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("Failed to convert float value for header '" + name + '\'', e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromFloat
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
fromFloat
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
public ViewPage createPage(EntityReference reference, String content)
{
return createPage(reference, content, this.serializeReference(reference), null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPage
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
createPage
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DevicePolicyState getDevicePolicyState() {
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS));
return mInjector.binderWithCleanCallingIdentity(mDevicePolicyEngine::getDevicePolicyState);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDevicePolicyState
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
|
getDevicePolicyState
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public static SsurgeonPattern ssurgeonPatternFromXML(Element elt) throws Exception {
String uid = getTagText(elt, SsurgeonPattern.UID_ELEM_TAG);
String notes = getTagText(elt, SsurgeonPattern.NOTES_ELEM_TAG);
String semgrexString = getTagText(elt, SsurgeonPattern.SEMGREX_ELEM_TAG);
SemgrexPattern semgrexPattern = SemgrexPattern.compile(semgrexString);
SsurgeonPattern retPattern = new SsurgeonPattern(uid, semgrexPattern);
retPattern.setNotes(notes);
NodeList editNodes = elt.getElementsByTagName(SsurgeonPattern.EDIT_LIST_ELEM_TAG);
for (int i=0; i<editNodes.getLength(); i++) {
Node node = editNodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element editElt = (Element) node;
String editVal = getEltText(editElt);
retPattern.addEdit(Ssurgeon.parseEditLine(editVal));
}
}
// If predicate available, parse
Element predElt = getFirstTag(elt, SsurgeonPattern.PREDICATE_TAG);
if (predElt != null) {
SsurgPred pred = assemblePredFromXML(getFirstChildElement(predElt));
retPattern.setPredicate(pred);
}
return retPattern;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ssurgeonPatternFromXML
File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3878
|
HIGH
| 7.5
|
stanfordnlp/CoreNLP
|
ssurgeonPatternFromXML
|
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
|
e5bbe135a02a74b952396751ed3015e8b8252e99
| 0
|
Analyze the following code function for security vulnerabilities
|
private @SetAllResult int setAllConfigSettings(String prefix, Map<String, String> keyValues) {
if (DEBUG) {
Slog.v(LOG_TAG, "setAllConfigSettings for prefix: " + prefix);
}
enforceWritePermission(Manifest.permission.WRITE_DEVICE_CONFIG);
final String callingPackage = resolveCallingPackage();
synchronized (mLock) {
if (getSyncDisabledModeConfigLocked() != SYNC_DISABLED_MODE_NONE) {
return SET_ALL_RESULT_DISABLED;
}
final int key = makeKey(SETTINGS_TYPE_CONFIG, UserHandle.USER_SYSTEM);
boolean success = mSettingsRegistry.setConfigSettingsLocked(key, prefix, keyValues,
callingPackage);
return success ? SET_ALL_RESULT_SUCCESS : SET_ALL_RESULT_FAILURE;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAllConfigSettings
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
|
setAllConfigSettings
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean removeTask(int taskId) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeTask
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
removeTask
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiRecycleBinStoreInterface getRecycleBinStore()
{
return this.recycleBinStore;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecycleBinStore
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
|
getRecycleBinStore
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean exists(int userId) {
synchronized (mPackagesLock) {
return mUsers.get(userId) != null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exists
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
exists
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
final void performAppGcLocked(ProcessRecord app) {
try {
app.lastRequestedGc = SystemClock.uptimeMillis();
if (app.thread != null) {
if (app.reportLowMemory) {
app.reportLowMemory = false;
app.thread.scheduleLowMemory();
} else {
app.thread.processInBackground();
}
}
} catch (Exception e) {
// whatever.
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performAppGcLocked
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
|
performAppGcLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseCosts(final ProductionRule rule, final List<Element> elements) throws GameParseException {
if (elements.size() == 0) {
throw newGameParseException("no costs for rule:" + rule.getName());
}
for (final Element current : elements) {
final Resource resource = getResource(current, "resource", true);
final int quantity = Integer.parseInt(current.getAttribute("quantity"));
rule.addCost(resource, quantity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseCosts
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
parseCosts
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public FormData getExistingParsedForm() {
if (context.fileUploads().isEmpty() && request.formAttributes().isEmpty()) {
return null;
}
FormData ret = new FormData(Integer.MAX_VALUE);
for (var i : context.fileUploads()) {
CaseInsensitiveMap<String> headers = new CaseInsensitiveMap<>();
if (i.contentType() != null) {
headers.add(HttpHeaders.CONTENT_TYPE, i.contentType());
}
ret.add(i.name(), Paths.get(i.uploadedFileName()), i.fileName(), headers);
}
for (var i : request.formAttributes()) {
ret.add(i.getKey(), i.getValue());
}
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExistingParsedForm
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
getExistingParsedForm
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean userNeedsBadging(int userId) {
int index = mUserNeedsBadging.indexOfKey(userId);
if (index < 0) {
final UserInfo userInfo;
final long token = Binder.clearCallingIdentity();
try {
userInfo = sUserManager.getUserInfo(userId);
} finally {
Binder.restoreCallingIdentity(token);
}
final boolean b;
if (userInfo != null && userInfo.isManagedProfile()) {
b = true;
} else {
b = false;
}
mUserNeedsBadging.put(userId, b);
return b;
}
return mUserNeedsBadging.valueAt(index);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: userNeedsBadging
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
|
userNeedsBadging
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> T unmarshal(final Class<T> clazz, final File file) {
return unmarshal(clazz, file, VALIDATE_IF_POSSIBLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
unmarshal
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
final void dumpBinderCacheContents(FileDescriptor fd, PrintWriter pw, String[] args) {
ArrayList<ProcessRecord> procs = collectProcesses(pw, 0, false, args);
if (procs == null) {
pw.println("No process found for: " + args[0]);
return;
}
pw.println("Per-process Binder Cache Contents");
for (int i = procs.size() - 1; i >= 0; i--) {
ProcessRecord r = procs.get(i);
final int pid = r.getPid();
final IApplicationThread thread = r.getThread();
if (thread != null) {
pw.println("\n\n** Cache info for pid " + pid + " [" + r.processName + "] **");
pw.flush();
try {
TransferPipe tp = new TransferPipe();
try {
thread.dumpCacheInfo(tp.getWriteFd(), args);
tp.go(fd);
} finally {
tp.kill();
}
} catch (IOException e) {
pw.println("Failure while dumping the app " + r);
pw.flush();
} catch (RemoteException e) {
pw.println("Got a RemoteException while dumping the app " + r);
pw.flush();
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpBinderCacheContents
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
|
dumpBinderCacheContents
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
private final boolean checkUriPermissionLocked(GrantUri grantUri, int uid,
final int modeFlags) {
final boolean persistable = (modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0;
final int minStrength = persistable ? UriPermission.STRENGTH_PERSISTABLE
: UriPermission.STRENGTH_OWNED;
// Root gets to do everything.
if (uid == 0) {
return true;
}
final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get(uid);
if (perms == null) return false;
// First look for exact match
final UriPermission exactPerm = perms.get(grantUri);
if (exactPerm != null && exactPerm.getStrength(modeFlags) >= minStrength) {
return true;
}
// No exact match, look for prefixes
final int N = perms.size();
for (int i = 0; i < N; i++) {
final UriPermission perm = perms.valueAt(i);
if (perm.uri.prefix && grantUri.uri.isPathPrefixMatch(perm.uri.uri)
&& perm.getStrength(modeFlags) >= minStrength) {
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkUriPermissionLocked
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
|
checkUriPermissionLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public XmlGenerator open(String name, Object... attributes) {
appendOpenNode(xml, name, attributes);
openNodes.addLast(name);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: open
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
open
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
public XmlGenerator appendProperties(Map<String, ? extends Comparable> props) {
if (!MapUtil.isNullOrEmpty(props)) {
open("properties");
for (Map.Entry entry : props.entrySet()) {
node("property", entry.getValue(), "name", entry.getKey());
}
close();
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendProperties
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
appendProperties
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String idFromValueAndType(Object value, Class<?> type) {
return _idFrom(value, type, _typeFactory);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: idFromValueAndType
File: src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
idFromValueAndType
|
src/main/java/com/fasterxml/jackson/databind/jsontype/impl/ClassNameIdResolver.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void processUriQueryParameter(String key, String value) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processUriQueryParameter
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
|
processUriQueryParameter
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
Configuration getGlobalConfiguration() {
// Return default configuration before mRootWindowContainer initialized, which happens
// while initializing process record for system, see {@link
// ActivityManagerService#setSystemProcess}.
return mRootWindowContainer != null ? mRootWindowContainer.getConfiguration()
: new Configuration();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getGlobalConfiguration
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
getGlobalConfiguration
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private PersistentUserSessionAdapter toAdapter(PersistentUserSessionEntity entity) {
RealmModel realm = session.realms().getRealm(entity.getRealmId());
if (realm == null) { // Realm has been deleted concurrently, ignore the entity
return null;
}
return toAdapter(realm, entity);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toAdapter
File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-6563
|
HIGH
| 7.7
|
keycloak
|
toAdapter
|
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
|
11eb952e1df7cbb95b1e2c101dfd4839a2375695
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String applySorting(String query, Sort sort) {
return applySorting(query, sort, detectAlias(query));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applySorting
File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
Repository: spring-projects/spring-data-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-6652
|
MEDIUM
| 6.8
|
spring-projects/spring-data-jpa
|
applySorting
|
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
|
b8e7fe
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
@VisibleForTesting
List<ResolveInfo> queryActivities(@NonNull Intent baseIntent,
@NonNull String packageName, @Nullable ComponentName activity, int userId) {
baseIntent.setPackage(Objects.requireNonNull(packageName));
if (activity != null) {
baseIntent.setComponent(activity);
}
return queryActivities(baseIntent, userId, /* exportedOnly =*/ true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryActivities
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
|
queryActivities
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
protected void resetMessageForModeChange() {
// When switching between reply, reply all, forward,
// follow the behavior of webview.
// The contents of the following fields are cleared
// so that they can be populated directly from the
// ref message:
// 1) Any recipient fields
// 2) The subject
mTo.setText("");
mCc.setText("");
mBcc.setText("");
// Any edits to the subject are replaced with the original subject.
mSubject.setText("");
// Any changes to the contents of the following fields are kept:
// 1) Body
// 2) Attachments
// If the user made changes to attachments, keep their changes.
if (!mAttachmentsChanged) {
mAttachmentsView.deleteAllAttachments();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetMessageForModeChange
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
resetMessageForModeChange
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
String injectBuildFingerprint() {
return Build.FINGERPRINT;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectBuildFingerprint
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
|
injectBuildFingerprint
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void specialFilterContentForDictSql(String value) {
String specialXssStr = " exec | insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
value = value.replaceAll("/\\*.*\\*/","");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2022-45206
- Severity: CRITICAL
- CVSS Score: 9.8
Description: sql注入检查更加严格,修复/sys/duplicate/check存在sql注入漏洞 #4129
Function: specialFilterContentForDictSql
File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
Repository: jeecgboot/jeecg-boot
Fixed Code:
public static void specialFilterContentForDictSql(String value) {
String specialXssStr = " exec |extractvalue|updatexml| insert | select | delete | update | drop | count | chr | mid | master | truncate | char | declare |;|+|user()";
String[] xssArr = specialXssStr.split("\\|");
if (value == null || "".equals(value)) {
return;
}
// 校验sql注释 不允许有sql注释
checkSqlAnnotation(value);
// 统一转为小写
value = value.toLowerCase();
//SQL注入检测存在绕过风险 https://gitee.com/jeecg/jeecg-boot/issues/I4NZGE
//value = value.replaceAll("/\\*.*\\*/","");
for (int i = 0; i < xssArr.length; i++) {
if (value.indexOf(xssArr[i]) > -1 || value.startsWith(xssArr[i].trim())) {
log.error("请注意,存在SQL注入关键词---> {}", xssArr[i]);
log.error("请注意,值可能存在SQL注入风险!---> {}", value);
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
}
if(Pattern.matches(SHOW_TABLES, value) || Pattern.matches(REGULAR_EXPRE_USER, value)){
throw new RuntimeException("请注意,值可能存在SQL注入风险!--->" + value);
}
return;
}
|
[
"CWE-89"
] |
CVE-2022-45206
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
specialFilterContentForDictSql
|
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
|
f18ced524c9ec13e876bfb74785a1b112cc8b6bb
| 1
|
Analyze the following code function for security vulnerabilities
|
private Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity<?> entity) {
Response response;
if ("POST".equals(method)) {
response = invocationBuilder.post(entity);
} else if ("PUT".equals(method)) {
response = invocationBuilder.put(entity);
} else if ("DELETE".equals(method)) {
response = invocationBuilder.method("DELETE", entity);
} else if ("PATCH".equals(method)) {
response = invocationBuilder.method("PATCH", entity);
} else {
response = invocationBuilder.method(method);
}
return response;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendRequest
File: samples/client/petstore/java/jersey2-java8-localdatetime/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
|
sendRequest
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void notifyActiveVoiceInteractionServiceChanged(ComponentName component) {
synchronized (ActivityManagerService.this) {
mActiveVoiceInteractionServiceComponent = component;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyActiveVoiceInteractionServiceChanged
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
|
notifyActiveVoiceInteractionServiceChanged
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getInitialWorkerPort() {
return Integer.parseInt(prop.getProperty(TS_INITIAL_WORKER_PORT, "9000"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInitialWorkerPort
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
getInitialWorkerPort
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public static File buildPrimaryVolumeFile(int userId, String... segments) {
return buildPath(new File("/storage/emulated/" + userId), segments);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildPrimaryVolumeFile
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
buildPrimaryVolumeFile
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.