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
public static Xid decodeXid(final ActiveMQBuffer in) { int formatID = in.readInt(); byte[] bq = new byte[in.readInt()]; in.readBytes(bq); byte[] gtxid = new byte[in.readInt()]; in.readBytes(gtxid); return new XidImpl(bq, formatID, gtxid); }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2021-4040 - Severity: MEDIUM - CVSS Score: 5.3 Description: ARTEMIS-3593 Defense against OME on parsing XID Co-authored-by: Viktor Kolomeyko <Viktor.Kolomeyko@r3.com> Function: decodeXid File: artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XidCodecSupport.java Repository: apache/activemq-artemis Fixed Code: public static Xid decodeXid(final ActiveMQBuffer in) { int formatID = in.readInt(); byte[] bq = safeReadBytes(in); byte[] gtxid = safeReadBytes(in); return new XidImpl(bq, formatID, gtxid); }
[ "CWE-787" ]
CVE-2021-4040
MEDIUM
5.3
apache/activemq-artemis
decodeXid
artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XidCodecSupport.java
153d2e9a979aead8dff95fbc91d659ecc7d0fb82
1
Analyze the following code function for security vulnerabilities
private int getIntProperty(String key, int def) { String value = prop.getProperty(key); if (value == null) { return def; } return Integer.parseInt(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntProperty File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getIntProperty
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public Boolean apply(Class<?> clazz) { return clazz == java.sql.Date.class // || clazz == java.sql.Time.class // || clazz == java.sql.Timestamp.class; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
apply
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public @Nullable ComponentName setGlobalProxy(@NonNull ComponentName admin, Proxy proxySpec, List<String> exclusionList ) { throwIfParentInstance("setGlobalProxy"); if (proxySpec == null) { throw new NullPointerException(); } if (mService != null) { try { String hostSpec; String exclSpec; if (proxySpec.equals(Proxy.NO_PROXY)) { hostSpec = null; exclSpec = null; } else { if (!proxySpec.type().equals(Proxy.Type.HTTP)) { throw new IllegalArgumentException(); } final Pair<String, String> proxyParams = getProxyParameters(proxySpec, exclusionList); hostSpec = proxyParams.first; exclSpec = proxyParams.second; } return mService.setGlobalProxy(admin, hostSpec, exclSpec); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGlobalProxy 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
setGlobalProxy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Animation createForceHideEnterAnimation(boolean onWallpaper, boolean goingToNotificationShade) { if (goingToNotificationShade) { return AnimationUtils.loadAnimation(mContext, R.anim.lock_screen_behind_enter_fade_in); } AnimationSet set = (AnimationSet) AnimationUtils.loadAnimation(mContext, onWallpaper ? R.anim.lock_screen_behind_enter_wallpaper : R.anim.lock_screen_behind_enter); // TODO: Use XML interpolators when we have log interpolators available in XML. final List<Animation> animations = set.getAnimations(); for (int i = animations.size() - 1; i >= 0; --i) { animations.get(i).setInterpolator(mLogDecelerateInterpolator); } return set; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createForceHideEnterAnimation 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
createForceHideEnterAnimation
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") private void launchBrowser(String url) throws Exception { if (SystemUtils.IS_OS_MAC) { FileManager.openURL(url); } else if (SystemUtils.IS_OS_WINDOWS) { Runtime .getRuntime() .exec("rundll32 url.dll,FileProtocolHandler " + url); } else { String browser = getLinuxBrowser(); if (browser == null) logger.error("Could not find web browser"); else Runtime.getRuntime().exec(new String[]{browser, url}); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchBrowser File: modules/service/browserlauncher/src/main/java/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherImpl.java Repository: jitsi The code follows secure coding practices.
[ "CWE-77" ]
CVE-2022-43550
CRITICAL
9.8
jitsi
launchBrowser
modules/service/browserlauncher/src/main/java/net/java/sip/communicator/impl/browserlauncher/BrowserLauncherImpl.java
8aa7be58522f4264078d54752aae5483bfd854b2
0
Analyze the following code function for security vulnerabilities
public ServerBuilder requestTimeout(Duration requestTimeout) { return requestTimeoutMillis(requireNonNull(requestTimeout, "requestTimeout").toMillis()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestTimeout 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
requestTimeout
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<ApplicationExitInfo> getHistoricalProcessExitReasons( String packageName, int pid, int maxNum, int userId) { enforceNotIsolatedCaller("getHistoricalProcessExitReasons"); // For the simplification, we don't support USER_ALL nor USER_CURRENT here. if (userId == UserHandle.USER_ALL || userId == UserHandle.USER_CURRENT) { throw new IllegalArgumentException("Unsupported userId"); } final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); final int callingUserId = UserHandle.getCallingUserId(); mUserController.handleIncomingUser(callingPid, callingUid, userId, true, ALLOW_NON_FULL, "getHistoricalProcessExitReasons", null); NativeTombstoneManager tombstoneService = LocalServices.getService( NativeTombstoneManager.class); final ArrayList<ApplicationExitInfo> results = new ArrayList<ApplicationExitInfo>(); if (!TextUtils.isEmpty(packageName)) { final int uid = enforceDumpPermissionForPackage(packageName, userId, callingUid, "getHistoricalProcessExitReasons"); if (uid != INVALID_UID) { mProcessList.mAppExitInfoTracker.getExitInfo( packageName, uid, pid, maxNum, results); tombstoneService.collectTombstones(results, uid, pid, maxNum); } } else { // If no package name is given, use the caller's uid as the filter uid. mProcessList.mAppExitInfoTracker.getExitInfo( packageName, callingUid, pid, maxNum, results); tombstoneService.collectTombstones(results, callingUid, pid, maxNum); } return new ParceledListSlice<ApplicationExitInfo>(results); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHistoricalProcessExitReasons 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
getHistoricalProcessExitReasons
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private boolean extractSearchParamsR4CapabilityStatement(IBaseResource theConformance, String resourceName, TreeSet<String> includes, TreeSet<String> theRevIncludes, TreeSet<String> sortParams, boolean haveSearchParams, List<List<String>> queryIncludes) { org.hl7.fhir.r4.model.CapabilityStatement conformance = (org.hl7.fhir.r4.model.CapabilityStatement) theConformance; for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestComponent nextRest : conformance.getRest()) { for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceComponent nextRes : nextRest.getResource()) { if (nextRes.getTypeElement().getValue().equals(resourceName)) { for (org.hl7.fhir.r4.model.StringType next : nextRes.getSearchInclude()) { if (next.isEmpty() == false) { includes.add(next.getValue()); } } for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() != org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE) { sortParams.add(next.getNameElement().getValue()); } } if (nextRes.getSearchParam().size() > 0) { haveSearchParams = true; } } else { // It's a different resource from the one we're searching, so // scan for revinclude candidates for (org.hl7.fhir.r4.model.CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent next : nextRes.getSearchParam()) { if (next.getTypeElement().getValue() == org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE) { } } } } } return haveSearchParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractSearchParamsR4CapabilityStatement File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
extractSearchParamsR4CapabilityStatement
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
public void setMaxInactivityInterval(Duration maxInactivityInterval) { this.maxInactivityInterval = maxInactivityInterval; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxInactivityInterval File: ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java Repository: ratpack The code follows secure coding practices.
[ "CWE-312" ]
CVE-2021-29481
MEDIUM
5
ratpack
setMaxInactivityInterval
ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java
60302fae7ef26897b9a0ec0def6281a9425344cf
0
Analyze the following code function for security vulnerabilities
protected String getDeployDirectory() { String webapp_dir = System.getProperty(WebApp.DEF_WEBAPP_AUTODEPLOY_DIR); if (webapp_dir == null) webapp_dir = System.getProperty("user.dir") + File.separator + "webapps"; return webapp_dir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeployDirectory File: 1.x/src/rogatkin/web/WarRoller.java Repository: drogatkin/TJWS2 The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-4594
CRITICAL
9.8
drogatkin/TJWS2
getDeployDirectory
1.x/src/rogatkin/web/WarRoller.java
1bac15c496ec54efe21ad7fab4e17633778582fc
0
Analyze the following code function for security vulnerabilities
private static Connection getConnection() { try { return DriverManager.getConnection("jdbc:hsqldb:mem:.", "SA", ""); } catch (SQLException e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnection File: injectIt/src/main/java/com/dextra/injectit/database/Database.java Repository: bmattoso/desafio_buzz_woody The code follows secure coding practices.
[ "CWE-89" ]
CVE-2015-10048
MEDIUM
5.2
bmattoso/desafio_buzz_woody
getConnection
injectIt/src/main/java/com/dextra/injectit/database/Database.java
cb8220cbae06082c969b1776fcb2fdafb3a1006b
0
Analyze the following code function for security vulnerabilities
public Column<T, ?> addColumn(String propertyName, AbstractRenderer<? super T, ?> renderer, Column.NestedNullBehavior nestedNullBehavior) { Objects.requireNonNull(propertyName, "Property name cannot be null"); Objects.requireNonNull(renderer, "Renderer cannot be null"); if (getColumn(propertyName) != null) { throw new IllegalStateException( "There is already a column for " + propertyName); } PropertyDefinition<T, ?> definition = propertySet .getProperty(propertyName) .orElseThrow(() -> new IllegalArgumentException( "Could not resolve property name " + propertyName + " from " + propertySet)); if (!renderer.getPresentationType() .isAssignableFrom(definition.getType())) { throw new IllegalArgumentException( renderer + " cannot be used with a property of type " + definition.getType().getName()); } @SuppressWarnings({ "unchecked", "rawtypes" }) Column<T, ?> column = createColumn(definition.getGetter(), ValueProvider.identity(), (AbstractRenderer) renderer, nestedNullBehavior); String generatedIdentifier = getGeneratedIdentifier(); addColumn(generatedIdentifier, column); column.setId(definition.getName()).setCaption(definition.getCaption()); return column; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addColumn 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
addColumn
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
private boolean removeNonRequiredAppsForManagedDevice( @UserIdInt int userId, boolean leaveAllSystemAppsEnabled, ComponentName admin) { Set<String> packagesToDelete = leaveAllSystemAppsEnabled ? Collections.emptySet() : mOverlayPackagesProvider.getNonRequiredApps( admin, userId, ACTION_PROVISION_MANAGED_DEVICE); removeNonInstalledPackages(packagesToDelete, userId); if (packagesToDelete.isEmpty()) { Slogf.i(LOG_TAG, "No packages to delete on user " + userId); return true; } NonRequiredPackageDeleteObserver packageDeleteObserver = new NonRequiredPackageDeleteObserver(packagesToDelete.size()); for (String packageName : packagesToDelete) { Slogf.i(LOG_TAG, "Deleting package [" + packageName + "] as user " + userId); mContext.getPackageManager().deletePackageAsUser( packageName, packageDeleteObserver, PackageManager.DELETE_SYSTEM_APP, userId); } Slogf.i(LOG_TAG, "Waiting for non required apps to be deleted"); return packageDeleteObserver.awaitPackagesDeletion(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeNonRequiredAppsForManagedDevice 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
removeNonRequiredAppsForManagedDevice
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void mayProceed() throws InsufficientPermissionException { Locale locale = LocaleResolver.getLocale(request); FormProcessor fp = new FormProcessor(request); /* int eventCRFId = fp.getInt("eventCRFId"); EventCRFDAO edao = new EventCRFDAO(sm.getDataSource()); if (eventCRFId > 0) { if (!entityIncluded(eventCRFId, ub.getName(), edao, sm.getDataSource())) { request.setAttribute("downloadStatus", "false"); addPageMessage(respage.getString("you_not_have_permission_download_attached_file")); throw new InsufficientPermissionException(Page.DOWNLOAD_ATTACHED_FILE, resexception.getString("no_permission"), "1"); } } else { request.setAttribute("downloadStatus", "false"); addPageMessage(respage.getString("you_not_have_permission_download_attached_file")); throw new InsufficientPermissionException(Page.DOWNLOAD_ATTACHED_FILE, resexception.getString("no_permission"), "1"); }*/ if (ub.isSysAdmin()) { return; } if (SubmitDataServlet.mayViewData(ub, currentRole)) { return; } request.setAttribute("downloadStatus", "false"); addPageMessage(respage.getString("you_not_have_permission_download_attached_file")); throw new InsufficientPermissionException(Page.DOWNLOAD_ATTACHED_FILE, resexception.getString("no_permission"), "1"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mayProceed File: web/src/main/java/org/akaza/openclinica/control/submit/DownloadAttachedFileServlet.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
mayProceed
web/src/main/java/org/akaza/openclinica/control/submit/DownloadAttachedFileServlet.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
public String getSpacePreferenceFor(String preference, SpaceReference spaceReference) { return this.xwiki.getSpacePreference(preference, spaceReference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpacePreferenceFor 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
getSpacePreferenceFor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void setNearbyAppStreamingPolicy(@NearbyStreamingPolicy int policy) { throwIfParentInstance("setNearbyAppStreamingPolicy"); if (mService == null) { return; } try { mService.setNearbyAppStreamingPolicy(policy); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNearbyAppStreamingPolicy 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
setNearbyAppStreamingPolicy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { if (SecurityUtils.getSecurityProfile() == SecurityProfile.INTERNET || SecurityUtils.getSecurityProfile() == SecurityProfile.ALLOWLIST) return super.toString(); try { return internal.getCanonicalPath(); } catch (IOException e) { return internal.getAbsolutePath(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
toString
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
@Override public Object substituteValueInInput(int index, String binding, String value, Object input, List<Map.Entry<String, String>> insertedParams, Object... args) { boolean isInputQueryBody = (boolean) args[0]; if (!isInputQueryBody) { String queryVariables = (String) input; return DataTypeStringUtils.jsonSmartReplacementPlaceholderWithValue(queryVariables, value, null, insertedParams, null); } else { String queryBody = (String) input; return smartlyReplaceGraphQLQueryBodyPlaceholderWithValue(queryBody, value, insertedParams); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: substituteValueInInput File: app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/plugins/GraphQLPlugin.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-4096
MEDIUM
6.5
appsmithorg/appsmith
substituteValueInInput
app/server/appsmith-plugins/graphqlPlugin/src/main/java/com/external/plugins/GraphQLPlugin.java
769719ccfe667f059fe0b107a19ec9feb90f2e40
0
Analyze the following code function for security vulnerabilities
@Deprecated public WearableExtender setBackground(Bitmap background) { mBackground = background; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBackground File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setBackground
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; // also set the date format for model (de)serialization with Date properties this.json.setDateFormat((DateFormat) dateFormat.clone()); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateFormat 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
setDateFormat
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
public String getExternalURL() { return this.doc.getExternalURL("view", getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExternalURL File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getExternalURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
protected boolean checkResourcePermissions(CmsPermissionSet required, boolean neededForFolder) { return checkResourcePermissions( required, neededForFolder, Messages.get().container( Messages.GUI_ERR_RESOURCE_PERMISSIONS_2, getParamResource(), required.getPermissionString())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkResourcePermissions 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
checkResourcePermissions
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public void setAppointmentService(AppointmentService appointmentService) { this.appointmentService = appointmentService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAppointmentService File: api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36635
MEDIUM
5.4
openmrs/openmrs-module-appointmentscheduling
setAppointmentService
api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
34213c3f6ea22df427573076fb62744694f601d8
0
Analyze the following code function for security vulnerabilities
private boolean shouldNotifyPackageOnAccountRemoval(Account account, String packageName, UserAccounts accounts) { int visibility = resolveAccountVisibility(account, packageName, accounts); if (visibility != AccountManager.VISIBILITY_VISIBLE && visibility != AccountManager.VISIBILITY_USER_MANAGED_VISIBLE) { return false; } Intent intent = new Intent(AccountManager.ACTION_ACCOUNT_REMOVED); intent.setFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); intent.setPackage(packageName); List<ResolveInfo> receivers = mPackageManager.queryBroadcastReceiversAsUser(intent, 0, accounts.userId); return (receivers != null && receivers.size() > 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldNotifyPackageOnAccountRemoval File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
shouldNotifyPackageOnAccountRemoval
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public long getFileLength(String file) { file = removeFilePrefix(file); return new File(file).length(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileLength 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
getFileLength
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override protected Dimension calcPreferredSize() { if(nativeVideo != null){ return new Dimension(nativeVideo.getWidth(), nativeVideo.getHeight()); } return new Dimension(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calcPreferredSize 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
calcPreferredSize
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected HttpClient getHttpClient(DatasourceConfiguration datasourceConfiguration) { // Initializing webClient to be used for http call final ConnectionProvider provider = ConnectionProvider .builder("rest-api-provider") .maxIdleTime(Duration.ofSeconds(600)) .maxLifeTime(Duration.ofSeconds(600)) .build(); HttpClient httpClient = HttpClient.create(provider) .secure(SSLHelper.sslCheckForHttpClient(datasourceConfiguration)) .compress(true); return httpClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpClient File: app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-4096
MEDIUM
6.5
appsmithorg/appsmith
getHttpClient
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
769719ccfe667f059fe0b107a19ec9feb90f2e40
0
Analyze the following code function for security vulnerabilities
private ProviderInfo getProviderInfoLocked(String authority, int userHandle) { ProviderInfo pi = null; ContentProviderRecord cpr = mProviderMap.getProviderByName(authority, userHandle); if (cpr != null) { pi = cpr.info; } else { try { pi = AppGlobals.getPackageManager().resolveContentProvider( authority, PackageManager.GET_URI_PERMISSION_PATTERNS, userHandle); } catch (RemoteException ex) { } } return pi; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProviderInfoLocked 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
getProviderInfoLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void grantUriPermissionFromIntent(int callingUid, String targetPkg, Intent intent, int targetUserId) { synchronized (ActivityManagerService.this) { ActivityManagerService.this.grantUriPermissionFromIntentLocked(callingUid, targetPkg, intent, null, targetUserId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantUriPermissionFromIntent 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
grantUriPermissionFromIntent
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static void putLong(long address, long value) { PlatformDependent0.putLong(address, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putLong File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
putLong
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
@Override public void removeItem(Context context, Collection collection, Item item) throws SQLException, AuthorizeException, IOException { // Check authorisation authorizeService.authorizeAction(context, collection, Constants.REMOVE); //Check if we orphaned our poor item if (item.getCollections().size() == 1) { // Orphan; delete it itemService.delete(context, item); } else { //Remove the item from the collection if we have multiple collections item.removeCollection(collection); } context.addEvent(new Event(Event.REMOVE, Constants.COLLECTION, collection.getID(), Constants.ITEM, item.getID(), item.getHandle(), getIdentifiers(context, collection))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeItem File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
removeItem
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
static Intent createLocalBroadcastIntent(Context context, String action) { Intent intent = new Intent(action); intent.setPackage(context.getPackageName()); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_FOREGROUND); return intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createLocalBroadcastIntent File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0813
MEDIUM
6.6
android
createLocalBroadcastIntent
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
0
Analyze the following code function for security vulnerabilities
@GetMapping({"/admin/rbstore/load-metaschemas", "/setup/init-models"}) public JSON loadMetaschemas() { JSONObject index = (JSONObject) RBStore.fetchMetaschema(null); JSONArray schemas = index.getJSONArray("schemas"); for (Object o : schemas) { JSONObject item = (JSONObject) o; String key = item.getString("key"); if (Application.isReady() && MetadataHelper.containsEntity(key)) { item.put("exists", true); } } return index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadMetaschemas File: src/main/java/com/rebuild/web/admin/rbstore/RBStoreController.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-30049
MEDIUM
5
getrebuild/rebuild
loadMetaschemas
src/main/java/com/rebuild/web/admin/rbstore/RBStoreController.java
a44bc6fd61c72b2edd525f3f2eadc0ed507d17ee
0
Analyze the following code function for security vulnerabilities
@Override public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options) throws RemoteException { Slog.i(TAG, "Activity tried to startVoiceInteraction"); synchronized (this) { ActivityRecord activity = getFocusedStack().topActivity(); if (ActivityRecord.forTokenLocked(callingActivity) != activity) { throw new SecurityException("Only focused activity can call startVoiceInteraction"); } if (mRunningVoice != null || activity.task.voiceSession != null || activity.voiceSession != null) { Slog.w(TAG, "Already in a voice interaction, cannot start new voice interaction"); return; } if (activity.pendingVoiceInteractionStart) { Slog.w(TAG, "Pending start of voice interaction already."); return; } activity.pendingVoiceInteractionStart = true; } LocalServices.getService(VoiceInteractionManagerInternal.class) .startLocalVoiceInteraction(callingActivity, options); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startLocalVoiceInteraction File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startLocalVoiceInteraction
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public Converter lookupConverterForType(Class type) { return defaultConverterLookup.lookupConverterForType(type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookupConverterForType 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
lookupConverterForType
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public int getConnectTimeout() { return connectionTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectTimeout File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getConnectTimeout
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") void closeSystemDialogsLocked(String reason) { Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); if (reason != null) { intent.putExtra("reason", reason); } mWindowManager.closeSystemDialogs(reason); mStackSupervisor.closeSystemDialogsLocked(); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, OP_NONE, null, false, false, -1, SYSTEM_UID, UserHandle.USER_ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeSystemDialogsLocked 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
closeSystemDialogsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected Http2FrameListener frameListener() { return frameListener; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: frameListener File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
frameListener
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
@Override public void moveRelationships( TrackedEntityInstance original, TrackedEntityInstance duplicate, List<String> relationships ) { duplicate.getRelationshipItems() .stream() .filter( r -> relationships.contains( r.getRelationship().getUid() ) ) .forEach( ri -> { ri.setTrackedEntityInstance( original ); getSession().update( ri ); } ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveRelationships File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
moveRelationships
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
public Map<String, User> getUsers() throws IOException { update(); m_readLock.lock(); try { return Collections.unmodifiableMap(m_users); } finally { m_readLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUsers File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
getUsers
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public void setConfigAttributes(Object attributes) { if (attributes == null) { return; } super.setConfigAttributes(attributes); Map map = (Map) attributes; if (map.containsKey(SERVER_AND_PORT)) { this.serverAndPort = (String) map.get(SERVER_AND_PORT); } if (map.containsKey(VIEW)) { setView((String) map.get(VIEW)); } if (map.containsKey(USERNAME)) { this.userName = (String) map.get(USERNAME); } if (map.containsKey(PASSWORD_CHANGED) && "1".equals(map.get(PASSWORD_CHANGED))) { String passwordToSet = (String) map.get(PASSWORD); resetPassword(passwordToSet); } setUseTickets("true".equals(map.get(USE_TICKETS))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConfigAttributes File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
setConfigAttributes
config/config-api/src/main/java/com/thoughtworks/go/config/materials/perforce/P4MaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public boolean isTrustAllowedForUser(int userId) { return getStrongAuthForUser(userId) == STRONG_AUTH_NOT_REQUIRED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTrustAllowedForUser File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isTrustAllowedForUser
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public AsyncSQLClient getClient() { return client; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClient File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getClient
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void updateAfterSizeChanged() { mPopupZoomer.hide(false); // Execute a delayed form focus operation because the OSK was brought // up earlier. if (!mFocusPreOSKViewportRect.isEmpty()) { Rect rect = new Rect(); getContainerView().getWindowVisibleDisplayFrame(rect); if (!rect.equals(mFocusPreOSKViewportRect)) { // Only assume the OSK triggered the onSizeChanged if width was preserved. if (rect.width() == mFocusPreOSKViewportRect.width()) { assert mWebContents != null; mWebContents.scrollFocusedEditableNodeIntoView(); } cancelRequestToScrollFocusedEditableNodeIntoView(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAfterSizeChanged File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
updateAfterSizeChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
int checkCallingPermission(String permission) { return checkPermission(permission, Binder.getCallingPid(), UserHandle.getAppId(Binder.getCallingUid())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkCallingPermission 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
checkCallingPermission
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@NonNull public static Notification.Builder recoverBuilder(Context context, Notification n) { // Re-create notification context so we can access app resources. ApplicationInfo applicationInfo = n.extras.getParcelable( EXTRA_BUILDER_APPLICATION_INFO, ApplicationInfo.class); Context builderContext; if (applicationInfo != null) { try { builderContext = context.createApplicationContext(applicationInfo, Context.CONTEXT_RESTRICTED); } catch (NameNotFoundException e) { Log.e(TAG, "ApplicationInfo " + applicationInfo + " not found"); builderContext = context; // try with our context } } else { builderContext = context; // try with given context } return new Builder(builderContext, n); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recoverBuilder File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
recoverBuilder
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void finishChannel(Channel channel) { setDefaultAttribute(channel, DiscardEvent.INSTANCE); // The channel may have already been removed if a timeout occurred, and // this method may be called just after. if (channel == null) return; LOGGER.debug("Closing Channel {} ", channel); try { channel.close(); } catch (Throwable t) { LOGGER.debug("Error closing a connection", t); } openChannels.remove(channel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishChannel 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
finishChannel
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public XWikiDeletedDocument[] getDeletedDocuments(String batchId, XWikiContext context) throws XWikiException { if (hasRecycleBin(context)) { return getRecycleBinStore().getAllDeletedDocuments(batchId, context, true); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeletedDocuments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getDeletedDocuments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("ResultOfMethodCallIgnored") public static void markConverted(final Context context) { final File file = getConvertedMarkedFile(context); try { file.getParentFile().mkdirs(); file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: markConverted 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
markConverted
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
Bundle attachmentFds() { return mAttachmentFds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachmentFds File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
attachmentFds
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public final boolean isTypeOrSubTypeOf(Class<?> clz) { return (_class == clz) || clz.isAssignableFrom(_class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTypeOrSubTypeOf File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isTypeOrSubTypeOf
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Override public void onLongPress(MotionEvent e) { performLongClick(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLongPress 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
onLongPress
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
protected void engineInit( Key key, SecureRandom random) throws InvalidKeyException { if (!(key instanceof DHPrivateKey)) { throw new InvalidKeyException("DHKeyAgreement requires DHPrivateKey"); } DHPrivateKey privKey = (DHPrivateKey)key; this.p = privKey.getParams().getP(); this.g = privKey.getParams().getG(); this.x = this.result = privKey.getX(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-320" ]
CVE-2016-1000346
MEDIUM
4.3
bcgit/bc-java
engineInit
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyAgreementSpi.java
1127131c89021612c6eefa26dbe5714c194e7495
0
Analyze the following code function for security vulnerabilities
private List<ReadableCategory> getSubCategories(MerchantStore store, Category category, Map<Long,Long> productCount, Language language, Locale locale) throws Exception { //sub categories List<Category> subCategories = categoryService.listByParent(category, language); ReadableCategoryPopulator populator = new ReadableCategoryPopulator(); List<ReadableCategory> subCategoryProxies = new ArrayList<ReadableCategory>(); for(Category sub : subCategories) { ReadableCategory cProxy = populator.populate(sub, new ReadableCategory(), store, language); if(productCount!=null) { Long total = productCount.get(cProxy.getId()); if(total!=null) { cProxy.setProductCount(total.intValue()); } } subCategoryProxies.add(cProxy); } return subCategoryProxies; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubCategories File: sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java Repository: shopizer-ecommerce/shopizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
getSubCategories
sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java
197f8c78c8f673b957e41ca2c823afc654c19271
0
Analyze the following code function for security vulnerabilities
@Override public Thermodynamic getThermodynamic(String tableName, DownSampling downsampling, List<String> ids, String valueCName) throws IOException { StringBuilder idValues = new StringBuilder(); for (int valueIdx = 0; valueIdx < ids.size(); valueIdx++) { if (valueIdx != 0) { idValues.append(","); } idValues.append("'").append(ids.get(valueIdx)).append("'"); } List<List<Long>> thermodynamicValueCollection = new ArrayList<>(); Map<String, List<Long>> thermodynamicValueMatrix = new HashMap<>(); try (Connection connection = h2Client.getConnection()) { Thermodynamic thermodynamic = new Thermodynamic(); int numOfSteps = 0; int axisYStep = 0; try (ResultSet resultSet = h2Client.executeQuery( connection, "select " + ThermodynamicMetrics.STEP + " step, " + ThermodynamicMetrics.NUM_OF_STEPS + " num_of_steps, " + ThermodynamicMetrics.DETAIL_GROUP + " detail_group, " + "id " + " from " + tableName + " where id in (" + idValues .toString() + ")" )) { while (resultSet.next()) { axisYStep = resultSet.getInt("step"); String id = resultSet.getString("id"); numOfSteps = resultSet.getInt("num_of_steps") + 1; String value = resultSet.getString("detail_group"); IntKeyLongValueHashMap intKeyLongValues = new IntKeyLongValueHashMap(5); intKeyLongValues.toObject(value); List<Long> axisYValues = new ArrayList<>(); for (int i = 0; i < numOfSteps; i++) { axisYValues.add(0L); } for (IntKeyLongValue intKeyLongValue : intKeyLongValues.values()) { axisYValues.set(intKeyLongValue.getKey(), intKeyLongValue.getValue()); } thermodynamicValueMatrix.put(id, axisYValues); } // try to add default values when there is no data in that time bucket. ids.forEach(id -> { if (thermodynamicValueMatrix.containsKey(id)) { thermodynamicValueCollection.add(thermodynamicValueMatrix.get(id)); } else { thermodynamicValueCollection.add(new ArrayList<>()); } }); } thermodynamic.fromMatrixData(thermodynamicValueCollection, numOfSteps); thermodynamic.setAxisYStep(axisYStep); return thermodynamic; } catch (SQLException e) { throw new IOException(e); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2020-9483 - Severity: MEDIUM - CVSS Score: 5.0 Description: Fix security issue of the metrics query Function: getThermodynamic File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetricsQueryDAO.java Repository: apache/skywalking Fixed Code: @Override public Thermodynamic getThermodynamic(String tableName, DownSampling downsampling, List<String> ids, String valueCName) throws IOException { StringBuilder sql = new StringBuilder( "select " + ThermodynamicMetrics.STEP + " step, " + ThermodynamicMetrics.NUM_OF_STEPS + " num_of_steps, " + ThermodynamicMetrics.DETAIL_GROUP + " detail_group, " + "id " + " from " + tableName + " where id in ("); List<Object> parameters = new ArrayList(); for (int i = 0; i < ids.size(); i++) { if (i == 0) { sql.append("?"); } else { sql.append(",?"); } parameters.add(ids.get(i)); } sql.append(")"); List<List<Long>> thermodynamicValueCollection = new ArrayList<>(); Map<String, List<Long>> thermodynamicValueMatrix = new HashMap<>(); try (Connection connection = h2Client.getConnection()) { Thermodynamic thermodynamic = new Thermodynamic(); int numOfSteps = 0; int axisYStep = 0; try (ResultSet resultSet = h2Client.executeQuery( connection, sql.toString(), parameters.toArray(new Object[0]))) { while (resultSet.next()) { axisYStep = resultSet.getInt("step"); String id = resultSet.getString("id"); numOfSteps = resultSet.getInt("num_of_steps") + 1; String value = resultSet.getString("detail_group"); IntKeyLongValueHashMap intKeyLongValues = new IntKeyLongValueHashMap(5); intKeyLongValues.toObject(value); List<Long> axisYValues = new ArrayList<>(); for (int i = 0; i < numOfSteps; i++) { axisYValues.add(0L); } for (IntKeyLongValue intKeyLongValue : intKeyLongValues.values()) { axisYValues.set(intKeyLongValue.getKey(), intKeyLongValue.getValue()); } thermodynamicValueMatrix.put(id, axisYValues); } // try to add default values when there is no data in that time bucket. ids.forEach(id -> { if (thermodynamicValueMatrix.containsKey(id)) { thermodynamicValueCollection.add(thermodynamicValueMatrix.get(id)); } else { thermodynamicValueCollection.add(new ArrayList<>()); } }); } thermodynamic.fromMatrixData(thermodynamicValueCollection, numOfSteps); thermodynamic.setAxisYStep(axisYStep); return thermodynamic; } catch (SQLException e) { throw new IOException(e); } }
[ "CWE-89" ]
CVE-2020-9483
MEDIUM
5
apache/skywalking
getThermodynamic
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetricsQueryDAO.java
2b6aae3b733f9dbeae1d6eff4f1975c723e1e7d1
1
Analyze the following code function for security vulnerabilities
private Calendar getDefaultCalendar() { if (getTimestampUtils().hasFastDefaultTimeZone()) { return getTimestampUtils().getSharedCalendar(null); } Calendar sharedCalendar = getTimestampUtils().getSharedCalendar(defaultTimeZone); if (defaultTimeZone == null) { defaultTimeZone = sharedCalendar.getTimeZone(); } return sharedCalendar; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultCalendar File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getDefaultCalendar
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { if (child != mTextLine1 && child != mTextLine2 && child != mAnswerImage) { return super.drawChild(canvas, child, drawingTime); } int height = getMeasuredHeight(); int line1Height = mTextLine1.getMeasuredHeight(); int line2Height = mTextLine2.getVisibility() == VISIBLE ? mTextLine2.getMeasuredHeight() : 0; int verticalOffset = 0; if (line1Height + line2Height > height) { // The text lines total height is larger than this view, snap them to the top and // bottom of the view. if (child == mTextLine1) { verticalOffset = 0; } else { verticalOffset = height - line2Height; } } else { // The text lines fit comfortably, so vertically center them. verticalOffset = (height - line1Height - line2Height) / 2; if (child == mTextLine2) { verticalOffset += line1Height; if (mSuggestion.hasAnswer() && mSuggestion.getAnswer().getSecondLine().hasImage()) { verticalOffset += getResources().getDimensionPixelOffset( R.dimen.omnibox_suggestion_answer_line2_vertical_spacing); } } // When one line is larger than the other, it contains extra vertical padding. This // produces more apparent whitespace above or below the text lines. Add a small // offset to compensate. if (line1Height != line2Height) { verticalOffset += (line2Height - line1Height) / 10; } // The image is positioned vertically aligned with the second text line but // requires a small additional offset to align with the ascent of the text instead // of the top of the text which includes some whitespace. if (child == mAnswerImage) { verticalOffset += getResources().getDimensionPixelOffset( R.dimen.omnibox_suggestion_answer_line2_vertical_spacing); } } canvas.save(); canvas.translate(0, verticalOffset); boolean retVal = super.drawChild(canvas, child, drawingTime); canvas.restore(); return retVal; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: drawChild File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
drawChild
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
protected PdfObject readPRObject() throws IOException { tokens.nextValidToken(); int type = tokens.getTokenType(); switch (type) { case PRTokeniser.TK_START_DIC: { ++readDepth; PdfDictionary dic = readDictionary(); --readDepth; int pos = tokens.getFilePointer(); // be careful in the trailer. May not be a "next" token. if (tokens.nextToken() && tokens.getStringValue().equals("stream")) { // ssteward - 6/21/10 // stream should be followed by a LF or a CRLF, but not just a CR, per the PDF spec. // however, I have encountered a generated PDF (Microsoft Reporting Services 10.0.0.0) // that added a space after "stream" but before the CR; so gobble up unexpected chars // until we find a LF // ssteward - 10/30/12 // I have been given a PDF with a stream with a CR but no LF -- I should have foreseen this case; int ch = tokens.read(); /* original code if (ch != '\n') ch = tokens.read(); if (ch != '\n') tokens.backOnePosition(ch); */ // ssteward -- 6/21/10 fix //while (ch != '\n') // ch = tokens.read(); // ssteward -- 10/31/12 fix // eat whitespace until we hit a LF, which is supposed to mark the beginning of the stream; // this logic should work even if there is no w/s padding around the stream data while( PRTokeniser.isWhitespace( ch ) ) { if( ch== '\n' ) break; ch= tokens.read(); } // PRStream(), below, seems to assume that our position is one before the data; testing for // whitespace catches case where there is a CR no LF used to delim stream data if( !PRTokeniser.isWhitespace( ch ) ) tokens.backOnePosition( ch ); PRStream stream = new PRStream(this, tokens.getFilePointer()); stream.putAll(dic); // crypto handling stream.setObjNum(objNum, objGen); return stream; } else { tokens.seek(pos); return dic; } } case PRTokeniser.TK_START_ARRAY: { ++readDepth; PdfArray arr = readArray(); --readDepth; return arr; } case PRTokeniser.TK_NUMBER: return new PdfNumber(tokens.getStringValue()); case PRTokeniser.TK_STRING: // ssteward: change from String to byte array input to PdfString() //PdfString str = new PdfString(tokens.getStringValue(), null).setHexWriting(tokens.isHexString()); PdfString str = new PdfString( PdfEncodings.convertToBytes( tokens.getStringValue(), null) ).setHexWriting(tokens.isHexString()); str.setObjNum(objNum, objGen); if (strings != null) strings.add(str); return str; case PRTokeniser.TK_NAME: { PdfName cachedName = (PdfName)PdfName.staticNames.get( tokens.getStringValue() ); if (readDepth > 0 && cachedName != null) { return cachedName; } else { // an indirect name (how odd...), or a non-standard one return new PdfName(tokens.getStringValue(), false); } } case PRTokeniser.TK_REF: int num = tokens.getReference(); PRIndirectReference ref = new PRIndirectReference(this, num, tokens.getGeneration()); return ref; case PRTokeniser.TK_ENDOFFILE: throw new IOException("unexpected.end.of.file"); default: String sv = tokens.getStringValue(); if ("null".equals(sv)) { if (readDepth == 0) { return new PdfNull(); } //else return PdfNull.PDFNULL; } else if ("true".equals(sv)) { if (readDepth == 0) { return new PdfBoolean( true ); } //else return PdfBoolean.PDFTRUE; } else if ("false".equals(sv)) { if (readDepth == 0) { return new PdfBoolean( false ); } //else return PdfBoolean.PDFFALSE; } return new PdfLiteral(-type, tokens.getStringValue()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readPRObject 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
readPRObject
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private boolean shouldKeepVisibleDeadAppWindow() { if (!isWinVisibleLw() || mActivityRecord == null || !mActivityRecord.isClientVisible()) { // Not a visible app window or the app isn't dead. return false; } if (mAttrs.token != mClient.asBinder()) { // The window was add by a client using another client's app token. We don't want to // keep the dead window around for this case since this is meant for 'real' apps. return false; } if (mAttrs.type == TYPE_APPLICATION_STARTING) { // We don't keep starting windows since they were added by the window manager before // the app even launched. return false; } return getWindowConfiguration().keepVisibleDeadAppWindowOnScreen(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldKeepVisibleDeadAppWindow 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
shouldKeepVisibleDeadAppWindow
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public boolean isInLockTaskMode() throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInLockTaskMode File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
isInLockTaskMode
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public int getPasswordMinimumLength(ComponentName who, int userHandle, boolean parent) { return getStrictestPasswordRequirement(who, userHandle, parent, admin -> admin.mPasswordPolicy.length, PASSWORD_QUALITY_NUMERIC); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumLength 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
getPasswordMinimumLength
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setKeywords(String keywords) { this.keywords = keywords; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeywords File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
setKeywords
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
public static IOException wrap(ShutdownSignalException ex) { return wrap(ex, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrap File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
wrap
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public void storeSpaceIdInCookie(String space, HttpServletRequest req, HttpServletResponse res) { // directly set the space on the requests, overriding the cookie value // used for setting the space from a direct URL to a particular space req.setAttribute(CONF.spaceCookie(), space); HttpUtils.setRawCookie(CONF.spaceCookie(), Utils.base64encURL(space.getBytes()), req, res, true, "Strict", StringUtils.isBlank(space) ? 0 : 365 * 24 * 60 * 60); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: storeSpaceIdInCookie File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
storeSpaceIdInCookie
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private static long getInputDispatchingTimeoutMillisLocked(WindowProcessController r) { if (r == null) { return DEFAULT_DISPATCHING_TIMEOUT_MILLIS; } return r.getInputDispatchingTimeoutMillis(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputDispatchingTimeoutMillisLocked File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getInputDispatchingTimeoutMillisLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private String getTableName(String str) { String[] arr = str.split("\\s+(?i)where\\s+"); return arr[0]; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2022-47105 - Severity: CRITICAL - CVSS Score: 9.8 Description: 修复 sql注入漏洞 #4393 Function: getTableName File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/security/DictQueryBlackListHandler.java Repository: jeecgboot/jeecg-boot Fixed Code: private String getTableName(String str) { String[] arr = str.split("\\s+(?i)where\\s+"); // sys_user , (sys_user), sys_user%20, %60sys_user%60 issues/4393 String reg = "\\s+|\\(|\\)|`"; return arr[0].replaceAll(reg, ""); }
[ "CWE-89" ]
CVE-2022-47105
CRITICAL
9.8
jeecgboot/jeecg-boot
getTableName
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/security/DictQueryBlackListHandler.java
0fc374de4745eac52620eeb8caf6a7b76127529a
1
Analyze the following code function for security vulnerabilities
public LoginResultMapper login() { AuthenticationInfo authInfo = noIdProviderSpecified() ? attemptLoginWithAllExistingIdProviders() : attemptLogin(); if ( authInfo.isAuthenticated() ) { switch ( this.scope ) { case REQUEST: this.context.get().getLocalScope().setAttribute( authInfo ); break; case SESSION: default: createSession( authInfo ); break; } return new LoginResultMapper( authInfo ); } else { return new LoginResultMapper( authInfo, "Access Denied" ); } }
Vulnerability Classification: - CWE: CWE-384 - CVE: CVE-2024-23679 - Severity: CRITICAL - CVSS Score: 9.8 Description: Invalidate old session after login #9253 (cherry picked from commit 0189975691e9e6407a9fee87006f730e84f734ff) Function: login File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp Fixed Code: public LoginResultMapper login() { AuthenticationInfo authInfo = noIdProviderSpecified() ? attemptLoginWithAllExistingIdProviders() : attemptLogin(); if ( authInfo.isAuthenticated() ) { switch ( this.scope ) { case NONE: // do nothing break; case REQUEST: this.context.get().getLocalScope().setAttribute( authInfo ); break; case SESSION: default: createSession( authInfo ); break; } return new LoginResultMapper( authInfo ); } else { return new LoginResultMapper( authInfo, "Access Denied" ); } }
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
login
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
2abac31cec8679074debc4f1fb69c25930e40842
1
Analyze the following code function for security vulnerabilities
private void checkTrustedCerts(CertPath certPath) throws Exception { CertInformation info = certs.get(certPath); try { X509Certificate publisher = (X509Certificate) getPublisher(certPath); KeyStore[] certKeyStores = KeyStores.getCertKeyStores(); if (CertificateUtils.inKeyStores(publisher, certKeyStores)) info.setAlreadyTrustPublisher(); KeyStore[] caKeyStores = KeyStores.getCAKeyStores(); // Check entire cert path for a trusted CA for (Certificate c : certPath.getCertificates()) { if (CertificateUtils.inKeyStores((X509Certificate) c, caKeyStores)) { info.setRootInCacerts(); return; } } } catch (Exception e) { // TODO: Warn user about not being able to // look through their cacerts/trusted.certs // file depending on exception. LOG.warn("Unable to read through cert store files."); throw e; } // Otherwise a parent cert was not found to be trusted. info.setUntrusted(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkTrustedCerts File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
checkTrustedCerts
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
@Override public void onEvent(IEvent<?> event) { super.onEvent(event); if (event.getPayload() instanceof RevisionResolved) { RevisionResolved revisionResolveEvent = (RevisionResolved) event.getPayload(); resolvedRevision = revisionResolveEvent.getResolvedRevision(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onEvent File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
onEvent
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
public int getLaunchedFromUid(IBinder activityToken) { ActivityRecord srec = ActivityRecord.forToken(activityToken); if (srec == null) { return -1; } return srec.launchedFromUid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLaunchedFromUid 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
getLaunchedFromUid
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public Client getHttpClient() { return httpClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHttpClient File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getHttpClient
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public static String issueJwt(String subject, Long period){ String id = UUID.randomUUID().toString(); String issuer = "sureness-token-server"; return issueJwt(id, subject, issuer, period, null, 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
public IssuesRequest getDefaultIssueRequest(String projectId, String workspaceId) { IssuesRequest issuesRequest = new IssuesRequest(); issuesRequest.setProjectId(projectId); issuesRequest.setWorkspaceId(workspaceId); return issuesRequest; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultIssueRequest File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getDefaultIssueRequest
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public void setStore(XWikiStoreInterface store) { this.store = store; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStore 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
setStore
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 postAdjustLocalVolume(final int stream, final int direction, final int flags, final String callingOpPackageName, final int callingPid, final int callingUid, final boolean asSystemService, final boolean useSuggested, final int previousFlagPlaySound) { if (DEBUG) { Log.w(TAG, "adjusting local volume, stream=" + stream + ", dir=" + direction + ", asSystemService=" + asSystemService + ", useSuggested=" + useSuggested); } // Must use opPackageName for adjusting volumes with UID. final String opPackageName; final int uid; final int pid; if (asSystemService) { opPackageName = mContext.getOpPackageName(); uid = Process.SYSTEM_UID; pid = Process.myPid(); } else { opPackageName = callingOpPackageName; uid = callingUid; pid = callingPid; } mHandler.post(new Runnable() { @Override public void run() { try { if (useSuggested) { if (AudioSystem.isStreamActive(stream, 0)) { mAudioManager.adjustSuggestedStreamVolumeForUid(stream, direction, flags, opPackageName, uid, pid, mContext.getApplicationInfo().targetSdkVersion); } else { mAudioManager.adjustSuggestedStreamVolumeForUid( AudioManager.USE_DEFAULT_STREAM_TYPE, direction, flags | previousFlagPlaySound, opPackageName, uid, pid, mContext.getApplicationInfo().targetSdkVersion); } } else { mAudioManager.adjustStreamVolumeForUid(stream, direction, flags, opPackageName, uid, pid, mContext.getApplicationInfo().targetSdkVersion); } } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", stream=" + stream + ", flags=" + flags + ", opPackageName=" + opPackageName + ", uid=" + uid + ", useSuggested=" + useSuggested + ", previousFlagPlaySound=" + previousFlagPlaySound, e); } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postAdjustLocalVolume File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
postAdjustLocalVolume
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
protected final GF2Polynomial[] invertMatrix(GF2Polynomial[] matrix) { GF2Polynomial[] a = new GF2Polynomial[matrix.length]; GF2Polynomial[] inv = new GF2Polynomial[matrix.length]; GF2Polynomial dummy; int i, j; // initialize a as a copy of matrix and inv as E(inheitsmatrix) for (i = 0; i < mDegree; i++) { try { a[i] = new GF2Polynomial(matrix[i]); inv[i] = new GF2Polynomial(mDegree); inv[i].setBit(mDegree - 1 - i); } catch (RuntimeException BDNEExc) { BDNEExc.printStackTrace(); } } // construct triangle matrix so that for each a[i] the first i bits are // zero for (i = 0; i < mDegree - 1; i++) { // find column where bit i is set j = i; while ((j < mDegree) && !a[j].testBit(mDegree - 1 - i)) { j++; } if (j >= mDegree) { throw new RuntimeException( "GF2nField.invertMatrix: Matrix cannot be inverted!"); } if (i != j) { // swap a[i]/a[j] and inv[i]/inv[j] dummy = a[i]; a[i] = a[j]; a[j] = dummy; dummy = inv[i]; inv[i] = inv[j]; inv[j] = dummy; } for (j = i + 1; j < mDegree; j++) { // add column i to all columns>i // having their i-th bit set if (a[j].testBit(mDegree - 1 - i)) { a[j].addToThis(a[i]); inv[j].addToThis(inv[i]); } } } // construct Einheitsmatrix from a for (i = mDegree - 1; i > 0; i--) { for (j = i - 1; j >= 0; j--) { // eliminate the i-th bit in all // columns < i if (a[j].testBit(mDegree - 1 - i)) { a[j].addToThis(a[i]); inv[j].addToThis(inv[i]); } } } return inv; }
Vulnerability Classification: - CWE: CWE-470 - CVE: CVE-2018-1000613 - Severity: HIGH - CVSS Score: 7.5 Description: added additional checking to XMSS BDS tree parsing. Failures now mostly cause IOException Function: invertMatrix File: core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java Repository: bcgit/bc-java Fixed Code: protected final GF2Polynomial[] invertMatrix(GF2Polynomial[] matrix) { GF2Polynomial[] a = new GF2Polynomial[matrix.length]; GF2Polynomial[] inv = new GF2Polynomial[matrix.length]; GF2Polynomial dummy; int i, j; // initialize a as a copy of matrix and inv as E(inheitsmatrix) for (i = 0; i < mDegree; i++) { a[i] = new GF2Polynomial(matrix[i]); inv[i] = new GF2Polynomial(mDegree); inv[i].setBit(mDegree - 1 - i); } // construct triangle matrix so that for each a[i] the first i bits are // zero for (i = 0; i < mDegree - 1; i++) { // find column where bit i is set j = i; while ((j < mDegree) && !a[j].testBit(mDegree - 1 - i)) { j++; } if (j >= mDegree) { throw new RuntimeException( "GF2nField.invertMatrix: Matrix cannot be inverted!"); } if (i != j) { // swap a[i]/a[j] and inv[i]/inv[j] dummy = a[i]; a[i] = a[j]; a[j] = dummy; dummy = inv[i]; inv[i] = inv[j]; inv[j] = dummy; } for (j = i + 1; j < mDegree; j++) { // add column i to all columns>i // having their i-th bit set if (a[j].testBit(mDegree - 1 - i)) { a[j].addToThis(a[i]); inv[j].addToThis(inv[i]); } } } // construct Einheitsmatrix from a for (i = mDegree - 1; i > 0; i--) { for (j = i - 1; j >= 0; j--) { // eliminate the i-th bit in all // columns < i if (a[j].testBit(mDegree - 1 - i)) { a[j].addToThis(a[i]); inv[j].addToThis(inv[i]); } } } return inv; }
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
invertMatrix
core/src/main/java/org/bouncycastle/pqc/math/linearalgebra/GF2nField.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
1
Analyze the following code function for security vulnerabilities
public static boolean isStringArray(Object[] args) { int argsCount = args.length; for (int i = 0; i < argsCount; i++) { if (!(args[i] instanceof String)) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStringArray File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
isStringArray
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
@Override public void updateLockTaskPackages(int userId, String[] packages) { final int callingUid = Binder.getCallingUid(); if (callingUid != 0 && callingUid != Process.SYSTEM_UID) { enforceCallingPermission(android.Manifest.permission.UPDATE_LOCK_TASK_PACKAGES, "updateLockTaskPackages()"); } synchronized (this) { if (DEBUG_LOCKTASK) Slog.w(TAG_LOCKTASK, "Whitelisting " + userId + ":" + Arrays.toString(packages)); mLockTaskPackages.put(userId, packages); mStackSupervisor.onLockTaskPackagesUpdatedLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLockTaskPackages File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
updateLockTaskPackages
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private static boolean hasSomeUser() { for (User u : User.getAll()) if(u.getProperty(Details.class)!=null) return true; return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSomeUser File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
hasSomeUser
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
protected Restrictor createRestrictor(Configuration config) { return RestrictorFactory.createRestrictor(config, logHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRestrictor File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
createRestrictor
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
@Override protected OrganizationDirectoryService getOrganizationDirectoryService() { return organizationDirectory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrganizationDirectoryService File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-21318
MEDIUM
5.5
opencast
getOrganizationDirectoryService
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
b18c6a7f81f08ed14884592a6c14c9ab611ad450
0
Analyze the following code function for security vulnerabilities
public int getWidth() { View view = getView(); return view != null ? view.getWidth() : 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWidth File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getWidth
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected PluginWrapper getPlugin() { return Jenkins.getInstance().getPluginManager().whichPlugin(clazz); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlugin File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getPlugin
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override protected String mapSourceFilenameToDest(GFile srcFile) throws IOException { String filename = srcFile.getName(); if (!FSUtilities.getSafeFilename(filename).equals(filename)) { throw new IOException("Bad filename in archive: \"" + filename + "\""); } return filename; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mapSourceFilenameToDest File: Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java Repository: NationalSecurityAgency/ghidra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-13623
MEDIUM
6.8
NationalSecurityAgency/ghidra
mapSourceFilenameToDest
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java
c15364e0a4bd2bcd3bdf13a35afd6ac9607a5164
0
Analyze the following code function for security vulnerabilities
public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) { if (!(sender instanceof PendingIntentRecord)) { return; } final PendingIntentRecord rec = (PendingIntentRecord)sender; final BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics(); synchronized (stats) { mBatteryStatsService.enforceCallingPermission(); int MY_UID = Binder.getCallingUid(); int uid = rec.uid == MY_UID ? Process.SYSTEM_UID : rec.uid; mBatteryStatsService.noteAlarmFinish(tag, sourceUid >= 0 ? sourceUid : uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteAlarmFinish File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
noteAlarmFinish
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private boolean isIncludedRequest(HttpServletRequest request) { return request.getAttribute(INCLUDE_HEADER) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIncludedRequest File: impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
isIncludedRequest
impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java
8e413202fa1af08c09c580f444e4fd16874f9c65
0
Analyze the following code function for security vulnerabilities
private boolean uidOnBackgroundWhitelist(final int uid) { final int appId = UserHandle.getAppId(uid); final int[] whitelist = mBackgroundAppIdWhitelist; final int N = whitelist.length; for (int i = 0; i < N; i++) { if (appId == whitelist[i]) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uidOnBackgroundWhitelist 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
uidOnBackgroundWhitelist
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s//text()", Joiner.on("/").join(path)); try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeException("未找到相应路径的文本:" + expression); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXmlValue File: weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java Repository: Wechat-Group/WxJava The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20318
HIGH
7.5
Wechat-Group/WxJava
getXmlValue
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java
6272639f02e397fed40828a2d0da66c30264bc0e
0
Analyze the following code function for security vulnerabilities
public void removeDatatransferProgressListener( OnDatatransferProgressListener listener, User user, OCFile file ) { if (user == null || file == null || listener == null) { return; } String targetKey = buildRemoteName(user.getAccountName(), file.getRemotePath()); if (mBoundListeners.get(targetKey) == listener) { mBoundListeners.remove(targetKey); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeDatatransferProgressListener File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
removeDatatransferProgressListener
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
abstract void onBackendConnected();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBackendConnected File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onBackendConnected
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public WorkBundle getPaths() { return this.paths; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPaths File: src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
getPaths
src/main/java/emissary/server/mvc/adapters/WorkSpaceAdapter.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
@Override public boolean setPermittedAccessibilityServices(ComponentName who, List<String> packageList) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); if (packageList != null) { int userId = caller.getUserId(); final List<AccessibilityServiceInfo> enabledServices; long id = mInjector.binderClearCallingIdentity(); try { UserInfo user = getUserInfo(userId); if (user.isManagedProfile()) { userId = user.profileGroupId; } enabledServices = withAccessibilityManager(userId, am -> am.getEnabledAccessibilityServiceList(FEEDBACK_ALL_MASK)); } finally { mInjector.binderRestoreCallingIdentity(id); } if (enabledServices != null) { List<String> enabledPackages = new ArrayList<>(); for (AccessibilityServiceInfo service : enabledServices) { enabledPackages.add(service.getResolveInfo().serviceInfo.packageName); } if (!checkPackagesInPermittedListOrSystem(enabledPackages, packageList, userId)) { Slogf.e(LOG_TAG, "Cannot set permitted accessibility services, " + "because it contains already enabled accesibility services."); return false; } } } synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); admin.permittedAccessiblityServices = packageList; saveSettingsLocked(UserHandle.getCallingUserId()); } final String[] packageArray = packageList != null ? ((List<String>) packageList).toArray(new String[0]) : null; DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_PERMITTED_ACCESSIBILITY_SERVICES) .setAdmin(who) .setStrings(packageArray) .write(); return true; }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-21284 - Severity: MEDIUM - CVSS Score: 5.5 Description: Ensure policy has no absurdly long strings The following APIs now enforce limits and throw IllegalArgumentException when limits are violated: * DPM.setTrustAgentConfiguration() limits agent packgage name, component name, and strings within configuration bundle. * DPM.setPermittedAccessibilityServices() limits package names. * DPM.setPermittedInputMethods() limits package names. * DPM.setAccountManagementDisabled() limits account name. * DPM.setLockTaskPackages() limits package names. * DPM.setAffiliationIds() limits id. * DPM.transferOwnership() limits strings inside the bundle. Package names are limited at 223, because they become directory names and it is a filesystem restriction, see FrameworkParsingPackageUtils. All other strings are limited at 65535, because longer ones break binary XML serializer. The following APIs silently truncate strings that are long beyond reason: * DPM.setShortSupportMessage() truncates message at 200. * DPM.setLongSupportMessage() truncates message at 20000. * DPM.setOrganizationName() truncates org name at 200. Bug: 260729089 Test: atest com.android.server.devicepolicy (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b) Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Function: setPermittedAccessibilityServices File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android Fixed Code: @Override public boolean setPermittedAccessibilityServices(ComponentName who, List<String> packageList) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); if (packageList != null) { for (String pkg : packageList) { enforceMaxPackageNameLength(pkg); } int userId = caller.getUserId(); final List<AccessibilityServiceInfo> enabledServices; long id = mInjector.binderClearCallingIdentity(); try { UserInfo user = getUserInfo(userId); if (user.isManagedProfile()) { userId = user.profileGroupId; } enabledServices = withAccessibilityManager(userId, am -> am.getEnabledAccessibilityServiceList(FEEDBACK_ALL_MASK)); } finally { mInjector.binderRestoreCallingIdentity(id); } if (enabledServices != null) { List<String> enabledPackages = new ArrayList<>(); for (AccessibilityServiceInfo service : enabledServices) { enabledPackages.add(service.getResolveInfo().serviceInfo.packageName); } if (!checkPackagesInPermittedListOrSystem(enabledPackages, packageList, userId)) { Slogf.e(LOG_TAG, "Cannot set permitted accessibility services, " + "because it contains already enabled accesibility services."); return false; } } } synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); admin.permittedAccessiblityServices = packageList; saveSettingsLocked(UserHandle.getCallingUserId()); } final String[] packageArray = packageList != null ? ((List<String>) packageList).toArray(new String[0]) : null; DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_PERMITTED_ACCESSIBILITY_SERVICES) .setAdmin(who) .setStrings(packageArray) .write(); return true; }
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
setPermittedAccessibilityServices
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings({ "rawtypes" }) private <T> List<ValidationCaller> findMethods(Class<T> annotated) { ResolvedTypeWithMembers annotatedType = memberResolver.resolve(typeResolver.resolve(annotated), annotationConfiguration, null); final List<ValidationCaller> callers = Arrays.stream(annotatedType.getMemberMethods()) .filter(this::isValidationMethod) .filter(this::isMethodCorrect) .map(m -> new ProxyValidationCaller<>(annotated, m)) .collect(Collectors.toList()); if (callers.isEmpty()) { log.warn("The class {} is annotated with @SelfValidating but contains no valid methods that are annotated " + "with @SelfValidation", annotated); } return callers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findMethods File: dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/SelfValidatingValidator.java Repository: dropwizard The code follows secure coding practices.
[ "CWE-74" ]
CVE-2020-11002
HIGH
9
dropwizard
findMethods
dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/SelfValidatingValidator.java
d5a512f7abf965275f2a6b913ac4fe778e424242
0
Analyze the following code function for security vulnerabilities
public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(permission); data.writeInt(pid); data.writeInt(uid); data.writeStrongBinder(callerToken); mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0); reply.readException(); int res = reply.readInt(); data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermissionWithToken File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
checkPermissionWithToken
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private boolean hasNoTimeComponent(Date date) { return new DateMidnight(date).toDate().equals(date); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNoTimeComponent File: omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java Repository: openmrs/openmrs-module-htmlformentryui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-4284
MEDIUM
6.1
openmrs/openmrs-module-htmlformentryui
hasNoTimeComponent
omod/src/main/java/org/openmrs/module/htmlformentryui/fragment/controller/htmlform/EnterHtmlFormFragmentController.java
811990972ea07649ae33c4b56c61c3b520895f07
0
Analyze the following code function for security vulnerabilities
@Override public KBTemplate fetchByPrimaryKey(Serializable primaryKey) { Serializable serializable = entityCache.getResult(KBTemplateModelImpl.ENTITY_CACHE_ENABLED, KBTemplateImpl.class, primaryKey); if (serializable == nullModel) { return null; } KBTemplate kbTemplate = (KBTemplate)serializable; if (kbTemplate == null) { Session session = null; try { session = openSession(); kbTemplate = (KBTemplate)session.get(KBTemplateImpl.class, primaryKey); if (kbTemplate != null) { cacheResult(kbTemplate); } else { entityCache.putResult(KBTemplateModelImpl.ENTITY_CACHE_ENABLED, KBTemplateImpl.class, primaryKey, nullModel); } } catch (Exception e) { entityCache.removeResult(KBTemplateModelImpl.ENTITY_CACHE_ENABLED, KBTemplateImpl.class, primaryKey); throw processException(e); } finally { closeSession(session); } } return kbTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fetchByPrimaryKey File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
fetchByPrimaryKey
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
public boolean shouldUpRecreateTask(IBinder token, String destAffinity) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); data.writeString(destAffinity); mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0); reply.readException(); boolean result = reply.readInt() != 0; data.recycle(); reply.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUpRecreateTask File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
shouldUpRecreateTask
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private RelationshipType getRelationshipType(final Element element, final String attribute, final boolean mustFind) throws GameParseException { return getValidatedObject(element, attribute, mustFind, data.getRelationshipTypeList()::getRelationshipType, "relation"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelationshipType File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getRelationshipType
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public boolean deleteSynchronously(String mediaPackageId) throws SearchException, UnauthorizedException, NotFoundException { SearchResult result; try { result = solrRequester.getForWrite(new SearchQuery().withId(mediaPackageId)); if (result.getItems().length == 0) { logger.warn( "Can not delete mediapackage {}, which is not available for the current user to delete from the search index.", mediaPackageId); return false; } logger.info("Removing mediapackage {} from search index", mediaPackageId); Date now = new Date(); try { persistence.deleteMediaPackage(mediaPackageId, now); logger.info("Removed mediapackage {} from search persistence", mediaPackageId); } catch (NotFoundException e) { // even if mp not found in persistence, it might still exist in search index. logger.info("Could not find mediapackage with id {} in persistence, but will try remove it from index, anyway.", mediaPackageId); } catch (SearchServiceDatabaseException e) { logger.error("Could not delete media package with id {} from persistence storage", mediaPackageId); throw new SearchException(e); } return indexManager.delete(mediaPackageId, now); } catch (SolrServerException e) { logger.info("Could not delete media package with id {} from search index", mediaPackageId); throw new SearchException(e); } }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2021-21318 - Severity: MEDIUM - CVSS Score: 5.5 Description: Fix Engage Series Publication and Access Access to series and series metadata on the search service (shown in media module and player) depends on the events published which are part of the series. Publishing an event will automatically publish a series and update access to it. Removing an event or republishing the event should do the same. Incorrectly Hiding Public Series -------------------------------- This patch fixes the access control update to the series when a new episode is being published. Until now, a new episode publication would always update the series access with the episode access. While this is no security issue since it can only cause the access to be stricter, it may cause public series to become private. This would happen, for example, if a users sets one episode of a series to private and republishes the episode. Now, the search service will merge the access control lists of all episodes to grant access based on their combined access rules. Update Series on Removal ------------------------ This patch fixes Opencast not updating the series access or remove a published series if an event is being removed. This means that access to a series is re-calculated when an episode is being deleted based on the remaining published episodes in the series. For example, removing the last episode with public access will now make the series private which it would have stayed public before. It also means that if the last episode of a series is being removed, the series itself will be unpublished as well, so no empty series will continue to show up any longer. Function: deleteSynchronously File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java Repository: opencast Fixed Code: public boolean deleteSynchronously(final String mediaPackageId) throws SearchException { SearchResult result; try { result = solrRequester.getForWrite(new SearchQuery().withId(mediaPackageId)); if (result.getItems().length == 0) { logger.warn( "Can not delete mediapackage {}, which is not available for the current user to delete from the search index.", mediaPackageId); return false; } final String seriesId = result.getItems()[0].getDcIsPartOf(); logger.info("Removing media package {} from search index", mediaPackageId); Date now = new Date(); try { persistence.deleteMediaPackage(mediaPackageId, now); logger.info("Removed mediapackage {} from search persistence", mediaPackageId); } catch (NotFoundException e) { // even if mp not found in persistence, it might still exist in search index. logger.info("Could not find mediapackage with id {} in persistence, but will try remove it from index, anyway.", mediaPackageId); } catch (SearchServiceDatabaseException e) { logger.error("Could not delete media package with id {} from persistence storage", mediaPackageId); throw new SearchException(e); } final boolean success = indexManager.delete(mediaPackageId, now); // Update series if (seriesId != null) { if (persistence.getMediaPackages(seriesId).size() > 0) { // Update series acl if there are still episodes in the series final AccessControlList seriesAcl = persistence.getAccessControlLists(seriesId).stream() .reduce(new AccessControlList(), AccessControlList::mergeActions); indexManager.addSeries(seriesId, seriesAcl); } else { // Remove series if there are no episodes in the series any longer indexManager.delete(seriesId, now); } } return success; } catch (SolrServerException | SearchServiceDatabaseException e) { logger.info("Could not delete media package with id {} from search index", mediaPackageId); throw new SearchException(e); } }
[ "CWE-863" ]
CVE-2021-21318
MEDIUM
5.5
opencast
deleteSynchronously
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
b18c6a7f81f08ed14884592a6c14c9ab611ad450
1