instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
private String getUserResourceKey(boolean cacheable, boolean session,
String mime) {
StringBuffer pathBuffer = new StringBuffer(UserResource.class.getName());
pathBuffer.append(cacheable ? "/c" : "/n");
pathBuffer.append(session ? "/s" : "/n");
if (null != mime) {
pathBuffer.append('/').append(mime.hashCode());
}
String path = pathBuffer.toString();
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserResourceKey
File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Repository: nuxeo/richfaces-3.3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2013-4521
|
HIGH
| 7.5
|
nuxeo/richfaces-3.3
|
getUserResourceKey
|
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
|
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
ResolveInfo target = mPm.resolveActivity(intent, 0);
if (target == null) {
// Not a valid target
return false;
}
if (TextUtils.isEmpty(target.activityInfo.permission)) {
// No permission is needed
return true;
}
if (TextUtils.isEmpty(srcPackage)) {
// The activity requires some permission but there is no source.
return false;
}
// Source does not have sufficient permissions.
if(mPm.checkPermission(target.activityInfo.permission, srcPackage) !=
PackageManager.PERMISSION_GRANTED) {
return false;
}
// On M and above also check AppOpsManager for compatibility mode permissions.
if (TextUtils.isEmpty(AppOpsManager.permissionToOp(target.activityInfo.permission))) {
// There is no app-op for this permission, which could have been disabled.
return true;
}
// There is no direct way to check if the app-op is allowed for a particular app. Since
// app-op is only enabled for apps running in compatibility mode, simply block such apps.
try {
return mPm.getApplicationInfo(srcPackage, 0).targetSdkVersion >= Build.VERSION_CODES.M;
} catch (NameNotFoundException e) { }
return false;
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-35682
- Severity: HIGH
- CVSS Score: 7.8
Description: Fix permission issue in legacy shortcut
When building legacy shortcut, Launcher calls
PackageManager#resolveActivity to retrieve necessary permission to
launch the intent.
However, when the source app wraps an arbitrary intent within
Intent#createChooser, the existing logic will fail because launching
Chooser doesn't require additional permission.
This CL fixes the security vulnerability by performing the permission
check against the intent that is wrapped within.
Bug: 270152142
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c53818a16b4322a823497726ac7e7a44501b4442)
Merged-In: If35344c08975e35085c7c2b9b814a3c457a144b0
Change-Id: If35344c08975e35085c7c2b9b814a3c457a144b0
Function: hasPermissionForActivity
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
Fixed Code:
public boolean hasPermissionForActivity(Intent intent, String srcPackage) {
// b/270152142
if (Intent.ACTION_CHOOSER.equals(intent.getAction())) {
final Bundle extras = intent.getExtras();
if (extras == null) {
return true;
}
// If given intent is ACTION_CHOOSER, verify srcPackage has permission over EXTRA_INTENT
intent = (Intent) extras.getParcelable(Intent.EXTRA_INTENT);
if (intent == null) {
return true;
}
}
ResolveInfo target = mPm.resolveActivity(intent, 0);
if (target == null) {
// Not a valid target
return false;
}
if (TextUtils.isEmpty(target.activityInfo.permission)) {
// No permission is needed
return true;
}
if (TextUtils.isEmpty(srcPackage)) {
// The activity requires some permission but there is no source.
return false;
}
// Source does not have sufficient permissions.
if(mPm.checkPermission(target.activityInfo.permission, srcPackage) !=
PackageManager.PERMISSION_GRANTED) {
return false;
}
// On M and above also check AppOpsManager for compatibility mode permissions.
if (TextUtils.isEmpty(AppOpsManager.permissionToOp(target.activityInfo.permission))) {
// There is no app-op for this permission, which could have been disabled.
return true;
}
// There is no direct way to check if the app-op is allowed for a particular app. Since
// app-op is only enabled for apps running in compatibility mode, simply block such apps.
try {
return mPm.getApplicationInfo(srcPackage, 0).targetSdkVersion >= Build.VERSION_CODES.M;
} catch (NameNotFoundException e) { }
return false;
}
|
[
"CWE-Other"
] |
CVE-2023-35682
|
HIGH
| 7.8
|
android
|
hasPermissionForActivity
|
src/com/android/launcher3/util/PackageManagerHelper.java
|
09f8b0e52e45a0b39bab457534ba2e5ae91ffad0
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void makePackageIdle(String packageName, int userId) {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: makePackageIdle() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
final int callingPid = Binder.getCallingPid();
userId = mUserController.handleIncomingUser(callingPid, Binder.getCallingUid(),
userId, true, ALLOW_FULL_ONLY, "makePackageIdle", null);
final long callingId = Binder.clearCallingIdentity();
try {
IPackageManager pm = AppGlobals.getPackageManager();
int pkgUid = -1;
try {
pkgUid = pm.getPackageUid(packageName, MATCH_UNINSTALLED_PACKAGES
| MATCH_DEBUG_TRIAGED_MISSING, UserHandle.USER_SYSTEM);
} catch (RemoteException e) {
}
if (pkgUid == -1) {
throw new IllegalArgumentException("Unknown package name " + packageName);
}
synchronized (this) {
try {
if (mLocalPowerManager != null) {
mLocalPowerManager.startUidChanges();
}
final int appId = UserHandle.getAppId(pkgUid);
for (int i = mProcessList.mActiveUids.size() - 1; i >= 0; i--) {
final UidRecord uidRec = mProcessList.mActiveUids.valueAt(i);
final long bgTime = uidRec.getLastBackgroundTime();
if (bgTime > 0 && !uidRec.isIdle()) {
final int uid = uidRec.getUid();
if (UserHandle.getAppId(uid) == appId) {
if (userId == UserHandle.USER_ALL
|| userId == UserHandle.getUserId(uid)) {
EventLogTags.writeAmUidIdle(uid);
synchronized (mProcLock) {
uidRec.setIdle(true);
uidRec.setSetIdle(true);
}
Slog.w(TAG, "Idling uid " + UserHandle.formatUid(uid)
+ " from package " + packageName + " user " + userId);
doStopUidLocked(uid, uidRec);
}
}
}
}
} finally {
if (mLocalPowerManager != null) {
mLocalPowerManager.finishUidChanges();
}
}
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makePackageIdle
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
makePackageIdle
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void uninstallPackageWithActiveAdmins(final String packageName) {
Preconditions.checkArgument(!TextUtils.isEmpty(packageName));
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(permission.MANAGE_DEVICE_ADMINS));
final int userId = caller.getUserId();
enforceUserUnlocked(userId);
final ComponentName profileOwner = getProfileOwnerAsUser(userId);
if (profileOwner != null && packageName.equals(profileOwner.getPackageName())) {
throw new IllegalArgumentException("Cannot uninstall a package with a profile owner");
}
final ComponentName deviceOwner = getDeviceOwnerComponent(/* callingUserOnly= */ false);
if (getDeviceOwnerUserId() == userId && deviceOwner != null
&& packageName.equals(deviceOwner.getPackageName())) {
throw new IllegalArgumentException("Cannot uninstall a package with a device owner");
}
final UserPackage packageUserPair = UserPackage.of(userId, packageName);
synchronized (getLockObject()) {
mPackagesToRemove.add(packageUserPair);
}
// All active admins on the user.
final List<ComponentName> allActiveAdmins = getActiveAdmins(userId);
// Active admins in the target package.
final List<ComponentName> packageActiveAdmins = new ArrayList<>();
if (allActiveAdmins != null) {
for (ComponentName activeAdmin : allActiveAdmins) {
if (packageName.equals(activeAdmin.getPackageName())) {
packageActiveAdmins.add(activeAdmin);
removeActiveAdmin(activeAdmin, userId);
}
}
}
if (packageActiveAdmins.size() == 0) {
startUninstallIntent(packageName, userId);
} else {
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
for (ComponentName activeAdmin : packageActiveAdmins) {
removeAdminArtifacts(activeAdmin, userId);
}
startUninstallIntent(packageName, userId);
}
}, DEVICE_ADMIN_DEACTIVATE_TIMEOUT); // Start uninstall after timeout anyway.
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uninstallPackageWithActiveAdmins
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
uninstallPackageWithActiveAdmins
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void handleTestCaseIssues(IssuesUpdateRequest issuesRequest) {
issuesService.handleTestCaseIssues(issuesRequest);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleTestCaseIssues
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
handleTestCaseIssues
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object createImage(byte[] bytes, int offset, int len) {
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inPreferredConfig = Bitmap.Config.ARGB_8888;
try {
BitmapFactory.Options.class.getField("inPurgeable").set(opts, true);
} catch (Exception e) {
// inPurgeable not supported
// http://www.droidnova.com/2d-sprite-animation-in-android-addendum,505.html
}
return BitmapFactory.decodeByteArray(bytes, offset, len, opts);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createImage
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
|
createImage
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean contains(CharSequence name) {
return headers.contains(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: contains
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
|
contains
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Analyze the following code function for security vulnerabilities
|
void getSurfaceTouchableRegion(Region region, WindowManager.LayoutParams attrs) {
final boolean modal = attrs.isModal();
if (modal) {
if (mActivityRecord != null) {
// Limit the outer touch to the activity root task region.
updateRegionForModalActivityWindow(region);
} else {
// Give it a large touchable region at first because it was touch modal. The window
// might be moved on the display, so the touchable region should be large enough to
// ensure it covers the whole display, no matter where it is moved.
getDisplayContent().getBounds(mTmpRect);
final int dw = mTmpRect.width();
final int dh = mTmpRect.height();
region.set(-dw, -dh, dw + dw, dh + dh);
}
subtractTouchExcludeRegionIfNeeded(region);
} else {
// Not modal
getTouchableRegion(region);
}
// Translate to surface based coordinates.
final Rect frame = mWindowFrames.mFrame;
if (frame.left != 0 || frame.top != 0) {
region.translate(-frame.left, -frame.top);
}
if (modal && mTouchableInsets == TOUCHABLE_INSETS_REGION) {
// The client gave us a touchable region and so first
// we calculate the untouchable region, then punch that out of our
// expanded modal region.
mTmpRegion.set(0, 0, frame.right, frame.bottom);
mTmpRegion.op(mGivenTouchableRegion, Region.Op.DIFFERENCE);
region.op(mTmpRegion, Region.Op.DIFFERENCE);
}
// TODO(b/139804591): sizecompat layout needs to be reworked. Currently mFrame is post-
// scaling but the existing logic doesn't expect that. The result is that the already-
// scaled region ends up getting sent to surfaceflinger which then applies the scale
// (again). Until this is resolved, apply an inverse-scale here.
if (mInvGlobalScale != 1.f) {
region.scale(mInvGlobalScale);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSurfaceTouchableRegion
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
|
getSurfaceTouchableRegion
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeResetGestureDetection(long nativeContentViewCoreImpl);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeResetGestureDetection
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
nativeResetGestureDetection
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException {
TrustManager[] trustAllCerts = new X509TrustManager[] {
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
@Override
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
};
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustAllCerts, new SecureRandom());
clientBuilder.sslContext(sslContext);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableCertificateValidation
File: samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
disableCertificateValidation
|
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void maybeValidateXml(File file) {
if (!file.getName().endsWith(".xml")) {
return;
}
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
try {
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException e) {
throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST)
.entity("Error configuring parser factory: " + e.getMessage()).build());
}
final CapturingErrorHandler errorHandler = new CapturingErrorHandler();
try {
final DocumentBuilder builder = factory.newDocumentBuilder();
builder.setErrorHandler(errorHandler);
builder.parse(file);
} catch (ParserConfigurationException | SAXException | IOException e) {
throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST)
.entity("Validation failed: " + e.getMessage()).build());
}
}
|
Vulnerability Classification:
- CWE: CWE-91
- CVE: CVE-2023-40612
- Severity: HIGH
- CVSS Score: 8.0
Description: NMS-15704: Added tests
Function: maybeValidateXml
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
Repository: OpenNMS/opennms
Fixed Code:
void maybeValidateXml(File file) {
if (!file.getName().endsWith(".xml")) {
return;
}
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
try {
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException e) {
throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST)
.entity("Error configuring parser factory: " + e.getMessage()).build());
}
final CapturingErrorHandler errorHandler = new CapturingErrorHandler();
try {
final DocumentBuilder builder = factory.newDocumentBuilder();
builder.setErrorHandler(errorHandler);
builder.parse(file);
} catch (ParserConfigurationException | SAXException | IOException e) {
throw new BadRequestException(Response.status(Response.Status.BAD_REQUEST)
.entity("Validation failed: " + e.getMessage()).build());
}
}
|
[
"CWE-91"
] |
CVE-2023-40612
|
HIGH
| 8
|
OpenNMS/opennms
|
maybeValidateXml
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
|
726328874812cfb5d0a28c5a76b3925e531928b7
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void initializeContainerComponent(XWikiContext context) throws ServletException
{
// Initialize the Container fields (request, response, session).
// Note that this is a bridge between the old core and the component architecture.
// In the new component architecture we use ThreadLocal to transport the request,
// response and session to components which require them.
// In the future this Servlet will be replaced by the XWikiPlexusServlet Servlet.
ServletContainerInitializer containerInitializer = Utils.getComponent(ServletContainerInitializer.class);
try {
containerInitializer.initializeRequest(context.getRequest().getHttpServletRequest(), context);
containerInitializer.initializeResponse(context.getResponse());
containerInitializer.initializeSession(context.getRequest().getHttpServletRequest());
} catch (ServletContainerException e) {
throw new ServletException("Failed to initialize Request/Response or Session", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initializeContainerComponent
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
initializeContainerComponent
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 0
|
Analyze the following code function for security vulnerabilities
|
public String dialogButtonRowStart() {
return dialogButtonRow(HTML_START);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dialogButtonRowStart
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2013-4600
|
MEDIUM
| 4.3
|
alkacon/opencms-core
|
dialogButtonRowStart
|
src/org/opencms/workplace/CmsDialog.java
|
72a05e3ea1cf692e2efce002687272e63f98c14a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void refreshRow(Object itemId) {
getParentGrid().datasourceExtension.updateRowData(itemId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: refreshRow
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
|
refreshRow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
private int fractionCountWithoutTrailingZeros() {
return Math.max(-scale, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fractionCountWithoutTrailingZeros
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
fractionCountWithoutTrailingZeros
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
public @CheckForNull <T extends Item> T getItemByFullName(String fullName, Class<T> type) {
StringTokenizer tokens = new StringTokenizer(fullName,"/");
ItemGroup parent = this;
if(!tokens.hasMoreTokens()) return null; // for example, empty full name.
while(true) {
Item item = parent.getItem(tokens.nextToken());
if(!tokens.hasMoreTokens()) {
if(type.isInstance(item))
return type.cast(item);
else
return null;
}
if(!(item instanceof ItemGroup))
return null; // this item can't have any children
if (!item.hasPermission(Item.READ))
return null; // XXX consider DISCOVER
parent = (ItemGroup) item;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItemByFullName
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
|
getItemByFullName
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private int getEncryptionStatus() {
if (mInjector.storageManagerIsFileBasedEncryptionEnabled()) {
return DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER;
} else {
return DevicePolicyManager.ENCRYPTION_STATUS_UNSUPPORTED;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEncryptionStatus
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
|
getEncryptionStatus
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
void logLockScreen(String msg) {
if (DEBUG_LOCKSCREEN) Slog.d(TAG, Debug.getCallers(2) + ":" + msg
+ " mLockScreenShown=" + lockScreenShownToString() + " mWakefulness="
+ PowerManagerInternal.wakefulnessToString(mWakefulness)
+ " mSleeping=" + mSleeping);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logLockScreen
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
logLockScreen
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int listAllTrash(ApiScenarioBatchRequest request) {
return extApiScenarioMapper.selectTrash(request.getProjectId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: listAllTrash
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
listAllTrash
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testPostRequestParsWithMaliciousRequest() throws WebdavException {
assertTrue(requestPars.processXml());
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-20000
- Severity: MEDIUM
- CVSS Score: 5.0
Description: format: follow the repo code style, and welcome mvnvm props to manage maven versions
Function: testPostRequestParsWithMaliciousRequest
File: src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java
Repository: Bedework/bw-webdav
Fixed Code:
@Test
public void testPostRequestParsWithMaliciousRequest() throws WebdavException {
assertTrue(requestPars.processXml());
}
|
[
"CWE-611"
] |
CVE-2018-20000
|
MEDIUM
| 5
|
Bedework/bw-webdav
|
testPostRequestParsWithMaliciousRequest
|
src/test/java/org/bedework/webdav/servlet/common/TestSecureXmlTypes.java
|
0ce2007b3515a23b5f287ef521300bcb1f748edc
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getGreaterOrEqualsConditionSQL(String column, Object param) {
String paramStr = getParameterSQL(param);
return column + " >= " + paramStr;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getGreaterOrEqualsConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
getGreaterOrEqualsConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getRobotNames() {
return "tested.robots.ConstructorHttpAttack,sample.Target";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRobotNames
File: robocode.tests/src/test/java/net/sf/robocode/test/robots/TestConstructorHttpAttack.java
Repository: robo-code/robocode
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2019-10648
|
HIGH
| 7.5
|
robo-code/robocode
|
getRobotNames
|
robocode.tests/src/test/java/net/sf/robocode/test/robots/TestConstructorHttpAttack.java
|
836c84635e982e74f2f2771b2c8640c3a34221bd
| 0
|
Analyze the following code function for security vulnerabilities
|
private String primaryPluginStatus() {
List<Map> externalPlugins = (List<Map>) primaryServerCommunicationService.getLatestPluginsStatus().get("external");
return externalPlugins.stream().map(map -> format("%s=%s", map.get("name"), map.get("md5"))).collect(Collectors.joining(", "));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: primaryPluginStatus
File: server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2021-43287
|
MEDIUM
| 5
|
gocd
|
primaryPluginStatus
|
server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java
|
41abc210ac4e8cfa184483c9ff1c0cc04fb3511c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void configureProcessor(NettyRequestSender requestSender, AtomicBoolean closed) {
final Processor httpProcessor = newHttpProcessor(config, nettyProviderConfig, requestSender, this, closed);
wsProcessor = newWsProcessor(config, nettyProviderConfig, requestSender, this, closed);
plainBootstrap.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline pipeline = ch.pipeline().addLast(HTTP_HANDLER, newHttpClientCodec());
if (config.isCompressionEnabled()) {
pipeline.addLast(INFLATER_HANDLER, new HttpContentDecompressor());
}
pipeline.addLast(CHUNKED_WRITER_HANDLER, new ChunkedWriteHandler())//
.addLast(HTTP_PROCESSOR, httpProcessor);
if (nettyProviderConfig.getHttpAdditionalChannelInitializer() != null) {
nettyProviderConfig.getHttpAdditionalChannelInitializer().initChannel(ch);
}
}
});
webSocketBootstrap.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.pipeline()//
.addLast(HTTP_HANDLER, newHttpClientCodec())//
.addLast(WS_PROCESSOR, wsProcessor);
if (nettyProviderConfig.getWsAdditionalChannelInitializer() != null) {
nettyProviderConfig.getWsAdditionalChannelInitializer().initChannel(ch);
}
}
});
secureBootstrap.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
SSLEngine sslEngine = createSSLEngine();
SslHandler sslHandler = new SslHandler(sslEngine);
if (handshakeTimeoutInMillis > 0)
sslHandler.setHandshakeTimeoutMillis(handshakeTimeoutInMillis);
ChannelPipeline pipeline = ch.pipeline()//
.addLast(SSL_HANDLER, sslHandler)//
.addLast(HTTP_HANDLER, newHttpClientCodec());
if (config.isCompressionEnabled()) {
pipeline.addLast(INFLATER_HANDLER, new HttpContentDecompressor());
}
pipeline.addLast(CHUNKED_WRITER_HANDLER, new ChunkedWriteHandler())//
.addLast(HTTP_PROCESSOR, httpProcessor);
if (nettyProviderConfig.getHttpsAdditionalChannelInitializer() != null) {
nettyProviderConfig.getHttpsAdditionalChannelInitializer().initChannel(ch);
}
}
});
secureWebSocketBootstrap.handler(new ChannelInitializer<Channel>() {
@Override
protected void initChannel(Channel ch) throws Exception {
ch.pipeline()//
.addLast(SSL_HANDLER, new SslHandler(createSSLEngine()))//
.addLast(HTTP_HANDLER, newHttpClientCodec())//
.addLast(WS_PROCESSOR, wsProcessor);
if (nettyProviderConfig.getWssAdditionalChannelInitializer() != null) {
nettyProviderConfig.getWssAdditionalChannelInitializer().initChannel(ch);
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configureProcessor
File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
configureProcessor
|
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int read(byte[] b, int off, int len) throws IOException {
return cipherInputStream.read(b, off, len);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: read
File: src/main/java/net/lingala/zip4j/io/inputstream/DecompressedInputStream.java
Repository: srikanth-lingala/zip4j
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2023-22899
|
MEDIUM
| 5.9
|
srikanth-lingala/zip4j
|
read
|
src/main/java/net/lingala/zip4j/io/inputstream/DecompressedInputStream.java
|
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<DictModel> queryTableDictItemsByCodeAndFilter(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("filterSql") String filterSql);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryTableDictItemsByCodeAndFilter
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45207
|
CRITICAL
| 9.8
|
jeecgboot/jeecg-boot
|
queryTableDictItemsByCodeAndFilter
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
|
8632a835c23f558dfee3584d7658cc6a13ccec6f
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean exists(EntityReference reference) throws Exception
{
GetMethod getMethod = executeGet(reference);
getMethod.releaseConnection();
return getMethod.getStatusCode() == Status.OK.getStatusCode();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exists
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
|
exists
|
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
|
@Deprecated(since = "2.2M2")
public List getListValue(String className, String fieldName)
{
return getListValue(resolveClassReference(className), fieldName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getListValue
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
|
getListValue
|
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
|
@RequiresPermission(value = MANAGE_DEVICE_POLICY_WIFI, conditional = true)
@Nullable
public WifiSsidPolicy getWifiSsidPolicy() {
throwIfParentInstance("getWifiSsidPolicy");
if (mService == null) {
return null;
}
try {
return mService.getWifiSsidPolicy(mContext.getPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWifiSsidPolicy
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
|
getWifiSsidPolicy
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setHeaders(HttpExchange pExchange) {
String origin = requestHandler.extractCorsOrigin(pExchange.getRequestHeaders().getFirst("Origin"));
Headers headers = pExchange.getResponseHeaders();
if (origin != null) {
headers.set("Access-Control-Allow-Origin",origin);
headers.set("Access-Control-Allow-Credentials","true");
}
// Avoid caching at all costs
headers.set("Cache-Control", "no-cache");
headers.set("Pragma","no-cache");
// Check for a date header and set it accordingly to the recommendations of
// RFC-2616. See also {@link AgentServlet#setNoCacheHeaders()}
// Issue: #71
Calendar cal = Calendar.getInstance();
headers.set("Date",rfc1123Format.format(cal.getTime()));
// 1h in the past since it seems, that some servlet set the date header on their
// own so that it cannot be guaranteed that these headers are really equals.
// It happened on Tomcat that "Date:" was finally set *before* "Expires:" in the final
// answers sometimes which seems to be an implementation peculiarity from Tomcat
cal.add(Calendar.HOUR, -1);
headers.set("Expires",rfc1123Format.format(cal.getTime()));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeaders
File: agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2014-0168
|
MEDIUM
| 6.8
|
jolokia
|
setHeaders
|
agent/jvm/src/main/java/org/jolokia/jvmagent/JolokiaHttpHandler.java
|
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setMediaPlaybackState(int state) {
PlaybackStateCompat.Builder playbackstateBuilder = new PlaybackStateCompat.Builder();
if( state == PlaybackStateCompat.STATE_PLAYING ) {
playbackstateBuilder.setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PAUSE | PlaybackStateCompat.ACTION_SKIP_TO_NEXT | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS);
} else {
playbackstateBuilder.setActions(PlaybackStateCompat.ACTION_PLAY_PAUSE | PlaybackStateCompat.ACTION_PLAY | PlaybackStateCompat.ACTION_SKIP_TO_NEXT | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS);
}
playbackstateBuilder.setState(state, PlaybackStateCompat.PLAYBACK_POSITION_UNKNOWN, 0);
mMediaSessionCompat.setPlaybackState(playbackstateBuilder.build());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMediaPlaybackState
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
setMediaPlaybackState
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public MessagingStyle setGroupConversation(boolean isGroupConversation) {
mIsGroupConversation = isGroupConversation;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setGroupConversation
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setGroupConversation
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getLocalKey()
{
if (this.localKeyCache == null) {
this.localKeyCache =
LocalUidStringEntityReferenceSerializer.INSTANCE.serialize(getDocumentReferenceWithLocale());
}
return this.localKeyCache;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocalKey
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getLocalKey
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
private void init() {
Jiffle.refCount++ ;
// TODO - CollectionFactory
imageParams = new HashMap<String, Jiffle.ImageRole>();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: init
File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
Repository: geosolutions-it/jai-ext
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-24816
|
HIGH
| 7.5
|
geosolutions-it/jai-ext
|
init
|
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
|
cb1d6565d38954676b0a366da4f965fef38da1cb
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void recoverAbusiveSortOrder(@NonNull Bundle queryArgs) {
final String origSortOrder = queryArgs.getString(QUERY_ARG_SQL_SORT_ORDER);
final String origLimit = queryArgs.getString(QUERY_ARG_SQL_LIMIT);
final int index = (origSortOrder != null)
? origSortOrder.toUpperCase(Locale.ROOT).indexOf(" LIMIT ") : -1;
if (index != -1) {
String sortOrder = origSortOrder.substring(0, index);
String limit = origSortOrder.substring(index + " LIMIT ".length());
// Yell if we already had a limit requested
if (!TextUtils.isEmpty(origLimit)) {
throw new IllegalArgumentException(
"Abusive '" + limit + "' conflicts with requested '" + origLimit + "'");
}
Log.w(TAG, "Recovered abusive '" + sortOrder + "' and '" + limit + "' from '"
+ origSortOrder + "'");
queryArgs.putString(QUERY_ARG_SQL_SORT_ORDER, sortOrder);
queryArgs.putString(QUERY_ARG_SQL_LIMIT, limit);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: recoverAbusiveSortOrder
File: src/com/android/providers/media/util/DatabaseUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2023-35683
|
MEDIUM
| 5.5
|
android
|
recoverAbusiveSortOrder
|
src/com/android/providers/media/util/DatabaseUtils.java
|
23d156ed1bed6d2c2b325f0be540d0afca510c49
| 0
|
Analyze the following code function for security vulnerabilities
|
static boolean equalsn(byte a1[], byte a2[]) {
int length = a2.length;
for (int k = 0; k < length; ++k) {
if (a1[k] != a2[k])
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equalsn
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
equalsn
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
public final void removeService(PackageParser.Service s) {
mServices.remove(s.getComponentName());
if (DEBUG_SHOW_INFO) {
Log.v(TAG, " " + (s.info.nonLocalizedLabel != null
? s.info.nonLocalizedLabel : s.info.name) + ":");
Log.v(TAG, " Class=" + s.info.name);
}
final int NI = s.intents.size();
int j;
for (j=0; j<NI; j++) {
PackageParser.ServiceIntentInfo intent = s.intents.get(j);
if (DEBUG_SHOW_INFO) {
Log.v(TAG, " IntentFilter:");
intent.dump(new LogPrinter(Log.VERBOSE, TAG), " ");
}
removeFilter(intent);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeService
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
|
removeService
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public String path() {
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: path
File: src/main/java/jodd/http/HttpRequest.java
Repository: oblac/jodd-http
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2022-29631
|
MEDIUM
| 5
|
oblac/jodd-http
|
path
|
src/main/java/jodd/http/HttpRequest.java
|
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
| 0
|
Analyze the following code function for security vulnerabilities
|
private String noParameters(String uri) {
final int pos = uri.indexOf("?");
if (pos > 0) {
uri = uri.substring(0, pos);
}
if (uri.equals("/")) {
uri = "";
}
return uri;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: noParameters
File: src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
Repository: Bedework/bw-webdav
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20000
|
MEDIUM
| 5
|
Bedework/bw-webdav
|
noParameters
|
src/main/java/org/bedework/webdav/servlet/common/PostRequestPars.java
|
67283fb8b9609acdb1a8d2e7fefe195b4a261062
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String issueJwt(String subject, Long period, List<String> roles){
String id = UUID.randomUUID().toString();
String issuer = "sureness-token-server";
return issueJwt(id, subject, issuer, period,
roles, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: issueJwt
File: core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
Repository: dromara/sureness
The code follows secure coding practices.
|
[
"CWE-798"
] |
CVE-2023-31581
|
CRITICAL
| 9.8
|
dromara/sureness
|
issueJwt
|
core/src/main/java/com/usthe/sureness/util/JsonWebTokenUtil.java
|
4f5fefaf673168d74820020a191fab2904629742
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void setVerticalPanelTranslation(float translation) {
mNotificationStackScroller.setTranslationX(translation);
mQsFrame.setTranslationX(translation);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVerticalPanelTranslation
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
|
setVerticalPanelTranslation
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationAsFloat01() throws Exception
{
Duration value = READER.with(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
.readValue("60.0");
assertNotNull("The value should not be null.", value);
Duration exp = Duration.ofSeconds(60L, 0);
assertEquals("The value is not correct.", exp, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationAsFloat01
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationAsFloat01
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onFastForward() {
super.onFastForward();
RemoteControlCallback.fastForward();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFastForward
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
onFastForward
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAllowUnsafe() {
return allowUnsafe;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAllowUnsafe
File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
isAllowUnsafe
|
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("getLockObject()")
private void maybePauseDeviceWideLoggingLocked() {
if (!areAllUsersAffiliatedWithDeviceLocked()) {
if (mOwners.hasDeviceOwner()) {
Slogf.i(LOG_TAG, "There are unaffiliated users, network logging will be "
+ "paused if enabled.");
if (mNetworkLogger != null) {
mNetworkLogger.pause();
}
}
// TODO: We need to also enable this when someone is managing using permission
if (!isOrganizationOwnedDeviceWithManagedProfile()) {
Slogf.i(LOG_TAG,
"Not org-owned managed profile device, security logging will be "
+ "paused if enabled.");
mSecurityLogMonitor.pause();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybePauseDeviceWideLoggingLocked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
maybePauseDeviceWideLoggingLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String tag() {
if (getPara(0) != null) {
String tag = convertRequestParam(getPara(0));
setPageInfo(Constants.getArticleUri() + "tag/" + getPara(0) + "-", new Log().findByTag(getParaToInt(1, 1), getDefaultRows(), tag), getParaToInt(1, 1));
setAttr("tipsType", I18nUtil.getStringFromRes("tag"));
setAttr("tipsName", tag);
}
return "page";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: tag
File: web/src/main/java/com/zrlog/web/controller/blog/ArticleController.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21316
|
MEDIUM
| 4.3
|
94fzb/zrlog
|
tag
|
web/src/main/java/com/zrlog/web/controller/blog/ArticleController.java
|
b921c1ae03b8290f438657803eee05226755c941
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getXObjectSize(EntityReference classReference)
{
return getXObjectSize(resolveClassReference(classReference));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXObjectSize
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getXObjectSize
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return "SimData{state=" + simState + ",slotId=" + slotId + ",subId=" + subId + "}";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
toString
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getHeaderCaption() throws IllegalStateException {
checkColumnIsAttached();
return state.headerCaption;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeaderCaption
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
|
getHeaderCaption
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int subWindowTypeToLayerLw(int type) {
switch (type) {
case TYPE_APPLICATION_PANEL:
case TYPE_APPLICATION_ATTACHED_DIALOG:
return APPLICATION_PANEL_SUBLAYER;
case TYPE_APPLICATION_MEDIA:
return APPLICATION_MEDIA_SUBLAYER;
case TYPE_APPLICATION_MEDIA_OVERLAY:
return APPLICATION_MEDIA_OVERLAY_SUBLAYER;
case TYPE_APPLICATION_SUB_PANEL:
return APPLICATION_SUB_PANEL_SUBLAYER;
}
Log.e(TAG, "Unknown sub-window type: " + type);
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: subWindowTypeToLayerLw
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
subWindowTypeToLayerLw
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onOffHostAidSelected() {
Log.d(TAG, "notifyOffHostAidSelected");
synchronized (mLock) {
if (mState != STATE_XFER || mActiveService == null) {
// Don't bother telling, we're not bound to any service yet
} else {
sendDeactivateToActiveServiceLocked(HostApduService.DEACTIVATION_DESELECTED);
}
mActiveService = null;
mActiveServiceName = null;
mActiveServiceUserId = -1;
unbindServiceIfNeededLocked();
mState = STATE_W4_SELECT;
//close the TapAgainDialog
Intent intent = new Intent(TapAgainDialog.ACTION_CLOSE);
intent.setPackage("com.android.nfc");
mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onOffHostAidSelected
File: src/com/android/nfc/cardemulation/HostEmulationManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35671
|
MEDIUM
| 5.5
|
android
|
onOffHostAidSelected
|
src/com/android/nfc/cardemulation/HostEmulationManager.java
|
745632835f3d97513a9c2a96e56e1dc06c4e4176
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isComplianceAcknowledgementRequired() {
throwIfParentInstance("isComplianceAcknowledgementRequired");
if (mService != null) {
try {
return mService.isComplianceAcknowledgementRequired();
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isComplianceAcknowledgementRequired
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
|
isComplianceAcknowledgementRequired
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void beginLink(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
{
// Ensure the link renderer is using the latest printer since the original printer used could have been
// superseded by another one in the printer stack.
this.linkRenderer.setXHTMLWikiPrinter(getXHTMLWikiPrinter());
// If the ResourceReference doesn't have a base reference specified, then look for one in previously sent
// events (it's sent in begin/endMetaData events).
List<String> baseReferences = reference.getBaseReferences();
if (baseReferences.isEmpty()) {
reference.addBaseReferences(getMetaDataState().<String>getAllMetaData(MetaData.BASE));
}
this.linkRenderer.beginLink(reference, freestanding, parameters);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: beginLink
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
beginLink
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void assertStatuses(int actualCode, int... expectedCodes)
{
if (!ArrayUtils.contains(expectedCodes, actualCode)) {
fail(String.format("Unexpected code [%s], was expecting one of [%s]",
actualCode, Arrays.toString(expectedCodes)));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: assertStatuses
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
|
assertStatuses
|
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
|
@SuppressWarnings("unchecked")
static boolean isInitialized(MessageOrBuilder message) {
// Check that all required fields are present.
for (final Descriptors.FieldDescriptor field : message.getDescriptorForType().getFields()) {
if (field.isRequired()) {
if (!message.hasField(field)) {
return false;
}
}
}
// Check that embedded messages are initialized.
for (final Map.Entry<Descriptors.FieldDescriptor, Object> entry :
message.getAllFields().entrySet()) {
final Descriptors.FieldDescriptor field = entry.getKey();
if (field.getJavaType() == Descriptors.FieldDescriptor.JavaType.MESSAGE) {
if (field.isRepeated()) {
for (final Message element : (List<Message>) entry.getValue()) {
if (!element.isInitialized()) {
return false;
}
}
} else {
if (!((Message) entry.getValue()).isInitialized()) {
return false;
}
}
}
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInitialized
File: java/core/src/main/java/com/google/protobuf/MessageReflection.java
Repository: protocolbuffers/protobuf
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-3509
|
HIGH
| 7.5
|
protocolbuffers/protobuf
|
isInitialized
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 0
|
Analyze the following code function for security vulnerabilities
|
private void _setToDoubleFast(double n) {
isApproximate = true;
origDouble = n;
origDelta = 0;
// NOTE: Unlike ICU4C, doubles are always IEEE 754 doubles.
long ieeeBits = Double.doubleToLongBits(n);
int exponent = (int) ((ieeeBits & 0x7ff0000000000000L) >> 52) - 0x3ff;
// Not all integers can be represented exactly for exponent > 52
if (exponent <= 52 && (long) n == n) {
_setToLong((long) n);
return;
}
// 3.3219... is log2(10)
int fracLength = (int) ((52 - exponent) / 3.32192809489);
if (fracLength >= 0) {
int i = fracLength;
// 1e22 is the largest exact double.
for (; i >= 22; i -= 22)
n *= 1e22;
n *= DOUBLE_MULTIPLIERS[i];
} else {
int i = fracLength;
// 1e22 is the largest exact double.
for (; i <= -22; i += 22)
n /= 1e22;
n /= DOUBLE_MULTIPLIERS[-i];
}
long result = Math.round(n);
if (result != 0) {
_setToLong(result);
scale -= fracLength;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _setToDoubleFast
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
_setToDoubleFast
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressLint("NullableCollection")
@RequiresPermission(value = MANAGE_DEVICE_POLICY_SECURITY_LOGGING, conditional = true)
public @Nullable List<SecurityEvent> retrievePreRebootSecurityLogs(
@Nullable ComponentName admin) {
throwIfParentInstance("retrievePreRebootSecurityLogs");
try {
ParceledListSlice<SecurityEvent> list = mService.retrievePreRebootSecurityLogs(
admin, mContext.getPackageName());
if (list != null) {
return list.getList();
} else {
return null;
}
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: retrievePreRebootSecurityLogs
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
|
retrievePreRebootSecurityLogs
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getEncodePath(String path, String queryString) {
String url = path;
try {
if (CommonUtils.notEmpty(queryString)) {
url += "?" + queryString;
}
url = URLEncoder.encode(url, Constants.DEFAULT_CHARSET_NAME);
} catch (UnsupportedEncodingException e) {
url = Constants.BLANK;
}
return url;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEncodePath
File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
getEncodePath
|
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void cardinalityEstimatorXmlGenerator(XmlGenerator gen, Config config) {
for (CardinalityEstimatorConfig ex : config.getCardinalityEstimatorConfigs().values()) {
MergePolicyConfig mergePolicyConfig = ex.getMergePolicyConfig();
gen.open("cardinality-estimator", "name", ex.getName())
.node("backup-count", ex.getBackupCount())
.node("async-backup-count", ex.getAsyncBackupCount())
.node("quorum-ref", ex.getQuorumName())
.node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize())
.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cardinalityEstimatorXmlGenerator
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
cardinalityEstimatorXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("mPm.mLock")
public void checkExistingBetterPackages(ArrayMap<String, File> expectingBetterPackages,
List<String> stubSystemApps, int systemScanFlags, int systemParseFlags) {
for (int i = 0; i < expectingBetterPackages.size(); i++) {
final String packageName = expectingBetterPackages.keyAt(i);
if (mPm.mPackages.containsKey(packageName)) {
continue;
}
final File scanFile = expectingBetterPackages.valueAt(i);
logCriticalInfo(Log.WARN, "Expected better " + packageName
+ " but never showed up; reverting to system");
final Pair<Integer, Integer> rescanAndReparseFlags =
mPm.getSystemPackageRescanFlagsAndReparseFlags(scanFile,
systemScanFlags, systemParseFlags);
@PackageManagerService.ScanFlags int rescanFlags = rescanAndReparseFlags.first;
@ParsingPackageUtils.ParseFlags int reparseFlags = rescanAndReparseFlags.second;
if (rescanFlags == 0) {
Slog.e(TAG, "Ignoring unexpected fallback path " + scanFile);
continue;
}
mPm.mSettings.enableSystemPackageLPw(packageName);
try {
final AndroidPackage newPkg = scanSystemPackageTracedLI(
scanFile, reparseFlags, rescanFlags, null);
// We rescanned a stub, add it to the list of stubbed system packages
if (newPkg.isStub()) {
stubSystemApps.add(packageName);
}
} catch (PackageManagerException e) {
Slog.e(TAG, "Failed to parse original system package: "
+ e.getMessage());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkExistingBetterPackages
File: services/core/java/com/android/server/pm/InstallPackageHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21257
|
HIGH
| 7.8
|
android
|
checkExistingBetterPackages
|
services/core/java/com/android/server/pm/InstallPackageHelper.java
|
1aec7feaf07e6d4568ca75d18158445dbeac10f6
| 0
|
Analyze the following code function for security vulnerabilities
|
public @NonNull DevicePolicyManager getParentProfileInstance(@NonNull ComponentName admin) {
throwIfParentInstance("getParentProfileInstance");
try {
if (!mService.isManagedProfile(admin)) {
throw new SecurityException("The current user does not have a parent profile.");
}
return new DevicePolicyManager(mContext, mService, true);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParentProfileInstance
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
|
getParentProfileInstance
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean finishActivityAffinity(IBinder token) {
synchronized(this) {
final long origId = Binder.clearCallingIdentity();
try {
ActivityRecord r = ActivityRecord.isInStackLocked(token);
if (r == null) {
return false;
}
// Do not allow task to finish if last task in lockTask mode. Launchable priv-apps
// can finish.
final TaskRecord task = r.getTask();
if (mLockTaskController.activityBlockedFromFinish(r)) {
return false;
}
return task.getStack().finishActivityAffinityLocked(r);
} finally {
Binder.restoreCallingIdentity(origId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishActivityAffinity
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
|
finishActivityAffinity
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void start(boolean pLazy) {
Restrictor restrictor = createRestrictor();
backendManager = new BackendManager(configuration, logHandler, restrictor, pLazy);
requestHandler = new HttpRequestHandler(configuration, backendManager, logHandler);
if (listenForDiscoveryMcRequests(configuration)) {
try {
discoveryMulticastResponder = new DiscoveryMulticastResponder(backendManager, restrictor, logHandler);
discoveryMulticastResponder.start();
} catch (IOException e) {
logHandler.error("Cannot start discovery multicast handler: " + e, e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: start
File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
Repository: jolokia
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-1000129
|
MEDIUM
| 4.3
|
jolokia
|
start
|
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
|
5895d5c137c335e6b473e9dcb9baf748851bbc5f
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isQuotedArgumentsEnabled()
{
return quotedArgumentsEnabled;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isQuotedArgumentsEnabled
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
|
isQuotedArgumentsEnabled
|
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void createWiki(String wikiName, XWikiContext inputxcontext) throws XWikiException
{
XWikiContext context = getExecutionXContext(inputxcontext, false);
boolean bTransaction = true;
String database = context.getWikiId();
AtomicReference<Statement> stmt = new AtomicReference<>(null);
bTransaction = beginTransaction(context);
try {
Session session = getSession(context);
session.doWork(connection -> {
stmt.set(connection.createStatement());
Statement statement = stmt.get();
String schema = getSchemaFromWikiName(wikiName, context);
String escapedSchema = escapeSchema(schema, context);
DatabaseProduct databaseProduct = getDatabaseProductName();
if (DatabaseProduct.ORACLE == databaseProduct) {
// Notes:
// - We use default tablespaces (which mean the USERS and TEMP tablespaces) to make it simple.
// We also don't know which tablespace was used to create the main wiki and creating a new one
// here would make things more complex (we would need to check if it exists already for example).
// - We must specify a quota on the USERS tablespace so that the user can create objects (like
// tables). Note that tables are created deferred by default so you'd think the user can create
// them without quotas set but that's because tables are created deferred by default and thus
// they'll fail when the first data is written in them.
// See https://dba.stackexchange.com/a/254950
// - Depending on how it's configured, the default users tablespace size might be too small. Thus
// it's up to a DBA to make sure it's large enough.
statement.execute(String.format("CREATE USER %s IDENTIFIED BY %s QUOTA UNLIMITED ON USERS",
escapedSchema, escapedSchema));
} else if (DatabaseProduct.DERBY == databaseProduct || DatabaseProduct.DB2 == databaseProduct
|| DatabaseProduct.H2 == databaseProduct) {
statement.execute("CREATE SCHEMA " + escapedSchema);
} else if (DatabaseProduct.HSQLDB == databaseProduct) {
statement.execute("CREATE SCHEMA " + escapedSchema + " AUTHORIZATION DBA");
} else if (DatabaseProduct.MYSQL == databaseProduct) {
StringBuilder statementBuilder = new StringBuilder("create database " + escapedSchema);
String[] charsetAndCollation = getCharsetAndCollation(wikiName, session, context);
statementBuilder.append(" CHARACTER SET ");
statementBuilder.append(charsetAndCollation[0]);
statementBuilder.append(" COLLATE ");
statementBuilder.append(charsetAndCollation[1]);
statement.execute(statementBuilder.toString());
} else if (DatabaseProduct.POSTGRESQL == databaseProduct) {
if (isInSchemaMode()) {
statement.execute("CREATE SCHEMA " + escapedSchema);
} else {
this.logger.error("Creation of a new database is currently only supported in the schema mode, "
+ "see https://jira.xwiki.org/browse/XWIKI-8753");
}
} else {
statement.execute("create database " + escapedSchema);
}
});
if (bTransaction) {
endTransaction(context, true);
}
} catch (Exception e) {
Object[] args = {wikiName};
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
XWikiException.ERROR_XWIKI_STORE_HIBERNATE_CREATE_DATABASE, "Exception while create wiki database {0}",
e, args);
} finally {
context.setWikiId(database);
try {
Statement statement = stmt.get();
if (statement != null) {
statement.close();
}
} catch (Exception e) {
}
try {
if (bTransaction) {
endTransaction(context, false);
}
} catch (Exception e) {
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createWiki
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
createWiki
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
com.codename1.io.Log.p("["+consoleMessage.messageLevel()+"] "+consoleMessage.message()+" On line "+consoleMessage.lineNumber()+" of "+consoleMessage.sourceId());
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onConsoleMessage
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
|
onConsoleMessage
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void registerEncoder(Encoder encoder) {
EncoderRegistry encoderRegistry = embeddedCache.getAdvancedCache().getComponentRegistry()
.getGlobalComponentRegistry().getComponent(EncoderRegistry.class);
encoderRegistry.registerEncoder(encoder);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerEncoder
File: integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
Repository: infinispan
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2017-15089
|
MEDIUM
| 6.5
|
infinispan
|
registerEncoder
|
integrationtests/compatibility-mode-it/src/test/java/org/infinispan/it/compatibility/CompatibilityCacheFactory.java
|
69be66141eee7abb1c47d46f0a6b74b079709f4b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public DeletedDocument getDeletedDocument(String fullname, String locale, String index) throws XWikiException
{
return getDeletedDocument(index);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeletedDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getDeletedDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
private String innerQueryProvider( Set<String> uids, Set<String> userOrgUnitPaths, User currentUser )
{
Stream<String> queryParts = Stream.of(
getInnerQuerySql(),
getUidsFilter( uids ) );
if ( nonSuperUser( currentUser ) )
{
queryParts = Stream.concat( queryParts,
Stream.of(
"and",
getUserOrgUnitPathsFilter( userOrgUnitPaths ) ) );
}
queryParts = Stream.concat( queryParts, Stream.of( INNER_QUERY_GROUPING_BY ) );
return queryParts.collect( joining( " " ) );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: innerQueryProvider
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
innerQueryProvider
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isDefaultOrientationForced() {
return mForceDefaultOrientation;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDefaultOrientationForced
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
isDefaultOrientationForced
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
public static long findContentLength(final int id, FileDownloadConnection connection) {
long contentLength = convertContentLengthString(
connection.getResponseHeaderField("Content-Length"));
final String transferEncoding = connection.getResponseHeaderField("Transfer-Encoding");
if (contentLength < 0) {
final boolean isEncodingChunked = transferEncoding != null && transferEncoding
.equals("chunked");
if (!isEncodingChunked) {
// not chunked transfer encoding data
if (FileDownloadProperties.getImpl().httpLenient) {
// do not response content-length either not chunk transfer encoding,
// but HTTP lenient is true, so handle as the case of transfer encoding chunk
contentLength = TOTAL_VALUE_IN_CHUNKED_RESOURCE;
if (FileDownloadLog.NEED_LOG) {
FileDownloadLog
.d(FileDownloadUtils.class, "%d response header is not legal but "
+ "HTTP lenient is true, so handle as the case of "
+ "transfer encoding chunk", id);
}
} else {
throw new FileDownloadGiveUpRetryException("can't know the size of the "
+ "download file, and its Transfer-Encoding is not Chunked "
+ "either.\nyou can ignore such exception by add "
+ "http.lenient=true to the filedownloader.properties");
}
} else {
contentLength = TOTAL_VALUE_IN_CHUNKED_RESOURCE;
}
}
return contentLength;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findContentLength
File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
Repository: lingochamp/FileDownloader
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-11248
|
HIGH
| 7.5
|
lingochamp/FileDownloader
|
findContentLength
|
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getPrlVersion() {
return mPrlVersion;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrlVersion
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
getPrlVersion
|
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
private void installPermission(Invocation ai) {
String template = null;
if (!ZrLogConfig.isInstalled()) {
ai.invoke();
if (ai.getReturnValue() != null) {
template = ai.getReturnValue();
}
} else {
ai.getController().getRequest().setAttribute("errorMsg", ((Map) ai.getController().getRequest().getAttribute("_res")).get("installed"));
}
if (template == null) {
template = "/install/forbidden";
}
ai.getController().setAttr("currentViewName", template.substring("/install/".length()));
ai.getController().render(new FreeMarkerRender(template + ".ftl"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: installPermission
File: web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java
Repository: 94fzb/zrlog
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21316
|
MEDIUM
| 4.3
|
94fzb/zrlog
|
installPermission
|
web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java
|
b921c1ae03b8290f438657803eee05226755c941
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Policy[] newArray(int size) {
return new Policy[size];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newArray
File: framework/java/android/net/wifi/hotspot2/pps/Policy.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21240
|
MEDIUM
| 5.5
|
android
|
newArray
|
framework/java/android/net/wifi/hotspot2/pps/Policy.java
|
69119d1d3102e27b6473c785125696881bce9563
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object fromXML(Reader xml, Object root) {
return unmarshal(hierarchicalStreamDriver.createReader(xml), root);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fromXML
File: xstream/src/java/com/thoughtworks/xstream/XStream.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
fromXML
|
xstream/src/java/com/thoughtworks/xstream/XStream.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract BaseXMLBuilder attr(String name, String value);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attr
File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
attr
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Bundle nonNull(@Nullable Bundle in) {
return in != null ? in : new Bundle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nonNull
File: services/core/java/com/android/server/pm/UserRestrictionsUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3876
|
HIGH
| 7.2
|
android
|
nonNull
|
services/core/java/com/android/server/pm/UserRestrictionsUtils.java
|
91fc934bb2e5ea59929bb2f574de6db9b5100745
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean shouldStartActivity() {
return mVisibleRequested && (isState(STOPPED) || isState(STOPPING));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldStartActivity
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
shouldStartActivity
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String formatXMLContent(String content) throws TransformerFactoryConfigurationError,
TransformerException
{
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
StreamResult result = new StreamResult(new StringWriter());
// Use a SAX Source instead of a StreamSource so that we can control the XMLReader used and set up one that
// doesn't resolve entities (and thus doesn't go out on the internet to fetch DTDs!).
SAXSource source = new SAXSource(new InputSource(new StringReader(content)));
try {
XMLReader reader = org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
reader.setEntityResolver(new org.xml.sax.EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException
{
// Return an empty resolved entity. Note that we don't return null since this would tell the reader
// to go on the internet to fetch the DTD.
return new InputSource(new StringReader(""));
}
});
source.setXMLReader(reader);
} catch (Exception e) {
throw new TransformerException(String.format(
"Failed to create XML Reader while pretty-printing content [%s]", content), e);
}
transformer.transform(source, result);
return result.getWriter().toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formatXMLContent
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
Repository: xwiki/xwiki-commons
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-24898
|
MEDIUM
| 4
|
xwiki/xwiki-commons
|
formatXMLContent
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/XMLUtils.java
|
947e8921ebd95462d5a7928f397dd1b64f77c7d5
| 0
|
Analyze the following code function for security vulnerabilities
|
private ApplicationParams getApplicationParams(Document androidManifest, Document appStrings) {
Element manifest = (Element) androidManifest.getElementsByTagName("manifest").item(0);
Element usesSdk = (Element) androidManifest.getElementsByTagName("uses-sdk").item(0);
Element application = (Element) androidManifest.getElementsByTagName("application").item(0);
Integer versionCode = Integer.valueOf(manifest.getAttribute("android:versionCode"));
String versionName = manifest.getAttribute("android:versionName");
Integer minSdk = Integer.valueOf(usesSdk.getAttribute("android:minSdkVersion"));
Integer targetSdk = Integer.valueOf(usesSdk.getAttribute("android:targetSdkVersion"));
String appName = "UNKNOWN";
if (application.hasAttribute("android:label")) {
String appLabelName = application.getAttribute("android:label");
if (appLabelName.startsWith("@string")) {
appLabelName = appLabelName.split("/")[1];
NodeList strings = appStrings.getElementsByTagName("string");
for (int i = 0; i < strings.getLength(); i++) {
String stringName = strings.item(i)
.getAttributes()
.getNamedItem("name")
.getNodeValue();
if (stringName.equals(appLabelName)) {
appName = strings.item(i).getTextContent();
break;
}
}
} else {
appName = appLabelName;
}
}
return new ApplicationParams(appName, minSdk, targetSdk, versionCode, versionName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApplicationParams
File: jadx-core/src/main/java/jadx/core/export/ExportGradleProject.java
Repository: skylot/jadx
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0219
|
MEDIUM
| 4.3
|
skylot/jadx
|
getApplicationParams
|
jadx-core/src/main/java/jadx/core/export/ExportGradleProject.java
|
d22db30166e7cb369d72be41382bb63ac8b81c52
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setProcessLimit(int max) {
enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT,
"setProcessLimit()");
synchronized (this) {
mProcessLimit = max < 0 ? ProcessList.MAX_CACHED_APPS : max;
mProcessLimitOverride = max;
}
trimApplications();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setProcessLimit
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
setProcessLimit
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
mInputConnection.setTarget(super.onCreateInputConnection(outAttrs));
return mInputConnection;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreateInputConnection
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
onCreateInputConnection
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
private String trimLeadingSlash(String s) {
if (s.charAt(0) == '/') {
return s.substring(1);
} else {
return s;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: trimLeadingSlash
File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-14371
|
MEDIUM
| 5
|
eclipse-ee4j/mojarra
|
trimLeadingSlash
|
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
|
1b434748d9239f42eae8aa7d37d7a0930c061e24
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String getParameter(HttpServletRequest request, String name, String defaultValue) {
String value = request.getParameter(name);
if (value == null || value.isEmpty() && defaultValue != null && !defaultValue.isEmpty()) {
return defaultValue;
}
return value;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParameter
File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-0869
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
getParameter
|
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
|
66b4ba96a18b9952f25a350bbccc2a7e206238d1
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object opt(int index) {
return (index < 0 || index >= length()) ?
null : this.myArrayList.get(index);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: opt
File: src/main/java/org/codehaus/jettison/json/JSONArray.java
Repository: jettison-json/jettison
The code follows secure coding practices.
|
[
"CWE-674",
"CWE-787"
] |
CVE-2022-45693
|
HIGH
| 7.5
|
jettison-json/jettison
|
opt
|
src/main/java/org/codehaus/jettison/json/JSONArray.java
|
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
| 0
|
Analyze the following code function for security vulnerabilities
|
public String setDoublePageModeAction(boolean doublePageMode) throws IndexUnreachableException, DAOException {
if (viewManager == null) {
return "";
}
try {
// Adapt URL page range when switching between single and double page modes
if (viewManager.isDoublePageMode() != doublePageMode) {
if (doublePageMode && !viewManager.getCurrentPage().isDoubleImage()) {
Optional<PhysicalElement> currentLeftPage = viewManager.getCurrentLeftPage();
Optional<PhysicalElement> currentRightPage = viewManager.getCurrentRightPage();
if (currentLeftPage.isPresent() && currentRightPage.isPresent()) {
imageToShow = currentLeftPage.get().getOrder() + "-" + currentRightPage.get().getOrder();
} else if (currentLeftPage.isPresent()) {
imageToShow = currentLeftPage.get().getOrder() + "-" + currentLeftPage.get().getOrder();
} else if (currentRightPage.isPresent()) {
imageToShow = currentRightPage.get().getOrder() + "-" + currentRightPage.get().getOrder();
}
} else if (doublePageMode) {
imageToShow = String.valueOf(viewManager.getCurrentPage().getOrder() + "-" + viewManager.getCurrentPage().getOrder());
} else {
imageToShow = String.valueOf(viewManager.getCurrentPage().getOrder());
}
}
} finally {
viewManager.setDoublePageMode(doublePageMode);
}
// When not using PrettyContext, the updated URL will always be a click behind
if (PrettyContext.getCurrentInstance() != null && PrettyContext.getCurrentInstance().getCurrentMapping() != null) {
return "pretty:" + PrettyContext.getCurrentInstance().getCurrentMapping().getId();
}
return "";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDoublePageModeAction
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
setDoublePageModeAction
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
private static Join<?, ?> getOrCreateJoin(From<?, ?> from, String attribute) {
for (Join<?, ?> join : from.getJoins()) {
boolean sameName = join.getAttribute().getName().equals(attribute);
if (sameName && join.getJoinType().equals(JoinType.LEFT)) {
return join;
}
}
return from.join(attribute, JoinType.LEFT);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrCreateJoin
File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
Repository: spring-projects/spring-data-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-6652
|
MEDIUM
| 6.8
|
spring-projects/spring-data-jpa
|
getOrCreateJoin
|
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
|
b8e7fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder setV4SignatureFile(File v4SignatureFile) {
mV4SignatureFile = v4SignatureFile;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setV4SignatureFile
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
setV4SignatureFile
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String[] saveSelfRegisteredUser(Object user) {
throw new UnsupportedOperationException();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveSelfRegisteredUser
File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-29451
|
MEDIUM
| 6.4
|
ManyDesigns/Portofino
|
saveSelfRegisteredUser
|
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
|
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
| 0
|
Analyze the following code function for security vulnerabilities
|
private String createTmpDir() {
try {
File tmp = File.createTempFile("fileresourcemanager", null);
tmp.delete();
tmp.mkdir();
String workDir = tmp.getAbsolutePath();
return workDir;
} catch (IOException e) {
throw log.errorCreateWorkDir(e);
}
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2018-25068
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Feature #4100 Fix critical Vulnerability
"File.createTempFile" should not be used to create a directory
Function: createTmpDir
File: globalpomutils-fileresources/src/main/java/com/anrisoftware/globalpom/fileresourcemanager/FileResourceManagerProvider.java
Repository: devent/globalpom-utils
Fixed Code:
private String createTmpDir() {
try {
File tmp = Files.createTempDirectory("fileresourcemanager").toFile();
String workDir = tmp.getAbsolutePath();
return workDir;
} catch (IOException e) {
throw log.errorCreateWorkDir(e);
}
}
|
[
"CWE-668"
] |
CVE-2018-25068
|
MEDIUM
| 6.5
|
devent/globalpom-utils
|
createTmpDir
|
globalpomutils-fileresources/src/main/java/com/anrisoftware/globalpom/fileresourcemanager/FileResourceManagerProvider.java
|
77a820bac2f68e662ce261ecb050c643bd7ee560
| 1
|
Analyze the following code function for security vulnerabilities
|
boolean isVisibleByPolicy() {
return (mPolicyVisibility & POLICY_VISIBILITY_ALL) == POLICY_VISIBILITY_ALL;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isVisibleByPolicy
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
|
isVisibleByPolicy
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private ModelNode readAttributeValue(PathAddress address, String attributeName) {
final ModelNode readAttributeOp = new ModelNode();
readAttributeOp.get(OP).set(READ_ATTRIBUTE_OPERATION);
readAttributeOp.get(OP_ADDR).set(address.toModelNode());
readAttributeOp.get(ModelDescriptionConstants.INCLUDE_UNDEFINED_METRIC_VALUES).set(false);
readAttributeOp.get(NAME).set(attributeName);
ModelNode response = modelControllerClient.execute(readAttributeOp);
String error = getFailureDescription(response);
if (error != null) {
// [WFLY-11933] if the value can not be read if the management resource is not accessible due to RBAC,
// it is logged it at a lower level.
if (error.contains("WFLYCTL0216")) {
LOGGER.debugf("Unable to read attribute %s: %s.", attributeName, error);
} else{
LOGGER.unableToReadAttribute(attributeName, address, error);
}
return new ModelNode(ModelType.UNDEFINED);
}
return response.get(RESULT);
}
|
Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2021-3503
- Severity: MEDIUM
- CVSS Score: 4.0
Description: [WFLY-11933] Return properly configured ModelNode when RBAC is enabled
Return empty ModelNode for attributes restricted by RBAC so that isDefined() answers correctly
(h/t jmesnil)
Function: readAttributeValue
File: metrics/src/main/java/org/wildfly/extension/metrics/WildFlyMetric.java
Repository: wildfly
Fixed Code:
private ModelNode readAttributeValue(PathAddress address, String attributeName) {
final ModelNode readAttributeOp = new ModelNode();
readAttributeOp.get(OP).set(READ_ATTRIBUTE_OPERATION);
readAttributeOp.get(OP_ADDR).set(address.toModelNode());
readAttributeOp.get(ModelDescriptionConstants.INCLUDE_UNDEFINED_METRIC_VALUES).set(false);
readAttributeOp.get(NAME).set(attributeName);
ModelNode response = modelControllerClient.execute(readAttributeOp);
String error = getFailureDescription(response);
if (error != null) {
// [WFLY-11933] if the value can not be read if the management resource is not accessible due to RBAC,
// it is logged it at a lower level.
if (error.contains("WFLYCTL0216")) {
LOGGER.debugf("Unable to read attribute %s: %s.", attributeName, error);
} else{
LOGGER.unableToReadAttribute(attributeName, address, error);
}
return UNDEFINED;
}
return response.get(RESULT);
}
|
[
"CWE-200"
] |
CVE-2021-3503
|
MEDIUM
| 4
|
wildfly
|
readAttributeValue
|
metrics/src/main/java/org/wildfly/extension/metrics/WildFlyMetric.java
|
a48db605577d941b5ae3e899a1187303e138ca74
| 1
|
Analyze the following code function for security vulnerabilities
|
void setNegativeButton(Button button) {
mNegativeButton = button;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNegativeButton
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
setNegativeButton
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
public String evaluateAmwFunction(AmwFunctionEntity function, AmwTemplateModel model, AmwModelPreprocessExceptionHandler amwModelPreprocessExceptionHandler) throws IOException, TemplateException {
Configuration cfg = getConfiguration(amwModelPreprocessExceptionHandler);
StringTemplateLoader loader = new StringTemplateLoader();
String tempTemplateName = "_evaluateFunctionTemplate_";
String tempTemplate = "<#include \"" + function.getName() + "\">${" + function.getName() + "()}";
loader.putTemplate(tempTemplateName, tempTemplate);
loader.putTemplate(function.getName(), function.getDecoratedImplementation());
addGlobalFunctionTemplates(model.getGlobalFunctionTemplates(), loader);
cfg.setTemplateLoader(loader);
Writer fileContentWriter = new StringWriter();
freemarker.template.Template fileContentTemplate = cfg.getTemplate(tempTemplateName);
fileContentTemplate.process(model, fileContentWriter);
fileContentWriter.flush();
String result = fileContentWriter.toString();
cfg.clearTemplateCache();
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: evaluateAmwFunction
File: AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
Repository: liimaorg/liima
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2023-26092
|
CRITICAL
| 9.8
|
liimaorg/liima
|
evaluateAmwFunction
|
AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
|
78ba2e198c615dc8858e56eee3290989f0362686
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerBuilder serviceUnder(String pathPrefix, HttpService service) {
virtualHostTemplate.serviceUnder(pathPrefix, service);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: serviceUnder
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
serviceUnder
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@JsonProperty(FIELD_CACHE_TTL_OVERRIDE)
public abstract Builder cacheTTLOverride(Long cacheTTLOverride);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cacheTTLOverride
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2023-41045
|
MEDIUM
| 5.3
|
Graylog2/graylog2-server
|
cacheTTLOverride
|
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
|
466af814523cffae9fbc7e77bab7472988f03c3e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void copy(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
try {
OutputStream out = new FileOutputStream(dst);
try {
// Transfer bytes from in to out
byte[] buf = new byte[8096];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
} finally {
out.close();
}
} finally {
in.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copy
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
|
copy
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void animateCollapsePanels(int flags, boolean force) {
animateCollapsePanels(flags, force, false /* delayed */, 1.0f /* speedUpFactor */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: animateCollapsePanels
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
animateCollapsePanels
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public String selectHeaderAccept(String[] accepts) {
if (accepts.length == 0) {
return null;
}
for (String accept : accepts) {
if (isJsonMime(accept)) {
return accept;
}
}
return StringUtil.join(accepts, ",");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectHeaderAccept
File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
selectHeaderAccept
|
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void marshal(Object graph, Result result, MimeContainer mimeContainer) throws XmlMappingException {
try {
Marshaller marshaller = createMarshaller();
if (this.mtomEnabled && mimeContainer != null) {
marshaller.setAttachmentMarshaller(new Jaxb2AttachmentMarshaller(mimeContainer));
}
if (StaxUtils.isStaxResult(result)) {
marshalStaxResult(marshaller, graph, result);
}
else {
marshaller.marshal(graph, result);
}
}
catch (JAXBException ex) {
throw convertJaxbException(ex);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: marshal
File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-4152
|
MEDIUM
| 6.8
|
spring-projects/spring-framework
|
marshal
|
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
|
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.