instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public String getMethod() {
return request.getMethod().name();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMethod
File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
getMethod
|
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ExtensionRegistry.ExtensionInfo findExtensionByNumber(
ExtensionRegistry registry, Descriptors.Descriptor containingType, int fieldNumber) {
return registry.findImmutableExtensionByNumber(containingType, fieldNumber);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findExtensionByNumber
File: java/core/src/main/java/com/google/protobuf/MessageReflection.java
Repository: protocolbuffers/protobuf
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-3509
|
HIGH
| 7.5
|
protocolbuffers/protobuf
|
findExtensionByNumber
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public Long getNonce() {
return nonce;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNonce
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getNonce
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void calculateAvgSentCounts(NotificationsSentState stats) {
if (stats != null) {
stats.avgSentDaily = Math.round((float) stats.sentCount / DAYS_TO_CHECK);
if (stats.sentCount < DAYS_TO_CHECK) {
stats.avgSentWeekly = stats.sentCount;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calculateAvgSentCounts
File: src/com/android/settings/notification/NotificationBackend.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35667
|
HIGH
| 7.8
|
android
|
calculateAvgSentCounts
|
src/com/android/settings/notification/NotificationBackend.java
|
d8355ac47e068ad20c6a7b1602e72f0585ec0085
| 0
|
Analyze the following code function for security vulnerabilities
|
private Intent newLostModeLocationUpdateIntent(ActiveAdmin admin, Location location) {
final Intent intent = new Intent(
DevicePolicyManager.ACTION_LOST_MODE_LOCATION_UPDATE);
intent.putExtra(DevicePolicyManager.EXTRA_LOST_MODE_LOCATION, location);
intent.setPackage(admin.info.getPackageName());
return intent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newLostModeLocationUpdateIntent
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
|
newLostModeLocationUpdateIntent
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void pinShortcuts(int launcherUserId,
@NonNull String callingPackage, @NonNull String packageName,
@NonNull List<String> shortcutIds, int userId) {
// Calling permission must be checked by LauncherAppsImpl.
Preconditions.checkStringNotEmpty(packageName, "packageName");
Objects.requireNonNull(shortcutIds, "shortcutIds");
List<ShortcutInfo> changedShortcuts = null;
List<ShortcutInfo> removedShortcuts = null;
final ShortcutPackage sp;
synchronized (mLock) {
throwIfUserLockedL(userId);
throwIfUserLockedL(launcherUserId);
final ShortcutLauncher launcher =
getLauncherShortcutsLocked(callingPackage, userId, launcherUserId);
launcher.attemptToRestoreIfNeededAndSave();
sp = getUserShortcutsLocked(userId).getPackageShortcutsIfExists(packageName);
if (sp != null) {
// List the shortcuts that are pinned only, these will get removed.
removedShortcuts = new ArrayList<>();
sp.findAll(removedShortcuts, (ShortcutInfo si) -> si.isVisibleToPublisher()
&& si.isPinned() && !si.isCached() && !si.isDynamic()
&& !si.isDeclaredInManifest(),
ShortcutInfo.CLONE_REMOVE_NON_KEY_INFO,
callingPackage, launcherUserId, false);
}
// Get list of shortcuts that will get unpinned.
ArraySet<String> oldPinnedIds = launcher.getPinnedShortcutIds(packageName, userId);
launcher.pinShortcuts(userId, packageName, shortcutIds, /*forPinRequest=*/ false);
if (oldPinnedIds != null && removedShortcuts != null) {
for (int i = 0; i < removedShortcuts.size(); i++) {
oldPinnedIds.remove(removedShortcuts.get(i).getId());
}
}
changedShortcuts = prepareChangedShortcuts(
oldPinnedIds, new ArraySet<>(shortcutIds), removedShortcuts, sp);
}
if (sp != null) {
packageShortcutsChanged(sp, changedShortcuts, removedShortcuts);
}
verifyStates();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pinShortcuts
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
pinShortcuts
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public com.sk89q.worldedit.world.block.BlockState getBlock(BlockVector3 position) {
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
try {
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)).toImmutableState();
} catch (Exception e) {
if (!hasWarnedImplError) {
hasWarnedImplError = true;
LOGGER.warn("Unable to retrieve block via impl adapter", e);
}
}
}
if (WorldEditPlugin.getInstance().getLocalConfiguration().unsupportedVersionEditing) {
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
} else {
throw new RuntimeException(new UnsupportedVersionEditException());
}
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-35925
- Severity: MEDIUM
- CVSS Score: 5.5
Description: feat: prevent edits outside +/- 30,000,000 blocks
Function: getBlock
File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
Repository: IntellectualSites/FastAsyncWorldEdit
Fixed Code:
@Override
public com.sk89q.worldedit.world.block.BlockState getBlock(BlockVector3 position) {
//FAWE start - safe edit region
testCoords(position);
//FAWE end
BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
if (adapter != null) {
try {
return adapter.getBlock(BukkitAdapter.adapt(getWorld(), position)).toImmutableState();
} catch (Exception e) {
if (!hasWarnedImplError) {
hasWarnedImplError = true;
LOGGER.warn("Unable to retrieve block via impl adapter", e);
}
}
}
if (WorldEditPlugin.getInstance().getLocalConfiguration().unsupportedVersionEditing) {
Block bukkitBlock = getWorld().getBlockAt(position.getBlockX(), position.getBlockY(), position.getBlockZ());
return BukkitAdapter.adapt(bukkitBlock.getBlockData());
} else {
throw new RuntimeException(new UnsupportedVersionEditException());
}
}
|
[
"CWE-400"
] |
CVE-2023-35925
|
MEDIUM
| 5.5
|
IntellectualSites/FastAsyncWorldEdit
|
getBlock
|
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
|
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void queryRemoteConnectionServices(RemoteServiceCallback callback,
String callingPackage, Session.Info sessionInfo) {
final UserHandle callingUserHandle = Binder.getCallingUserHandle();
Log.startSession(sessionInfo, "CSW.qRCS", mPackageAbbreviation);
long token = Binder.clearCallingIdentity();
try {
synchronized (mLock) {
logIncoming("queryRemoteConnectionServices callingPackage=" + callingPackage);
ConnectionServiceWrapper.this
.queryRemoteConnectionServices(callingUserHandle, callingPackage,
callback);
}
} catch (Throwable t) {
Log.e(ConnectionServiceWrapper.this, t, "");
throw t;
} finally {
Binder.restoreCallingIdentity(token);
Log.endSession();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryRemoteConnectionServices
File: src/com/android/server/telecom/ConnectionServiceWrapper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
queryRemoteConnectionServices
|
src/com/android/server/telecom/ConnectionServiceWrapper.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
boolean requireFull, String name, String callerPackage) {
return mUserController.handleIncomingUser(callingPid, callingUid, userId, allowAll,
requireFull ? ALLOW_FULL_ONLY : ALLOW_NON_FULL, name, callerPackage);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIncomingUser
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
|
handleIncomingUser
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private void createRestMemcachedCaches() throws Exception {
createRestCache();
createMemcachedCache();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createRestMemcachedCaches
File: integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
Repository: infinispan
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2017-15089
|
MEDIUM
| 6.5
|
infinispan
|
createRestMemcachedCaches
|
integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
|
69be66141eee7abb1c47d46f0a6b74b079709f4b
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getMasterSyncAutomatically(int userId) {
synchronized (mAuthorities) {
Boolean auto = mMasterSyncAutomatically.get(userId);
return auto == null ? mDefaultMasterSyncAutomatically : auto;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMasterSyncAutomatically
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
getMasterSyncAutomatically
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setRightButtonText(int text) {
mNextButton.setText(getActivity(), text);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRightButtonText
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
setRightButtonText
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
@Override
public JsonDeserializer<T> createContextual(DeserializationContext ctxt,
BeanProperty property) throws JsonMappingException
{
InstantDeserializer<T> deserializer =
(InstantDeserializer<T>)super.createContextual(ctxt, property);
if (deserializer != this) {
JsonFormat.Value val = findFormatOverrides(ctxt, property, handledType());
if (val != null) {
return new InstantDeserializer<>(deserializer, val.getFeature(JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE));
}
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createContextual
File: datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
createContextual
|
datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
public void SwitchTo(int lexState)
{
if (lexState >= 3 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: SwitchTo
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
SwitchTo
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
protected int encoderEnforceMaxQueuedControlFrames() {
return maxQueuedControlFrames;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encoderEnforceMaxQueuedControlFrames
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
netty
|
encoderEnforceMaxQueuedControlFrames
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSafeMode() {
return mPm.isSafeMode();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSafeMode
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-40097
|
HIGH
| 7.8
|
android
|
isSafeMode
|
src/com/android/launcher3/util/PackageManagerHelper.java
|
6c9a41117d5a9365cf34e770bbb00138f6bf997e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer create(DatabaseTypeCreateRequest request) {
DatabaseTypePojo pojo = databaseTypePojoConverter.of(request);
try {
return databaseTypeDao.insertAndReturnId(pojo);
} catch (DuplicateKeyException e) {
throw DomainErrors.DATABASE_TYPE_NAME_DUPLICATE.exception();
}
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2022-24861
- Severity: MEDIUM
- CVSS Score: 6.5
Description: fix some security bug (#103)
* fix: use hard-code secret
* feat: add driver class validate
* feat: optimize drvier resource code
* fix:ut failed
Function: create
File: core/src/main/java/com/databasir/core/domain/database/service/DatabaseTypeService.java
Repository: vran-dev/databasir
Fixed Code:
public Integer create(DatabaseTypeCreateRequest request) {
driverResources.validateJar(request.getJdbcDriverFileUrl(), request.getJdbcDriverClassName());
DatabaseTypePojo pojo = databaseTypePojoConverter.of(request);
try {
return databaseTypeDao.insertAndReturnId(pojo);
} catch (DuplicateKeyException e) {
throw DomainErrors.DATABASE_TYPE_NAME_DUPLICATE.exception();
}
}
|
[
"CWE-20"
] |
CVE-2022-24861
|
MEDIUM
| 6.5
|
vran-dev/databasir
|
create
|
core/src/main/java/com/databasir/core/domain/database/service/DatabaseTypeService.java
|
ca22a8fef7a31c0235b0b2951260a7819b89993b
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldUnzipStream(MultipartFile multipartFile) {
return multipartFile.getName().equals(ZIP_MULTIPART_FILENAME);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldUnzipStream
File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-43289
|
MEDIUM
| 5
|
gocd
|
shouldUnzipStream
|
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
|
4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updatePersistentConfiguration(Configuration values) {
enforceCallingPermission(android.Manifest.permission.CHANGE_CONFIGURATION,
"updateConfiguration()");
enforceCallingPermission(android.Manifest.permission.WRITE_SETTINGS,
"updateConfiguration()");
if (values == null) {
throw new NullPointerException("Configuration must not be null");
}
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
updateConfigurationLocked(values, null, true, false);
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePersistentConfiguration
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
updatePersistentConfiguration
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnsupportedAppUsage
public void setSplitScreenCreateMode(int splitScreenCreateMode) {
// Remove this method after @UnsupportedAppUsage can be removed.
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSplitScreenCreateMode
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
setSplitScreenCreateMode
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public String optString(String key) {
return this.optString(key, "");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optString
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
optString
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void saveBatchNullConnection(TestContext context) {
log.fatal("saveBatchNullConnection started");
List<Object> list = Collections.singletonList(xPojo);
postgresClientNullConnection().saveBatch(FOO, list, context.asyncAssertFailure());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveBatchNullConnection
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
|
saveBatchNullConnection
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
protected ObserverList.RewindableIterator<TabObserver> getTabObservers() {
return mObservers.rewindableIterator();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTabObservers
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
getTabObservers
|
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<Structure> getStructures(User user, boolean respectFrontendRoles, boolean allowedStructsOnly,
String condition, String orderBy, int limit, int offset, String direction) throws DotDataException {
condition = (UtilMethods.isSet(condition.trim())) ? condition + " AND " : "";
if (LicenseUtil.getLevel() < 200) {
condition += " structuretype NOT IN (" + Structure.STRUCTURE_TYPE_FORM + ", " + Structure.STRUCTURE_TYPE_PERSONA
+ ") AND ";
}
condition += " 1=1 ";
List<Structure> all = InodeFactory.getInodesOfClassByConditionAndOrderBy(Structure.class, condition, orderBy, limit,
offset, direction);
if (!allowedStructsOnly) {
return all;
}
List<Structure> retList = new ArrayList<Structure>();
for (Structure st : all) {
if (permissionAPI.doesUserHavePermission(st, PERMISSION_READ, user, respectFrontendRoles) && !st.isSystem()) {
retList.add(st);
}
}
return retList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStructures
File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
getStructures
|
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getLogicalConditionSQL(LogicalCondition condition) {
LogicalExprType type = condition.getType();
Condition[] conditions = condition.getConditions();
if (LogicalExprType.NOT.equals(type)) {
return getNotExprConditionSQL(conditions[0]);
}
if (LogicalExprType.AND.equals(type)) {
return getAndExprConditionSQL(conditions);
}
if (LogicalExprType.OR.equals(type)) {
return getOrExprConditionSQL(conditions);
}
throw new IllegalArgumentException("Logical condition type not supported: " + type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLogicalConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getLogicalConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
void addLayer2PacketsToHlpReq(List<Layer2PacketParcelable> packets) {
List<Layer2PacketParcelable> mLayer2Packet = packets;
if ((mLayer2Packet != null) && (mLayer2Packet.size() > 0)) {
mWifiNative.flushAllHlp(mInterfaceName);
for (int j = 0; j < mLayer2Packet.size(); j++) {
byte [] bytes = mLayer2Packet.get(j).payload;
byte [] payloadBytes = Arrays.copyOfRange(bytes, 12, bytes.length);
MacAddress dstAddress = mLayer2Packet.get(j).dstMacAddress;
mWifiNative.addHlpReq(mInterfaceName, dstAddress, payloadBytes);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addLayer2PacketsToHlpReq
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
addLayer2PacketsToHlpReq
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
static boolean isMetaDataElement(WikiParameters parameters)
{
return parameters.getParameter(CLASS_ATTRIBUTE) != null
&& METADATA_CONTAINER_CLASS.equals(parameters.getParameter(CLASS_ATTRIBUTE).getValue());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMetaDataElement
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
isMetaDataElement
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSystemMetricsDisabled() {
return Boolean.parseBoolean(getProperty(TS_DISABLE_SYSTEM_METRICS, "false"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSystemMetricsDisabled
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
|
isSystemMetricsDisabled
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public void formatMultiValue(final Iterator<?> iIterator, final StringWriter buffer, final String format) throws IOException {
if (iIterator != null) {
int counter = 0;
String objectJson;
while (iIterator.hasNext()) {
final Object entry = iIterator.next();
if (entry != null) {
if (counter++ > 0) {
buffer.append(", ");
}
if (entry instanceof OIdentifiable) {
ORecord rec = ((OIdentifiable) entry).getRecord();
if (rec != null) {
try {
objectJson = rec.toJSON(format);
buffer.append(objectJson);
} catch (Exception e) {
OLogManager.instance().error(this, "Error transforming record " + rec.getIdentity() + " to JSON", e);
}
}
} else if (OMultiValue.isMultiValue(entry)) {
formatMultiValue(OMultiValue.getMultiValueIterator(entry), buffer, format);
} else {
buffer.append(OJSONWriter.writeValue(entry, format));
}
}
checkConnection();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formatMultiValue
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
Repository: orientechnologies/orientdb
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2015-2912
|
MEDIUM
| 6.8
|
orientechnologies/orientdb
|
formatMultiValue
|
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
|
d5a45e608ba8764fd817c1bdd7cf966564e828e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReadTimeout
File: samples/openapi3/client/extensions/x-auth-id-alias/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
|
setReadTimeout
|
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient configureApiKeys(Map<String, String> secrets) {
for (Map.Entry<String, Authentication> authEntry : authentications.entrySet()) {
Authentication auth = authEntry.getValue();
if (auth instanceof ApiKeyAuth) {
String name = authEntry.getKey();
// respect x-auth-id-alias property
name = authenticationLookup.containsKey(name) ? authenticationLookup.get(name) : name;
if (secrets.containsKey(name)) {
((ApiKeyAuth) auth).setApiKey(secrets.get(name));
}
}
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configureApiKeys
File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
configureApiKeys
|
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
public long getSpacePreferenceAsLong(String preference, XWikiContext context)
{
return Long.parseLong(getSpacePreference(preference, context));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpacePreferenceAsLong
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
|
getSpacePreferenceAsLong
|
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 Host findHostByTag(int tag) {
if (tag < 0) {
return null;
}
final int hostCount = mHosts.size();
for (int i = 0; i < hostCount; i++) {
Host host = mHosts.get(i);
if (host.tag == tag) {
return host;
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findHostByTag
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
findHostByTag
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
@JRubyMethod(name = "io", meta = true)
public static IRubyObject
parse_io(ThreadContext context,
IRubyObject klazz,
IRubyObject data,
IRubyObject enc)
{
//int encoding = (int)enc.convertToInteger().getLongValue();
final Ruby runtime = context.runtime;
XmlSaxParserContext ctx = newInstance(runtime, (RubyClass) klazz);
ctx.initialize(runtime);
ctx.setIOInputSource(context, data, runtime.getNil());
return ctx;
}
|
Vulnerability Classification:
- CWE: CWE-241
- CVE: CVE-2022-29181
- Severity: MEDIUM
- CVSS Score: 6.4
Description: fix: {HTML4,XML}::SAX::{Parser,ParserContext} check arg types
Previously, arguments of the wrong type might cause segfault on CRuby.
Function: parse_io
File: ext/java/nokogiri/XmlSaxParserContext.java
Repository: sparklemotion/nokogiri
Fixed Code:
@JRubyMethod(name = "io", meta = true)
public static IRubyObject
parse_io(ThreadContext context,
IRubyObject klazz,
IRubyObject data,
IRubyObject encoding)
{
// check the type of the unused encoding to match behavior of CRuby
if (!(encoding instanceof RubyFixnum)) {
throw context.getRuntime().newTypeError("encoding must be kind_of String");
}
final Ruby runtime = context.runtime;
XmlSaxParserContext ctx = newInstance(runtime, (RubyClass) klazz);
ctx.initialize(runtime);
ctx.setIOInputSource(context, data, runtime.getNil());
return ctx;
}
|
[
"CWE-241"
] |
CVE-2022-29181
|
MEDIUM
| 6.4
|
sparklemotion/nokogiri
|
parse_io
|
ext/java/nokogiri/XmlSaxParserContext.java
|
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
| 1
|
Analyze the following code function for security vulnerabilities
|
public void initialize(
AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidAlgorithmParameterException
{
if (!(params instanceof DSAParameterSpec))
{
throw new InvalidAlgorithmParameterException("parameter object not a DSAParameterSpec");
}
DSAParameterSpec dsaParams = (DSAParameterSpec)params;
param = new DSAKeyGenerationParameters(random, new DSAParameters(dsaParams.getP(), dsaParams.getQ(), dsaParams.getG()));
engine.init(param);
initialised = true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initialize
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/KeyPairGeneratorSpi.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000343
|
MEDIUM
| 5
|
bcgit/bc-java
|
initialize
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/KeyPairGeneratorSpi.java
|
50a53068c094d6cff37659da33c9b4505becd389
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setUserRestrictions(Bundle restrictions, int userId) {
checkManageUsersPermission("setUserRestrictions");
if (restrictions == null) return;
synchronized (mPackagesLock) {
final Bundle oldUserRestrictions = mUserRestrictions.get(userId);
// Restore the original state of system controlled restrictions from oldUserRestrictions
for (String key : SYSTEM_CONTROLLED_RESTRICTIONS) {
restrictions.remove(key);
if (oldUserRestrictions.containsKey(key)) {
restrictions.putBoolean(key, oldUserRestrictions.getBoolean(key));
}
}
setUserRestrictionsInternalLocked(restrictions, userId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserRestrictions
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
setUserRestrictions
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean withinRange(Pair<LocalDate, LocalDate> range, LocalDate date) {
return (!date.isBefore(range.first) && !date.isAfter(range.second));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withinRange
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
|
withinRange
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isAllowedDataValue(String elementName, String attributeName, String attributeValue)
{
boolean attributeAllowsData = "src".equals(attributeName) || "xlink:href".equals(attributeName)
|| "href".equals(attributeName);
return attributeAllowsData && !"script".equals(elementName) && attributeValue.startsWith("data:")
&& this.dataUriTags.contains(elementName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAllowedDataValue
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/SecureHTMLElementSanitizer.java
Repository: xwiki/xwiki-commons
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-31126
|
CRITICAL
| 9.6
|
xwiki/xwiki-commons
|
isAllowedDataValue
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/SecureHTMLElementSanitizer.java
|
0b8e9c45b7e7457043938f35265b2aa5adc76a68
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String,TopLevelItem> getItemMap() {
return Collections.unmodifiableMap(items);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItemMap
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getItemMap
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean canAllowWhileInUsePermissionInFgs(int pid, int uid,
@NonNull String packageName) {
synchronized (ActivityManagerService.this) {
return mServices.canAllowWhileInUsePermissionInFgsLocked(pid, uid, packageName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canAllowWhileInUsePermissionInFgs
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
|
canAllowWhileInUsePermissionInFgs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onParentChanged(Call call) {
// parent-child relationship affects which call should be foreground, so do an update.
updateCallsManagerState();
for (CallsManagerListener listener : mListeners) {
listener.onIsConferencedChanged(call);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onParentChanged
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
onParentChanged
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T extends Describable<T>>
List<T> newInstancesFromHeteroList(StaplerRequest req, Object formData,
Collection<? extends Descriptor<T>> descriptors) throws FormException {
List<T> items = new ArrayList<T>();
if (formData!=null) {
for (Object o : JSONArray.fromObject(formData)) {
JSONObject jo = (JSONObject)o;
String kind = jo.getString("kind");
items.add(find(descriptors,kind).newInstance(req,jo));
}
}
return items;
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2013-7330
- Severity: MEDIUM
- CVSS Score: 4.0
Description: [SECURITY-55]
This patch makes standard post-build action refuse to let you configure a downstream project you cannot currently build.
The one from parameterized-trigger will show an error in the configure screen but still lets you save the configuration; needs an analogous patch to that plugin.
Does not yet protect against POSTing config.xml with the trigger.
(cherry picked from commit 757bc8a53956e6fbab267214e6e0896f03c3c262)
Conflicts:
core/src/main/java/hudson/model/Descriptor.java
Function: newInstancesFromHeteroList
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
Fixed Code:
public static <T extends Describable<T>>
List<T> newInstancesFromHeteroList(StaplerRequest req, Object formData,
Collection<? extends Descriptor<T>> descriptors) throws FormException {
List<T> items = new ArrayList<T>();
if (formData!=null) {
for (Object o : JSONArray.fromObject(formData)) {
JSONObject jo = (JSONObject)o;
String kind = jo.getString("kind");
Descriptor<T> d = find(descriptors, kind);
if (d != null) {
items.add(d.newInstance(req, jo));
}
}
}
return items;
}
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
newInstancesFromHeteroList
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isReady() {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isReady
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
isReady
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
public synchronized static void setCurrentUser(int currentUser) {
sCurrentUser = currentUser;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCurrentUser
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
setCurrentUser
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
String urlParam = request.getParameter("url");
if (Utils.sanitizeUrl(urlParam))
{
// build the UML source from the compressed request parameter
String ref = request.getHeader("referer");
String ua = request.getHeader("User-Agent");
String auth = request.getHeader("Authorization");
String dom = getCorsDomain(ref, ua);
try(OutputStream out = response.getOutputStream())
{
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
URL url = new URL(urlParam);
URLConnection connection = url.openConnection();
connection.setConnectTimeout(TIMEOUT);
connection.setReadTimeout(TIMEOUT);
response.setHeader("Cache-Control", "private, max-age=86400");
// Workaround for 451 response from Iconfinder CDN
connection.setRequestProperty("User-Agent", "draw.io");
//Forward auth header
if (auth != null)
{
connection.setRequestProperty("Authorization", auth);
}
if (dom != null && dom.length() > 0)
{
response.addHeader("Access-Control-Allow-Origin", dom);
}
// Status code pass-through and follow redirects
if (connection instanceof HttpURLConnection)
{
((HttpURLConnection) connection)
.setInstanceFollowRedirects(false);
int status = ((HttpURLConnection) connection)
.getResponseCode();
int counter = 0;
// Follows a maximum of 6 redirects
while (counter++ <= 6 && (int)(status / 10) == 30) //Any redirect status 30x
{
String redirectUrl = connection.getHeaderField("Location");
if (!Utils.sanitizeUrl(redirectUrl))
{
break;
}
url = new URL(redirectUrl);
connection = url.openConnection();
((HttpURLConnection) connection)
.setInstanceFollowRedirects(false);
connection.setConnectTimeout(TIMEOUT);
connection.setReadTimeout(TIMEOUT);
// Workaround for 451 response from Iconfinder CDN
connection.setRequestProperty("User-Agent", "draw.io");
status = ((HttpURLConnection) connection)
.getResponseCode();
}
if (status >= 200 && status <= 299)
{
response.setStatus(status);
// Copies input stream to output stream
InputStream is = connection.getInputStream();
byte[] head = (contentAlwaysAllowed(urlParam)) ? emptyBytes
: Utils.checkStreamContent(is);
response.setContentType("application/octet-stream");
String base64 = request.getParameter("base64");
copyResponse(is, out, head,
base64 != null && base64.equals("1"));
}
else
{
response.setStatus(HttpURLConnection.HTTP_PRECON_FAILED);
}
}
else
{
response.setStatus(HttpURLConnection.HTTP_UNSUPPORTED_TYPE);
}
out.flush();
log.log(Level.FINEST, "processed proxy request: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
}
catch (DeadlineExceededException e)
{
response.setStatus(HttpServletResponse.SC_REQUEST_TIMEOUT);
}
catch (UnknownHostException | FileNotFoundException e)
{
// do not log 404 and DNS errors
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
catch (UnsupportedContentException e)
{
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
log.log(Level.SEVERE, "proxy request with invalid content: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
}
catch (Exception e)
{
response.setStatus(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
log.log(Level.FINE, "proxy request failed: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
e.printStackTrace();
}
}
else
{
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
log.log(Level.SEVERE,
"proxy request with invalid URL parameter: url="
+ ((urlParam != null) ? urlParam : "[null]"));
}
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-3398
- Severity: HIGH
- CVSS Score: 7.5
Description: 18.1.3 release
Function: doGet
File: src/main/java/com/mxgraph/online/ProxyServlet.java
Repository: jgraph/drawio
Fixed Code:
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
String urlParam = request.getParameter("url");
if (Utils.sanitizeUrl(urlParam))
{
// build the UML source from the compressed request parameter
String ref = request.getHeader("referer");
String ua = request.getHeader("User-Agent");
String auth = request.getHeader("Authorization");
String dom = getCorsDomain(ref, ua);
try(OutputStream out = response.getOutputStream())
{
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
URL url = new URL(urlParam);
URLConnection connection = url.openConnection();
connection.setConnectTimeout(TIMEOUT);
connection.setReadTimeout(TIMEOUT);
response.setHeader("Cache-Control", "private, max-age=86400");
// Workaround for 451 response from Iconfinder CDN
connection.setRequestProperty("User-Agent", "draw.io");
//Forward auth header
if (auth != null)
{
connection.setRequestProperty("Authorization", auth);
}
if (dom != null && dom.length() > 0)
{
response.addHeader("Access-Control-Allow-Origin", dom);
}
// Status code pass-through and follow redirects
if (connection instanceof HttpURLConnection)
{
((HttpURLConnection) connection)
.setInstanceFollowRedirects(false);
int status = ((HttpURLConnection) connection)
.getResponseCode();
int counter = 0;
// Follows a maximum of 6 redirects
while (counter++ <= 6 && (int)(status / 10) == 30) //Any redirect status 30x
{
String redirectUrl = connection.getHeaderField("Location");
if (!Utils.sanitizeUrl(redirectUrl))
{
break;
}
url = new URL(redirectUrl);
connection = url.openConnection();
((HttpURLConnection) connection)
.setInstanceFollowRedirects(false);
connection.setConnectTimeout(TIMEOUT);
connection.setReadTimeout(TIMEOUT);
// Workaround for 451 response from Iconfinder CDN
connection.setRequestProperty("User-Agent", "draw.io");
status = ((HttpURLConnection) connection)
.getResponseCode();
}
if (status >= 200 && status <= 299)
{
response.setStatus(status);
String contentLength = connection.getHeaderField("Content-Length");
// If content length is available, use it to enforce maximum size
if (contentLength != null && Long.parseLong(contentLength) > MAX_FETCH_SIZE)
{
throw new UnsupportedContentException();
}
// Copies input stream to output stream
InputStream is = connection.getInputStream();
byte[] head = (contentAlwaysAllowed(urlParam)) ? emptyBytes
: Utils.checkStreamContent(is);
response.setContentType("application/octet-stream");
String base64 = request.getParameter("base64");
copyResponse(is, out, head,
base64 != null && base64.equals("1"));
}
else
{
response.setStatus(HttpURLConnection.HTTP_PRECON_FAILED);
}
}
else
{
response.setStatus(HttpURLConnection.HTTP_UNSUPPORTED_TYPE);
}
out.flush();
log.log(Level.FINEST, "processed proxy request: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
}
catch (DeadlineExceededException e)
{
response.setStatus(HttpServletResponse.SC_REQUEST_TIMEOUT);
}
catch (UnknownHostException | FileNotFoundException e)
{
// do not log 404 and DNS errors
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
catch (UnsupportedContentException e)
{
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
log.log(Level.SEVERE, "proxy request with invalid content: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
}
catch (Exception e)
{
response.setStatus(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
log.log(Level.FINE, "proxy request failed: url="
+ ((urlParam != null) ? urlParam : "[null]")
+ ", referer=" + ((ref != null) ? ref : "[null]")
+ ", user agent=" + ((ua != null) ? ua : "[null]"));
e.printStackTrace();
}
}
else
{
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
log.log(Level.SEVERE,
"proxy request with invalid URL parameter: url="
+ ((urlParam != null) ? urlParam : "[null]"));
}
}
|
[
"CWE-400"
] |
CVE-2023-3398
|
HIGH
| 7.5
|
jgraph/drawio
|
doGet
|
src/main/java/com/mxgraph/online/ProxyServlet.java
|
064729fec4262f9373d9fdcafda0be47cd18dd50
| 1
|
Analyze the following code function for security vulnerabilities
|
private static void memberAddressProviderConfigXmlGenerator(XmlGenerator gen,
MemberAddressProviderConfig memberAddressProviderConfig) {
if (memberAddressProviderConfig == null) {
return;
}
String className = classNameOrImplClass(memberAddressProviderConfig.getClassName(),
memberAddressProviderConfig.getImplementation());
if (isNullOrEmpty(className)) {
return;
}
gen.open("member-address-provider", "enabled", memberAddressProviderConfig.isEnabled())
.node("class-name", className)
.appendProperties(memberAddressProviderConfig.getProperties())
.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: memberAddressProviderConfigXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
memberAddressProviderConfigXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
private PositionImpl calculatePositionAckSet(boolean isExcluded, int batchSize,
int batchIndex, MessageIdImpl messageId) {
PositionImpl seekPosition;
if (batchSize > 0) {
long[] ackSet;
BitSetRecyclable bitSet = BitSetRecyclable.create();
bitSet.set(0, batchSize);
if (isExcluded) {
bitSet.clear(0, Math.max(batchIndex + 1, 0));
if (bitSet.length() > 0) {
ackSet = bitSet.toLongArray();
seekPosition = PositionImpl.get(messageId.getLedgerId(),
messageId.getEntryId(), ackSet);
} else {
seekPosition = PositionImpl.get(messageId.getLedgerId(), messageId.getEntryId());
seekPosition = seekPosition.getNext();
}
} else {
if (batchIndex - 1 >= 0) {
bitSet.clear(0, batchIndex);
ackSet = bitSet.toLongArray();
seekPosition = PositionImpl.get(messageId.getLedgerId(),
messageId.getEntryId(), ackSet);
} else {
seekPosition = PositionImpl.get(messageId.getLedgerId(), messageId.getEntryId());
}
}
bitSet.recycle();
} else {
seekPosition = PositionImpl.get(messageId.getLedgerId(), messageId.getEntryId());
seekPosition = isExcluded ? seekPosition.getNext() : seekPosition;
}
return seekPosition;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calculatePositionAckSet
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
|
calculatePositionAckSet
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private MutableHttpResponse<Object> newNotFoundError(HttpRequest<?> request) {
JsonError error = newError(request, "Page Not Found");
return HttpResponse.notFound()
.body(error);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newNotFoundError
File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
newNotFoundError
|
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
void subscribe(final String item) {
if (billingSupport != null) billingSupport.subscribe(item);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: subscribe
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
subscribe
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getSerialNumberRangeInUse() {
return serialNumberRangeInUse;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSerialNumberRangeInUse
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
|
getSerialNumberRangeInUse
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMessageSummary(String messageSummary) {
this.messageSummary = messageSummary;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMessageSummary
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
setMessageSummary
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isPreEditor() {
return CmsPreEditorAction.isPreEditorMode(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPreEditor
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
|
isPreEditor
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void setSerialNumber(File file, int serialNumber)
throws IOException {
try {
final byte[] buf = Integer.toString(serialNumber).getBytes(StandardCharsets.UTF_8);
Os.setxattr(file.getAbsolutePath(), XATTR_SERIAL, buf, OsConstants.XATTR_CREATE);
} catch (ErrnoException e) {
throw e.rethrowAsIOException();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSerialNumber
File: services/core/java/com/android/server/pm/UserManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2457
|
LOW
| 2.1
|
android
|
setSerialNumber
|
services/core/java/com/android/server/pm/UserManagerService.java
|
12332e05f632794e18ea8c4ac52c98e82532e5db
| 0
|
Analyze the following code function for security vulnerabilities
|
private Cursor getAllSystemSettings(int userId, String[] projection) {
if (DEBUG) {
Slog.v(LOG_TAG, "getAllSecureSystem(" + userId + ")");
}
// Resolve the userId on whose behalf the call is made.
final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(userId);
synchronized (mLock) {
List<String> names = mSettingsRegistry.getSettingsNamesLocked(
SETTINGS_TYPE_SYSTEM, callingUserId);
final int nameCount = names.size();
String[] normalizedProjection = normalizeProjection(projection);
MatrixCursor result = new MatrixCursor(normalizedProjection, nameCount);
for (int i = 0; i < nameCount; i++) {
String name = names.get(i);
// Determine the owning user as some profile settings are cloned from the parent.
final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId,
name);
Setting setting = mSettingsRegistry.getSettingLocked(
SETTINGS_TYPE_SYSTEM, owningUserId, name);
appendSettingToCursor(result, setting);
}
return result;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllSystemSettings
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
|
getAllSystemSettings
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getValidityCount() {
return validityCount;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValidityCount
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
|
getValidityCount
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasShareTargets() {
synchronized (mLock) {
return !mShareTargets.isEmpty();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasShareTargets
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
hasShareTargets
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
public static byte[] compress(String s)
throws IOException
{
try {
return compress(s, "UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new IllegalStateException("UTF-8 encoder is not found");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compress
File: src/main/java/org/xerial/snappy/Snappy.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34454
|
HIGH
| 7.5
|
xerial/snappy-java
|
compress
|
src/main/java/org/xerial/snappy/Snappy.java
|
d0042551e4a3509a725038eb9b2ad1f683674d94
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
if (mUiStage == Stage.HelpScreen) {
updateStage(Stage.Introduction);
return true;
}
}
if (keyCode == KeyEvent.KEYCODE_MENU && mUiStage == Stage.Introduction) {
updateStage(Stage.HelpScreen);
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onKeyDown
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
onKeyDown
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static double[] unshuffleDoubleArray(byte[] input) throws IOException {
double[] output = new double[input.length / 8];
int numProcessed = impl.unshuffle(input, 0, 8, input.length, output, 0);
assert(numProcessed == input.length);
return output;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unshuffleDoubleArray
File: src/main/java/org/xerial/snappy/BitShuffle.java
Repository: xerial/snappy-java
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2023-34453
|
HIGH
| 7.5
|
xerial/snappy-java
|
unshuffleDoubleArray
|
src/main/java/org/xerial/snappy/BitShuffle.java
|
820e2e074c58748b41dbd547f4edba9e108ad905
| 0
|
Analyze the following code function for security vulnerabilities
|
void putPkcs12Data(byte[] data) {
mBundle.put(KeyChain.EXTRA_PKCS12, data);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: putPkcs12Data
File: src/com/android/certinstaller/CredentialHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2422
|
HIGH
| 9.3
|
android
|
putPkcs12Data
|
src/com/android/certinstaller/CredentialHelper.java
|
70dde9870e9450e10418a32206ac1bb30f036b2c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void loginAndTakeBack(StaplerRequest req, StaplerResponse rsp, User u) throws ServletException, IOException {
// ... and let him login
Authentication a = new UsernamePasswordAuthenticationToken(u.getId(),req.getParameter("password1"));
a = this.getSecurityComponents().manager.authenticate(a);
SecurityContextHolder.getContext().setAuthentication(a);
// then back to top
req.getView(this,"success.jelly").forward(req,rsp);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loginAndTakeBack
File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2014-2064
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
loginAndTakeBack
|
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
|
fbf96734470caba9364f04e0b77b0bae7293a1ec
| 0
|
Analyze the following code function for security vulnerabilities
|
@DELETE
@ApiOperation(value = "Terminate an existing session", notes = "Destroys the session with the given ID: the equivalent of logging out.")
@Path("/{sessionId}")
@RequiresAuthentication
@Deprecated
@AuditEvent(type = AuditEventTypes.SESSION_DELETE)
public Response terminateSessionWithId(@ApiParam(name = "sessionId", required = true) @PathParam("sessionId") String sessionId,
@Context ContainerRequestContext requestContext) {
final Subject subject = getSubject();
securityManager.logout(subject);
return Response.ok()
.cookie(cookieFactory.deleteAuthenticationCookie(requestContext))
.build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: terminateSessionWithId
File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-384"
] |
CVE-2024-24823
|
MEDIUM
| 4.4
|
Graylog2/graylog2-server
|
terminateSessionWithId
|
graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
|
1596b749db86368ba476662f23a0f0c5ec2b5097
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void checkMulticast(InetAddress maddr) {
try {
if (enterPublicInterface())
return;
throw new SecurityException(localized("security.error_network_multicast")); //$NON-NLS-1$
} finally {
exitPublicInterface();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkMulticast
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
Repository: ls1intum/Ares
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2024-23683
|
HIGH
| 8.2
|
ls1intum/Ares
|
checkMulticast
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
|
af4f28a56e2fe600d8750b3b415352a0a3217392
| 0
|
Analyze the following code function for security vulnerabilities
|
public HgMaterial getHgMaterial() {
return getExistingOrDefaultMaterial(new HgMaterial("", null));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHgMaterial
File: domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
getHgMaterial
|
domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public void notifyIconDone(IconEvent iconEvent) {
mPasspointEventHandler.notifyIconDone(iconEvent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyIconDone
File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
notifyIconDone
|
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public SigningState getSigningState() {
return signing;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSigningState
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
getSigningState
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<ProviderStub> getProviderStubs(Collection<Provider> providers) {
List<ProviderStub> providerStubList = new LinkedList<ProviderStub>();
if(providers != null && !providers.isEmpty()) {
for (Provider p : providers) {
providerStubList.add(new ProviderStub(p));
}
}
return providerStubList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviderStubs
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
getProviderStubs
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
private Entry findLdapEntryForAuthentication(String username) {
final List<Entry> results = search(ldapConfiguration.getUserLoginFilter(), new String[]{username}, resultWrapper -> (Entry) resultWrapper.getResult(), 0);
if (results.isEmpty()) {
throw new RuntimeException(format("User {0} does not exist in {1}", username, ldapConfiguration.getLdapUrlAsString()));
}
if (results.size() > 1) {
throw new MultipleUserDetectedException(username, ldapConfiguration.getSearchBases().toString(), ldapConfiguration.getUserLoginFilter());
}
return results.get(0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findLdapEntryForAuthentication
File: src/main/java/cd/go/apacheds/ApacheDsLdapClient.java
Repository: gocd/gocd-ldap-authentication-plugin
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2022-24832
|
MEDIUM
| 4.9
|
gocd/gocd-ldap-authentication-plugin
|
findLdapEntryForAuthentication
|
src/main/java/cd/go/apacheds/ApacheDsLdapClient.java
|
87fa7dac5d899b3960ab48e151881da4793cfcc3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getClipY(Object graphics) {
return ((AndroidGraphics) graphics).getClipY();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClipY
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
getClipY
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int enableSystemAppWithIntent(ComponentName who, String callerPackage, Intent intent) {
final CallerIdentity caller = getCallerIdentity(who, callerPackage);
Preconditions.checkCallAuthorization((caller.hasAdminComponent()
&& (isProfileOwner(caller) || isDefaultDeviceOwner(caller)))
|| (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_ENABLE_SYSTEM_APP)));
int numberOfAppsInstalled = 0;
long id = mInjector.binderClearCallingIdentity();
try {
final int parentUserId = getProfileParentId(caller.getUserId());
List<ResolveInfo> activitiesToEnable = mIPackageManager
.queryIntentActivities(intent,
intent.resolveTypeIfNeeded(mContext.getContentResolver()),
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
parentUserId)
.getList();
if (VERBOSE_LOG) {
Slogf.d(LOG_TAG, "Enabling system activities: " + activitiesToEnable);
}
if (activitiesToEnable != null) {
for (ResolveInfo info : activitiesToEnable) {
if (info.activityInfo != null) {
String packageName = info.activityInfo.packageName;
if (isSystemApp(mIPackageManager, packageName, parentUserId)) {
numberOfAppsInstalled++;
mIPackageManager.installExistingPackageAsUser(packageName,
caller.getUserId(),
PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS,
PackageManager.INSTALL_REASON_POLICY, null);
} else {
Slogf.d(LOG_TAG, "Not enabling " + packageName + " since is not a"
+ " system app");
}
}
}
}
} catch (RemoteException e) {
// shouldn't happen
Slogf.wtf(LOG_TAG, "Failed to resolve intent for: " + intent, e);
return 0;
} finally {
mInjector.binderRestoreCallingIdentity(id);
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.ENABLE_SYSTEM_APP_WITH_INTENT)
.setAdmin(caller.getPackageName())
.setBoolean(/* isDelegate */ who == null)
.setStrings(intent.getAction())
.write();
return numberOfAppsInstalled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableSystemAppWithIntent
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
|
enableSystemAppWithIntent
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApiUrl
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
setApiUrl
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getCurrentDayLocked() {
mCal.setTimeInMillis(System.currentTimeMillis());
final int dayOfYear = mCal.get(Calendar.DAY_OF_YEAR);
if (mYear != mCal.get(Calendar.YEAR)) {
mYear = mCal.get(Calendar.YEAR);
mCal.clear();
mCal.set(Calendar.YEAR, mYear);
mYearInDays = (int)(mCal.getTimeInMillis()/86400000);
}
return dayOfYear + mYearInDays;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentDayLocked
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
getCurrentDayLocked
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setDestFile(final File destFile) {
this.destFile = destFile;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDestFile
File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
Repository: codehaus-plexus/plexus-archiver
The code follows secure coding practices.
|
[
"CWE-22",
"CWE-61"
] |
CVE-2023-37460
|
CRITICAL
| 9.8
|
codehaus-plexus/plexus-archiver
|
setDestFile
|
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
|
54759839fbdf85caf8442076f001d5fd64e0dcb2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTurnEnded(TurnEndedEvent event) {
super.onTurnEnded(event);
final String out = event.getTurnSnapshot().getRobots()[0].getOutputStreamSnapshot();
if (out.contains("An error occurred during initialization")) {
messagedInitialization = true;
}
if (out.contains("access denied (java.net.SocketPermission")
|| out.contains("access denied (\"java.net.SocketPermission\"")) {
messagedAccessDenied = true;
}
}
|
Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2019-10648
- Severity: HIGH
- CVSS Score: 7.5
Description: Bug-406: DNS interaction is not blocked by Robocode's security manager + test(s) to verify the fix
Function: onTurnEnded
File: robocode.tests/src/test/java/net/sf/robocode/test/robots/TestConstructorHttpAttack.java
Repository: robo-code/robocode
Fixed Code:
@Override
public void onTurnEnded(TurnEndedEvent event) {
super.onTurnEnded(event);
final String out = event.getTurnSnapshot().getRobots()[0].getOutputStreamSnapshot();
if (out.contains("An error occurred during initialization")) {
messagedInitialization = true;
}
if (out.contains("java.lang.SecurityException:")) {
securityExceptionOccurred = true;
}
}
|
[
"CWE-862"
] |
CVE-2019-10648
|
HIGH
| 7.5
|
robo-code/robocode
|
onTurnEnded
|
robocode.tests/src/test/java/net/sf/robocode/test/robots/TestConstructorHttpAttack.java
|
836c84635e982e74f2f2771b2c8640c3a34221bd
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args, boolean asProto) {
mActivityManagerService.dumpApplicationMemoryUsage(
fd, pw, " ", args, false, null, asProto);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dump
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
|
dump
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Transactional
public void save(PanelShareRequest request) {
List<PanelGroup> panelGroups = queryGroup(request.getPanelIds());
// 1.先根据仪表板删除所有已经分享的
Integer type = request.getType();
List<String> panelIds = request.getPanelIds();
List<Long> targetIds = request.getTargetIds();
// 使用原生对象会导致事物失效 所以这里需要使用spring代理对象
if (CollectionUtils.isNotEmpty(panelIds)) {
ShareService proxy = CommonBeanFactory.getBean(ShareService.class);
panelIds.forEach(panelId -> proxy.delete(panelId, type));
}
if (CollectionUtils.isEmpty(targetIds))
return;
long now = System.currentTimeMillis();
List<PanelShare> shares = panelIds.stream().flatMap(panelId -> targetIds.stream().map(targetId -> {
PanelShare share = new PanelShare();
share.setCreateTime(now);
share.setPanelGroupId(panelId);
share.setTargetId(targetId);
share.setType(type);
return share;
})).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(shares)) {
extPanelShareMapper.batchInsert(shares, AuthUtils.getUser().getUsername());
}
// 下面是发送提醒消息逻辑
Set<Long> userIdSet;
AuthURD authURD = new AuthURD();
if (type == 0) {
authURD.setUserIds(targetIds);
}
if (type == 1) {
authURD.setRoleIds(targetIds);
}
if (type == 2) {
authURD.setDeptIds(targetIds);
}
userIdSet = AuthUtils.userIdsByURD(authURD);
CurrentUserDto user = AuthUtils.getUser();
String msg = StringUtils.joinWith(",",
panelGroups.stream().map(PanelGroup::getName).collect(Collectors.toList()));
Gson gson = new Gson();
userIdSet.forEach(userId -> DeMsgutil.sendMsg(userId, 2L, user.getNickName() + " 分享了仪表板【" + msg + "】给您,请查收!",
gson.toJson(panelIds)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: save
File: backend/src/main/java/io/dataease/service/panel/ShareService.java
Repository: dataease
The code follows secure coding practices.
|
[
"CWE-639"
] |
CVE-2023-32310
|
HIGH
| 8.1
|
dataease
|
save
|
backend/src/main/java/io/dataease/service/panel/ShareService.java
|
72f428e87b5395c03d2f94ef6185fc247ddbc8dc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean containsChar(K name, char value) {
return contains(name, fromChar(name, value));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containsChar
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
|
containsChar
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setCertTypeSSLClient(String SSLClient) {
this.certTypeSSLClient = SSLClient;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCertTypeSSLClient
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
|
setCertTypeSSLClient
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean willShowAsBubble() {
return mBubbleMetadata != null
&& BubblesManager.areBubblesEnabled(mContext, mSbn.getUser());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: willShowAsBubble
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
willShowAsBubble
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setRoamingType(ServiceState currentServiceState) {
final boolean isVoiceInService =
(currentServiceState.getVoiceRegState() == ServiceState.STATE_IN_SERVICE);
if (isVoiceInService) {
if (currentServiceState.getVoiceRoaming()) {
// some carrier defines international roaming by indicator
int[] intRoamingIndicators = mPhone.getContext().getResources().getIntArray(
com.android.internal.R.array.config_cdma_international_roaming_indicators);
if ((intRoamingIndicators != null) && (intRoamingIndicators.length > 0)) {
// It's domestic roaming at least now
currentServiceState.setVoiceRoamingType(ServiceState.ROAMING_TYPE_DOMESTIC);
int curRoamingIndicator = currentServiceState.getCdmaRoamingIndicator();
for (int i = 0; i < intRoamingIndicators.length; i++) {
if (curRoamingIndicator == intRoamingIndicators[i]) {
currentServiceState.setVoiceRoamingType(
ServiceState.ROAMING_TYPE_INTERNATIONAL);
break;
}
}
} else {
// check roaming type by MCC
if (inSameCountry(currentServiceState.getVoiceOperatorNumeric())) {
currentServiceState.setVoiceRoamingType(
ServiceState.ROAMING_TYPE_DOMESTIC);
} else {
currentServiceState.setVoiceRoamingType(
ServiceState.ROAMING_TYPE_INTERNATIONAL);
}
}
} else {
currentServiceState.setVoiceRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING);
}
}
final boolean isDataInService =
(currentServiceState.getDataRegState() == ServiceState.STATE_IN_SERVICE);
final int dataRegType = currentServiceState.getRilDataRadioTechnology();
if (isDataInService) {
if (!currentServiceState.getDataRoaming()) {
currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_NOT_ROAMING);
} else if (ServiceState.isCdma(dataRegType)) {
if (isVoiceInService) {
// CDMA data should have the same state as voice
currentServiceState.setDataRoamingType(currentServiceState
.getVoiceRoamingType());
} else {
// we can not decide CDMA data roaming type without voice
// set it as same as last time
currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_UNKNOWN);
}
} else {
// take it as 3GPP roaming
if (inSameCountry(currentServiceState.getDataOperatorNumeric())) {
currentServiceState.setDataRoamingType(ServiceState.ROAMING_TYPE_DOMESTIC);
} else {
currentServiceState.setDataRoamingType(
ServiceState.ROAMING_TYPE_INTERNATIONAL);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRoamingType
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
setRoamingType
|
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public XSLTranformationDoc XSLTTransformXMLString(String xmlString, String XSLPath) {
try {
String outputXML = null;
Source xmlSource = null;
XSLTranformationDoc doc = null;
Host host = hostWebAPI.getCurrentHost(request);
/*Get the XSL source*/
File xslFile = fileAPI.getFileByURI(XSLPath, host, true, userAPI.getSystemUser(), false);
if (doc == null) {
xmlSource = new StreamSource(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
Source xsltSource = new StreamSource(new InputStreamReader(new FileInputStream(fileAPI.getAssetIOFile (xslFile)), "UTF8"));
// create an instance of TransformerFactory
TransformerFactory transFact = TransformerFactory.newInstance();
StreamResult result = new StreamResult(new ByteArrayOutputStream());
Transformer trans = transFact.newTransformer(xsltSource);
try {
trans.transform(xmlSource, result);
} catch (Exception e1) {
Logger.error(XsltTool.class, "Error in transformation. " + e1.getMessage());
e1.printStackTrace();
}
outputXML = result.getOutputStream().toString();
doc = new XSLTranformationDoc();
doc.setIdentifier(xslFile.getIdentifier());
doc.setInode(xslFile.getInode());
doc.setXslPath(XSLPath);
doc.setXmlTransformation(outputXML);
}
return doc;
} catch (Exception e) {
Logger.error(XsltTool.class, "Error in transformation. " + e.getMessage());
e.printStackTrace();
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: XSLTTransformXMLString
File: src/com/dotmarketing/viewtools/XsltTool.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2012-1826
|
MEDIUM
| 6
|
dotCMS/core
|
XSLTTransformXMLString
|
src/com/dotmarketing/viewtools/XsltTool.java
|
b6b15c45fd550db7f1103e6aeab8780465855c29
| 0
|
Analyze the following code function for security vulnerabilities
|
public void saveFilesToServe(String staticResource) {
Gson gson = new Gson();
if (StringUtils.isNotEmpty(staticResource)) {
Map<String, String> resource = gson.fromJson(staticResource, Map.class);
for (Map.Entry<String, String> entry : resource.entrySet()) {
String path = entry.getKey();
String fileName = path.substring(path.lastIndexOf("/") + 1, path.length());
saveSingleFileToServe(fileName, entry.getValue());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveFilesToServe
File: core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java
Repository: dataease
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2023-40183
|
MEDIUM
| 5.3
|
dataease
|
saveFilesToServe
|
core/backend/src/main/java/io/dataease/service/staticResource/StaticResourceService.java
|
826513053146721a2b3e09a9c9d3ea41f8f10569
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getClientVersion() {
return clientID.substring(8);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClientVersion
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
getClientVersion
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object xpathQuery(String xpath, QName type, NamespaceContext nsContext)
{
try {
return super.xpathQuery(xpath, type, nsContext);
} catch (XPathExpressionException e) {
throw wrapExceptionAsRuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: xpathQuery
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
xpathQuery
|
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public ModalDialog setTitle(final String title)
{
return setTitle(Model.of(title));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTitle
File: src/main/java/org/projectforge/web/dialog/ModalDialog.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
setTitle
|
src/main/java/org/projectforge/web/dialog/ModalDialog.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Field field(final String key, final Lang lang) {
// Value
String fieldValue = null;
Http.MultipartFormData.FilePart file = null;
if (rawData.containsKey(key)) {
fieldValue = rawData.get(key);
} else if (files.containsKey(key)) {
file = files.get(key);
} else {
if (value.isPresent()) {
ConfigurablePropertyAccessor propertyAccessor = propertyAccessor(value.get());
propertyAccessor.setAutoGrowNestedPaths(true);
String objectKey = key;
if (rootName != null && key.startsWith(rootName + ".")) {
objectKey = key.substring(rootName.length() + 1);
}
if (propertyAccessor.isReadableProperty(objectKey)) {
Object oValue = propertyAccessor.getPropertyValue(objectKey);
if (oValue != null) {
if (oValue instanceof Http.MultipartFormData.FilePart<?>) {
file = (Http.MultipartFormData.FilePart<?>) oValue;
} else {
if (formatters != null) {
final String objectKeyFinal = objectKey;
fieldValue =
withRequestLocale(
lang,
() ->
formatters.print(
propertyAccessor.getPropertyTypeDescriptor(objectKeyFinal),
oValue));
} else {
fieldValue = oValue.toString();
}
}
}
}
}
}
// Format
Tuple<String, List<Object>> format = null;
ConfigurablePropertyAccessor propertyAccessor = propertyAccessor(blankInstance());
propertyAccessor.setAutoGrowNestedPaths(true);
try {
for (Annotation a : propertyAccessor.getPropertyTypeDescriptor(key).getAnnotations()) {
Class<?> annotationType = a.annotationType();
if (annotationType.isAnnotationPresent(play.data.Form.Display.class)) {
play.data.Form.Display d = annotationType.getAnnotation(play.data.Form.Display.class);
if (d.name().startsWith("format.")) {
List<Object> attributes = new ArrayList<>();
for (String attr : d.attributes()) {
Object attrValue = null;
try {
attrValue = a.getClass().getDeclaredMethod(attr).invoke(a);
} catch (Exception e) {
// do nothing
}
attributes.add(attrValue);
}
format = Tuple(d.name(), Collections.unmodifiableList(attributes));
}
}
}
} catch (NullPointerException e) {
// do nothing
}
// Constraints
List<Tuple<String, List<Object>>> constraints = new ArrayList<>();
Class<?> classType = backedType;
String leafKey = key;
if (rootName != null && leafKey.startsWith(rootName + ".")) {
leafKey = leafKey.substring(rootName.length() + 1);
}
int p = leafKey.lastIndexOf('.');
if (p > 0) {
classType = propertyAccessor.getPropertyType(leafKey.substring(0, p));
leafKey = leafKey.substring(p + 1);
}
if (classType != null && this.validatorFactory != null) {
BeanDescriptor beanDescriptor =
this.validatorFactory.getValidator().getConstraintsForClass(classType);
if (beanDescriptor != null) {
PropertyDescriptor property = beanDescriptor.getConstraintsForProperty(leafKey);
if (property != null) {
Annotation[] orderedAnnotations = null;
for (Class<?> c = classType;
c != null;
c = c.getSuperclass()) { // we also check the fields of all superclasses
java.lang.reflect.Field field = null;
try {
field = c.getDeclaredField(leafKey);
} catch (NoSuchFieldException | SecurityException e) {
continue;
}
// getDeclaredAnnotations also looks for private fields; also it provides the
// annotations in a guaranteed order
orderedAnnotations =
AnnotationUtils.unwrapContainerAnnotations(field.getDeclaredAnnotations());
break;
}
constraints =
Constraints.displayableConstraint(
property
.findConstraints()
.unorderedAndMatchingGroups(
groups != null ? groups : new Class[] {Default.class})
.getConstraintDescriptors(),
orderedAnnotations);
}
}
}
return new Field(this, key, constraints, format, errors(key), fieldValue, file);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: field
File: web/play-java-forms/src/main/java/play/data/Form.java
Repository: playframework
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-31018
|
MEDIUM
| 5
|
playframework
|
field
|
web/play-java-forms/src/main/java/play/data/Form.java
|
15393b736df939e35e275af2347155f296c684f2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testGETAttachmentsAtPageVersion() throws Exception
{
final int NUMBER_OF_ATTACHMENTS = 4;
String[] attachmentNames = new String[NUMBER_OF_ATTACHMENTS];
String[] pageVersions = new String[NUMBER_OF_ATTACHMENTS];
for (int i = 0; i < NUMBER_OF_ATTACHMENTS; i++) {
attachmentNames[i] = String.format("%s.txt", UUID.randomUUID());
}
String content = "ATTACHMENT CONTENT";
/* Create NUMBER_OF_ATTACHMENTS attachments */
for (int i = 0; i < NUMBER_OF_ATTACHMENTS; i++) {
String attachmentURI = buildURIForThisPage(AttachmentResource.class, attachmentNames[i]);
PutMethod putMethod = executePut(attachmentURI, content, MediaType.TEXT_PLAIN,
TestUtils.SUPER_ADMIN_CREDENTIALS.getUserName(), TestUtils.SUPER_ADMIN_CREDENTIALS.getPassword());
Assert.assertEquals(getHttpMethodInfo(putMethod), HttpStatus.SC_CREATED, putMethod.getStatusCode());
Attachment attachment = (Attachment) this.unmarshaller.unmarshal(putMethod.getResponseBodyAsStream());
pageVersions[i] = attachment.getPageVersion();
}
// For each page version generated, check that the attachments that are supposed to be there are actually there.
// We do the following: at pageVersion[i] we check that all attachmentNames[0..i] are there.
for (int i = 0; i < NUMBER_OF_ATTACHMENTS; i++) {
String attachmentsUri = buildURIForThisPage(AttachmentsAtPageVersionResource.class, pageVersions[i]);
GetMethod getMethod = executeGet(attachmentsUri);
Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());
Attachments attachments = (Attachments) this.unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());
/*
* Check that all attachmentNames[0..i] are present in the list of attachments of page at version
* pageVersions[i]
*/
for (int j = 0; j <= i; j++) {
boolean found = false;
for (Attachment attachment : attachments.getAttachments()) {
if (attachment.getName().equals(attachmentNames[j])) {
if (attachment.getPageVersion().equals(pageVersions[i])) {
found = true;
break;
}
}
}
Assert.assertTrue(String.format("%s is not present in attachments list of the page at version %s",
attachmentNames[j], pageVersions[i]), found);
}
/* Check links */
for (Attachment attachment : attachments.getAttachments()) {
checkLinks(attachment);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testGETAttachmentsAtPageVersion
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
testGETAttachmentsAtPageVersion
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder setHeader(FileDownloadHeader header) {
this.header = header;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeader
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
|
setHeader
|
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
void importanceTokenDied(ImportanceToken token) {
synchronized (ActivityManagerService.this) {
synchronized (mPidsSelfLocked) {
ImportanceToken cur
= mImportantProcesses.get(token.pid);
if (cur != token) {
return;
}
mImportantProcesses.remove(token.pid);
ProcessRecord pr = mPidsSelfLocked.get(token.pid);
if (pr == null) {
return;
}
pr.forcingToImportant = null;
updateProcessForegroundLocked(pr, false, false);
}
updateOomAdjLocked();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importanceTokenDied
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
|
importanceTokenDied
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getRotationTargetsDevRelease() {
return mRotationTargetsDevRelease;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRotationTargetsDevRelease
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getRotationTargetsDevRelease
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getEverythingIncludesFetchPageSize() {
return myEverythingIncludesFetchPageSize;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEverythingIncludesFetchPageSize
File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
getEverythingIncludesFetchPageSize
|
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
|
f2934b229c491235ab0e7782dea86b324521082a
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean shouldBeReplacedWithChildren() {
return mIsChildWindow || mAttrs.type == TYPE_APPLICATION
|| mAttrs.type == TYPE_DRAWN_APPLICATION;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldBeReplacedWithChildren
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
|
shouldBeReplacedWithChildren
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
@POST
@Path("task/{nodeId}")
@Operation(summary = "Update a Task Element onto a given course", description = "This updates a Task Element onto a given course")
@ApiResponse(responseCode = "200", description = "The course node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or parentNode not found")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response updateTask(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId,
@FormParam("shortTitle") @DefaultValue("undefined") String shortTitle,
@FormParam("longTitle") @DefaultValue("undefined") String longTitle, @FormParam("objectives") @DefaultValue("undefined") String objectives,
@FormParam("visibilityExpertRules") String visibilityExpertRules, @FormParam("accessExpertRules") String accessExpertRules,
@FormParam("text") String text, @FormParam("points") Float points,
@Context HttpServletRequest request) {
TaskCustomConfig config = new TaskCustomConfig(points, text);
return update(courseId, nodeId, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateTask
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41242
|
HIGH
| 7.9
|
OpenOLAT
|
updateTask
|
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
|
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<Object> processEnvDep(final Set<Object> src, final Env env) {
List<Object> result = new ArrayList<>();
List<Object> bag = new ArrayList<>(src);
bag.forEach(it -> {
if (it instanceof EnvDep) {
EnvDep envdep = (EnvDep) it;
if (envdep.predicate.test(env.name())) {
int from = src.size();
envdep.callback.accept(env.config());
int to = src.size();
result.addAll(new ArrayList<>(src).subList(from, to));
}
} else {
result.add(it);
}
});
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processEnvDep
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
processEnvDep
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initValidColumTypes()
{
String[] string_types = {"string", "text", "clob"};
String[] number_types =
{"integer", "long", "float", "double", "big_decimal", "big_integer", "yes_no", "true_false"};
String[] date_types = {"date", "time", "timestamp"};
String[] boolean_types = {"boolean", "yes_no", "true_false", "integer"};
this.validTypesMap = new HashMap<>();
this.validTypesMap.put("com.xpn.xwiki.objects.classes.StringClass", string_types);
this.validTypesMap.put("com.xpn.xwiki.objects.classes.TextAreaClass", string_types);
this.validTypesMap.put("com.xpn.xwiki.objects.classes.PasswordClass", string_types);
this.validTypesMap.put("com.xpn.xwiki.objects.classes.NumberClass", number_types);
this.validTypesMap.put("com.xpn.xwiki.objects.classes.DateClass", date_types);
this.validTypesMap.put("com.xpn.xwiki.objects.classes.BooleanClass", boolean_types);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initValidColumTypes
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
initValidColumTypes
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public void binderDied() {
synchronized (observersLock) {
removeObserverLocked(observer);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: binderDied
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
binderDied
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isPlaybackActive(int state) {
if (state != PlaybackState.STATE_STOPPED
&& state != PlaybackState.STATE_ERROR
&& state != PlaybackState.STATE_NONE) {
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPlaybackActive
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
|
isPlaybackActive
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
void cancelIntentSenderLocked(PendingIntentRecord rec, boolean cleanActivity) {
rec.canceled = true;
mIntentSenderRecords.remove(rec.key);
if (cleanActivity && rec.key.activity != null) {
rec.key.activity.pendingResults.remove(rec.ref);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelIntentSenderLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
cancelIntentSenderLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setRestTemplate(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRestTemplate
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
setRestTemplate
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getScreenCaptureDisabled(@Nullable ComponentName admin) {
return getScreenCaptureDisabled(admin, myUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScreenCaptureDisabled
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
|
getScreenCaptureDisabled
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.