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
|
void setServiceRestartBackoffEnabled(@NonNull String packageName, boolean enable,
@NonNull String reason) {
synchronized (this) {
mServices.setServiceRestartBackoffEnabledLocked(packageName, enable, reason);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setServiceRestartBackoffEnabled
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
|
setServiceRestartBackoffEnabled
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onAuthenticationFailed() {
Log.w(TAG, "onAuthenticatoinFailed()");
fingerprintPrompt.setImageResource(R.drawable.ic_close_white_48dp);
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.red_500), PorterDuff.Mode.SRC_IN);
TranslateAnimation shake = new TranslateAnimation(0, 30, 0, 0);
shake.setDuration(50);
shake.setRepeatCount(7);
shake.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) {
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.signal_primary), PorterDuff.Mode.SRC_IN);
}
@Override
public void onAnimationRepeat(Animation animation) {}
});
fingerprintPrompt.startAnimation(shake);
}
|
Vulnerability Classification:
- CWE: CWE-287
- CVE: CVE-2022-1955
- Severity: LOW
- CVSS Score: 2.1
Description: feat: handle KeyStore backed fingerprint verification
Function: onAuthenticationFailed
File: app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
Repository: oxen-io/session-android
Fixed Code:
@Override
public void onAuthenticationFailed() {
Log.w(TAG, "onAuthenticationFailed()");
fingerprintPrompt.setImageResource(R.drawable.ic_close_white_48dp);
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.red_500), PorterDuff.Mode.SRC_IN);
TranslateAnimation shake = new TranslateAnimation(0, 30, 0, 0);
shake.setDuration(50);
shake.setRepeatCount(7);
shake.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) {
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.signal_primary), PorterDuff.Mode.SRC_IN);
}
@Override
public void onAnimationRepeat(Animation animation) {}
});
fingerprintPrompt.startAnimation(shake);
}
|
[
"CWE-287"
] |
CVE-2022-1955
|
LOW
| 2.1
|
oxen-io/session-android
|
onAuthenticationFailed
|
app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
|
c69b49e676dd8f619418cf296d6fdad9ce5a9510
| 1
|
Analyze the following code function for security vulnerabilities
|
protected boolean saveToFile(File file) throws IOException {
OutputStream stream = new FileOutputStream(file);
List<Long> modified = getModifiedProjectIds();
boolean saveWasNeeded = (modified.size() > 0) || (_preferenceStore.isDirty());
try {
// writeValue(OutputStream) is documented to use JsonEncoding.UTF8
ParsingUtilities.defaultWriter.writeValue(stream, this);
saveProjectMetadata(modified);
} finally {
stream.close();
}
return saveWasNeeded;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveToFile
File: main/src/com/google/refine/io/FileProjectManager.java
Repository: OpenRefine
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-37476
|
HIGH
| 7.8
|
OpenRefine
|
saveToFile
|
main/src/com/google/refine/io/FileProjectManager.java
|
e9c1e65d58b47aec8cd676bd5c07d97b002f205e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public CompatibilityInfo compatibilityInfoForPackage(ApplicationInfo ai) {
synchronized (mGlobalLock) {
return compatibilityInfoForPackageLocked(ai);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compatibilityInfoForPackage
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
|
compatibilityInfoForPackage
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalRemoveDispatchRate() {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
if (!op.isPresent()) {
return CompletableFuture.completedFuture(null);
}
op.get().setDispatchRate(null);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, op.get());
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalRemoveDispatchRate
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalRemoveDispatchRate
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean getAutoTimeZoneEnabled(ComponentName who) {
if (!mHasFeature) {
return false;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
|| isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner(caller));
return mInjector.settingsGlobalGetInt(Global.AUTO_TIME_ZONE, 0) > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoTimeZoneEnabled
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
getAutoTimeZoneEnabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof DefaultArgument)) {
return false;
}
DefaultArgument<?> that = (DefaultArgument<?>) o;
return Objects.equals(type, that.type) &&
Objects.equals(name, that.name) &&
Objects.equals(typeParameters, that.typeParameters);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: core/src/main/java/io/micronaut/core/type/DefaultArgument.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
equals
|
core/src/main/java/io/micronaut/core/type/DefaultArgument.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRequestURL() {
return requestURL;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestURL
File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getRequestURL
|
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void maybeClearLockTaskPolicyLocked() {
mInjector.binderWithCleanCallingIdentity(() -> {
final List<UserInfo> userInfos = mUserManager.getAliveUsers();
for (int i = userInfos.size() - 1; i >= 0; i--) {
int userId = userInfos.get(i).id;
if (canUserUseLockTaskLocked(userId)) {
continue;
}
final List<String> lockTaskPackages = getUserData(userId).mLockTaskPackages;
if (!lockTaskPackages.isEmpty()) {
Slogf.d(LOG_TAG,
"User id " + userId + " not affiliated. Clearing lock task packages");
setLockTaskPackagesLocked(userId, Collections.<String>emptyList());
}
final int lockTaskFeatures = getUserData(userId).mLockTaskFeatures;
if (lockTaskFeatures != DevicePolicyManager.LOCK_TASK_FEATURE_NONE){
Slogf.d(LOG_TAG,
"User id " + userId + " not affiliated. Clearing lock task features");
setLockTaskFeaturesLocked(userId, DevicePolicyManager.LOCK_TASK_FEATURE_NONE);
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeClearLockTaskPolicyLocked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
maybeClearLockTaskPolicyLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public ScenarioImport scenarioImport(MultipartFile file, ApiTestImportRequest request) {
ApiImportParser runService = ScenarioImportParserFactory.getImportParser(request.getPlatform());
ScenarioImport apiImport = null;
Optional.ofNullable(file)
.ifPresent(item -> request.setFileName(file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf("."))));
try {
apiImport = (ScenarioImport) Objects.requireNonNull(runService).parse(file == null ? null : file.getInputStream(), request);
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
MSException.throwException(Translator.get("parse_data_error"));
}
if (apiImport != null) {
editScenario(request, apiImport);
if (CollectionUtils.isNotEmpty(apiImport.getData())) {
List<String> names = apiImport.getData().stream().map(ApiScenarioWithBLOBs::getName).collect(Collectors.toList());
List<String> ids = apiImport.getData().stream().map(ApiScenarioWithBLOBs::getId).collect(Collectors.toList());
request.setName(String.join(",", names));
request.setId(JSON.toJSONString(ids));
}
}
return apiImport;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scenarioImport
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
scenarioImport
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return "Page{" +
"count=" + count +
", pageNum=" + pageNum +
", pageSize=" + pageSize +
", startRow=" + startRow +
", endRow=" + endRow +
", total=" + total +
", pages=" + pages +
", reasonable=" + reasonable +
", pageSizeZero=" + pageSizeZero +
'}' + super.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: src/main/java/com/github/pagehelper/Page.java
Repository: pagehelper/Mybatis-PageHelper
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-28111
|
HIGH
| 7.5
|
pagehelper/Mybatis-PageHelper
|
toString
|
src/main/java/com/github/pagehelper/Page.java
|
554a524af2d2b30d09505516adc412468a84d8fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public static Point2D findRectEdgeIntersection(@Nonnull final Rectangle2D rect, final double outboundX, final double outboundY) {
final int detectedSide = rect.outcode(outboundX, outboundY);
if ((detectedSide & (Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM)) != 0) {
final boolean top = (detectedSide & Rectangle2D.OUT_BOTTOM) == 0;
final double dx = outboundX - rect.getCenterX();
if (dx == 0.0d) {
return new Point2D.Double(rect.getCenterX(), top ? rect.getMinY() : rect.getMaxY());
} else {
final double halfy = top ? rect.getHeight() / 2 : -rect.getHeight() / 2;
final double coeff = (outboundY - rect.getCenterY()) / dx;
final double calculatedX = rect.getCenterX() - (halfy / coeff);
if (calculatedX >= rect.getMinX() && calculatedX <= rect.getMaxX()) {
return new Point2D.Double(calculatedX, top ? rect.getMinY() : rect.getMaxY());
}
}
}
if ((detectedSide & (Rectangle2D.OUT_LEFT | Rectangle2D.OUT_RIGHT)) != 0) {
final boolean left = (detectedSide & Rectangle2D.OUT_RIGHT) == 0;
final double dy = outboundY - rect.getCenterY();
if (dy == 0.0d) {
return new Point2D.Double(left ? rect.getMinX() : rect.getMaxX(), rect.getCenterY());
} else {
final double halfx = left ? rect.getWidth() / 2 : -rect.getWidth() / 2;
final double coeff = (outboundX - rect.getCenterX()) / dy;
final double calculatedY = rect.getCenterY() - (halfx / coeff);
if (calculatedY >= rect.getMinY() && calculatedY <= rect.getMaxY()) {
return new Point2D.Double(left ? rect.getMinX() : rect.getMaxX(), calculatedY);
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findRectEdgeIntersection
File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
Repository: raydac/netbeans-mmd-plugin
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000542
|
MEDIUM
| 6.8
|
raydac/netbeans-mmd-plugin
|
findRectEdgeIntersection
|
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
|
9fba652bf06e649186b8f9e612d60e9cc15097e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Long getLongAndRemove(K name) {
V v = getAndRemove(name);
try {
return v != null ? toLong(name, v) : null;
} catch (RuntimeException ignore) {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLongAndRemove
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
|
getLongAndRemove
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
void vibrate() {
android.os.Vibrator vib = (android.os.Vibrator)mContext.getSystemService(
Context.VIBRATOR_SERVICE);
vib.vibrate(250, VIBRATION_ATTRIBUTES);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: vibrate
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
vibrate
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isPhoneAccountHandleVisibleToCallingUser(
PhoneAccountHandle phoneAccountUserHandle, UserHandle callingUser) {
synchronized (mLock) {
return mPhoneAccountRegistrar.getPhoneAccount(phoneAccountUserHandle, callingUser)
!= null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPhoneAccountHandleVisibleToCallingUser
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21394
|
MEDIUM
| 5.5
|
android
|
isPhoneAccountHandleVisibleToCallingUser
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
68dca62035c49e14ad26a54f614199cb29a3393f
| 0
|
Analyze the following code function for security vulnerabilities
|
public org.neo4j.graphdb.Node getParent() {
return parent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParent
File: src/main/java/apoc/load/Xml.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000820
|
HIGH
| 7.5
|
neo4j-contrib/neo4j-apoc-procedures
|
getParent
|
src/main/java/apoc/load/Xml.java
|
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getInitialDistributionPort() {
return Integer.parseInt(prop.getProperty(TS_INITIAL_DISTRIBUTION_PORT, "29500"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInitialDistributionPort
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
|
getInitialDistributionPort
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable RowId getRowId(@Positive int columnIndex) throws SQLException {
connection.getLogger().log(Level.FINEST, " getRowId columnIndex: {0}", columnIndex);
throw org.postgresql.Driver.notImplemented(this.getClass(), "getRowId(int)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRowId
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
|
getRowId
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void addActionsToNotification(PushActionsProvider provider, String categoryId, NotificationCompat.Builder builder, Intent targetIntent, Context context) throws IOException {
// NOTE: THis will likely run when the main activity isn't running so we won't have
// access to any display properties... just native Android APIs will be accessible.
PushActionCategory category = null;
PushActionCategory[] categories;
if (provider != null) {
categories = provider.getPushActionCategories();
} else {
categories = getInstalledPushActionCategories(context);
}
for (PushActionCategory candidateCategory : categories) {
if (categoryId.equals(candidateCategory.getId())) {
category = candidateCategory;
break;
}
}
if (category == null) {
return;
}
int requestCode = 1;
for (PushAction action : category.getActions()) {
Intent newIntent = (Intent)targetIntent.clone();
newIntent.putExtra("pushActionId", action.getId());
PendingIntent contentIntent = PendingIntent.getActivity(context, requestCode++, newIntent, PendingIntent.FLAG_CANCEL_CURRENT);
try {
int iconId = 0;
try { iconId = Integer.parseInt(action.getIcon());} catch (Exception ex){}
//android.app.Notification.Action.Builder actionBuilder = new android.app.Notification.Action.Builder(iconId, action.getTitle(), contentIntent);
System.out.println("Adding action "+action.getId()+", "+action.getTitle()+", icon="+iconId);
if (ActionWrapper.BuilderWrapper.isSupported()) {
// We need to take this abstracted "wrapper" approach because the Action.Builder class, and RemoteInput class
// aren't available until API 22.
// These classes use reflection to provide support for these classes safely.
ActionWrapper.BuilderWrapper actionBuilder = new ActionWrapper.BuilderWrapper(iconId, action.getTitle(), contentIntent);
if (action.getTextInputPlaceholder() != null && RemoteInputWrapper.isSupported()) {
RemoteInputWrapper.BuilderWrapper remoteInputBuilder = new RemoteInputWrapper.BuilderWrapper(action.getId()+"$Result");
remoteInputBuilder.setLabel(action.getTextInputPlaceholder());
RemoteInputWrapper remoteInput = remoteInputBuilder.build();
actionBuilder.addRemoteInput(remoteInput);
}
ActionWrapper actionWrapper = actionBuilder.build();
new NotificationCompatWrapper.BuilderWrapper(builder).addAction(actionWrapper);
} else {
builder.addAction(iconId, action.getTitle(), contentIntent);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2022-4903
- Severity: MEDIUM
- CVSS Score: 5.1
Description: Fixed #3583 Pending Intent vulnerability
Function: addActionsToNotification
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
Fixed Code:
public static void addActionsToNotification(PushActionsProvider provider, String categoryId, NotificationCompat.Builder builder, Intent targetIntent, Context context) throws IOException {
// NOTE: THis will likely run when the main activity isn't running so we won't have
// access to any display properties... just native Android APIs will be accessible.
PushActionCategory category = null;
PushActionCategory[] categories;
if (provider != null) {
categories = provider.getPushActionCategories();
} else {
categories = getInstalledPushActionCategories(context);
}
for (PushActionCategory candidateCategory : categories) {
if (categoryId.equals(candidateCategory.getId())) {
category = candidateCategory;
break;
}
}
if (category == null) {
return;
}
int requestCode = 1;
for (PushAction action : category.getActions()) {
Intent newIntent = (Intent)targetIntent.clone();
newIntent.putExtra("pushActionId", action.getId());
PendingIntent contentIntent = createPendingIntent(context, requestCode++, newIntent);
try {
int iconId = 0;
try { iconId = Integer.parseInt(action.getIcon());} catch (Exception ex){}
//android.app.Notification.Action.Builder actionBuilder = new android.app.Notification.Action.Builder(iconId, action.getTitle(), contentIntent);
System.out.println("Adding action "+action.getId()+", "+action.getTitle()+", icon="+iconId);
if (ActionWrapper.BuilderWrapper.isSupported()) {
// We need to take this abstracted "wrapper" approach because the Action.Builder class, and RemoteInput class
// aren't available until API 22.
// These classes use reflection to provide support for these classes safely.
ActionWrapper.BuilderWrapper actionBuilder = new ActionWrapper.BuilderWrapper(iconId, action.getTitle(), contentIntent);
if (action.getTextInputPlaceholder() != null && RemoteInputWrapper.isSupported()) {
RemoteInputWrapper.BuilderWrapper remoteInputBuilder = new RemoteInputWrapper.BuilderWrapper(action.getId()+"$Result");
remoteInputBuilder.setLabel(action.getTextInputPlaceholder());
RemoteInputWrapper remoteInput = remoteInputBuilder.build();
actionBuilder.addRemoteInput(remoteInput);
}
ActionWrapper actionWrapper = actionBuilder.build();
new NotificationCompatWrapper.BuilderWrapper(builder).addAction(actionWrapper);
} else {
builder.addAction(iconId, action.getTitle(), contentIntent);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
addActionsToNotification
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String sanitize(String jsonish) {
return sanitize(jsonish, DEFAULT_NESTING_DEPTH);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sanitize
File: src/main/java/com/google/json/JsonSanitizer.java
Repository: OWASP/json-sanitizer
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-13973
|
MEDIUM
| 4.3
|
OWASP/json-sanitizer
|
sanitize
|
src/main/java/com/google/json/JsonSanitizer.java
|
53ceaac3e0a10e86d512ce96a0056578f2d1978f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int getStepReached(SubmissionInfo subInfo)
{
if (subInfo == null || subInfo.isInWorkflow() || subInfo.getSubmissionItem() == null)
{
return -1;
}
else
{
WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();
int i = wi.getStageReached();
// Uninitialised workspace items give "-1" as the stage reached
// this is a special value used by the progress bar, so we change
// it to "FIRST_STEP"
if (i == -1)
{
i = FIRST_STEP;
}
return i;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStepReached
File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31194
|
HIGH
| 7.2
|
DSpace
|
getStepReached
|
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
|
d1dd7d23329ef055069759df15cfa200c8e3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getFilePathSlash(String text) {
if (text.contains("\\")) {
return "\\";
}
return "/";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFilePathSlash
File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/FilesUtils.java
Repository: eclipse/lemminx
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-18212
|
MEDIUM
| 4
|
eclipse/lemminx
|
getFilePathSlash
|
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/utils/FilesUtils.java
|
e37c399aa266be1b7a43061d4afc43dc230410d2
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrate83(File dataDir, Stack<Integer> versions) {
Map<String, String> issueInfos = new HashMap<>();
Map<String, String> pullRequestInfos = new HashMap<>();
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Issues.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String issueInfo = MessageFormat.format(
"project id: {0}, issue number: {1}",
element.elementText("project"), element.elementText("number"));
issueInfos.put(element.elementTextTrim("id"), issueInfo);
}
} else if (file.getName().startsWith("PullRequests.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String pullRequestInfo = MessageFormat.format(
"project id: {0}, pull request number: {1}",
element.elementText("targetProject"), element.elementText("number"));
pullRequestInfos.put(element.elementTextTrim("id"), pullRequestInfo);
}
}
}
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Issues.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element descriptionElement = element.element("description");
if (descriptionElement != null) {
String description = descriptionElement.getText().trim();
if (description.length() > Issue.MAX_DESCRIPTION_LEN) {
descriptionElement.setText(StringUtils.abbreviate(description, Issue.MAX_DESCRIPTION_LEN));
logger.warn("Issue description too long and truncated ({})",
issueInfos.get(element.elementTextTrim("id")));
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("PullRequests.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element descriptionElement = element.element("description");
if (descriptionElement != null) {
String description = descriptionElement.getText().trim();
if (description.length() > PullRequest.MAX_DESCRIPTION_LEN) {
descriptionElement.setText(StringUtils.abbreviate(description, PullRequest.MAX_DESCRIPTION_LEN));
logger.warn("Pull request description too long and truncated ({})",
pullRequestInfos.get(element.elementTextTrim("id")));
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("IssueComments.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element contentElement = element.element("content");
if (contentElement != null) {
String content = contentElement.getText().trim();
if (content.length() > IssueComment.MAX_CONTENT_LEN) {
contentElement.setText(StringUtils.abbreviate(content, IssueComment.MAX_CONTENT_LEN));
logger.warn("Issue comment too long and truncated ({})",
issueInfos.get(element.elementText("issue")));
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("PullRequestComments.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
Element contentElement = element.element("content");
if (contentElement != null) {
String content = contentElement.getText().trim();
if (content.length() > PullRequestComment.MAX_CONTENT_LEN) {
contentElement.setText(StringUtils.abbreviate(content, PullRequestComment.MAX_CONTENT_LEN));
logger.warn("Pull request comment too long and truncated ({})",
pullRequestInfos.get(element.elementText("request")));
}
}
}
dom.writeToFile(file, false);
} else if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
if (element.elementTextTrim("key").equals("MAIL")) {
Element valueElement = element.element("value");
if (valueElement != null) {
Element receiveMailSettingElement = valueElement.element("receiveMailSetting");
if (receiveMailSettingElement != null)
receiveMailSettingElement.addElement("pollInterval").setText("60");
}
}
}
dom.writeToFile(file, false);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate83
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate83
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
private AssessmentPackage importStandaloneXml(final File importSandboxDirectory, final MultipartFile multipartFile) {
/* Save XML */
final File resultFile = new File(importSandboxDirectory, STANDALONE_XML_IMPORT_FILE_NAME);
try {
multipartFile.transferTo(resultFile);
}
catch (final IOException e) {
throw QtiWorksRuntimeException.unexpectedException(e);
}
/* Create AssessmentPackage representing this */
final AssessmentPackage assessmentPackage = new AssessmentPackage();
assessmentPackage.setAssessmentType(AssessmentObjectType.ASSESSMENT_ITEM);
assessmentPackage.setImportType(AssessmentPackageImportType.STANDALONE_ITEM_XML);
assessmentPackage.setAssessmentHref(STANDALONE_XML_IMPORT_FILE_NAME);
assessmentPackage.setSandboxPath(importSandboxDirectory.getAbsolutePath());
assessmentPackage.setQtiFileHrefs(new HashSet<String>(Arrays.asList(STANDALONE_XML_IMPORT_FILE_NAME)));
return assessmentPackage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importStandaloneXml
File: qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
Repository: davemckain/qtiworks
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-39367
|
MEDIUM
| 6.5
|
davemckain/qtiworks
|
importStandaloneXml
|
qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
|
1a46d6d842877ba2b824d5c269845827e2e0ccac
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder removeOption(String option) {
if (!ClickHouseChecker.isNullOrEmpty(option)) {
options.remove(option);
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeOption
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
removeOption
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean hasPermission(String callerPackage, String permission, int targetUserId) {
return DevicePolicyManagerService.this.hasPermission(permission, callerPackage,
targetUserId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasPermission
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
|
hasPermission
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private int zigzagToInt(int n) {
return (n >>> 1) ^ -(n & 1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: zigzagToInt
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
|
zigzagToInt
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "3.0M3")
public String getContentAuthor()
{
return userReferenceToString(getContentAuthorReference());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentAuthor
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getContentAuthor
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void startSaveAndFinish() {
if (mSaveAndFinishWorker != null) {
Log.w(TAG, "startSaveAndFinish with an existing SaveAndFinishWorker.");
return;
}
mPasswordEntryInputDisabler.setInputEnabled(false);
setNextEnabled(false);
mSaveAndFinishWorker = new SaveAndFinishWorker();
mSaveAndFinishWorker.setListener(this);
getFragmentManager().beginTransaction().add(mSaveAndFinishWorker,
FRAGMENT_TAG_SAVE_AND_FINISH).commit();
getFragmentManager().executePendingTransactions();
final Intent intent = getActivity().getIntent();
final boolean required = intent.getBooleanExtra(
EncryptionInterstitial.EXTRA_REQUIRE_PASSWORD, true);
if (mUnificationProfileId != UserHandle.USER_NULL) {
try (LockscreenCredential profileCredential = (LockscreenCredential)
intent.getParcelableExtra(EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL)) {
mSaveAndFinishWorker.setProfileToUnify(mUnificationProfileId,
profileCredential);
}
}
mSaveAndFinishWorker.start(mLockPatternUtils, required, mRequestGatekeeperPassword,
mChosenPassword, mCurrentCredential, mUserId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startSaveAndFinish
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
startSaveAndFinish
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getServletPath(String wikiName, XWikiContext context)
{
// unless we are in virtual wiki path mode we should return null
if (!context.isMainWiki(wikiName) && isPathBased()) {
try {
WikiDescriptor wikiDescriptor = getWikiDescriptorManager().getById(wikiName);
if (wikiDescriptor != null) {
return "wiki/" + wikiDescriptor.getDefaultAlias() + "/";
}
} catch (Exception e) {
LOGGER.error("Failed to get URL for provided wiki [" + wikiName + "]", e);
}
}
String servletPath = getConfiguration().getProperty("xwiki.servletpath", "");
if (context.getRequest() != null) {
if (StringUtils.isEmpty(servletPath)) {
String currentServletpath = context.getRequest().getServletPath();
if (currentServletpath != null && currentServletpath.startsWith("/bin")) {
servletPath = "bin/";
} else {
servletPath = getConfiguration().getProperty("xwiki.defaultservletpath", "bin/");
}
}
}
return servletPath;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServletPath
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
|
getServletPath
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
private static int bitMode0() {
// Check user-specified bit mode first.
int bitMode = SystemPropertyUtil.getInt("io.netty.bitMode", 0);
if (bitMode > 0) {
logger.debug("-Dio.netty.bitMode: {}", bitMode);
return bitMode;
}
// And then the vendor specific ones which is probably most reliable.
bitMode = SystemPropertyUtil.getInt("sun.arch.data.model", 0);
if (bitMode > 0) {
logger.debug("-Dio.netty.bitMode: {} (sun.arch.data.model)", bitMode);
return bitMode;
}
bitMode = SystemPropertyUtil.getInt("com.ibm.vm.bitmode", 0);
if (bitMode > 0) {
logger.debug("-Dio.netty.bitMode: {} (com.ibm.vm.bitmode)", bitMode);
return bitMode;
}
// os.arch also gives us a good hint.
String arch = SystemPropertyUtil.get("os.arch", "").toLowerCase(Locale.US).trim();
if ("amd64".equals(arch) || "x86_64".equals(arch)) {
bitMode = 64;
} else if ("i386".equals(arch) || "i486".equals(arch) || "i586".equals(arch) || "i686".equals(arch)) {
bitMode = 32;
}
if (bitMode > 0) {
logger.debug("-Dio.netty.bitMode: {} (os.arch: {})", bitMode, arch);
}
// Last resort: guess from VM name and then fall back to most common 64-bit mode.
String vm = SystemPropertyUtil.get("java.vm.name", "").toLowerCase(Locale.US);
Pattern bitPattern = Pattern.compile("([1-9][0-9]+)-?bit");
Matcher m = bitPattern.matcher(vm);
if (m.find()) {
return Integer.parseInt(m.group(1));
} else {
return 64;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bitMode0
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
bitMode0
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Locale> getTranslationLocales(XWikiContext context) throws XWikiException
{
List<String> translations = getTranslationList(context);
List<Locale> locales = new ArrayList<Locale>(translations.size());
for (String translationString : translations) {
locales.add(LocaleUtils.toLocale(translationString));
}
return locales;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTranslationLocales
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
|
getTranslationLocales
|
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
|
public static String formatRFC1123DateTime(final long time) {
return DateTimeFormatter.RFC_1123_DATE_TIME.format(Instant.ofEpochMilli(time).atZone(ZONE_GMT));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formatRFC1123DateTime
File: vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java
Repository: vert-x3/vertx-web
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-24815
|
MEDIUM
| 5.3
|
vert-x3/vertx-web
|
formatRFC1123DateTime
|
vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java
|
9e3a783b1d1a731055e9049078b1b1494ece9c15
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_MTE, conditional = true)
public void setMtePolicy(@MtePolicy int policy) {
throwIfParentInstance("setMtePolicy");
if (mService != null) {
try {
mService.setMtePolicy(policy, mContext.getPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMtePolicy
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
|
setMtePolicy
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final boolean isEndOfStream() {
return endOfStream;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEndOfStream
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
isEndOfStream
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
private Map<String, FileEntry> getStringFileEntryMap(GeneratorOptionDTO generateOptionDTO,
List<TemplateFile> templateFiles) {
Map<String, FileEntry> map = new HashMap<>(templateFiles.size());
for (String tableName : generateOptionDTO.getTableNames()) {
// 查询表详情
TableDetails tableDetails = tableInfoQuery.queryTableDetails(tableName);
// 生成代码
Map<String, FileEntry> fileEntryMap = generatorCode(tableDetails, generateOptionDTO.getTablePrefix(),
generateOptionDTO.getGenProperties(), templateFiles);
map.putAll(fileEntryMap);
}
return map;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStringFileEntryMap
File: ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/service/impl/GeneratorServiceImpl.java
Repository: ballcat-projects/ballcat-codegen
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2022-24881
|
HIGH
| 7.5
|
ballcat-projects/ballcat-codegen
|
getStringFileEntryMap
|
ballcat-codegen-backend/src/main/java/com/hccake/ballcat/codegen/service/impl/GeneratorServiceImpl.java
|
84a7cb38daf0295b93aba21d562ec627e4eb463b
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isShowingAndNotOccluded() {
return mShowing && !mOccluded;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isShowingAndNotOccluded
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
isShowingAndNotOccluded
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Path visit(File file, String filename, FileVisitor<Path> visitor)
throws IOException, IllegalArgumentException {
if(!StringHelper.containsNonWhitespace(filename)) {
filename = file.getName();
}
Path fPath = null;
if(file.isDirectory()) {
fPath = file.toPath();
} else if(filename != null && filename.toLowerCase().endsWith(".zip")) {
try {
fPath = FileSystems.newFileSystem(file.toPath(), null).getPath("/");
} catch (ProviderNotFoundException | ServiceConfigurationError e) {
throw new IOException("Unreadable file with .zip extension: " + file, e);
}
} else {
fPath = file.toPath();
}
if(fPath != null) {
Files.walkFileTree(fPath, visitor);
}
return fPath;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2021-39180
- Severity: HIGH
- CVSS Score: 9.0
Description: OO-5549: fix the wiki import and add some unit tests
Function: visit
File: src/main/java/org/olat/core/util/PathUtils.java
Repository: OpenOLAT
Fixed Code:
public static Path visit(File file, String filename, FileVisitor<Path> visitor)
throws IOException, IllegalArgumentException {
if(!StringHelper.containsNonWhitespace(filename)) {
filename = file.getName();
}
Path fPath = null;
if(file.isDirectory()) {
fPath = file.toPath();
} else if(filename != null && filename.toLowerCase().endsWith(".zip")) {
try {
fPath = FileSystems.newFileSystem(file.toPath(), null).getPath("/");
} catch (ProviderNotFoundException | ServiceConfigurationError e) {
throw new IOException("Unreadable file with .zip extension: " + file, e);
}
} else {
fPath = file.toPath();
}
if(fPath != null) {
Files.walkFileTree(fPath, EnumSet.noneOf(FileVisitOption.class), 32, visitor);
}
return fPath;
}
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
visit
|
src/main/java/org/olat/core/util/PathUtils.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 1
|
Analyze the following code function for security vulnerabilities
|
public void removeCometListeners() {
_cometListeners.clear();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeCometListeners
File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
Repository: cometd
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-24721
|
MEDIUM
| 5.5
|
cometd
|
removeCometListeners
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setXObjects(Map<DocumentReference, List<BaseObject>> objects)
{
if (objects == null) {
// Make sure we don`t set a null objects map since we assume everywhere that it is not null when using it.
objects = new HashMap<>();
}
boolean isDirty = false;
for (List<BaseObject> objList : objects.values()) {
for (BaseObject obj : objList) {
obj.setOwnerDocument(this);
isDirty = true;
}
}
// This operation resulted in marking the current document dirty.
if (isDirty) {
setMetaDataDirty(true);
}
// Replace the current objects with the provided ones.
this.xObjects = objects;
}
|
Vulnerability Classification:
- CWE: CWE-787
- CVE: CVE-2023-26470
- Severity: HIGH
- CVSS Score: 7.5
Description: XWIKI-19223: Improve xobject memory storage in XWikidocument
Function: setXObjects
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
Fixed Code:
public void setXObjects(Map<DocumentReference, List<BaseObject>> objects)
{
if (objects == null) {
// Make sure we don`t set a null objects map since we assume everywhere that it is not null when using it.
objects = new HashMap<>();
}
boolean isDirty = false;
for (List<BaseObject> objList : objects.values()) {
for (BaseObject obj : objList) {
obj.setOwnerDocument(this);
isDirty = true;
}
}
// This operation resulted in marking the current document dirty.
if (isDirty) {
setMetaDataDirty(true);
}
// Replace the current objects with the provided ones.
Map<DocumentReference, BaseObjects> objectsCopy = new ConcurrentSkipListMap<>();
objects.forEach((k, v) -> objectsCopy.put(k, new BaseObjects(v)));
this.xObjects = objectsCopy;
}
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
setXObjects
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 1
|
Analyze the following code function for security vulnerabilities
|
public JSONArray getUserNav(ID user) {
return getUserNav(user, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserNav
File: src/main/java/com/rebuild/core/configuration/NavBuilder.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
getUserNav
|
src/main/java/com/rebuild/core/configuration/NavBuilder.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
public Cursor query(boolean distinct, String table, String[] columns,
String selection, String[] selectionArgs, String groupBy,
String having, String orderBy, String limit) {
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs,
groupBy, having, orderBy, limit, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: query
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
query
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("/generate/{sourceKey}/{id}")
@Produces(MediaType.APPLICATION_JSON)
public JobExecutionResource generateFeatures(@PathParam("id") final int id, @PathParam("sourceKey") final String sourceKey) {
Source source = getSourceRepository().findBySourceKey(sourceKey);
String cdmTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.CDM);
String resultsTableQualifier = source.getTableQualifier(SourceDaimon.DaimonType.Results);
DefaultTransactionDefinition requresNewTx = new DefaultTransactionDefinition();
requresNewTx.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
TransactionStatus initStatus = this.getTransactionTemplate().getTransactionManager().getTransaction(requresNewTx);
this.getTransactionTemplate().getTransactionManager().commit(initStatus);
JobParametersBuilder builder = new JobParametersBuilder();
builder.addString("jobName", "generating features for cohort " + id + " : " + source.getSourceName()
+ " (" + source.getSourceKey() + ")");
builder.addString("cdm_database_schema", cdmTableQualifier);
builder.addString("results_database_schema", resultsTableQualifier);
builder.addString("target_dialect", source.getSourceDialect());
builder.addString("cohort_definition_id", ("" + id));
builder.addString("source_id", ("" + source.getSourceId()));
builder.addString(TEMP_DATABASE_SCHEMA, SourceUtils.getTempQualifier(source));
final JobParameters jobParameters = builder.toJobParameters();
log.info("Beginning generate cohort features for cohort definition id: {}", id);
GenerateCohortFeaturesTasklet generateCohortFeaturesTasklet
= new GenerateCohortFeaturesTasklet(getSourceJdbcTemplate(source), getTransactionTemplate());
Step generateCohortFeaturesStep = stepBuilders.get("cohortFeatures.generateFeatures")
.tasklet(generateCohortFeaturesTasklet)
.build();
Job generateCohortFeaturesJob = jobBuilders.get("generateFeatures")
.start(generateCohortFeaturesStep)
.build();
JobExecutionResource jobExec = this.jobTemplate.launch(generateCohortFeaturesJob, jobParameters);
return jobExec;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateFeatures
File: src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java
Repository: OHDSI/WebAPI
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15563
|
HIGH
| 7.5
|
OHDSI/WebAPI
|
generateFeatures
|
src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java
|
b3944074a1976c95d500239cbbf0741917ed75ca
| 0
|
Analyze the following code function for security vulnerabilities
|
private void requestLocationUpdates(Context context, LocationRequest req, AndroidLocationPlayServiceManager mgr) {
PlayServices.getInstance().requestLocationUpdates(getmGoogleApiClient(), context, req, mgr);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestLocationUpdates
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
requestLocationUpdates
|
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public InputStream getByteStream() {
return fByteStream;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getByteStream
File: ext/java/nokogiri/XmlSchema.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2020-26247
|
MEDIUM
| 4
|
sparklemotion/nokogiri
|
getByteStream
|
ext/java/nokogiri/XmlSchema.java
|
9c87439d9afa14a365ff13e73adc809cb2c3d97b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder c(String comment) {
return comment(comment);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: c
File: src/main/java/com/jamesmurty/utils/XMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
c
|
src/main/java/com/jamesmurty/utils/XMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final ProxyRetriever getProxyRetriever() {
return this.proxyRetriever;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProxyRetriever
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2014-4172
|
HIGH
| 7.5
|
apereo/java-cas-client
|
getProxyRetriever
|
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java
|
ae37092100c8eaec610dab6d83e5e05a8ee58814
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Predicate getSubtreePredicate(CriteriaBuilder builder, Path<Project> path, Project project) {
cacheLock.readLock().lock();
try {
return Criteria.forManyValues(builder, path.get(Project.PROP_ID),
getSubtreeIds(project.getId()), cache.keySet());
} finally {
cacheLock.readLock().unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubtreePredicate
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
getSubtreePredicate
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setContentType(ContentType contentType)
{
setContentType(contentType.toString());
// Make sure the editor type is compatible
EditorType compatible = getEditorType(contentType, null);
if (compatible != null) {
setEditor(compatible);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setContentType
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
|
setContentType
|
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
|
public String getCertTypeSubEmailCA() {
return certTypeSubEmailCA;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCertTypeSubEmailCA
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getCertTypeSubEmailCA
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> T unmarshall(byte[] bytes, Parcelable.Creator<T> creator) {
Parcel parcel = unmarshall(bytes);
T result = creator.createFromParcel(parcel);
parcel.recycle();
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshall
File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
unmarshall
|
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onUnbind(Intent intent) {
((FileUploaderBinder) mBinder).clearListeners();
return false; // not accepting rebinding (default behaviour)
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUnbind
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
|
onUnbind
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
public PrintStream createPrintStream() throws FileNotFoundException {
return new PrintStream(internal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPrintStream
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
createPrintStream
|
src/net/sourceforge/plantuml/security/SFile.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void convertInput() {
setConvertedInput(input.getConvertedInput());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertInput
File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-21242
|
HIGH
| 7.5
|
theonedev/onedev
|
convertInput
|
server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
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/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2018-9492
|
HIGH
| 7.2
|
android
|
finishRunningVoiceLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getNextPageUrl(int step) throws IndexUnreachableException, DAOException {
return getPageUrlRelativeToCurrentPage(step);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNextPageUrl
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
getNextPageUrl
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
private void createNoCredentialsPermissionNotification(Account account, Intent intent,
String packageName, int userId) {
int uid = intent.getIntExtra(
GrantCredentialsPermissionActivity.EXTRAS_REQUESTING_UID, -1);
String authTokenType = intent.getStringExtra(
GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE);
final String titleAndSubtitle =
mContext.getString(R.string.permission_request_notification_for_app_with_subtitle,
getApplicationLabel(packageName, userId), account.name);
final int index = titleAndSubtitle.indexOf('\n');
String title = titleAndSubtitle;
String subtitle = "";
if (index > 0) {
title = titleAndSubtitle.substring(0, index);
subtitle = titleAndSubtitle.substring(index + 1);
}
UserHandle user = UserHandle.of(userId);
Context contextForUser = getContextForUser(user);
Notification n =
new Notification.Builder(contextForUser, SystemNotificationChannels.ACCOUNT)
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setWhen(0)
.setColor(contextForUser.getColor(
com.android.internal.R.color.system_notification_accent_color))
.setContentTitle(title)
.setContentText(subtitle)
.setContentIntent(PendingIntent.getActivityAsUser(mContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
null, user))
.build();
installNotification(getCredentialPermissionNotificationId(
account, authTokenType, uid), n, "android", user.getIdentifier());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createNoCredentialsPermissionNotification
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
createNoCredentialsPermissionNotification
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendResponse(HttpExchange pExchange, ParsedUri pParsedUri, JSONAware pJson) throws IOException {
OutputStream out = null;
try {
Headers headers = pExchange.getResponseHeaders();
if (pJson != null) {
headers.set("Content-Type", getMimeType(pParsedUri) + "; charset=utf-8");
String json = pJson.toJSONString();
String callback = pParsedUri.getParameter(ConfigKey.CALLBACK.getKeyValue());
String content = callback == null ? json : callback + "(" + json + ");";
byte[] response = content.getBytes("UTF8");
pExchange.sendResponseHeaders(200,response.length);
out = pExchange.getResponseBody();
out.write(response);
} else {
headers.set("Content-Type", "text/plain");
pExchange.sendResponseHeaders(200,-1);
}
} finally {
if (out != null) {
// Always close in order to finish the request.
// Otherwise the thread blocks.
out.close();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendResponse
File: agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
sendResponse
|
agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
@GetMapping({"reference", "quick"})
public JSON referenceSearch(@EntityParam Entity entity, HttpServletRequest request) {
final ID user = getRequestUser(request);
Field referenceField = entity.getField(getParameterNotNull(request, "field"));
Entity searchEntity = referenceField.getReferenceEntity();
// 引用字段数据过滤
String cascadingValue = getParameter(request, "cascadingValue", StringUtils.EMPTY);
if (cascadingValue.contains(",")) cascadingValue = cascadingValue.split(",")[0]; // N2N
String protocolFilter = new ProtocolFilterParser(null)
.parseRef(referenceField.getName() + "." + entity.getName(), cascadingValue);
String q = getParameter(request, "q");
// 强制搜索 H5
boolean forceResults = getBoolParameter(request, "forceResults");
boolean forceSearchs = getBoolParameter(request, "forceSearchs");
// 为空则加载最近使用的
if (StringUtils.isBlank(q) && !forceSearchs) {
ID[] used = RecentlyUsedHelper.gets(
user, searchEntity.getName(), getParameter(request, "type"), protocolFilter);
if (used.length == 0) {
if (!forceResults) return JSONUtils.EMPTY_ARRAY;
} else {
return RecentlyUsedSearchController.formatSelect2(used, Language.L("最近使用"));
}
}
int pageSize = getIntParameter(request, "pageSize", 10);
return buildResultSearch(
searchEntity, getParameter(request, "quickFields"), q, protocolFilter, pageSize);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: referenceSearch
File: src/main/java/com/rebuild/web/general/ReferenceSearchController.java
Repository: getrebuild/rebuild
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-1495
|
MEDIUM
| 6.5
|
getrebuild/rebuild
|
referenceSearch
|
src/main/java/com/rebuild/web/general/ReferenceSearchController.java
|
c9474f84e5f376dd2ade2078e3039961a9425da7
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getAttributeResourceValue(String namespace, String attribute,
int defaultValue) {
int idx = nativeGetAttributeIndex(mParseState, namespace, attribute);
if (idx >= 0) {
return getAttributeResourceValue(idx, defaultValue);
}
return defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributeResourceValue
File: core/java/android/content/res/XmlBlock.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
getAttributeResourceValue
|
core/java/android/content/res/XmlBlock.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public ResolveInfo resolveCameraIntent() {
return mContext.getPackageManager().resolveActivityAsUser(getCameraIntent(),
PackageManager.MATCH_DEFAULT_ONLY,
KeyguardUpdateMonitor.getCurrentUser());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveCameraIntent
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
resolveCameraIntent
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private NfcDiscoveryParameters computeDiscoveryParameters(int screenState) {
// Recompute discovery parameters based on screen state
NfcDiscoveryParameters.Builder paramsBuilder = NfcDiscoveryParameters.newBuilder();
// Polling
if (screenState >= NFC_POLLING_MODE) {
// Check if reader-mode is enabled
if (mReaderModeParams != null) {
int techMask = 0;
if ((mReaderModeParams.flags & NfcAdapter.FLAG_READER_NFC_A) != 0)
techMask |= NFC_POLL_A;
if ((mReaderModeParams.flags & NfcAdapter.FLAG_READER_NFC_B) != 0)
techMask |= NFC_POLL_B;
if ((mReaderModeParams.flags & NfcAdapter.FLAG_READER_NFC_F) != 0)
techMask |= NFC_POLL_F;
if ((mReaderModeParams.flags & NfcAdapter.FLAG_READER_NFC_V) != 0)
techMask |= NFC_POLL_ISO15693;
if ((mReaderModeParams.flags & NfcAdapter.FLAG_READER_NFC_BARCODE) != 0)
techMask |= NFC_POLL_KOVIO;
paramsBuilder.setTechMask(techMask);
paramsBuilder.setEnableReaderMode(true);
} else {
paramsBuilder.setTechMask(NfcDiscoveryParameters.NFC_POLL_DEFAULT);
paramsBuilder.setEnableP2p(mIsNdefPushEnabled);
}
} else if (screenState == ScreenStateHelper.SCREEN_STATE_ON_LOCKED && mInProvisionMode) {
paramsBuilder.setTechMask(NfcDiscoveryParameters.NFC_POLL_DEFAULT);
// enable P2P for MFM/EDU/Corp provisioning
paramsBuilder.setEnableP2p(true);
} else if (screenState == ScreenStateHelper.SCREEN_STATE_ON_LOCKED &&
mNfcUnlockManager.isLockscreenPollingEnabled()) {
// For lock-screen tags, no low-power polling
paramsBuilder.setTechMask(mNfcUnlockManager.getLockscreenPollMask());
paramsBuilder.setEnableLowPowerDiscovery(false);
paramsBuilder.setEnableP2p(false);
}
if (mIsHceCapable && mScreenState >= ScreenStateHelper.SCREEN_STATE_ON_LOCKED) {
// Host routing is always enabled at lock screen or later
paramsBuilder.setEnableHostRouting(true);
}
return paramsBuilder.build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeDiscoveryParameters
File: src/com/android/nfc/NfcService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3761
|
LOW
| 2.1
|
android
|
computeDiscoveryParameters
|
src/com/android/nfc/NfcService.java
|
9ea802b5456a36f1115549b645b65c791eff3c2c
| 0
|
Analyze the following code function for security vulnerabilities
|
public static NativeArray jsFunction_getHTTPsGatewayEndpointURLs(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException, APIManagementException {
NativeArray myn = new NativeArray(0);
APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration();
String storeTokenDisplayURL = config.getFirstProperty(APIConstants.STORE_TOKEN_DISPLAY_URL);
//If the <StoreTokenDisplayURL> parameter is specified, we give it the highest priority, when displaying the
//cURL command in API Store application page.
if (storeTokenDisplayURL != null && storeTokenDisplayURL.length() > 0) {
myn.put(0, myn, storeTokenDisplayURL);
} else {
Map<String, Environment> environments = config.getApiGatewayEnvironments();
int index = 0;
for (Environment environment : environments.values()) {
String apiGatewayEndpoints = environment.getApiGatewayEndpoint();
List<String> urlsList = new ArrayList<String>();
urlsList.addAll(Arrays.asList(apiGatewayEndpoints.split(",")));
ListIterator<String> it = urlsList.listIterator();
while (it.hasNext()) {
String url = it.next();
if (url != null && url.startsWith("https:")) {
myn.put(index, myn, url);
index++;
}
}
}
}
return myn;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_getHTTPsGatewayEndpointURLs
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-20736
|
LOW
| 3.5
|
wso2/carbon-apimgt
|
jsFunction_getHTTPsGatewayEndpointURLs
|
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
|
490f2860822f89d745b7c04fa9570bd86bef4236
| 0
|
Analyze the following code function for security vulnerabilities
|
public void loadPlugin(String pluginId) {
if (getPluginManager().getClassLoader(pluginId) == null) {
// 如果没有加载才加载
InputStream pluginJar = basePluginService.getPluginJar(pluginId);
PluginManagerUtil.loadPlugin(pluginId, getPluginManager(), pluginJar);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadPlugin
File: test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
loadPlugin
|
test-track/backend/src/main/java/io/metersphere/service/PlatformPluginService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setColumnOrder(String... columnIds) {
setColumnOrder(Stream.of(columnIds).map(this::getColumnOrThrow));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setColumnOrder
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
|
setColumnOrder
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getItemGroupAndItemMetaWithUnitSql(String crfVersionIds) {
return "select cv.*, mu.oc_oid as mu_oid from (" + this.getItemGroupAndItemMetaSql(crfVersionIds) + ")cv left join"
+ " (select item.item_id, mu.oc_oid from item, measurement_unit mu where item.item_id in (select vm.item_id from versioning_map vm"
+ " where vm.crf_version_id in (" + crfVersionIds + "))"
+ " and item.units = mu.name )mu on cv.item_id = mu.item_id ";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItemGroupAndItemMetaWithUnitSql
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getItemGroupAndItemMetaWithUnitSql
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void selectStreamParamTxException(TestContext context) {
postgresClient().selectStream(null, "SELECT 1", new JsonArray(), context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectStreamParamTxException
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
|
selectStreamParamTxException
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CoercionAction _findCoercionFromBlankString(DeserializationContext ctxt) {
return ctxt.findCoercionFromBlankString(logicalType(), handledType(),
CoercionAction.Fail);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _findCoercionFromBlankString
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_findCoercionFromBlankString
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
int relayoutVisibleWindow(int result) {
final boolean wasVisible = isVisible();
result |= (!wasVisible || !isDrawn()) ? RELAYOUT_RES_FIRST_TIME : 0;
if (mAnimatingExit) {
Slog.d(TAG, "relayoutVisibleWindow: " + this + " mAnimatingExit=true, mRemoveOnExit="
+ mRemoveOnExit + ", mDestroying=" + mDestroying);
// Cancel the existing exit animation for the next enter animation.
if (isAnimating()) {
cancelAnimation();
}
mAnimatingExit = false;
ProtoLog.d(WM_DEBUG_ANIM, "Clear animatingExit: reason=relayoutVisibleWindow win=%s",
this);
}
if (mDestroying) {
mDestroying = false;
mWmService.mDestroySurface.remove(this);
}
if (!wasVisible) {
mWinAnimator.mEnterAnimationPending = true;
}
mLastVisibleLayoutRotation = getDisplayContent().getRotation();
mWinAnimator.mEnteringAnimation = true;
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "prepareToDisplay");
try {
prepareWindowToDisplayDuringRelayout(wasVisible);
} finally {
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: relayoutVisibleWindow
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
|
relayoutVisibleWindow
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setEncryptionRequested(boolean encrypt) {
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEncryptionRequested
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
setEncryptionRequested
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Document toXml(final List<IBaseDataObject> list) {
final Element root = new Element("payload-list");
for (final IBaseDataObject d : list) {
final Document doc = toXml(d);
root.addContent(doc.detachRootElement());
logger.debug("Adding xml content for " + d.shortName() + " to document");
}
final Document doc = new Document(root);
return doc;
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2021-32634
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Merge pull request from GHSA-m5qf-gfmp-7638
* Remove unsafe serialization from PayloadUtil
* This code will likely be removed wholesale, but this change
should be used as a departure point for future development
if we end up re-implementing moveTo and friends.
* Removed vestigial MoveTo related code.
* Remove unsafe serialization in WorkSpace infra.
* Favor DataInput/DataOutputStream over ObjectInput/ObjectOutputStream
* Implement lightweight serialization in WorkBundle/WorkUnit
* Updates to WorkBundle serDe, added tests.
- set limit on number of WorkUnits per bundle. In practice these are
commonly less than 1024.
- added null handling for WorkBundle/WorkUnit string fields.
- confirmed readUTF/writeUTF has a limit ensuring strings will
be 65535 characters or less.
* Minor cleanup to WorkBundleTest
* Minor Change to WorkBundleTest
* Formatting updates
Function: toXml
File: src/main/java/emissary/util/PayloadUtil.java
Repository: NationalSecurityAgency/emissary
Fixed Code:
public static Document toXml(final List<IBaseDataObject> list) {
final Element root = new Element("payload-list");
for (final IBaseDataObject d : list) {
final Document doc = toXml(d);
root.addContent(doc.detachRootElement());
logger.debug("Adding xml content for " + d.shortName() + " to document");
}
return new Document(root);
}
|
[
"CWE-502"
] |
CVE-2021-32634
|
MEDIUM
| 6.5
|
NationalSecurityAgency/emissary
|
toXml
|
src/main/java/emissary/util/PayloadUtil.java
|
40260b1ec1f76cc92361702cc14fa1e4388e19d7
| 1
|
Analyze the following code function for security vulnerabilities
|
public PrintWriter createPrintWriter() throws FileNotFoundException {
return new PrintWriter(internal);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPrintWriter
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
createPrintWriter
|
src/net/sourceforge/plantuml/security/SFile.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getDefaultSpace() {
return DEFAULT_SPACE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultSpace
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
|
getDefaultSpace
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onProgress(long increaseBytes) {
if (paused) return;
statusCallback.onProgress(increaseBytes);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onProgress
File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
Repository: lingochamp/FileDownloader
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-11248
|
HIGH
| 7.5
|
lingochamp/FileDownloader
|
onProgress
|
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateHideOrShowCcBcc() {
// Its possible there is a menu item OR a button.
boolean ccVisible = mCcBccView.isCcVisible();
boolean bccVisible = mCcBccView.isBccVisible();
if (mCcBccButton != null) {
if (!ccVisible || !bccVisible) {
mCcBccButton.setVisibility(View.VISIBLE);
} else {
mCcBccButton.setVisibility(View.GONE);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateHideOrShowCcBcc
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
|
updateHideOrShowCcBcc
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void intercept(Invocation inv) {
adminPermission(inv);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: intercept
File: web/src/main/java/com/zrlog/web/interceptor/AdminInterceptor.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-16643
|
LOW
| 3.5
|
94fzb/zrlog
|
intercept
|
web/src/main/java/com/zrlog/web/interceptor/AdminInterceptor.java
|
4a91c83af669e31a22297c14f089d8911d353fa1
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String calculatePackagePrefix() {
String maybeShaded = NativeLibraryLoader.class.getName();
// Use ! instead of . to avoid shading utilities from modifying the string
String expected = "io!netty!util!internal!NativeLibraryLoader".replace('!', '.');
if (!maybeShaded.endsWith(expected)) {
throw new UnsatisfiedLinkError(String.format(
"Could not find prefix added to %s to get %s. When shading, only adding a "
+ "package prefix is supported", expected, maybeShaded));
}
return maybeShaded.substring(0, maybeShaded.length() - expected.length());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calculatePackagePrefix
File: common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
calculatePackagePrefix
|
common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 0
|
Analyze the following code function for security vulnerabilities
|
public VaadinSession getSession() {
return session;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSession
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
getSession
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getDescription() {
return getUriForDisplay();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDescription
File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-77"
] |
CVE-2021-43286
|
MEDIUM
| 6.5
|
gocd
|
getDescription
|
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
|
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
| 0
|
Analyze the following code function for security vulnerabilities
|
public final GF2nElement convert(GF2nElement elem, GF2nField basis)
throws RuntimeException
{
if (basis == this)
{
return (GF2nElement)elem.clone();
}
if (fieldPolynomial.equals(basis.fieldPolynomial))
{
return (GF2nElement)elem.clone();
}
if (mDegree != basis.mDegree)
{
throw new RuntimeException("GF2nField.convert: B1 has a"
+ " different degree and thus cannot be coverted to!");
}
int i;
GF2Polynomial[] COBMatrix;
i = fields.indexOf(basis);
if (i == -1)
{
computeCOBMatrix(basis);
i = fields.indexOf(basis);
}
COBMatrix = (GF2Polynomial[])matrices.elementAt(i);
GF2nElement elemCopy = (GF2nElement)elem.clone();
if (elemCopy instanceof GF2nONBElement)
{
// remember: ONB treats its bits in reverse order
((GF2nONBElement)elemCopy).reverseOrder();
}
GF2Polynomial bs = new GF2Polynomial(mDegree, elemCopy.toFlexiBigInt());
bs.expandN(mDegree);
GF2Polynomial result = new GF2Polynomial(mDegree);
for (i = 0; i < mDegree; i++)
{
if (bs.vectorMult(COBMatrix[i]))
{
result.setBit(mDegree - 1 - i);
}
}
if (basis instanceof GF2nPolynomialField)
{
return new GF2nPolynomialElement((GF2nPolynomialField)basis,
result);
}
else if (basis instanceof GF2nONBField)
{
GF2nONBElement res = new GF2nONBElement((GF2nONBField)basis,
result.toFlexiBigInt());
// TODO Remember: ONB treats its Bits in reverse order !!!
res.reverseOrder();
return res;
}
else
{
throw new RuntimeException(
"GF2nField.convert: B1 must be an instance of "
+ "GF2nPolynomialField or GF2nONBField!");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convert
File: core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-470"
] |
CVE-2018-1000613
|
HIGH
| 7.5
|
bcgit/bc-java
|
convert
|
core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java
|
4092ede58da51af9a21e4825fbad0d9a3ef5a223
| 0
|
Analyze the following code function for security vulnerabilities
|
@Get("regex:/projects/(?<projectName>[^/]+)/repos/(?<repoName>[^/]+)/list(?<path>(|/.*))$")
public CompletableFuture<List<EntryDto<?>>> listFiles(@Param String path,
@Param @Default("-1") String revision,
Repository repository) {
final String normalizedPath = normalizePath(path);
final Revision normalizedRev = repository.normalizeNow(new Revision(revision));
final CompletableFuture<List<EntryDto<?>>> future = new CompletableFuture<>();
listFiles(repository, normalizedPath, normalizedRev, false, future);
return future;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listFiles
File: server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
listFiles
|
server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
|
6a395aed73f0b009cf8174a3ebf3ed826521c11d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setPermittedCrossProfileNotificationListeners(
ComponentName who, List<String> packageList) {
if (!mHasFeature) {
return false;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
if (!isManagedProfile(caller.getUserId())) {
return false;
}
synchronized (getLockObject()) {
ActiveAdmin admin = getProfileOwnerLocked(caller);
admin.permittedNotificationListeners = packageList;
saveSettingsLocked(caller.getUserId());
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPermittedCrossProfileNotificationListeners
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
setPermittedCrossProfileNotificationListeners
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public synchronized void dispose() throws FactoryException {
super.dispose();
datasource = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispose
File: modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java
Repository: geotools
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2022-24818
|
HIGH
| 7.5
|
geotools
|
dispose
|
modules/library/referencing/src/main/java/org/geotools/referencing/factory/epsg/ThreadedEpsgFactory.java
|
4f70fa3234391dd0cda883a20ab0ec75688cba49
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void killApplicationProcess(String processName, int uid) {
if (processName == null) {
return;
}
int callerUid = Binder.getCallingUid();
// Only the system server can kill an application
if (callerUid == SYSTEM_UID) {
synchronized (this) {
ProcessRecord app = getProcessRecordLocked(processName, uid);
IApplicationThread thread;
if (app != null && (thread = app.getThread()) != null) {
try {
thread.scheduleSuicide();
} catch (RemoteException e) {
// If the other end already died, then our work here is done.
}
} else {
Slog.w(TAG, "Process/uid not found attempting kill of "
+ processName + " / " + uid);
}
}
} else {
throw new SecurityException(callerUid + " cannot kill app process: " +
processName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killApplicationProcess
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
|
killApplicationProcess
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String normalizePath(String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return "/*";
}
if (isValidFilePath(path)) {
return path;
}
if (isValidDirPath(path)) {
if (path.endsWith("/")) {
return path + '*';
} else {
return path + "/*";
}
}
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: normalizePath
File: server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
normalizePath
|
server/src/main/java/com/linecorp/centraldogma/server/internal/api/ContentServiceV1.java
|
6a395aed73f0b009cf8174a3ebf3ed826521c11d
| 0
|
Analyze the following code function for security vulnerabilities
|
private void internalSetFeature(final XMLReader parser, final String feature,
final boolean value, final String displayName) throws JDOMException {
try {
parser.setFeature(feature, value);
} catch (final SAXNotSupportedException e) {
throw new JDOMException(
displayName + " feature not supported for SAX driver " + parser.getClass().getName());
} catch (final SAXNotRecognizedException e) {
throw new JDOMException(
displayName + " feature not recognized for SAX driver " + parser.getClass().getName());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalSetFeature
File: core/src/java/org/jdom2/input/SAXBuilder.java
Repository: hunterhacker/jdom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-33813
|
MEDIUM
| 5
|
hunterhacker/jdom
|
internalSetFeature
|
core/src/java/org/jdom2/input/SAXBuilder.java
|
bd3ab78370098491911d7fe9d7a43b97144a234e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void doEnqueueRpc(Supplier<RpcWrapper> rpcWrapperSupplier) {
synchronized (_channelMutex) {
boolean waitClearedInterruptStatus = false;
while (_activeRpc != null) {
try {
_channelMutex.wait();
} catch (InterruptedException e) { //NOSONAR
waitClearedInterruptStatus = true;
// No Sonar: we re-interrupt the thread later
}
}
if (waitClearedInterruptStatus) {
Thread.currentThread().interrupt();
}
_activeRpc = rpcWrapperSupplier.get();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doEnqueueRpc
File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
doEnqueueRpc
|
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String dialogLockButtons() {
StringBuffer html = new StringBuffer(512);
html.append("<div id='butClose' >\n");
html.append(dialogButtonsClose());
html.append("</div>\n");
html.append("<div id='butContinue' class='hide' >\n");
html.append(dialogButtons(new int[] {BUTTON_CONTINUE, BUTTON_CANCEL}, new String[] {
" onclick=\"submitAction('" + DIALOG_OK + "', form); form.submit();\"",
""}));
html.append("</div>\n");
return html.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dialogLockButtons
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
dialogLockButtons
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAuthentication
File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
getAuthentication
|
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, byte[]> getTrustRootCertList() {
return mTrustRootCertList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTrustRootCertList
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
getTrustRootCertList
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setCameraDisabled(ComponentName who, boolean disabled, boolean parent) {
if (!mHasFeature) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
if (parent) {
Preconditions.checkCallAuthorization(isProfileOwnerOfOrganizationOwnedDevice(caller));
}
checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_CAMERA_DISABLED);
final int userHandle = caller.getUserId();
synchronized (getLockObject()) {
ActiveAdmin ap = getActiveAdminForCallerLocked(who,
DeviceAdminInfo.USES_POLICY_DISABLE_CAMERA, parent);
if (ap.disableCamera != disabled) {
ap.disableCamera = disabled;
saveSettingsLocked(userHandle);
}
}
// Tell the user manager that the restrictions have changed.
pushUserRestrictions(userHandle);
final int affectedUserId = parent ? getProfileParentId(userHandle) : userHandle;
if (SecurityLog.isLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_CAMERA_POLICY_SET,
who.getPackageName(), userHandle, affectedUserId, disabled ? 1 : 0);
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_CAMERA_DISABLED)
.setAdmin(caller.getComponentName())
.setBoolean(disabled)
.setStrings(parent ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT)
.write();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCameraDisabled
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
setCameraDisabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract String retrieveResponseFromServer(URL validationUrl, String ticket);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: retrieveResponseFromServer
File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
Repository: apereo/java-cas-client
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2014-4172
|
HIGH
| 7.5
|
apereo/java-cas-client
|
retrieveResponseFromServer
|
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
|
ae37092100c8eaec610dab6d83e5e05a8ee58814
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
String filename = file.getFileName().toString();
if(IMS_MANIFEST.equals(filename)) {
manifestFile = true;
manifestPath = file;
}
return manifestFile ? FileVisitResult.TERMINATE : FileVisitResult.CONTINUE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: visitFile
File: src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
visitFile
|
src/main/java/org/olat/fileresource/types/ScormCPFileResource.java
|
699490be8e931af0ef1f135c55384db1f4232637
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isCurrentUserCreator(XWikiContext context)
{
return isCreator(context.getUserReference());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isCurrentUserCreator
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
|
isCurrentUserCreator
|
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
|
private boolean promoteOrDemoteUser(Profile authUser, User u) {
if (authUser != null) {
if (!isAdmin(authUser) && isRecognizedAsAdmin(u)) {
logger.info("User '{}' with id={} promoted to admin.", u.getName(), authUser.getId());
authUser.setGroups(User.Groups.ADMINS.toString());
return true;
} else if (isAdmin(authUser) && !isRecognizedAsAdmin(u)) {
logger.info("User '{}' with id={} demoted to regular user.", u.getName(), authUser.getId());
authUser.setGroups(User.Groups.USERS.toString());
return true;
} else if (!isMod(authUser) && u.isModerator()) {
authUser.setGroups(User.Groups.MODS.toString());
return true;
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: promoteOrDemoteUser
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
|
promoteOrDemoteUser
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public Document getPreviousDocument() throws XWikiException
{
return getDocumentRevision(getPreviousVersion());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPreviousDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getPreviousDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void parseQueryMTypeWExplicitAndDSAndRate() throws Exception {
HttpQuery query = NettyMocks.getQuery(tsdb,
"/api/query?start=1h-ago&m=sum:explicit_tags:1m-sum:rate:sys.cpu.0{host=web01}");
TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions);
TSSubQuery sub = tsq.getQueries().get(0);
assertNotNull(sub.getTags());
assertEquals("literal_or(web01)", sub.getTags().get("host"));
assertTrue(sub.getRate());
assertTrue(sub.getExplicitTags());
assertEquals("1m-sum", sub.getDownsample());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseQueryMTypeWExplicitAndDSAndRate
File: test/tsd/TestQueryRpc.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-25827
|
MEDIUM
| 6.1
|
OpenTSDB/opentsdb
|
parseQueryMTypeWExplicitAndDSAndRate
|
test/tsd/TestQueryRpc.java
|
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDefaultHeaderRow(HeaderRow row) {
header.setDefaultRow((Row) row);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDefaultHeaderRow
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
|
setDefaultHeaderRow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
private void considerRepairs(Document doc, Element root) {
LogisimVersion version = LogisimVersion.parse(root
.getAttribute("source"));
if (version.compareTo(LogisimVersion.get(2, 3, 0)) < 0) {
// This file was saved before an Edit tool existed. Most likely
// we should replace the Select and Wiring tools in the toolbar
// with the Edit tool instead.
for (Element toolbar : XmlIterator
.forChildElements(root, "toolbar")) {
Element wiring = null;
Element select = null;
Element edit = null;
for (Element elt : XmlIterator
.forChildElements(toolbar, "tool")) {
String eltName = elt.getAttribute("name");
if (eltName != null && !eltName.equals("")) {
if (eltName.equals("Select Tool"))
select = elt;
if (eltName.equals("Wiring Tool"))
wiring = elt;
if (eltName.equals("Edit Tool"))
edit = elt;
}
}
if (select != null && wiring != null && edit == null) {
select.setAttribute("name", "Edit Tool");
toolbar.removeChild(wiring);
}
}
}
if (version.compareTo(LogisimVersion.get(2, 6, 3)) < 0) {
for (Element circElt : XmlIterator
.forChildElements(root, "circuit")) {
for (Element attrElt : XmlIterator.forChildElements(circElt,
"a")) {
String name = attrElt.getAttribute("name");
if (name != null && name.startsWith("label")) {
attrElt.setAttribute("name", "c" + name);
}
}
}
repairForWiringLibrary(doc, root);
repairForLegacyLibrary(doc, root);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: considerRepairs
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
considerRepairs
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
private void migrateLegacySettingsLocked(SettingsState settingsState,
SQLiteDatabase database, String table) {
SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
queryBuilder.setTables(table);
Cursor cursor = queryBuilder.query(database, ALL_COLUMNS,
null, null, null, null, null);
if (cursor == null) {
return;
}
try {
if (!cursor.moveToFirst()) {
return;
}
final int nameColumnIdx = cursor.getColumnIndex(Settings.NameValueTable.NAME);
final int valueColumnIdx = cursor.getColumnIndex(Settings.NameValueTable.VALUE);
settingsState.setVersionLocked(database.getVersion());
while (!cursor.isAfterLast()) {
String name = cursor.getString(nameColumnIdx);
String value = cursor.getString(valueColumnIdx);
settingsState.insertSettingLocked(name, value,
SettingsState.SYSTEM_PACKAGE_NAME);
cursor.moveToNext();
}
} finally {
cursor.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrateLegacySettingsLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
migrateLegacySettingsLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.