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
|
static String readToEnd(Reader reader) throws IOException {
// read everything into a buffer
int n;
char[] part=new char[8*1024];
StringBuilder sb=new StringBuilder();
while ((n=reader.read(part, 0, part.length))!=-1) sb.append(part, 0, n);
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readToEnd
File: src/main/org/hjson/HjsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
readToEnd
|
src/main/org/hjson/HjsonParser.java
|
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
| 0
|
Analyze the following code function for security vulnerabilities
|
void closeSilently()
{
try
{
mSocket.close();
}
catch (Throwable t)
{
// Ignored.
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeSilently
File: src/main/java/com/neovisionaries/ws/client/SocketConnector.java
Repository: TakahikoKawasaki/nv-websocket-client
The code follows secure coding practices.
|
[
"CWE-295"
] |
CVE-2017-1000209
|
MEDIUM
| 4.3
|
TakahikoKawasaki/nv-websocket-client
|
closeSilently
|
src/main/java/com/neovisionaries/ws/client/SocketConnector.java
|
feb9c8302757fd279f4cfc99cbcdfb6ee709402d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCommandFromHandler(Command command) {
if (function == null || sourceFormat == null) {
logger.warn(
"Please specify a function and a source format for this Profile in the '{}', and '{}' parameters. Returning the original command now.",
FUNCTION_PARAM, SOURCE_FORMAT_PARAM);
callback.sendCommand(command);
return;
}
callback.sendCommand((Command) transformState(command));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCommandFromHandler
File: bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
Repository: openhab/openhab-addons
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-5242
|
HIGH
| 9.3
|
openhab/openhab-addons
|
onCommandFromHandler
|
bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
|
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
| 0
|
Analyze the following code function for security vulnerabilities
|
private void loadPrivatePackagesInner(VolumeInfo vol) {
final ArrayList<ApplicationInfo> loaded = new ArrayList<>();
final int parseFlags = mDefParseFlags | PackageParser.PARSE_EXTERNAL_STORAGE;
final VersionInfo ver;
final List<PackageSetting> packages;
synchronized (mPackages) {
ver = mSettings.findOrCreateVersion(vol.fsUuid);
packages = mSettings.getVolumePackagesLPr(vol.fsUuid);
}
for (PackageSetting ps : packages) {
synchronized (mInstallLock) {
final PackageParser.Package pkg;
try {
pkg = scanPackageLI(ps.codePath, parseFlags, SCAN_INITIAL, 0L, null);
loaded.add(pkg.applicationInfo);
} catch (PackageManagerException e) {
Slog.w(TAG, "Failed to scan " + ps.codePath + ": " + e.getMessage());
}
if (!Build.FINGERPRINT.equals(ver.fingerprint)) {
deleteCodeCacheDirsLI(ps.volumeUuid, ps.name);
}
}
}
synchronized (mPackages) {
int updateFlags = UPDATE_PERMISSIONS_ALL;
if (ver.sdkVersion != mSdkVersion) {
logCriticalInfo(Log.INFO, "Platform changed from " + ver.sdkVersion + " to "
+ mSdkVersion + "; regranting permissions for " + vol.fsUuid);
updateFlags |= UPDATE_PERMISSIONS_REPLACE_PKG | UPDATE_PERMISSIONS_REPLACE_ALL;
}
updatePermissionsLPw(null, null, vol.fsUuid, updateFlags);
// Yay, everything is now upgraded
ver.forceCurrent();
mSettings.writeLPr();
}
if (DEBUG_INSTALL) Slog.d(TAG, "Loaded packages " + loaded);
sendResourcesChangedBroadcast(true, false, loaded, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadPrivatePackagesInner
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
loadPrivatePackagesInner
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public void registerLocalConverter(Class definedIn, String fieldName, SingleValueConverter converter) {
registerLocalConverter(definedIn, fieldName, (Converter)new SingleValueConverterWrapper(converter));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerLocalConverter
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
registerLocalConverter
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public ArrayList<String> getCommandHistoryList() {
ArrayList<String> result = new ArrayList<>();
if (commandHistoryString == null) {
return result;
}
// Split the commandHistoryString on non-escaped semicolons
// and unescape it.
StringBuilder sb = new StringBuilder();
for (int end = 0;; end++) {
if (end == commandHistoryString.length() ||
commandHistoryString.charAt(end) == ';') {
if (sb.length() > 0) {
result.add(sb.toString());
sb.delete(0, sb.length());
}
if (end == commandHistoryString.length()) {
break;
}
} else if (commandHistoryString.charAt(end) == '\\' &&
end < commandHistoryString.length() - 1) {
sb.append(commandHistoryString.charAt(++end));
} else {
sb.append(commandHistoryString.charAt(end));
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommandHistoryList
File: h2/src/main/org/h2/server/web/WebServer.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getCommandHistoryList
|
h2/src/main/org/h2/server/web/WebServer.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateActivityLockScreenState(boolean showing, boolean aodShowing) {
mUiBgExecutor.execute(() -> {
if (DEBUG) {
Log.d(TAG, "updateActivityLockScreenState(" + showing + ", " + aodShowing + ")");
}
try {
ActivityTaskManager.getService().setLockScreenShown(showing, aodShowing);
} catch (RemoteException e) {
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateActivityLockScreenState
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21267
|
MEDIUM
| 5.5
|
android
|
updateActivityLockScreenState
|
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
|
d18d8b350756b0e89e051736c1f28744ed31e93a
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isCsrfTokenValid(VaadinSession session,
String requestToken) {
if (session.getService().getDeploymentConfiguration()
.isXsrfProtectionEnabled()) {
String sessionToken = session.getCsrfToken();
if (sessionToken == null || !sessionToken.equals(requestToken)) {
return false;
}
}
return true;
}
|
Vulnerability Classification:
- CWE: CWE-203
- CVE: CVE-2021-31403
- Severity: LOW
- CVSS Score: 1.9
Description: fix: use time-constant comparison for CSRF tokens
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
Function: isCsrfTokenValid
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
Fixed Code:
public static boolean isCsrfTokenValid(VaadinSession session,
String requestToken) {
if (session.getService().getDeploymentConfiguration()
.isXsrfProtectionEnabled()) {
String sessionToken = session.getCsrfToken();
if (sessionToken == null || !MessageDigest.isEqual(
sessionToken.getBytes(StandardCharsets.UTF_8),
requestToken.getBytes(StandardCharsets.UTF_8))) {
return false;
}
}
return true;
}
|
[
"CWE-203"
] |
CVE-2021-31403
|
LOW
| 1.9
|
vaadin/framework
|
isCsrfTokenValid
|
server/src/main/java/com/vaadin/server/VaadinService.java
|
4f2ffdd4da343316bd8ac615b26f64f66cac89a3
| 1
|
Analyze the following code function for security vulnerabilities
|
@GetMapping("/list")
public ResultDTO<List<AppInfoVO>> listAppInfo(@RequestParam(required = false) String condition) {
List<AppInfoDO> result;
Pageable limit = PageRequest.of(0, MAX_APP_NUM);
if (StringUtils.isEmpty(condition)) {
result = appInfoRepository.findAll(limit).getContent();
}else {
result = appInfoRepository.findByAppNameLike("%" + condition + "%", limit).getContent();
}
return ResultDTO.success(convert(result));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listAppInfo
File: powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
Repository: PowerJob
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2020-28865
|
MEDIUM
| 5
|
PowerJob
|
listAppInfo
|
powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
|
464ce2dc0ca3e65fa1dc428239829890c52a413a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTable() {
return table;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTable
File: src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
Repository: Bricco/authenticator-plugin
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2013-10013
|
MEDIUM
| 5.2
|
Bricco/authenticator-plugin
|
getTable
|
src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
|
a5456633ff75e8f13705974c7ed1ce77f3f142d5
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isOrganizationOwnedDeviceWithManagedProfile() {
if (!mHasFeature) {
return false;
}
return getOrganizationOwnedProfileUserId() != UserHandle.USER_NULL;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOrganizationOwnedDeviceWithManagedProfile
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
|
isOrganizationOwnedDeviceWithManagedProfile
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public HttpHeaders remove(CharSequence name) {
headers.remove(name);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: remove
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
remove
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
@LargeTest
@Test
public void testSelfManagedIncoming() throws Exception {
PhoneAccountHandle phoneAccountHandle = mPhoneAccountSelfManaged.getAccountHandle();
IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", phoneAccountHandle,
mConnectionServiceFixtureA);
// The InCallService should not know about the call since its self-managed.
assertNull(mInCallServiceFixtureX.getCall(ids.mCallId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testSelfManagedIncoming
File: tests/src/com/android/server/telecom/tests/BasicCallTests.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
testSelfManagedIncoming
|
tests/src/com/android/server/telecom/tests/BasicCallTests.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
public void clearPendingBackup() throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearPendingBackup
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
clearPendingBackup
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private void onDisconnected(String reason) {
unregisterPongListener();
mLastError = reason;
updateConnectionState(ConnectionState.DISCONNECTED);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDisconnected
File: src/org/yaxim/androidclient/service/SmackableImp.java
Repository: ge0rg/yaxim
The code follows secure coding practices.
|
[
"CWE-20",
"CWE-346"
] |
CVE-2017-5589
|
MEDIUM
| 4.3
|
ge0rg/yaxim
|
onDisconnected
|
src/org/yaxim/androidclient/service/SmackableImp.java
|
65a38dc77545d9568732189e86089390f0ceaf9f
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getMessage(String messageId) {
Context ctx = Context.getCurrentContext();
return getMessage(messageId, ctx.getLocale(), new Object[0]);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMessage
File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
Repository: spacewalkproject/spacewalk
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2016-3079
|
MEDIUM
| 4.3
|
spacewalkproject/spacewalk
|
getMessage
|
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
|
7b9ff9ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setIsSyncable(Account account, String providerName, int syncable) {
if (TextUtils.isEmpty(providerName)) {
throw new IllegalArgumentException("Authority must not be empty");
}
mContext.enforceCallingOrSelfPermission(Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
int userId = UserHandle.getCallingUserId();
long identityToken = clearCallingIdentity();
try {
SyncManager syncManager = getSyncManager();
if (syncManager != null) {
syncManager.getSyncStorageEngine().setIsSyncable(
account, userId, providerName, syncable);
}
} finally {
restoreCallingIdentity(identityToken);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIsSyncable
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
|
setIsSyncable
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
private void notifyChange(final Uri uri, final Uri caseSpecificUri) {
final Context context = getContext();
if (caseSpecificUri != null) {
context.getContentResolver().notifyChange(
caseSpecificUri, null, true, UserHandle.USER_ALL);
}
context.getContentResolver().notifyChange(
MmsSms.CONTENT_URI, null, true, UserHandle.USER_ALL);
ProviderUtil.notifyIfNotDefaultSmsApp(caseSpecificUri == null ? uri : caseSpecificUri,
getCallingPackage(), context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyChange
File: src/com/android/providers/telephony/MmsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-22"
] |
CVE-2023-21268
|
MEDIUM
| 5.5
|
android
|
notifyChange
|
src/com/android/providers/telephony/MmsProvider.java
|
ca4c9a19635119d95900793e7a41b820cd1d94d9
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void initVariant() throws Exception {
String[] tmp = Input.idStr.split("-");
String sql = "SELECT * "
+ "FROM variant_v2 "
+ "WHERE chr='" + tmp[0] + "' "
+ "AND pos=" + tmp[1] + " "
+ "AND ref='" + tmp[2] + "' "
+ "AND allele='" + tmp[3] + "'";
ResultSet rset = DBManager.executeQuery(sql);
if (rset.next()) {
variant = new Variant(rset);
}
if (variant != null) {
variant.initAnnotationMap();
}
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2016-15021
- Severity: MEDIUM
- CVSS Score: 5.2
Description: fixed sql injection vulnerability
Function: initVariant
File: src/main/java/model/Output.java
Repository: nickzren/alsdb
Fixed Code:
public static void initVariant() throws Exception {
String[] tmp = Input.idStr.split("-");
String sql = "SELECT * "
+ "FROM variant_v2 "
+ "WHERE chr= ? AND pos= ? AND ref= ? AND allele= ?";
PreparedStatement stmt = DBManager.prepareStatement(sql);
stmt.setString(1, tmp[0]);
stmt.setInt(2, Integer.valueOf(tmp[1]));
stmt.setString(3, tmp[2]);
stmt.setString(4, tmp[3]);
ResultSet rset = stmt.executeQuery();
if (rset.next()) {
variant = new Variant(rset);
}
if (variant != null) {
variant.initAnnotationMap();
}
}
|
[
"CWE-89"
] |
CVE-2016-15021
|
MEDIUM
| 5.2
|
nickzren/alsdb
|
initVariant
|
src/main/java/model/Output.java
|
cbc79a68145e845f951113d184b4de207c341599
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String getCrumb(StaplerRequest req) {
Jenkins h = Jenkins.getInstance();
CrumbIssuer issuer = h != null ? h.getCrumbIssuer() : null;
return issuer != null ? issuer.getCrumb(req) : "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCrumb
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2014-2061
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getCrumb
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
public void initialize(
int strength,
SecureRandom random)
{
if (strength < 512 || strength > 4096 || ((strength < 1024) && strength % 64 != 0) || (strength >= 1024 && strength % 1024 != 0))
{
throw new InvalidParameterException("strength must be from 512 - 4096 and a multiple of 1024 above 1024");
}
this.strength = strength;
this.random = random;
}
|
Vulnerability Classification:
- CWE: CWE-310
- CVE: CVE-2016-1000343
- Severity: MEDIUM
- CVSS Score: 5.0
Description: updated default DSA parameters to follow 186-4
Function: initialize
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/KeyPairGeneratorSpi.java
Repository: bcgit/bc-java
Fixed Code:
public void initialize(
int strength,
SecureRandom random)
{
if (strength < 512 || strength > 4096 || ((strength < 1024) && strength % 64 != 0) || (strength >= 1024 && strength % 1024 != 0))
{
throw new InvalidParameterException("strength must be from 512 - 4096 and a multiple of 1024 above 1024");
}
this.strength = strength;
this.random = random;
this.initialised = false;
}
|
[
"CWE-310"
] |
CVE-2016-1000343
|
MEDIUM
| 5
|
bcgit/bc-java
|
initialize
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/KeyPairGeneratorSpi.java
|
50a53068c094d6cff37659da33c9b4505becd389
| 1
|
Analyze the following code function for security vulnerabilities
|
private void setQsExpanded(boolean expanded) {
boolean changed = mQsExpanded != expanded;
if (changed) {
mQsExpanded = expanded;
updateQsState();
requestPanelHeightUpdate();
mFalsingManager.setQsExpanded(expanded);
mStatusBar.setQsExpanded(expanded);
mNotificationContainerParent.setQsExpanded(expanded);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setQsExpanded
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
setQsExpanded
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder2 reference(String name) {
super.referenceImpl(name);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reference
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
|
reference
|
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public NetworkUpdateResult addOrUpdateNetwork(WifiConfiguration config, int uid,
@Nullable String packageName, boolean overrideCreator) {
if (!mWifiPermissionsUtil.doesUidBelongToCurrentUserOrDeviceOwner(uid)) {
Log.e(TAG, "UID " + uid + " not visible to the current user");
return new NetworkUpdateResult(WifiConfiguration.INVALID_NETWORK_ID);
}
if (config == null) {
Log.e(TAG, "Cannot add/update network with null config");
return new NetworkUpdateResult(WifiConfiguration.INVALID_NETWORK_ID);
}
if (mPendingStoreRead) {
Log.e(TAG, "Cannot add/update network before store is read!");
return new NetworkUpdateResult(WifiConfiguration.INVALID_NETWORK_ID);
}
config.convertLegacyFieldsToSecurityParamsIfNeeded();
WifiConfiguration existingConfig = getInternalConfiguredNetwork(config);
if (!config.isEphemeral()) {
// Removes the existing ephemeral network if it exists to add this configuration.
if (existingConfig != null && existingConfig.isEphemeral()) {
// In this case, new connection for this config won't happen because same
// network is already registered as an ephemeral network.
// Clear the Ephemeral Network to address the situation.
removeNetwork(
existingConfig.networkId, existingConfig.creatorUid, config.creatorName);
}
}
Pair<NetworkUpdateResult, WifiConfiguration> resultPair = addOrUpdateNetworkInternal(
config, uid, packageName, overrideCreator);
NetworkUpdateResult result = resultPair.first;
existingConfig = resultPair.second;
if (!result.isSuccess()) {
Log.e(TAG, "Failed to add/update network " + config.getPrintableSsid());
return result;
}
WifiConfiguration newConfig = getInternalConfiguredNetwork(result.getNetworkId());
sendConfiguredNetworkChangedBroadcast(
result.isNewNetwork()
? WifiManager.CHANGE_REASON_ADDED
: WifiManager.CHANGE_REASON_CONFIG_CHANGE);
// Unless the added network is ephemeral or Passpoint, persist the network update/addition.
if (!config.ephemeral && !config.isPasspoint()) {
saveToStore(true);
}
for (OnNetworkUpdateListener listener : mListeners) {
if (result.isNewNetwork()) {
listener.onNetworkAdded(
createExternalWifiConfiguration(newConfig, true, Process.WIFI_UID));
} else {
listener.onNetworkUpdated(
createExternalWifiConfiguration(newConfig, true, Process.WIFI_UID),
createExternalWifiConfiguration(existingConfig, true, Process.WIFI_UID));
}
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOrUpdateNetwork
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
addOrUpdateNetwork
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Group find(Context context, UUID id) throws SQLException {
if (id == null) {
return null;
} else {
return groupDAO.findByID(context, Group.class, id);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: find
File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41189
|
HIGH
| 9
|
DSpace
|
find
|
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
|
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
| 0
|
Analyze the following code function for security vulnerabilities
|
private static short[] init__puma_parser_index_offsets_0()
{
return new short [] {
0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
39, 41, 44, 46, 57, 59, 70, 73, 75, 82, 89, 96,
104, 113, 121, 129, 136, 143, 150, 157, 164, 171, 178, 185,
192, 199, 206, 213, 220, 227, 234, 241, 248, 255, 257
};
}
|
Vulnerability Classification:
- CWE: CWE-444
- CVE: CVE-2021-41136
- Severity: LOW
- CVSS Score: 3.6
Description: Merge pull request from GHSA-48w2-rm65-62xx
* Fix HTTP request smuggling vulnerability
See GHSA-48w2-rm65-62xx or CVE-2021-41136 for more info.
* 4.3.9 release note
* 5.5.1 release note
* 5.5.1
Function: init__puma_parser_index_offsets_0
File: ext/puma_http11/org/jruby/puma/Http11Parser.java
Repository: puma
Fixed Code:
private static short[] init__puma_parser_index_offsets_0()
{
return new short [] {
0, 0, 6, 13, 21, 24, 26, 28, 30, 32, 34, 36,
39, 41, 44, 46, 57, 59, 70, 75, 79, 86, 93, 100,
108, 117, 125, 133, 140, 147, 154, 161, 168, 175, 182, 189,
196, 203, 210, 217, 224, 231, 238, 245, 252, 259, 261
};
}
|
[
"CWE-444"
] |
CVE-2021-41136
|
LOW
| 3.6
|
puma
|
init__puma_parser_index_offsets_0
|
ext/puma_http11/org/jruby/puma/Http11Parser.java
|
acdc3ae571dfae0e045cf09a295280127db65c7f
| 1
|
Analyze the following code function for security vulnerabilities
|
private GameData parse(final InputStream stream) throws GameParseException, EngineVersionException {
final Element root = parseDom(stream);
parseMapProperties(root);
parseMapDetails(root);
return data;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parse
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
parse
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
protected char[] getQuotingTriggerChars()
{
return DEFAULT_QUOTING_TRIGGER_CHARS;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getQuotingTriggerChars
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
getQuotingTriggerChars
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
void reportOomAdjMessageLocked(String tag, String msg) {
Slog.d(tag, msg);
if (mCurOomAdjObserver != null) {
mUiHandler.obtainMessage(DISPATCH_OOM_ADJ_OBSERVER_MSG, msg).sendToTarget();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reportOomAdjMessageLocked
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
|
reportOomAdjMessageLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void shiftRight(int numDigits) {
if (usingBytes) {
int i = 0;
for (; i < precision - numDigits; i++) {
bcdBytes[i] = bcdBytes[i + numDigits];
}
for (; i < precision; i++) {
bcdBytes[i] = 0;
}
} else {
bcdLong >>>= (numDigits * 4);
}
scale += numDigits;
precision -= numDigits;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shiftRight
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
shiftRight
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean isRestrictedClass(Object o) {
if (o == null) {
return false;
}
return (
(
o.getClass().getPackage() != null &&
o.getClass().getPackage().getName().startsWith("java.lang.reflect")
) ||
o instanceof Class ||
o instanceof ClassLoader ||
o instanceof Thread ||
o instanceof Method ||
o instanceof Field ||
o instanceof Constructor
);
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2020-12668
- Severity: MEDIUM
- CVSS Score: 6.8
Description: Add interpreter to blacklist
Function: isRestrictedClass
File: src/main/java/com/hubspot/jinjava/el/ext/JinjavaBeanELResolver.java
Repository: HubSpot/jinjava
Fixed Code:
protected boolean isRestrictedClass(Object o) {
if (o == null) {
return false;
}
return (
(
o.getClass().getPackage() != null &&
o.getClass().getPackage().getName().startsWith("java.lang.reflect")
) ||
o instanceof Class ||
o instanceof ClassLoader ||
o instanceof Thread ||
o instanceof Method ||
o instanceof Field ||
o instanceof Constructor ||
o instanceof JinjavaInterpreter
);
}
|
[
"CWE-863"
] |
CVE-2020-12668
|
MEDIUM
| 6.8
|
HubSpot/jinjava
|
isRestrictedClass
|
src/main/java/com/hubspot/jinjava/el/ext/JinjavaBeanELResolver.java
|
1b9aaa4b420c58b4a301cf4b7d26207f1c8d1165
| 1
|
Analyze the following code function for security vulnerabilities
|
public static Variant getVariant(HttpHeaders headers) {
Variant v = RestEasy960Util.getVariant(headers);
if( v == null ) {
v = Variant.mediaTypes(getMediaType(headers)).add().build().get(0);;
}
return v;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVariant
File: kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
Repository: kiegroup/droolsjbpm-integration
The code follows secure coding practices.
|
[
"CWE-260"
] |
CVE-2016-7043
|
MEDIUM
| 5
|
kiegroup/droolsjbpm-integration
|
getVariant
|
kie-server-parent/kie-server-controller/kie-server-controller-rest/src/main/java/org/kie/server/controller/rest/ControllerUtils.java
|
e916032edd47aa46d15f3a11909b4804ee20a7e8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected <T extends Field> T build(String caption, Class<?> dataType,
Class<T> fieldType) throws BindException {
T field = super.build(caption, dataType, fieldType);
if (field instanceof CheckBox) {
field.setCaption(null);
}
return field;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: build
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
build
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("deletefile")
public void deleteFile() throws Exception {
if (file.exists()) {
file.delete();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteFile
File: testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java
Repository: resteasy
The code follows secure coding practices.
|
[
"CWE-378"
] |
CVE-2023-0482
|
MEDIUM
| 5.5
|
resteasy
|
deleteFile
|
testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java
|
807d7456f2137cde8ef7c316707211bf4e542d56
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void establishZygoteConnectionForAbi(String abi) {
try {
openZygoteSocketIfNeeded(abi);
} catch (ZygoteStartFailedEx ex) {
throw new RuntimeException("Unable to connect to zygote for abi: " + abi, ex);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: establishZygoteConnectionForAbi
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
establishZygoteConnectionForAbi
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiCriteriaService getCriteriaService(XWikiContext context)
{
return this.criteriaService;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCriteriaService
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
|
getCriteriaService
|
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 boolean deleteSecureSetting(String name, int requestingUserId, boolean forceNotify) {
if (DEBUG) {
Slog.v(LOG_TAG, "deleteSecureSetting(" + name + ", " + requestingUserId
+ ", " + forceNotify + ")");
}
return mutateSecureSetting(name, null, null, false, requestingUserId,
MUTATION_OPERATION_DELETE, forceNotify, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteSecureSetting
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
deleteSecureSetting
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setText(String text) {
this.text = text;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setText
File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setText
|
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraint.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mDefaultDescriptionView = findViewById(R.id.default_summary);
mSilentDescriptionView = findViewById(R.id.silence_summary);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFinishInflate
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
|
onFinishInflate
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DockerImageDetails inspect(ImageReference imageReference)
throws IOException, InterruptedException {
Process inspectProcess =
docker("inspect", "-f", "{{json .}}", "--type", "image", imageReference.toString());
if (inspectProcess.waitFor() != 0) {
throw new IOException(
"'docker inspect' command failed with error: " + getStderrOutput(inspectProcess));
}
return JsonTemplateMapper.readJson(inspectProcess.getInputStream(), DockerImageDetails.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inspect
File: jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java
Repository: GoogleContainerTools/jib
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-25914
|
CRITICAL
| 9.8
|
GoogleContainerTools/jib
|
inspect
|
jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java
|
67fa40bc2c484da0546333914ea07a89fe44eaaf
| 0
|
Analyze the following code function for security vulnerabilities
|
public void putPersistableBundle(@Nullable String key, @Nullable PersistableBundle value) {
unparcel();
mMap.put(key, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: putPersistableBundle
File: core/java/android/os/PersistableBundle.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40074
|
MEDIUM
| 5.5
|
android
|
putPersistableBundle
|
core/java/android/os/PersistableBundle.java
|
40e4ea759743737958dde018f3606d778f7a53f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void notifyStartingWindowDrawn() {
synchronized (ActivityManagerService.this) {
mStackSupervisor.mActivityMetricsLogger.notifyStartingWindowDrawn();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyStartingWindowDrawn
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
notifyStartingWindowDrawn
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void internalResetCursorOnPosition(AsyncResponse asyncResponse, String subName, boolean authoritative,
MessageIdImpl messageId, boolean isExcluded, int batchIndex) {
if (topicName.isGlobal()) {
try {
validateGlobalNamespaceOwnership(namespaceName);
} catch (Exception e) {
log.warn("[{}][{}] Failed to reset cursor on subscription {} to position {}: {}", clientAppId(),
topicName, subName, messageId, e.getMessage());
resumeAsyncResponseExceptionally(asyncResponse, e);
return;
}
}
log.info("[{}][{}] received reset cursor on subscription {} to position {}", clientAppId(), topicName,
subName, messageId);
// If the topic name is a partition name, no need to get partition topic metadata again
if (!topicName.isPartitioned() && getPartitionedTopicMetadata(topicName, authoritative, false).partitions > 0) {
log.warn("[{}] Not supported operation on partitioned-topic {} {}", clientAppId(), topicName,
subName);
asyncResponse.resume(new RestException(Status.METHOD_NOT_ALLOWED,
"Reset-cursor at position is not allowed for partitioned-topic"));
return;
} else {
validateTopicOwnership(topicName, authoritative);
validateTopicOperation(topicName, TopicOperation.RESET_CURSOR, subName);
PersistentTopic topic = (PersistentTopic) getTopicReference(topicName);
if (topic == null) {
asyncResponse.resume(new RestException(Status.NOT_FOUND, "Topic not found"));
return;
}
try {
PersistentSubscription sub = topic.getSubscription(subName);
if (sub == null) {
asyncResponse.resume(new RestException(Status.NOT_FOUND, "Subscription not found"));
return;
}
CompletableFuture<Integer> batchSizeFuture = new CompletableFuture<>();
getEntryBatchSize(batchSizeFuture, topic, messageId, batchIndex);
batchSizeFuture.thenAccept(bi -> {
PositionImpl seekPosition = calculatePositionAckSet(isExcluded, bi, batchIndex, messageId);
sub.resetCursor(seekPosition).thenRun(() -> {
log.info("[{}][{}] successfully reset cursor on subscription {} to position {}", clientAppId(),
topicName, subName, messageId);
asyncResponse.resume(Response.noContent().build());
}).exceptionally(ex -> {
Throwable t = (ex instanceof CompletionException ? ex.getCause() : ex);
log.warn("[{}][{}] Failed to reset cursor on subscription {} to position {}", clientAppId(),
topicName, subName, messageId, t);
if (t instanceof SubscriptionInvalidCursorPosition) {
asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED,
"Unable to find position for position specified: " + t.getMessage()));
} else if (t instanceof SubscriptionBusyException) {
asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED,
"Failed for Subscription Busy: " + t.getMessage()));
} else {
resumeAsyncResponseExceptionally(asyncResponse, t);
}
return null;
});
}).exceptionally(e -> {
asyncResponse.resume(e);
return null;
});
} catch (Exception e) {
log.warn("[{}][{}] Failed to reset cursor on subscription {} to position {}", clientAppId(), topicName,
subName, messageId, e);
resumeAsyncResponseExceptionally(asyncResponse, e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalResetCursorOnPosition
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
|
internalResetCursorOnPosition
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean detectWhetherAppIsFramework() throws AndrolibException {
File publicXml = new File(mApkDir, "res/values/public.xml");
if (!publicXml.exists()) {
return false;
}
Iterator<String> it;
try {
it = IOUtils.lineIterator(new FileReader(new File(mApkDir, "res/values/public.xml")));
} catch (FileNotFoundException ex) {
throw new AndrolibException(
"Could not detect whether app is framework one", ex);
}
it.next();
it.next();
return it.next().contains("0x01");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: detectWhetherAppIsFramework
File: brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
Repository: iBotPeaches/Apktool
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-21633
|
HIGH
| 7.8
|
iBotPeaches/Apktool
|
detectWhetherAppIsFramework
|
brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkBuilder.java
|
d348c43b24a9de350ff6e5bd610545a10c1fc712
| 0
|
Analyze the following code function for security vulnerabilities
|
public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws IOException, JellyException {
ContextMenu menu = new ContextMenu().from(this, request, response);
for (MenuItem i : menu.items) {
if (i.url.equals(request.getContextPath() + "/manage")) {
// add "Manage Jenkins" subitems
i.subMenu = new ContextMenu().from(this, request, response, "manage");
}
}
return menu;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doContextMenu
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
|
doContextMenu
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((attrs == null) ? 0 : attrs.hashCode());
result = prime * result + ((classId == null) ? 0 : classId.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((text == null) ? 0 : text.hashCode());
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hashCode
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
hashCode
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setUserAgent(String userAgent) {
userAgent = userAgent;
addDefaultHeader("User-Agent", userAgent);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserAgent
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setUserAgent
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
default void onNetworkRemoved(@NonNull WifiConfiguration config) { }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onNetworkRemoved
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
onNetworkRemoved
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void saveSchema(String projectName, Schema schema, AsyncMethodCallback resultHandler) {
unimplemented(resultHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveSchema
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
saveSchema
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected AddressResolver createAddressResolver(List<Address> addresses) {
if (addresses.size() > 1) {
return new ListAddressResolver(addresses);
} else {
return new DnsRecordIpAddressResolver(addresses.get(0), isSSL());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAddressResolver
File: src/main/java/com/rabbitmq/client/ConnectionFactory.java
Repository: rabbitmq/rabbitmq-java-client
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-46120
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-java-client
|
createAddressResolver
|
src/main/java/com/rabbitmq/client/ConnectionFactory.java
|
714aae602dcae6cb4b53cadf009323ebac313cc8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected byte[] bigIntToBytes(
BigInteger r)
{
//
// RFC 2631 (2.1.2) specifies that the secret should be padded with leading zeros if necessary
// must be the same length as p
//
int expectedLength = (p.bitLength() + 7) / 8;
byte[] tmp = r.toByteArray();
if (tmp.length == expectedLength)
{
return tmp;
}
if (tmp[0] == 0 && tmp.length == expectedLength + 1)
{
byte[] rv = new byte[tmp.length - 1];
System.arraycopy(tmp, 1, rv, 0, rv.length);
return rv;
}
// tmp must be shorter than expectedLength
// pad to the left with zeros.
byte[] rv = new byte[expectedLength];
System.arraycopy(tmp, 0, rv, rv.length - tmp.length, tmp.length);
return rv;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bigIntToBytes
File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-320"
] |
CVE-2016-1000346
|
MEDIUM
| 4.3
|
bcgit/bc-java
|
bigIntToBytes
|
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java
|
1127131c89021612c6eefa26dbe5714c194e7495
| 0
|
Analyze the following code function for security vulnerabilities
|
private void launchPhone() {
final TelecomManager tm = TelecomManager.from(mContext);
if (tm.isInCall()) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
tm.showInCallScreen(false /* showDialpad */);
}
});
} else {
boolean dismissShade = !TextUtils.isEmpty(mLeftButtonStr)
&& Dependency.get(TunerService.class).getValue(LOCKSCREEN_LEFT_UNLOCK, 1) != 0;
mActivityStarter.startActivity(mLeftButton.getIntent(), dismissShade);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: launchPhone
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
launchPhone
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
void updateFrameRateSelectionPriorityIfNeeded() {
RefreshRatePolicy refreshRatePolicy =
getDisplayContent().getDisplayPolicy().getRefreshRatePolicy();
final int priority = refreshRatePolicy.calculatePriority(this);
if (mFrameRateSelectionPriority != priority) {
mFrameRateSelectionPriority = priority;
getPendingTransaction().setFrameRateSelectionPriority(mSurfaceControl,
mFrameRateSelectionPriority);
}
// If refresh rate switching is disabled there is no point to set the frame rate on the
// surface as the refresh rate will be limited by display manager to a single value
// and SurfaceFlinger wouldn't be able to change it anyways.
if (mWmService.mDisplayManagerInternal.getRefreshRateSwitchingType()
!= SWITCHING_TYPE_NONE) {
final float refreshRate = refreshRatePolicy.getPreferredRefreshRate(this);
if (mAppPreferredFrameRate != refreshRate) {
mAppPreferredFrameRate = refreshRate;
getPendingTransaction().setFrameRate(
mSurfaceControl, mAppPreferredFrameRate,
Surface.FRAME_RATE_COMPATIBILITY_EXACT, Surface.CHANGE_FRAME_RATE_ALWAYS);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateFrameRateSelectionPriorityIfNeeded
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
|
updateFrameRateSelectionPriorityIfNeeded
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void openConversationForContact(Contact contact) {
Conversation conversation = xmppConnectionService.findOrCreateConversation(contact.getAccount(), contact.getJid(), false, true);
SoftKeyboardUtils.hideSoftKeyboard(this);
switchToConversation(conversation);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openConversationForContact
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
openConversationForContact
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public void error(SAXParseException e) {
sb.append("ERROR: ");
sb.append(e.getMessage());
sb.append("\n");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: error
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40315
|
HIGH
| 8
|
OpenNMS/opennms
|
error
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
|
201301e067329ababa3c0671ded5c4c43347d4a8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String lookupNamespaceURI(String prefix) {
return doc.lookupNamespaceURI(prefix);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: lookupNamespaceURI
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
lookupNamespaceURI
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeIntArray(pids);
mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
reply.readException();
Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
data.recycle();
reply.recycle();
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProcessMemoryInfo
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getProcessMemoryInfo
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
public int addFileName(String file) {
workUnitList.add(new WorkUnit(file));
return size();
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2021-32634
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Merge pull request from GHSA-m5qf-gfmp-7638
* Remove unsafe serialization from PayloadUtil
* This code will likely be removed wholesale, but this change
should be used as a departure point for future development
if we end up re-implementing moveTo and friends.
* Removed vestigial MoveTo related code.
* Remove unsafe serialization in WorkSpace infra.
* Favor DataInput/DataOutputStream over ObjectInput/ObjectOutputStream
* Implement lightweight serialization in WorkBundle/WorkUnit
* Updates to WorkBundle serDe, added tests.
- set limit on number of WorkUnits per bundle. In practice these are
commonly less than 1024.
- added null handling for WorkBundle/WorkUnit string fields.
- confirmed readUTF/writeUTF has a limit ensuring strings will
be 65535 characters or less.
* Minor cleanup to WorkBundleTest
* Minor Change to WorkBundleTest
* Formatting updates
Function: addFileName
File: src/main/java/emissary/pickup/WorkBundle.java
Repository: NationalSecurityAgency/emissary
Fixed Code:
public int addFileName(String file) {
return addWorkUnit(new WorkUnit(file));
}
|
[
"CWE-502"
] |
CVE-2021-32634
|
MEDIUM
| 6.5
|
NationalSecurityAgency/emissary
|
addFileName
|
src/main/java/emissary/pickup/WorkBundle.java
|
40260b1ec1f76cc92361702cc14fa1e4388e19d7
| 1
|
Analyze the following code function for security vulnerabilities
|
void updateCpuStats() {
mH.post(mAmInternal::updateCpuStats);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateCpuStats
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
updateCpuStats
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public void testPOJOString()
throws Exception
{
ObjectMapper mapper = new ObjectMapper();
// also need tree mapper to construct tree to serialize
ObjectNode n = mapper.getNodeFactory().objectNode();
n.set("pojo", mapper.getNodeFactory().pojoNode("abc"));
StringWriter sw = new StringWriter();
JsonGenerator jg = mapper.createGenerator(sw);
mapper.writeTree(jg, n);
Map<String,Object> result = (Map<String,Object>) mapper.readValue(sw.toString(), Map.class);
assertEquals(1, result.size());
assertEquals("abc", result.get("pojo"));
jg.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testPOJOString
File: src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2020-36518
|
MEDIUM
| 5
|
FasterXML/jackson-databind
|
testPOJOString
|
src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
|
8238ab41d0350fb915797c89d46777b4496b74fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void gotServiceAccept()
throws TransportException {
serviceAccept.lock();
try {
if (!serviceAccept.hasWaiters())
throw new TransportException(DisconnectReason.PROTOCOL_ERROR,
"Got a service accept notification when none was awaited");
// Immediately switch to next service to prevent race condition mentioned in #559
setService(nextService);
serviceAccept.set();
} finally {
serviceAccept.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: gotServiceAccept
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
|
gotServiceAccept
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Path findWithEnding(Path basePath, String... endings) {
for (String ending : endings) {
Path newPath = basePath.resolveSibling(basePath.getFileName() + ending);
if (Files.exists(newPath)) {
return newPath;
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findWithEnding
File: pf4j/src/main/java/org/pf4j/util/FileUtils.java
Repository: pf4j
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-40827
|
HIGH
| 7.5
|
pf4j
|
findWithEnding
|
pf4j/src/main/java/org/pf4j/util/FileUtils.java
|
ed9392069fe14c6c30d9f876710e5ad40f7ea8c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("mLock")
long getNextResetTimeLocked() {
updateTimesLocked();
return mRawLastResetTime.get() + mResetInterval;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNextResetTimeLocked
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
|
getNextResetTimeLocked
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public AppendableCharSequence parse(ByteBuf buffer) {
reset();
return super.parse(buffer);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parse
File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2019-16869
|
MEDIUM
| 5
|
netty
|
parse
|
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
|
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public char readChar() throws JMSException {
return (Character)this.readPrimitiveType(Character.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readChar
File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
Repository: rabbitmq/rabbitmq-jms-client
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2020-36282
|
HIGH
| 7.5
|
rabbitmq/rabbitmq-jms-client
|
readChar
|
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
private void postTransfer(String broadcast, int callingUserId) {
deleteTransferOwnershipMetadataFileLocked();
sendOwnerChangedBroadcast(broadcast, callingUserId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postTransfer
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
|
postTransfer
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void internalSetDataProvider(DataProvider<T, ?> dataProvider) {
super.internalSetDataProvider(dataProvider);
for (Column<T, ?> column : getColumns()) {
column.updateSortable();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalSetDataProvider
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
internalSetDataProvider
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setInjectedCode(final String injectedCode) {
this.injectedCode = injectedCode;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInjectedCode
File: stroom-pipeline/src/main/java/stroom/xml/converter/xmlfragment/XMLFragmentParser.java
Repository: gchq/stroom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
setInjectedCode
|
stroom-pipeline/src/main/java/stroom/xml/converter/xmlfragment/XMLFragmentParser.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initAndSaveDocument(XWikiContext context, XWikiDocument newDocument, String title, String template,
String parent) throws XWikiException
{
XWiki xwiki = context.getWiki();
// Set the locale and default locale, considering that we're creating the original version of the document
// (not a translation).
newDocument.setLocale(Locale.ROOT);
if (newDocument.getDefaultLocale() == Locale.ROOT) {
newDocument.setDefaultLocale(xwiki.getLocalePreference(context));
}
// Copy the template.
readFromTemplate(newDocument, template, context);
// Set the parent field.
if (!StringUtils.isEmpty(parent)) {
DocumentReference parentReference = this.currentmixedReferenceResolver.resolve(parent);
newDocument.setParentReference(parentReference);
}
// Set the document title
if (title != null) {
newDocument.setTitle(title);
}
// Set the author and creator.
DocumentReference currentUserReference = context.getUserReference();
newDocument.setAuthorReference(currentUserReference);
newDocument.setCreatorReference(currentUserReference);
// Make sure the user is allowed to make this modification
xwiki.checkSavingDocument(currentUserReference, newDocument, context);
xwiki.saveDocument(newDocument, context);
}
|
Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2022-23617
- Severity: MEDIUM
- CVSS Score: 4.0
Description: XWIKI-18430: Wrong handling of template documents
* improve retro compatibility with future 12.10.x versions
Function: initAndSaveDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
Repository: xwiki/xwiki-platform
Fixed Code:
private void initAndSaveDocument(XWikiContext context, XWikiDocument newDocument, String title, String template,
String parent) throws XWikiException
{
XWiki xwiki = context.getWiki();
// Set the locale and default locale, considering that we're creating the original version of the document
// (not a translation).
newDocument.setLocale(Locale.ROOT);
if (newDocument.getDefaultLocale() == Locale.ROOT) {
newDocument.setDefaultLocale(xwiki.getLocalePreference(context));
}
// Copy the template.
readFromTemplate(newDocument, template, context);
// Set the parent field.
if (!StringUtils.isEmpty(parent)) {
DocumentReference parentReference = getCurrentMixedDocumentReferenceResolver().resolve(parent);
newDocument.setParentReference(parentReference);
}
// Set the document title
if (title != null) {
newDocument.setTitle(title);
}
// Set the author and creator.
DocumentReference currentUserReference = context.getUserReference();
newDocument.setAuthorReference(currentUserReference);
newDocument.setCreatorReference(currentUserReference);
// Make sure the user is allowed to make this modification
xwiki.checkSavingDocument(currentUserReference, newDocument, context);
xwiki.saveDocument(newDocument, context);
}
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
initAndSaveDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setHeight(float height, Unit unit) {
getState().heightMode = HeightMode.CSS;
super.setHeight(height, unit);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeight
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
setHeight
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String displayXML(String input) {
debug.message("In displayXML ");
StringCharacterIterator iter = new StringCharacterIterator(input);
StringBuffer buf = new StringBuffer();
for(char c = iter.first();c != CharacterIterator.DONE;c = iter.next()) {
if (c=='>') {
buf.append(">");
} else if (c=='<') {
buf.append("<");
} else if (c=='\n'){
buf.append("<BR>\n");
} else {
buf.append(c);
}
}
return buf.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: displayXML
File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
Repository: OpenIdentityPlatform/OpenAM
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-37471
|
CRITICAL
| 9.8
|
OpenIdentityPlatform/OpenAM
|
displayXML
|
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
|
7c18543d126e8a567b83bb4535631825aaa9d742
| 0
|
Analyze the following code function for security vulnerabilities
|
private Document parseDocumentImpl(ParserEnvironment environment) throws InvalidSyntaxException {
BiFunction<GraphqlParser, GraphqlAntlrToLanguage, Object[]> nodeFunction = (parser, toLanguage) -> {
GraphqlParser.DocumentContext documentContext = parser.document();
Document doc = toLanguage.createDocument(documentContext);
return new Object[]{documentContext, doc};
};
return (Document) parseImpl(environment, nodeFunction);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseDocumentImpl
File: src/main/java/graphql/parser/Parser.java
Repository: graphql-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-28867
|
HIGH
| 7.5
|
graphql-java
|
parseDocumentImpl
|
src/main/java/graphql/parser/Parser.java
|
8a1c884c81c0b656db201cfd95881feb0f430a55
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<Node> getNonTextNodes(final Node node) {
final NodeList children = node.getChildNodes();
return IntStream.range(0, children.getLength())
.mapToObj(children::item)
.filter(current -> !(current.getNodeType() == Node.TEXT_NODE))
.collect(Collectors.toList());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNonTextNodes
File: game-core/src/main/java/games/strategy/engine/data/GameParser.java
Repository: triplea-game/triplea
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000546
|
MEDIUM
| 6.8
|
triplea-game/triplea
|
getNonTextNodes
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeSleepStateToProto(ProtoOutputStream proto, int wakeFullness,
boolean testPssMode) {
final long sleepToken = proto.start(ActivityManagerServiceDumpProcessesProto.SLEEP_STATUS);
proto.write(ActivityManagerServiceDumpProcessesProto.SleepStatus.WAKEFULNESS,
PowerManagerInternal.wakefulnessToProtoEnum(wakeFullness));
final int tokenSize = mRootWindowContainer.mSleepTokens.size();
for (int i = 0; i < tokenSize; i++) {
final RootWindowContainer.SleepToken st =
mRootWindowContainer.mSleepTokens.valueAt(i);
proto.write(ActivityManagerServiceDumpProcessesProto.SleepStatus.SLEEP_TOKENS,
st.toString());
}
proto.write(ActivityManagerServiceDumpProcessesProto.SleepStatus.SLEEPING, mSleeping);
proto.write(ActivityManagerServiceDumpProcessesProto.SleepStatus.SHUTTING_DOWN,
mShuttingDown);
proto.write(ActivityManagerServiceDumpProcessesProto.SleepStatus.TEST_PSS_MODE,
testPssMode);
proto.end(sleepToken);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeSleepStateToProto
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
writeSleepStateToProto
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private TokenRequest createTokenRequest(final AuthorizationGrant grant) {
if (clientAuthentication != null) {
return new TokenRequest(configuration.findProviderMetadata().getTokenEndpointURI(),
this.clientAuthentication, grant);
} else {
return new TokenRequest(configuration.findProviderMetadata().getTokenEndpointURI(),
new ClientID(configuration.getClientId()), grant);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createTokenRequest
File: datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java
Repository: datahub-project/datahub
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2023-25558
|
HIGH
| 8.8
|
datahub-project/datahub
|
createTokenRequest
|
datahub-frontend/app/auth/sso/oidc/custom/CustomOidcAuthenticator.java
|
2a182f484677d056730d6b4e9f0143e67368359f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test(expected = Exception.class)
public void pojo2jsonBadMap(TestContext context) throws Exception {
PostgresClient.pojo2json(postgresClient);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pojo2jsonBadMap
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
|
pojo2jsonBadMap
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCancel(IntentSender listener) {
if (sDebug) Slog.d(TAG, "OneTimeListener.onCancel(): " + mDone);
if (mDone) {
return;
}
mRealListener.onCancel(listener);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCancel
File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
onCancel
|
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setExecutors(List<XWikiExecutor> executors)
{
this.executors = executors;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setExecutors
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
setExecutors
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAutocomplete(String autocomplete) {
this.autocomplete = autocomplete;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAutocomplete
File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-1904
|
MEDIUM
| 4.3
|
spring-projects/spring-framework
|
setAutocomplete
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ArgumentBinder.BindingResult<Session> bind(ArgumentConversionContext<Session> context, HttpRequest<?> source) {
if (!source.getAttributes().contains(OncePerRequestHttpServerFilter.getKey(HttpSessionFilter.class))) {
// the filter hasn't been executed
//noinspection unchecked
return ArgumentBinder.BindingResult.EMPTY;
}
MutableConvertibleValues<Object> attrs = source.getAttributes();
Optional<Session> existing = attrs.get(HttpSessionFilter.SESSION_ATTRIBUTE, Session.class);
if (existing.isPresent()) {
return () -> existing;
} else {
// create a new session store it in the attribute
if (!context.getArgument().isNullable()) {
Session newSession = sessionStore.newSession();
attrs.put(HttpSessionFilter.SESSION_ATTRIBUTE, newSession);
return () -> Optional.of(newSession);
} else {
//noinspection unchecked
return BindingResult.EMPTY;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bind
File: session/src/main/java/io/micronaut/session/binder/SessionArgumentBinder.java
Repository: micronaut-projects/micronaut-core
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-21700
|
MEDIUM
| 5
|
micronaut-projects/micronaut-core
|
bind
|
session/src/main/java/io/micronaut/session/binder/SessionArgumentBinder.java
|
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
private String cleanPath(String path) {
// Remove user information, because we don't like to store user/password or
// userTokens in allow-list
path = removeUserInfoFromUrlPath(path);
path = path.trim().toLowerCase(Locale.US);
// We simplify/normalize the url, removing default ports
path = path.replace(":80/", "");
path = path.replace(":443/", "");
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanPath
File: src/net/sourceforge/plantuml/security/SURL.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
cleanPath
|
src/net/sourceforge/plantuml/security/SURL.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
void fixUpShortcutResourceNamesAndValues(ShortcutInfo si) {
final Resources publisherRes = injectGetResourcesForApplicationAsUser(
si.getPackage(), si.getUserId());
if (publisherRes != null) {
final long start = getStatStartTime();
try {
si.lookupAndFillInResourceNames(publisherRes);
} finally {
logDurationStat(Stats.RESOURCE_NAME_LOOKUP, start);
}
si.resolveResourceStrings(publisherRes);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fixUpShortcutResourceNamesAndValues
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
|
fixUpShortcutResourceNamesAndValues
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setComponentEnabledSetting(ComponentName componentName,
int newState, int flags, int userId) {
if (!sUserManager.exists(userId)) return;
setEnabledSetting(componentName.getPackageName(),
componentName.getClassName(), newState, flags, userId, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setComponentEnabledSetting
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
setComponentEnabledSetting
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURL() {
final String[] retVal = new String[1];
final boolean[] complete = new boolean[1];
act.runOnUiThread(new Runnable() {
public void run() {
try {
retVal[0] = web.getUrl();
} finally {
complete[0] = true;
}
}
});
while (!complete[0]) {
Display.getInstance().invokeAndBlock(new Runnable() {
@Override
public void run() {
if (!complete[0]) {
try {
Thread.sleep(20);
} catch (InterruptedException ex) {
}
}
}
});
}
return retVal[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
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
|
getURL
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldCheckUpgradeKeySetLP(PackageSetting oldPs, int scanFlags) {
// Can't rotate keys during boot or if sharedUser.
if (oldPs == null || (scanFlags&SCAN_INITIAL) != 0 || oldPs.sharedUser != null
|| !oldPs.keySetData.isUsingUpgradeKeySets()) {
return false;
}
// app is using upgradeKeySets; make sure all are valid
KeySetManagerService ksms = mSettings.mKeySetManagerService;
long[] upgradeKeySets = oldPs.keySetData.getUpgradeKeySets();
for (int i = 0; i < upgradeKeySets.length; i++) {
if (!ksms.isIdValidKeySetId(upgradeKeySets[i])) {
Slog.wtf(TAG, "Package "
+ (oldPs.name != null ? oldPs.name : "<null>")
+ " contains upgrade-key-set reference to unknown key-set: "
+ upgradeKeySets[i]
+ " reverting to signatures check.");
return false;
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldCheckUpgradeKeySetLP
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
shouldCheckUpgradeKeySetLP
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public Integer getCommentsNum() {
return commentsNum;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommentsNum
File: src/main/java/cn/luischen/model/ContentDomain.java
Repository: WinterChenS/my-site
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29638
|
MEDIUM
| 5.4
|
WinterChenS/my-site
|
getCommentsNum
|
src/main/java/cn/luischen/model/ContentDomain.java
|
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
| 0
|
Analyze the following code function for security vulnerabilities
|
private final List<ProviderInfo> generateApplicationProvidersLocked(ProcessRecord app) {
List<ProviderInfo> providers = null;
try {
providers = AppGlobals.getPackageManager()
.queryContentProviders(app.processName, app.uid,
STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS
| MATCH_DEBUG_TRIAGED_MISSING, /*metadastaKey=*/ null)
.getList();
} catch (RemoteException ex) {
}
if (DEBUG_MU) Slog.v(TAG_MU,
"generateApplicationProvidersLocked, app.info.uid = " + app.uid);
int userId = app.userId;
if (providers != null) {
int N = providers.size();
app.pubProviders.ensureCapacity(N + app.pubProviders.size());
for (int i=0; i<N; i++) {
// TODO: keep logic in sync with installEncryptionUnawareProviders
ProviderInfo cpi =
(ProviderInfo)providers.get(i);
boolean singleton = isSingleton(cpi.processName, cpi.applicationInfo,
cpi.name, cpi.flags);
if (singleton && UserHandle.getUserId(app.uid) != UserHandle.USER_SYSTEM) {
// This is a singleton provider, but a user besides the
// default user is asking to initialize a process it runs
// in... well, no, it doesn't actually run in this process,
// it runs in the process of the default user. Get rid of it.
providers.remove(i);
N--;
i--;
continue;
}
ComponentName comp = new ComponentName(cpi.packageName, cpi.name);
ContentProviderRecord cpr = mProviderMap.getProviderByClass(comp, userId);
if (cpr == null) {
cpr = new ContentProviderRecord(this, cpi, app.info, comp, singleton);
mProviderMap.putProviderByClass(comp, cpr);
}
if (DEBUG_MU) Slog.v(TAG_MU,
"generateApplicationProvidersLocked, cpi.uid = " + cpr.uid);
app.pubProviders.put(cpi.name, cpr);
if (!cpi.multiprocess || !"android".equals(cpi.packageName)) {
// Don't add this if it is a platform component that is marked
// to run in multiple processes, because this is actually
// part of the framework so doesn't make sense to track as a
// separate apk in the process.
app.addPackage(cpi.applicationInfo.packageName, cpi.applicationInfo.versionCode,
mProcessStats);
}
notifyPackageUse(cpi.applicationInfo.packageName,
PackageManager.NOTIFY_PACKAGE_USE_CONTENT_PROVIDER);
}
}
return providers;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateApplicationProvidersLocked
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
|
generateApplicationProvidersLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void deploy(File warDir, final File deployTarDir, final String virtualHost) {
// by list
if (warDir.listFiles(new FileFilter() {
public boolean accept(File pathname) {
if (pathname.isFile() && pathname.getName().toLowerCase().endsWith(DEPLOY_ARCH_EXT)) {
deployWar(pathname, deployTarDir);
return true;
}
return false;
}
}).length == 0)
server.log("No .war packaged web apps found in " + (virtualHost == null ? "default" : virtualHost));
if (deployTarDir.listFiles(new FileFilter() {
public boolean accept(File file) {
if (file.isDirectory())
try {
attachApp(WebAppServlet.create(file, file.getName(), server, virtualHost), virtualHost);
markSucceeded(file.getParentFile(), file.getName()); // assumes that parent always exists
return true;
} catch (ServletException se) {
server.log(
"Deployment of aplication " + file.getName() + " failed, reason: " + se.getRootCause(),
se.getRootCause());
} catch (Throwable t) {
if (t instanceof ThreadDeath)
throw (ThreadDeath) t;
server.log("Unexpected problem in deployment of application " + file.getName(), t);
}
return false;
}
}).length == 0)
server.log("No web apps have been deployed in " + (virtualHost == null ? "default" : virtualHost));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deploy
File: 1.x/src/rogatkin/web/WarRoller.java
Repository: drogatkin/TJWS2
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4594
|
CRITICAL
| 9.8
|
drogatkin/TJWS2
|
deploy
|
1.x/src/rogatkin/web/WarRoller.java
|
1bac15c496ec54efe21ad7fab4e17633778582fc
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void doKexNegotiation() throws Exception {
KexStart starting = kexHandler.updateState(() -> {
if (kexState.compareAndSet(KexState.DONE, KexState.RUN)) {
kexHandler.initNewKeyExchange();
return KexStart.PEER;
} else if (kexState.compareAndSet(KexState.INIT, KexState.RUN)) {
return KexStart.BOTH;
}
return KexStart.ONGOING;
});
switch (starting) {
case PEER:
sendKexInit();
break;
case BOTH:
DefaultKeyExchangeFuture initFuture;
synchronized (kexState) {
initFuture = kexInitializedFuture;
if (initFuture == null) {
initFuture = new DefaultKeyExchangeFuture(toString(), null);
kexInitializedFuture = initFuture;
}
}
// requestNewKeyExchange() is running in some other thread: wait until it has set up our own proposal.
// The timeout is a last resort only to avoid blocking indefinitely in case something goes
// catastrophically wrong somewhere; it should never be hit. If it is, an exception will be thrown.
//
// See https://issues.apache.org/jira/browse/SSHD-1197
initFuture.await(CoreModuleProperties.KEX_PROPOSAL_SETUP_TIMEOUT.getRequired(this));
break;
default:
throw new IllegalStateException("Received SSH_MSG_KEXINIT while key exchange is running");
}
Map<KexProposalOption, String> result = negotiate();
String kexAlgorithm = result.get(KexProposalOption.ALGORITHMS);
Collection<? extends KeyExchangeFactory> kexFactories = getKeyExchangeFactories();
KeyExchangeFactory kexFactory = NamedResource.findByName(
kexAlgorithm, String.CASE_INSENSITIVE_ORDER, kexFactories);
ValidateUtils.checkNotNull(kexFactory, "Unknown negotiated KEX algorithm: %s", kexAlgorithm);
byte[] v_s = serverVersion.getBytes(StandardCharsets.UTF_8);
byte[] v_c = clientVersion.getBytes(StandardCharsets.UTF_8);
byte[] i_s;
byte[] i_c;
synchronized (kexState) {
i_s = getServerKexData();
i_c = getClientKexData();
}
kex = kexFactory.createKeyExchange(this);
kex.init(v_s, v_c, i_s, i_c);
synchronized (kexState) {
kexInitializedFuture = null;
}
signalSessionEvent(SessionListener.Event.KexCompleted);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doKexNegotiation
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
doKexNegotiation
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationAsFloatEdgeCase01() throws Exception
{
String input = Instant.MAX.getEpochSecond() + ".999999999";
Instant value = MAPPER.readValue(input, Instant.class);
assertEquals(value, Instant.MAX);
assertEquals(Instant.MAX.getEpochSecond(), value.getEpochSecond());
assertEquals(999999999, value.getNano());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationAsFloatEdgeCase01
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationAsFloatEdgeCase01
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void refreshUiReal() {
if (mSearchEditText != null) {
filter(mSearchEditText.getText().toString());
}
configureHomeButton();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: refreshUiReal
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
refreshUiReal
|
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void copy(InputStream in, OutputStream out, int bufferSize)
throws IOException
{
byte[] b = new byte[bufferSize];
int read;
while ((read = in.read(b)) != -1)
{
out.write(b, 0, read);
}
}
|
Vulnerability Classification:
- CWE: CWE-400
- CVE: CVE-2023-3398
- Severity: HIGH
- CVSS Score: 7.5
Description: 18.1.3 release
Function: copy
File: src/main/java/com/mxgraph/online/Utils.java
Repository: jgraph/drawio
Fixed Code:
public static void copy(InputStream in, OutputStream out, int bufferSize)
throws IOException
{
copy(in, out, bufferSize, 0);
}
|
[
"CWE-400"
] |
CVE-2023-3398
|
HIGH
| 7.5
|
jgraph/drawio
|
copy
|
src/main/java/com/mxgraph/online/Utils.java
|
064729fec4262f9373d9fdcafda0be47cd18dd50
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void handleMessage(Message msg) {
@SuppressWarnings("unchecked")
List<String> requestedUploads = (List<String>) msg.obj;
if (msg.obj != null) {
for (String requestedUpload : requestedUploads) {
mService.uploadFile(requestedUpload);
}
}
Log_OC.d(TAG, "Stopping command after id " + msg.arg1);
mService.mNotificationManager.cancel(FOREGROUND_SERVICE_ID);
mService.stopForeground(true);
mService.stopSelf(msg.arg1);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleMessage
File: src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
handleMessage
|
src/main/java/com/owncloud/android/files/services/FileUploader.java
|
c01fa0b17050cdcf77a468cc22f4071eae29d464
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)
public void setPasswordHistoryLength(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
mService.setPasswordHistoryLength(admin, length, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordHistoryLength
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
|
setPasswordHistoryLength
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
//Log_OC.e(TAG, "onSaveInstanceState init" );
super.onSaveInstanceState(outState);
/// global state
outState.putLong(KEY_WAITING_FOR_OP_ID, mWaitingForOpId);
outState.putBoolean(KEY_IS_SSL_CONN, mServerInfo.mIsSslConn);
outState.putString(KEY_HOST_URL_TEXT, mServerInfo.mBaseUrl);
if (mServerInfo.mVersion != null) {
outState.putString(KEY_OC_VERSION, mServerInfo.mVersion.getVersion());
}
outState.putString(KEY_SERVER_AUTH_METHOD, mServerInfo.mAuthMethod.name());
/// authentication
outState.putBoolean(KEY_AUTH_IS_FIRST_ATTEMPT_TAG, mIsFirstAuthAttempt);
/// AsyncTask (User and password)
if (mAsyncTask != null) {
mAsyncTask.cancel(true);
outState.putBoolean(KEY_ASYNC_TASK_IN_PROGRESS, true);
} else {
outState.putBoolean(KEY_ASYNC_TASK_IN_PROGRESS, false);
}
mAsyncTask = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSaveInstanceState
File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-248"
] |
CVE-2021-32694
|
MEDIUM
| 4.3
|
nextcloud/android
|
onSaveInstanceState
|
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
|
9343bdd85d70625a90e0c952897957a102c2421b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
public void editUserWithDepart(SysUser user, String departs) {
//更新角色的时候已经更新了一次了,可以再跟新一次
this.updateById(user);
String[] arr = {};
if(oConvertUtils.isNotEmpty(departs)){
arr = departs.split(",");
}
//查询已关联部门
List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
if(userDepartList != null && userDepartList.size()>0){
for(SysUserDepart depart : userDepartList ){
//修改已关联部门删除部门用户角色关系
if(!Arrays.asList(arr).contains(depart.getDepId())){
List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList(
new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId,depart.getDepId()));
List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList());
if(roleIds != null && roleIds.size()>0){
departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId())
.in(SysDepartRoleUser::getDroleId,roleIds));
}
}
}
}
//先删后加
sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId()));
if(oConvertUtils.isNotEmpty(departs)) {
for (String departId : arr) {
SysUserDepart userDepart = new SysUserDepart(user.getId(), departId);
sysUserDepartMapper.insert(userDepart);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: editUserWithDepart
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45208
|
MEDIUM
| 4.3
|
jeecgboot/jeecg-boot
|
editUserWithDepart
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
|
51e2227bfe54f5d67b09411ee9a336750164e73d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean handles(final Event event) {
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handles
File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
Repository: HtmlUnit/htmlunit
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-2798
|
HIGH
| 7.5
|
HtmlUnit/htmlunit
|
handles
|
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
|
940dc7fd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void customizeClientBuilder(ClientBuilder clientBuilder) {
// No-op extension point
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: customizeClientBuilder
File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
customizeClientBuilder
|
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M1")
public BaseObject getObject(String className, String key, String value)
{
return getObject(className, key, value, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObject
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getObject
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void readFieldValues(Object obj, ObjectStreamClass classDesc) throws OptionalDataException, ClassNotFoundException, IOException {
// Now we must read all fields and assign them to the receiver
ObjectStreamField[] fields = classDesc.getLoadFields();
fields = (fields == null) ? ObjectStreamClass.NO_FIELDS : fields;
Class<?> declaringClass = classDesc.forClass();
if (declaringClass == null && mustResolve) {
throw new ClassNotFoundException(classDesc.getName());
}
for (ObjectStreamField fieldDesc : fields) {
Field field = classDesc.getReflectionField(fieldDesc);
if (field != null && Modifier.isTransient(field.getModifiers())) {
field = null; // No setting transient fields! (http://b/4471249)
}
// We may not have been able to find the field, or it may be transient, but we still
// need to read the value and do the other checking...
try {
Class<?> type = fieldDesc.getTypeInternal();
if (type == byte.class) {
byte b = input.readByte();
if (field != null) {
field.setByte(obj, b);
}
} else if (type == char.class) {
char c = input.readChar();
if (field != null) {
field.setChar(obj, c);
}
} else if (type == double.class) {
double d = input.readDouble();
if (field != null) {
field.setDouble(obj, d);
}
} else if (type == float.class) {
float f = input.readFloat();
if (field != null) {
field.setFloat(obj, f);
}
} else if (type == int.class) {
int i = input.readInt();
if (field != null) {
field.setInt(obj, i);
}
} else if (type == long.class) {
long j = input.readLong();
if (field != null) {
field.setLong(obj, j);
}
} else if (type == short.class) {
short s = input.readShort();
if (field != null) {
field.setShort(obj, s);
}
} else if (type == boolean.class) {
boolean z = input.readBoolean();
if (field != null) {
field.setBoolean(obj, z);
}
} else {
Object toSet = fieldDesc.isUnshared() ? readUnshared() : readObject();
if (toSet != null) {
// Get the field type from the local field rather than
// from the stream's supplied data. That's the field
// we'll be setting, so that's the one that needs to be
// validated.
String fieldName = fieldDesc.getName();
ObjectStreamField localFieldDesc = classDesc.getField(fieldName);
Class<?> fieldType = localFieldDesc.getTypeInternal();
Class<?> valueType = toSet.getClass();
if (!fieldType.isAssignableFrom(valueType)) {
throw new ClassCastException(classDesc.getName() + "." + fieldName + " - " + fieldType + " not compatible with " + valueType);
}
if (field != null) {
field.set(obj, toSet);
}
}
}
} catch (IllegalAccessException iae) {
// ObjectStreamField should have called setAccessible(true).
throw new AssertionError(iae);
} catch (NoSuchFieldError ignored) {
}
}
}
|
Vulnerability Classification:
- CWE: CWE-264
- CVE: CVE-2014-7911
- Severity: HIGH
- CVSS Score: 7.2
Description: Add additional checks in ObjectInputStream
Thanks to Jann Horn for reporting a bug in ObjectInputStream
and sending the initial patch.
Add some checks that the class of an object
being deserialized still conforms to the requirements
for serialization.
Add some checks that the class being deserialized matches
the type information (enum, serializable, externalizable)
held in the stream.
Delayed static initialization of classes until the
type of the class has been validated against the stream
content in some cases.
Added more tests.
Bug: 15874291
Change-Id: I0f0fe68e0d21e041c5160482113ae847c357b8f5
Function: readFieldValues
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
Fixed Code:
private void readFieldValues(Object obj, ObjectStreamClass classDesc)
throws OptionalDataException, ClassNotFoundException, IOException {
// Now we must read all fields and assign them to the receiver
ObjectStreamField[] fields = classDesc.getLoadFields();
fields = (fields == null) ? ObjectStreamClass.NO_FIELDS : fields;
Class<?> declaringClass = classDesc.forClass();
if (declaringClass == null && mustResolve) {
throw new ClassNotFoundException(classDesc.getName());
}
for (ObjectStreamField fieldDesc : fields) {
Field field = classDesc.getReflectionField(fieldDesc);
if (field != null && Modifier.isTransient(field.getModifiers())) {
field = null; // No setting transient fields! (http://b/4471249)
}
// We may not have been able to find the field, or it may be transient, but we still
// need to read the value and do the other checking...
try {
Class<?> type = fieldDesc.getTypeInternal();
if (type == byte.class) {
byte b = input.readByte();
if (field != null) {
field.setByte(obj, b);
}
} else if (type == char.class) {
char c = input.readChar();
if (field != null) {
field.setChar(obj, c);
}
} else if (type == double.class) {
double d = input.readDouble();
if (field != null) {
field.setDouble(obj, d);
}
} else if (type == float.class) {
float f = input.readFloat();
if (field != null) {
field.setFloat(obj, f);
}
} else if (type == int.class) {
int i = input.readInt();
if (field != null) {
field.setInt(obj, i);
}
} else if (type == long.class) {
long j = input.readLong();
if (field != null) {
field.setLong(obj, j);
}
} else if (type == short.class) {
short s = input.readShort();
if (field != null) {
field.setShort(obj, s);
}
} else if (type == boolean.class) {
boolean z = input.readBoolean();
if (field != null) {
field.setBoolean(obj, z);
}
} else {
Object toSet = fieldDesc.isUnshared() ? readUnshared() : readObject();
if (toSet != null) {
// Get the field type from the local field rather than
// from the stream's supplied data. That's the field
// we'll be setting, so that's the one that needs to be
// validated.
String fieldName = fieldDesc.getName();
ObjectStreamField localFieldDesc = classDesc.getField(fieldName);
Class<?> fieldType = localFieldDesc.getTypeInternal();
Class<?> valueType = toSet.getClass();
if (!fieldType.isAssignableFrom(valueType)) {
throw new ClassCastException(classDesc.getName() + "." + fieldName + " - " + fieldType + " not compatible with " + valueType);
}
if (field != null) {
field.set(obj, toSet);
}
}
}
} catch (IllegalAccessException iae) {
// ObjectStreamField should have called setAccessible(true).
throw new AssertionError(iae);
} catch (NoSuchFieldError ignored) {
}
}
}
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
readFieldValues
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.