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
protected void appendToken(final StringBuilder builder, final StringBuilder token) { String string = token.toString(); if ("Jvm".equals(string)) { string = "JVM"; } builder.append(string); token.setLength(0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendToken File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
appendToken
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public void sendRedirect(String location) throws IOException { if (isIncluding()) { Logger.log(Logger.ERROR, Launcher.RESOURCES, "IncludeResponse.Redirect", location); return; } else if (isCommitted()) { throw new IllegalStateException(Launcher.RESOURCES.getString("WinstoneOutputStream.AlreadyCommitted")); } resetBuffer(); // Build location StringBuffer fullLocation = new StringBuffer(); if (location.startsWith("http://") || location.startsWith("https://")) { fullLocation.append(location); } else { if (location.trim().equals(".")) { location = ""; } fullLocation.append(this.req.getScheme()).append("://"); fullLocation.append(this.req.getServerName()); if (!((this.req.getServerPort() == 80) && this.req.getScheme().equals("http")) && !((this.req.getServerPort() == 443) && this.req.getScheme().equals("https"))) fullLocation.append(':').append(this.req.getServerPort()); if (location.startsWith("/")) { fullLocation.append(location); } else { fullLocation.append(this.req.getRequestURI()); int questionPos = fullLocation.toString().indexOf("?"); if (questionPos != -1) { fullLocation.delete(questionPos, fullLocation.length()); } fullLocation.delete( fullLocation.toString().lastIndexOf("/") + 1, fullLocation.length()); fullLocation.append(location); } } if (this.req != null) { this.req.discardRequestBody(); } this.statusCode = HttpServletResponse.SC_MOVED_TEMPORARILY; setHeader(LOCATION_HEADER, fullLocation.toString()); setContentLength(0); getWriter().flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendRedirect File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
sendRedirect
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
int invokeAgentForBackup(String packageName, IBackupAgent agent, IBackupTransport transport) { if (DEBUG) Slog.d(TAG, "invokeAgentForBackup on " + packageName); addBackupTrace("invoking " + packageName); mSavedStateName = new File(mStateDir, packageName); mBackupDataName = new File(mDataDir, packageName + ".data"); mNewStateName = new File(mStateDir, packageName + ".new"); if (MORE_DEBUG) Slog.d(TAG, "data file: " + mBackupDataName); mSavedState = null; mBackupData = null; mNewState = null; final int token = generateToken(); try { // Look up the package info & signatures. This is first so that if it // throws an exception, there's no file setup yet that would need to // be unraveled. if (packageName.equals(PACKAGE_MANAGER_SENTINEL)) { // The metadata 'package' is synthetic; construct one and make // sure our global state is pointed at it mCurrentPackage = new PackageInfo(); mCurrentPackage.packageName = packageName; } // In a full backup, we pass a null ParcelFileDescriptor as // the saved-state "file". This is by definition an incremental, // so we build a saved state file to pass. mSavedState = ParcelFileDescriptor.open(mSavedStateName, ParcelFileDescriptor.MODE_READ_ONLY | ParcelFileDescriptor.MODE_CREATE); // Make an empty file if necessary mBackupData = ParcelFileDescriptor.open(mBackupDataName, ParcelFileDescriptor.MODE_READ_WRITE | ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE); if (!SELinux.restorecon(mBackupDataName)) { Slog.e(TAG, "SELinux restorecon failed on " + mBackupDataName); } mNewState = ParcelFileDescriptor.open(mNewStateName, ParcelFileDescriptor.MODE_READ_WRITE | ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_TRUNCATE); // Initiate the target's backup pass addBackupTrace("setting timeout"); prepareOperationTimeout(token, TIMEOUT_BACKUP_INTERVAL, this); addBackupTrace("calling agent doBackup()"); agent.doBackup(mSavedState, mBackupData, mNewState, token, mBackupManagerBinder); } catch (Exception e) { Slog.e(TAG, "Error invoking for backup on " + packageName); addBackupTrace("exception: " + e); EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, packageName, e.toString()); agentErrorCleanup(); return BackupTransport.AGENT_ERROR; } // At this point the agent is off and running. The next thing to happen will // either be a callback from the agent, at which point we'll process its data // for transport, or a timeout. Either way the next phase will happen in // response to the TimeoutHandler interface callbacks. addBackupTrace("invoke success"); return BackupTransport.TRANSPORT_OK; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invokeAgentForBackup File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
invokeAgentForBackup
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@Override public void keyguardGoingAway(boolean disableWindowAnimations, boolean keyguardGoingToNotificationShade) { enforceNotIsolatedCaller("keyguardGoingAway"); final long token = Binder.clearCallingIdentity(); try { synchronized (this) { if (DEBUG_LOCKSCREEN) logLockScreen(""); mWindowManager.keyguardGoingAway(disableWindowAnimations, keyguardGoingToNotificationShade); if (mLockScreenShown == LOCK_SCREEN_SHOWN) { mLockScreenShown = LOCK_SCREEN_HIDDEN; updateSleepIfNeededLocked(); } } } finally { Binder.restoreCallingIdentity(token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyguardGoingAway 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
keyguardGoingAway
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public void setRestTemplate(RestTemplate restTemplate) { this.restTemplate = restTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRestTemplate File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setRestTemplate
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override protected String process(Job job) throws Exception { throw new IllegalStateException("Ingest jobs are not expected to be dispatched"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: process File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
process
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public static void updateFolderReferences(Folder folder) throws DotDataException{ HibernateUtil dh = new HibernateUtil(Structure.class); dh.setQuery("select inode from inode in class " + Structure.class.getName() + " where inode.folder = ?"); dh.setParam(folder.getInode()); List<Structure> results = dh.list(); for(Structure structure : results){ if(UtilMethods.isSet(folder.getHostId()) && !hostAPI.findSystemHost().getIdentifier().equals(folder.getHostId())){ structure.setHost(folder.getHostId()); }else{ structure.setHost("SYSTEM_HOST"); } structure.setFolder("SYSTEM_FOLDER"); HibernateUtil.saveOrUpdate(structure); CacheLocator.getContentTypeCache().remove(structure); permissionAPI.resetPermissionReferences(structure); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFolderReferences File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
updateFolderReferences
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
static int parseIntAttribute(TypedXmlPullParser parser, String attribute) { return (int) parseLongAttribute(parser, attribute); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseIntAttribute File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
parseIntAttribute
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void setDebugApp( String packageName, boolean waitForDebugger, boolean persistent) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDebugApp File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setDebugApp
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
Call getDialingCall() { return getFirstCallWithState(CallState.DIALING); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDialingCall File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
getDialingCall
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
protected void addLocales(XWikiDocument xdocument, Locale entityLocale, SolrInputDocument solrDocument) throws SolrIndexerException, XWikiException { Set<Locale> locales = getLocales(xdocument, entityLocale); for (Locale childLocale : locales) { solrDocument.addField(FieldUtils.LOCALES, childLocale.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addLocales File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
addLocales
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public void sort(Sort s) { setSortOrder(s.build()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sort 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
sort
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public boolean isGroupSync() { String groupClaim = getGroupClaim(); return getUserInfoClaims().contains(groupClaim); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isGroupSync File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
isGroupSync
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
private boolean checkAuthorization(String authorization, List<String> availableSecrets, String timestamp, String path, String query) { String signature = null; if (authorization != null) { String[] split = authorization.split(":"); if (split.length > 1) { signature = split[1]; } } for (String secret : availableSecrets) { String availableSignature = accessKeyUtil.buildSignature(path, query, timestamp, secret); if (Objects.equals(signature, availableSignature)) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAuthorization File: apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java Repository: apolloconfig/apollo The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-15170
MEDIUM
6.8
apolloconfig/apollo
checkAuthorization
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java
ae9ba6cfd32ed80469f162e5e3583e2477862ddf
0
Analyze the following code function for security vulnerabilities
protected void populateMap(HierarchicalStreamReader reader, UnmarshallingContext context, Map map, Map target) { while (reader.hasMoreChildren()) { reader.moveDown(); putCurrentEntryIntoMap(reader, context, map, target); reader.moveUp(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateMap File: xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
populateMap
xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public static WebClient create(String baseUrl) { return builder() .baseUrl(baseUrl) .build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: app/server/appsmith-interfaces/src/main/java/com/appsmith/util/WebClientUtils.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-4096
MEDIUM
6.5
appsmithorg/appsmith
create
app/server/appsmith-interfaces/src/main/java/com/appsmith/util/WebClientUtils.java
769719ccfe667f059fe0b107a19ec9feb90f2e40
0
Analyze the following code function for security vulnerabilities
public int getEdgeSizeOfDrawer() { try { Field mDragger = Objects.requireNonNull(binding.drawerLayout).getClass().getDeclaredField("mLeftDragger"); mDragger.setAccessible(true); ViewDragHelper draggerObj = (ViewDragHelper) mDragger.get(binding.drawerLayout); Field mEdgeSize = Objects.requireNonNull(draggerObj).getClass().getDeclaredField("mEdgeSize"); mEdgeSize.setAccessible(true); return mEdgeSize.getInt(draggerObj); } catch (Exception e) { Log.e(TAG, "Failed to get edge size of drawer", e); } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEdgeSizeOfDrawer File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
getEdgeSizeOfDrawer
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
private void cleanupDisabledPackageComponentsLocked( String packageName, int userId, String[] changedClasses) { Set<String> disabledClasses = null; boolean packageDisabled = false; IPackageManager pm = AppGlobals.getPackageManager(); if (changedClasses == null) { // Nothing changed... return; } // Determine enable/disable state of the package and its components. int enabled = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; for (int i = changedClasses.length - 1; i >= 0; i--) { final String changedClass = changedClasses[i]; if (changedClass.equals(packageName)) { try { // Entire package setting changed enabled = pm.getApplicationEnabledSetting(packageName, (userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_SYSTEM); } catch (Exception e) { // No such package/component; probably racing with uninstall. In any // event it means we have nothing further to do here. return; } packageDisabled = enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED && enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; if (packageDisabled) { // Entire package is disabled. // No need to continue to check component states. disabledClasses = null; break; } } else { try { enabled = pm.getComponentEnabledSetting( new ComponentName(packageName, changedClass), (userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_SYSTEM); } catch (Exception e) { // As above, probably racing with uninstall. return; } if (enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED && enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) { if (disabledClasses == null) { disabledClasses = new ArraySet<>(changedClasses.length); } disabledClasses.add(changedClass); } } } if (!packageDisabled && disabledClasses == null) { // Nothing to do here... return; } mAtmInternal.cleanupDisabledPackageComponents( packageName, disabledClasses, userId, mBooted); // Clean-up disabled services. mServices.bringDownDisabledPackageServicesLocked( packageName, disabledClasses, userId, false /* evenPersistent */, false /* fullStop */, true /* doIt */); // Clean-up disabled providers. ArrayList<ContentProviderRecord> providers = new ArrayList<>(); mCpHelper.getProviderMap().collectPackageProvidersLocked( packageName, disabledClasses, true, false, userId, providers); for (int i = providers.size() - 1; i >= 0; i--) { mCpHelper.removeDyingProviderLocked(null, providers.get(i), true); } // Clean-up disabled broadcast receivers. for (int i = mBroadcastQueues.length - 1; i >= 0; i--) { mBroadcastQueues[i].cleanupDisabledPackageReceiversLocked( packageName, disabledClasses, userId, true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupDisabledPackageComponentsLocked 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
cleanupDisabledPackageComponentsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void onServiceDisconnected(ComponentName name) { synchronized (this) { mService = null; if (MORE_DEBUG) Slog.i(TAG, "OBB service connection disconnected on " + this); this.notifyAll(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onServiceDisconnected File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
onServiceDisconnected
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public long getMinHomeUplinkBandwidth() { return mMinHomeUplinkBandwidth; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMinHomeUplinkBandwidth File: framework/java/android/net/wifi/hotspot2/pps/Policy.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21240
MEDIUM
5.5
android
getMinHomeUplinkBandwidth
framework/java/android/net/wifi/hotspot2/pps/Policy.java
69119d1d3102e27b6473c785125696881bce9563
0
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "set the ProbeIndicator") @RequestMapping(value = "/setProbeIndicator", method = RequestMethod.POST) public @ResponseBody SuccessErrorMessage setProbeIndicator(HttpServletRequest request, @RequestParam(value = "userId", required = true) String userId, @RequestParam(value = "solutionId", required = false) String solutionId, @RequestParam(value = "version", required = true) String version, @RequestParam(value = "cid", required = false) String cid, @RequestParam(value = "probeIndicator", required = true) String probeIndicator ) throws AcumosException { SuccessErrorMessage successErrorMessage = null; logger.debug(EELFLoggerDelegator.debugLogger, "setProbeIndicator() in SolutionController Begin"); try { successErrorMessage = compositeServiceImpl.setProbeIndicator(userId, solutionId, version, cid,probeIndicator); }catch (Exception e) { logger.error(EELFLoggerDelegator.errorLogger, "Exception in setProbeIndicator() in SolutionController", e); } logger.debug(EELFLoggerDelegator.debugLogger, "setProbeIndicator() in SolutionController End"); return successErrorMessage; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-25097 - Severity: MEDIUM - CVSS Score: 4.0 Description: Senitization for CSS Vulnerability Issue-Id : ACUMOS-1650 Description : Senitization for CSS Vulnerability - Design Studio Change-Id: If8fd4b9b06f884219d93881f7922421870de8e3d Signed-off-by: Ramanaiah Pirla <RP00490596@techmahindra.com> Function: setProbeIndicator File: ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java Repository: acumos/design-studio Fixed Code: @ApiOperation(value = "set the ProbeIndicator") @RequestMapping(value = "/setProbeIndicator", method = RequestMethod.POST) public @ResponseBody SuccessErrorMessage setProbeIndicator(HttpServletRequest request, @RequestParam(value = "userId", required = true) String userId, @RequestParam(value = "solutionId", required = false) String solutionId, @RequestParam(value = "version", required = true) String version, @RequestParam(value = "cid", required = false) String cid, @RequestParam(value = "probeIndicator", required = true) String probeIndicator ) throws AcumosException { SuccessErrorMessage successErrorMessage = null; logger.debug(EELFLoggerDelegator.debugLogger, "setProbeIndicator() in SolutionController Begin"); try { successErrorMessage = compositeServiceImpl.setProbeIndicator(userId, SanitizeUtils.sanitize(solutionId), version, cid,probeIndicator); }catch (Exception e) { logger.error(EELFLoggerDelegator.errorLogger, "Exception in setProbeIndicator() in SolutionController", e); } logger.debug(EELFLoggerDelegator.debugLogger, "setProbeIndicator() in SolutionController End"); return successErrorMessage; }
[ "CWE-79" ]
CVE-2018-25097
MEDIUM
4
acumos/design-studio
setProbeIndicator
ds-compositionengine/src/main/java/org/acumos/designstudio/ce/controller/SolutionController.java
0df8a5e8722188744973168648e4c74c69ce67fd
1
Analyze the following code function for security vulnerabilities
@Beta public static void copy(File from, OutputStream to) throws IOException { asByteSource(from).copyTo(to); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copy File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
copy
guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
public AsyncHttpClientConfigBean setMaxRedirects(int maxRedirects) { this.maxRedirects = maxRedirects; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxRedirects File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setMaxRedirects
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
protected Object _mapObjectWithDups(JsonParser p, DeserializationContext ctxt, final Map<String, Object> result, String initialKey, Object oldValue, Object newValue, String nextKey) throws IOException { final boolean squashDups = ctxt.isEnabled(StreamReadCapability.DUPLICATE_PROPERTIES); if (squashDups) { _squashDups(result, initialKey, oldValue, newValue); } while (nextKey != null) { p.nextToken(); newValue = deserialize(p, ctxt); oldValue = result.put(nextKey, newValue); if ((oldValue != null) && squashDups) { _squashDups(result, nextKey, oldValue, newValue); } nextKey = p.nextFieldName(); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _mapObjectWithDups File: src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-787" ]
CVE-2020-36518
MEDIUM
5
FasterXML/jackson-databind
_mapObjectWithDups
src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
8238ab41d0350fb915797c89d46777b4496b74fd
0
Analyze the following code function for security vulnerabilities
public boolean isUserStopped(int userId) { synchronized (this) { return mUserController.getStartedUserStateLocked(userId) == null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserStopped 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
isUserStopped
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static <M extends HttpMethod> M assertStatusCodes(M method, boolean release, int... expectedCodes) throws Exception { if (expectedCodes.length > 0) { int actualCode = method.getStatusCode(); if (!ArrayUtils.contains(expectedCodes, actualCode)) { if (actualCode == Status.INTERNAL_SERVER_ERROR.getStatusCode()) { String message; try { message = method.getResponseBodyAsString(); } catch (IOException e) { message = ""; } fail(String.format("Unexpected internal server error with message [%s] for [%s]", message, method.getURI())); } else { fail(String.format("Unexpected code [%s], was expecting one of [%s] for [%s]", actualCode, Arrays.toString(expectedCodes), method.getURI())); } } } if (release) { method.releaseConnection(); } return method; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: assertStatusCodes File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
assertStatusCodes
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public static JSONObject getFieldDataFilter(Field field) { String dataFilter = EasyMetaFactory.valueOf(field).getExtraAttr(EasyFieldConfigProps.REFERENCE_DATAFILTER); if (JSONUtils.wellFormat(dataFilter) && dataFilter.length() > 10) { JSONObject advFilter = JSON.parseObject(dataFilter); if (advFilter.get("items") != null && !advFilter.getJSONArray ("items").isEmpty()) { return advFilter; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFieldDataFilter File: src/main/java/com/rebuild/core/support/general/ProtocolFilterParser.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
getFieldDataFilter
src/main/java/com/rebuild/core/support/general/ProtocolFilterParser.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
@Programming public String getURLContent(String surl, String username, String password, int timeout) throws IOException { if (!hasProgrammingRights()) { return ""; } try { return this.xwiki.getURLContent(surl, username, password, timeout, this.xwiki.getHttpUserAgent(this.context)); } catch (Exception e) { return ""; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURLContent 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
getURLContent
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 AnnotatedElement getSecurityTarget(Method method) { if (!Modifier.isPublic(method.getModifiers())) { throw new IllegalArgumentException(String.format( "The method '%s' is not public hence cannot have a security target", method)); } return hasSecurityAnnotation(method) ? method : method.getDeclaringClass(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecurityTarget File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31406
LOW
1.9
vaadin/flow
getSecurityTarget
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
3fe644cab2cffa5b86316dbe71b11df1083861a9
0
Analyze the following code function for security vulnerabilities
private Component newUploadPanel() { Fragment fragment; IModel<Collection<FileUpload>> model = new PropertyModel<Collection<FileUpload>>(this, "uploads"); String acceptedFiles; if (isImage) acceptedFiles = "image/*"; else acceptedFiles = null; AttachmentSupport attachmentSupport = markdownEditor.getAttachmentSupport(); if (attachmentSupport != null) { fragment = new Fragment(CONTENT_ID, "uploadAttachmentFrag", this); Form<?> form = new Form<Void>("form") { @Override protected void onSubmit() { super.onSubmit(); AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); String attachmentName; FileUpload upload = uploads.iterator().next(); try (InputStream is = upload.getInputStream()) { attachmentName = attachmentSupport.saveAttachment(upload.getClientFileName(), is); } catch (IOException e) { throw new RuntimeException(e); } markdownEditor.insertUrl(target, isImage, attachmentSupport.getAttachmentUrl(attachmentName), UrlUtils.describe(attachmentName), null); onClose(target); } @Override protected void onFileUploadException(FileUploadException e, Map<String, Object> model) { throw new RuntimeException(e); } }; form.setMaxSize(Bytes.bytes(attachmentSupport.getAttachmentMaxSize())); form.setMultiPart(true); form.add(new FencedFeedbackPanel("feedback", form)); int maxFilesize = (int) (attachmentSupport.getAttachmentMaxSize()/1024/1024); if (maxFilesize <= 0) maxFilesize = 1; form.add(new DropzoneField("file", model, acceptedFiles, 1, maxFilesize) .setRequired(true).setLabel(Model.of("Attachment"))); form.add(new AjaxButton("insert"){}); fragment.add(form); } else { fragment = new Fragment(CONTENT_ID, "uploadBlobFrag", this); Form<?> form = new Form<Void>("form"); form.setMultiPart(true); form.setFileMaxSize(Bytes.megabytes(Project.MAX_UPLOAD_SIZE)); add(form); FencedFeedbackPanel feedback = new FencedFeedbackPanel("feedback", form); feedback.setOutputMarkupPlaceholderTag(true); form.add(feedback); form.add(new DropzoneField("file", model, acceptedFiles, 1, Project.MAX_UPLOAD_SIZE) .setRequired(true).setLabel(Model.of("Attachment"))); form.add(new TextField<String>("directory", new IModel<String>() { @Override public void detach() { } @Override public String getObject() { return WebSession.get().getMetaData(UPLOAD_DIRECTORY); } @Override public void setObject(String object) { WebSession.get().setMetaData(UPLOAD_DIRECTORY, object); } })); BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext()); ObjectId commitId = resolveCommitId(context); Set<BlobIdent> folderPickerState = getPickerState(commitId, context.getBlobIdent(), WebSession.get().getMetaData(FOLDER_PICKER_STATE)); form.add(new DropdownLink("select") { @Override protected Component newContent(String id, FloatingPanel dropdown) { return new BlobFolderPicker(id, commitId) { @Override protected void onSelect(AjaxRequestTarget target, BlobIdent blobIdent) { dropdown.close(); String relativePath = PathUtils.relativize(context.getDirectory(), blobIdent.path); String script = String.format("$('form.upload-blob .directory input').val('%s');", JavaScriptEscape.escapeJavaScript(relativePath)); target.appendJavaScript(script); } @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } @Override protected void onStateChange() { HashSet<String> expandedPaths = new HashSet<>(); for (BlobIdent blobIdent: folderPickerState) expandedPaths.add(blobIdent.path); WebSession.get().setMetaData(FOLDER_PICKER_STATE, expandedPaths); } @Override protected Set<BlobIdent> getState() { return folderPickerState; } }; } }); ReferenceInputBehavior behavior = new ReferenceInputBehavior(true) { @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } }; form.add(new TextField<String>("summaryCommitMessage", new PropertyModel<String>(this, "summaryCommitMessage")).add(behavior)); behavior = new ReferenceInputBehavior(true) { @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } }; form.add(new TextArea<String>("detailCommitMessage", new PropertyModel<String>(this, "detailCommitMessage")).add(behavior)); form.add(new AjaxButton("insert") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { super.onSubmit(target, form); BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext()); String commitMessage = summaryCommitMessage; if (StringUtils.isBlank(commitMessage)) commitMessage = "Add files via upload"; if (StringUtils.isNotBlank(detailCommitMessage)) commitMessage += "\n\n" + detailCommitMessage; try { String directory = WebSession.get().getMetaData(UPLOAD_DIRECTORY); context.onCommitted(null, context.uploadFiles(uploads, directory, commitMessage), null); String fileName = uploads.iterator().next().getClientFileName(); String url; if (directory != null) url = directory + "/" + UrlUtils.encodePath(fileName); else url = UrlUtils.encodePath(fileName); markdownEditor.insertUrl(target, isImage, url, UrlUtils.describe(fileName), null); onClose(target); } catch (GitException e) { form.error(e.getMessage()); target.add(feedback); } } @Override protected void onError(AjaxRequestTarget target, Form<?> form) { super.onError(target, form); target.add(feedback); } }); fragment.add(form); } fragment.setOutputMarkupId(true); return fragment; }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2021-21245 - Severity: HIGH - CVSS Score: 7.5 Description: Fix the issue that uploaded file can be stored anywhere OneDev has write permissions over Function: newUploadPanel File: server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java Repository: theonedev/onedev Fixed Code: private Component newUploadPanel() { Fragment fragment; IModel<Collection<FileUpload>> model = new PropertyModel<Collection<FileUpload>>(this, "uploads"); String acceptedFiles; if (isImage) acceptedFiles = "image/*"; else acceptedFiles = null; AttachmentSupport attachmentSupport = markdownEditor.getAttachmentSupport(); if (attachmentSupport != null) { fragment = new Fragment(CONTENT_ID, "uploadAttachmentFrag", this); Form<?> form = new Form<Void>("form") { @Override protected void onSubmit() { super.onSubmit(); AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class); String attachmentName; FileUpload upload = uploads.iterator().next(); try (InputStream is = upload.getInputStream()) { attachmentName = attachmentSupport.saveAttachment( FilenameUtils.sanitizeFilename(upload.getClientFileName()), is); } catch (IOException e) { throw new RuntimeException(e); } markdownEditor.insertUrl(target, isImage, attachmentSupport.getAttachmentUrl(attachmentName), UrlUtils.describe(attachmentName), null); onClose(target); } @Override protected void onFileUploadException(FileUploadException e, Map<String, Object> model) { throw new RuntimeException(e); } }; form.setMaxSize(Bytes.bytes(attachmentSupport.getAttachmentMaxSize())); form.setMultiPart(true); form.add(new FencedFeedbackPanel("feedback", form)); int maxFilesize = (int) (attachmentSupport.getAttachmentMaxSize()/1024/1024); if (maxFilesize <= 0) maxFilesize = 1; form.add(new DropzoneField("file", model, acceptedFiles, 1, maxFilesize) .setRequired(true).setLabel(Model.of("Attachment"))); form.add(new AjaxButton("insert"){}); fragment.add(form); } else { fragment = new Fragment(CONTENT_ID, "uploadBlobFrag", this); Form<?> form = new Form<Void>("form"); form.setMultiPart(true); form.setFileMaxSize(Bytes.megabytes(Project.MAX_UPLOAD_SIZE)); add(form); FencedFeedbackPanel feedback = new FencedFeedbackPanel("feedback", form); feedback.setOutputMarkupPlaceholderTag(true); form.add(feedback); form.add(new DropzoneField("file", model, acceptedFiles, 1, Project.MAX_UPLOAD_SIZE) .setRequired(true).setLabel(Model.of("Attachment"))); form.add(new TextField<String>("directory", new IModel<String>() { @Override public void detach() { } @Override public String getObject() { return WebSession.get().getMetaData(UPLOAD_DIRECTORY); } @Override public void setObject(String object) { WebSession.get().setMetaData(UPLOAD_DIRECTORY, object); } })); BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext()); ObjectId commitId = resolveCommitId(context); Set<BlobIdent> folderPickerState = getPickerState(commitId, context.getBlobIdent(), WebSession.get().getMetaData(FOLDER_PICKER_STATE)); form.add(new DropdownLink("select") { @Override protected Component newContent(String id, FloatingPanel dropdown) { return new BlobFolderPicker(id, commitId) { @Override protected void onSelect(AjaxRequestTarget target, BlobIdent blobIdent) { dropdown.close(); String relativePath = PathUtils.relativize(context.getDirectory(), blobIdent.path); String script = String.format("$('form.upload-blob .directory input').val('%s');", JavaScriptEscape.escapeJavaScript(relativePath)); target.appendJavaScript(script); } @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } @Override protected void onStateChange() { HashSet<String> expandedPaths = new HashSet<>(); for (BlobIdent blobIdent: folderPickerState) expandedPaths.add(blobIdent.path); WebSession.get().setMetaData(FOLDER_PICKER_STATE, expandedPaths); } @Override protected Set<BlobIdent> getState() { return folderPickerState; } }; } }); ReferenceInputBehavior behavior = new ReferenceInputBehavior(true) { @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } }; form.add(new TextField<String>("summaryCommitMessage", new PropertyModel<String>(this, "summaryCommitMessage")).add(behavior)); behavior = new ReferenceInputBehavior(true) { @Override protected Project getProject() { return markdownEditor.getBlobRenderContext().getProject(); } }; form.add(new TextArea<String>("detailCommitMessage", new PropertyModel<String>(this, "detailCommitMessage")).add(behavior)); form.add(new AjaxButton("insert") { @Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { super.onSubmit(target, form); BlobRenderContext context = Preconditions.checkNotNull(markdownEditor.getBlobRenderContext()); String commitMessage = summaryCommitMessage; if (StringUtils.isBlank(commitMessage)) commitMessage = "Add files via upload"; if (StringUtils.isNotBlank(detailCommitMessage)) commitMessage += "\n\n" + detailCommitMessage; try { String directory = WebSession.get().getMetaData(UPLOAD_DIRECTORY); context.onCommitted(null, context.uploadFiles(uploads, directory, commitMessage), null); String fileName = uploads.iterator().next().getClientFileName(); String url; if (directory != null) url = directory + "/" + UrlUtils.encodePath(fileName); else url = UrlUtils.encodePath(fileName); markdownEditor.insertUrl(target, isImage, url, UrlUtils.describe(fileName), null); onClose(target); } catch (GitException e) { form.error(e.getMessage()); target.add(feedback); } } @Override protected void onError(AjaxRequestTarget target, Form<?> form) { super.onError(target, form); target.add(feedback); } }); fragment.add(form); } fragment.setOutputMarkupId(true); return fragment; }
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
newUploadPanel
server-core/src/main/java/io/onedev/server/web/component/markdown/InsertUrlPanel.java
0c060153fb97c0288a1917efdb17cc426934dacb
1
Analyze the following code function for security vulnerabilities
public static long calculateDefaultFlexTime(long syncTimeSeconds) { if (syncTimeSeconds < DEFAULT_MIN_FLEX_ALLOWED_SECS) { // Small enough sync request time that we don't add flex time - developer probably // wants to wait for an operation to occur before syncing so we honour the // request time. return 0L; } else if (syncTimeSeconds < DEFAULT_POLL_FREQUENCY_SECONDS) { return (long) (syncTimeSeconds * DEFAULT_FLEX_PERCENT_SYNC); } else { // Large enough sync request time that we cap the flex time. return (long) (DEFAULT_POLL_FREQUENCY_SECONDS * DEFAULT_FLEX_PERCENT_SYNC); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateDefaultFlexTime File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
calculateDefaultFlexTime
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public void addPostCollapseAction(Runnable r) { mPostCollapseRunnables.add(r); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPostCollapseAction File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
addPostCollapseAction
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected DeleteMethod executeDelete(String uri) throws Exception { HttpClient httpClient = new HttpClient(); DeleteMethod deleteMethod = new DeleteMethod(uri); httpClient.executeMethod(deleteMethod); return deleteMethod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeDelete File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
executeDelete
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
protected SkinExtensionAsync getSkinExtensionAsync() { if (this.async == null) { this.async = Utils.getComponent(SkinExtensionAsync.class); } return this.async; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkinExtensionAsync File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getSkinExtensionAsync
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public ApiClient setOauthCredentials(String clientId, String clientSecret) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging()); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthCredentials 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
setOauthCredentials
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void setRequestedOrientation(IBinder token, int requestedOrientation) { synchronized (this) { ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return; } TaskRecord task = r.task; if (task != null && (!task.mFullscreen || !task.stack.mFullscreen)) { // Fixed screen orientation isn't supported when activities aren't in full screen // mode. return; } final long origId = Binder.clearCallingIdentity(); mWindowManager.setAppOrientation(r.appToken, requestedOrientation); Configuration config = mWindowManager.updateOrientationFromAppTokens( mConfiguration, r.mayFreezeScreenLocked(r.app) ? r.appToken : null); if (config != null) { r.frozenBeforeDestroy = true; if (!updateConfigurationLocked(config, r, false)) { mStackSupervisor.resumeFocusedStackTopActivityLocked(); } } Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestedOrientation 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
setRequestedOrientation
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Override public byte getDigit(int magnitude) { // If this assertion fails, you need to call roundToInfinity() or some other rounding method. // See the comment at the top of this file explaining the "isApproximate" field. assert !isApproximate; return getDigitPos(magnitude - scale); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDigit File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
getDigit
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setMinimumWidth(double pixels) throws IllegalStateException { checkColumnIsAttached(); final double maxwidth = getMaximumWidth(); if (pixels >= 0 && pixels > maxwidth && maxwidth >= 0) { throw new IllegalArgumentException("New minimum width (" + pixels + ") was greater than maximum width (" + maxwidth + ")"); } getState().minWidth = pixels; getGrid().markAsDirty(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMinimumWidth 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
setMinimumWidth
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
long getEntityLikes(EntityReference target) throws LikeException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEntityLikes File: xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2023-35152
HIGH
8.8
xwiki/xwiki-platform
getEntityLikes
xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/LikeManager.java
0993a7ab3c102f9ac37ffe361a83a3dc302c0e45
0
Analyze the following code function for security vulnerabilities
public static String escapeXML(String in) { int leng = in.length(); StringBuilder sb = new StringBuilder(leng); for (int i = 0; i < leng; i++) { char c = in.charAt(i); if (c == '&') { sb.append("&amp;"); } else if (c == '<') { sb.append("&lt;"); } else if (c == '>') { sb.append("&gt;"); } else if (c == '"') { sb.append("&quot;"); } else if (c == '\'') { sb.append("&apos;"); } else { sb.append(c); } } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeXML File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
escapeXML
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
private void symmetricEncInterceptorConfigXmlGenerator(XmlGenerator gen, NetworkConfig netCfg) { SymmetricEncryptionConfig sec = netCfg.getSymmetricEncryptionConfig(); if (sec == null) { return; } gen.open("symmetric-encryption", "enabled", sec.isEnabled()) .node("algorithm", sec.getAlgorithm()) .node("salt", getOrMaskValue(sec.getSalt())) .node("password", getOrMaskValue(sec.getPassword())) .node("iteration-count", sec.getIterationCount()) .close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: symmetricEncInterceptorConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
symmetricEncInterceptorConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public void event(UserRequest ureq, Component source, Event event) { if(cancelButton == source) { status = FolderCommandStatus.STATUS_CANCELED; fireEvent(ureq, FOLDERCOMMAND_FINISHED); } else if (selectButton == source) { doMove(ureq); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: event File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
event
src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@Override boolean isEmbedded() { final TaskFragment parent = getTaskFragment(); return parent != null && parent.isEmbedded(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEmbedded File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
isEmbedded
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static void rememberEmbeddedPostgres() { embeddedPostgres = new EmbeddedPostgres(Version.Main.V10); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rememberEmbeddedPostgres 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
rememberEmbeddedPostgres
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public boolean canShowErrorDialogs() { synchronized (mGlobalLock) { return mShowDialogs && !mSleeping && !mShuttingDown && !mKeyguardController.isKeyguardOrAodShowing(DEFAULT_DISPLAY) && !hasUserRestriction(UserManager.DISALLOW_SYSTEM_ERROR_DIALOGS, mAmInternal.getCurrentUserId()) && !(UserManager.isDeviceInDemoMode(mContext) && mAmInternal.getCurrentUser().isDemo()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canShowErrorDialogs 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
canShowErrorDialogs
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(name); data.writeStrongBinder(token); mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeContentProviderExternal File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
removeContentProviderExternal
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private String _getXMPPAddress(final User user) { if (user == null) return ""; for (final Contact contact : user.getContacts()) { if (contact != null && contact.getType().equals(ContactType.xmppAddress.toString())) { return contact.getInfo().orElse(""); } } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _getXMPPAddress 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
_getXMPPAddress
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
private void updateCryptoUserInfo(int userId) { if (userId != UserHandle.USER_SYSTEM) { return; } final String ownerInfo = isOwnerInfoEnabled(userId) ? getOwnerInfo(userId) : ""; IBinder service = ServiceManager.getService("mount"); if (service == null) { Log.e(TAG, "Could not find the mount service to update the user info"); return; } IMountService mountService = IMountService.Stub.asInterface(service); try { Log.d(TAG, "Setting owner info"); mountService.setField(StorageManager.OWNER_INFO_KEY, ownerInfo); } catch (RemoteException e) { Log.e(TAG, "Error changing user info", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateCryptoUserInfo 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
updateCryptoUserInfo
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasOverlappingRendering() { return !mDozing; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasOverlappingRendering File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
hasOverlappingRendering
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static Ssurgeon inst() { synchronized(Ssurgeon.class) { if (instance == null) instance = new Ssurgeon(); } return instance; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inst File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
inst
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
private void writeUserListLocked() { FileOutputStream fos = null; AtomicFile userListFile = new AtomicFile(mUserListFile); try { fos = userListFile.startWrite(); final BufferedOutputStream bos = new BufferedOutputStream(fos); // XmlSerializer serializer = XmlUtils.serializerInstance(); final XmlSerializer serializer = new FastXmlSerializer(); serializer.setOutput(bos, StandardCharsets.UTF_8.name()); serializer.startDocument(null, true); serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true); serializer.startTag(null, TAG_USERS); serializer.attribute(null, ATTR_NEXT_SERIAL_NO, Integer.toString(mNextSerialNumber)); serializer.attribute(null, ATTR_USER_VERSION, Integer.toString(mUserVersion)); serializer.startTag(null, TAG_GUEST_RESTRICTIONS); writeRestrictionsLocked(serializer, mGuestRestrictions); serializer.endTag(null, TAG_GUEST_RESTRICTIONS); for (int i = 0; i < mUsers.size(); i++) { UserInfo user = mUsers.valueAt(i); serializer.startTag(null, TAG_USER); serializer.attribute(null, ATTR_ID, Integer.toString(user.id)); serializer.endTag(null, TAG_USER); } serializer.endTag(null, TAG_USERS); serializer.endDocument(); userListFile.finishWrite(fos); } catch (Exception e) { userListFile.failWrite(fos); Slog.e(LOG_TAG, "Error writing user list"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeUserListLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
writeUserListLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public void addInitNavOnInstall(String[] initEntity) { JSONArray initNav = replaceLang(NAVS_DEFAULT); for (String e : initEntity) { EasyEntity entity = EasyMetaFactory.valueOf(e); JSONObject navItem = JSONUtils.toJSONObject( NAV_ITEM_PROPS, new String[] { entity.getIcon(), entity.getLabel(), "ENTITY", entity.getName() }); initNav.add(navItem); } Record record = RecordBuilder.builder(EntityHelper.LayoutConfig) .add("belongEntity", "N") .add("shareTo", SHARE_ALL) .add("applyType", TYPE_NAV) .add("config", initNav.toJSONString()) .build(UserService.SYSTEM_USER); UserContextHolder.setUser(UserService.SYSTEM_USER); try { Application.getService(EntityHelper.LayoutConfig).create(record); } finally { UserContextHolder.clearUser(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addInitNavOnInstall File: src/main/java/com/rebuild/core/configuration/NavBuilder.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
addInitNavOnInstall
src/main/java/com/rebuild/core/configuration/NavBuilder.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
public byte[] doFinal() { return mac.doFinal(); }
Vulnerability Classification: - CWE: CWE-346 - CVE: CVE-2023-22899 - Severity: MEDIUM - CVSS Score: 5.9 Description: #485 Calculate AES mac with cache and push back functionality Function: doFinal File: src/main/java/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java Repository: srikanth-lingala/zip4j Fixed Code: public byte[] doFinal() { return doFinal(0); }
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
doFinal
src/main/java/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
1
Analyze the following code function for security vulnerabilities
@Override public List<Event> getEvents() { return EVENTS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEvents File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/SolrIndexEventListener.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
getEvents
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/SolrIndexEventListener.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
@Nonnull private JsonParseException _parseEx (@Nullable final IJsonParsePosition aTokenStart, @Nonnull final String sMsg) { if (m_bTrackPosition) return new JsonParseException (aTokenStart, m_aParsePos, sMsg); return new JsonParseException (sMsg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _parseEx File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
_parseEx
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
private SearchRequestBuilder createRequest(Client client, String query) { return createRequest(client, query, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRequest File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
createRequest
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public String getSpaceName(String space) { if (DEFAULT_SPACE.equalsIgnoreCase(space)) { return ""; } return RegExUtils.replaceAll(space, "^scooldspace:[^:]+:", ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpaceName 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
getSpaceName
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki Fixed Code: @Override public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
@Override public SecurityDesc getClassLoaderSecurity(final URL codebaseHost) throws LaunchException { if (isPluginApplet()) { if (!runInSandbox && classLoader.getSigning()) { return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.ALL_PERMISSIONS, codebaseHost); } else { return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } else /* * Various combinations of the jars being signed and <security> tags being * present are possible. They are treated as follows * * Jars JNLP File Result * * Signed <security> Appropriate Permissions * Signed no <security> Sandbox * Unsigned <security> Error * Unsigned no <security> Sandbox * */ if (!runInSandbox && !classLoader.getSigning() && !classLoader.file.getSecurity().getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS)) { if (classLoader.jcv.allJarsSigned()) { LaunchException ex = new LaunchException(classLoader.file, null, "Fatal", "Application Error", "The JNLP application is not fully signed by a single cert.", "The JNLP application has its components individually signed, however there must be a common signer to all entries."); consultCertificateSecurityException(ex); return consultResult(codebaseHost); } else { LaunchException ex = new LaunchException(classLoader.file, null, "Fatal", "Application Error", "Cannot grant permissions to unsigned jars.", "Application requested security permissions, but jars are not signed."); consultCertificateSecurityException(ex); return consultResult(codebaseHost); } } else return consultResult(codebaseHost); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClassLoaderSecurity File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getClassLoaderSecurity
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
static public CharSequence getDeviceList(ICompanionDeviceManager cdm, LocalBluetoothManager lbm, String pkg, int userId) { boolean multiple = false; StringBuilder sb = new StringBuilder(); try { List<String> associatedMacAddrs = CollectionUtils.mapNotNull( cdm.getAssociations(pkg, userId), a -> a.isSelfManaged() ? null : a.getDeviceMacAddress().toString()); if (associatedMacAddrs != null) { for (String assocMac : associatedMacAddrs) { final Collection<CachedBluetoothDevice> cachedDevices = lbm.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice cachedBluetoothDevice : cachedDevices) { if (Objects.equals(assocMac, cachedBluetoothDevice.getAddress())) { if (multiple) { sb.append(", "); } else { multiple = true; } sb.append(cachedBluetoothDevice.getName()); } } } } } catch (RemoteException e) { Log.w(TAG, "Error calling CDM", e); } return sb.toString(); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-35667 - Severity: HIGH - CVSS Score: 7.8 Description: Don't hide approved NLSes in Settings Note that an NLS that shouldn't be approvable (because its name is too long) but was already approved (either before the max length check was introduced, or through other means) will disappear from the list if the user revokes its access. This might be somewhat confusing, but since this is a very-edge case already it's fine. Bug: 282932362 Test: manual (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ff255c6eda1528f01a167a9a65b7f8e414d28584) Merged-In: I4c9faea68e6d16b1a4ec7f472b5433cac1704c06 Change-Id: I4c9faea68e6d16b1a4ec7f472b5433cac1704c06 Function: getDeviceList File: src/com/android/settings/notification/NotificationBackend.java Repository: android Fixed Code: static public CharSequence getDeviceList(ICompanionDeviceManager cdm, LocalBluetoothManager lbm, String pkg, int userId) { if (cdm == null) { return ""; } boolean multiple = false; StringBuilder sb = new StringBuilder(); try { List<String> associatedMacAddrs = CollectionUtils.mapNotNull( cdm.getAssociations(pkg, userId), a -> a.isSelfManaged() ? null : a.getDeviceMacAddress().toString()); if (associatedMacAddrs != null) { for (String assocMac : associatedMacAddrs) { final Collection<CachedBluetoothDevice> cachedDevices = lbm.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice cachedBluetoothDevice : cachedDevices) { if (Objects.equals(assocMac, cachedBluetoothDevice.getAddress())) { if (multiple) { sb.append(", "); } else { multiple = true; } sb.append(cachedBluetoothDevice.getName()); } } } } } catch (RemoteException e) { Log.w(TAG, "Error calling CDM", e); } return sb.toString(); }
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getDeviceList
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
1
Analyze the following code function for security vulnerabilities
protected String getStudyEventAndFormMetaSql(int parentStudyId, int studyId, boolean isIncludedSite) { return "select sed.ordinal as definition_order, edc.ordinal as crf_order, edc.crf_id, cv.crf_version_id," + " sed.oc_oid as definition_oid, sed.name as definition_name, sed.repeating as definition_repeating," + " sed.type as definition_type, cv.oc_oid as cv_oid," + " cv.name as cv_name, edc.required_crf as cv_required, edc.null_values, crf.name as crf_name" + " from " + this.studyEventAndFormMetaTables() + this.studyEventAndFormMetaCondition(parentStudyId, studyId, isIncludedSite); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStudyEventAndFormMetaSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getStudyEventAndFormMetaSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public boolean dispatchKeyEvent(KeyEvent event) { if (GamepadList.dispatchKeyEvent(event)) return true; if (getContentViewClient().shouldOverrideKeyEvent(event)) { return mContainerViewInternals.super_dispatchKeyEvent(event); } if (mImeAdapter.dispatchKeyEvent(event)) return true; return mContainerViewInternals.super_dispatchKeyEvent(event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchKeyEvent 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
dispatchKeyEvent
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
@Override public void close() throws IOException { stop(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
close
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
private boolean isLandscapeOrSeascape(int rotation) { return rotation == mLandscapeRotation || rotation == mSeascapeRotation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLandscapeOrSeascape 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
isLandscapeOrSeascape
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
TrustManager getTrustManager() { return (TrustManager) mContext.getSystemService(Context.TRUST_SERVICE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTrustManager 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
getTrustManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean shouldClampCursor(int line) { // Only clamp cursor position in left-aligned displays. switch (getParagraphAlignment(line)) { case ALIGN_LEFT: return true; case ALIGN_NORMAL: return getParagraphDirection(line) > 0; default: return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldClampCursor File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
shouldClampCursor
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
@Override public List<String> listPolicyExemptApps() { CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_DEVICE_ADMINS) || isDefaultDeviceOwner(caller) || isProfileOwner(caller)); return listPolicyExemptAppsUnchecked(mContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listPolicyExemptApps File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
listPolicyExemptApps
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void onServiceDisconnected(ComponentName component) { if (component.equals( new ComponentName(AuthenticatorActivity.this, OperationsService.class) )) { Log_OC.e(TAG, "Operations service crashed"); mOperationsServiceBinder = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onServiceDisconnected File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onServiceDisconnected
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
@Test public void executeNSU() throws Exception { final DeferredGroupException dge = mock(DeferredGroupException.class); when(dge.getCause()).thenReturn(new NoSuchUniqueName("foo", "metrics")); when(query_result.configureFromQuery((TSQuery)any(), anyInt())) .thenReturn(Deferred.fromError(dge)); final HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:sys.cpu.user"); rpc.execute(tsdb, query); assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus()); final String json = query.response().getContent().toString(Charset.forName("UTF-8")); assertTrue(json.contains("No such name for 'foo': 'metrics'")); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2023-36812 - Severity: CRITICAL - CVSS Score: 9.8 Description: Fix for #2269 and #2267 XSS vulnerability. Escaping the user supplied input when outputing the HTML for the old BadRequest HTML handlers should help. Thanks to the reporters. Fixes CVE-2018-13003. Function: executeNSU File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb Fixed Code: @Test public void executeNSU() throws Exception { final DeferredGroupException dge = mock(DeferredGroupException.class); when(dge.getCause()).thenReturn(new NoSuchUniqueName("foo", "metrics")); when(query_result.configureFromQuery((TSQuery)any(), anyInt())) .thenReturn(Deferred.fromError(dge)); final HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:sys.cpu.user"); rpc.execute(tsdb, query); assertEquals(HttpResponseStatus.BAD_REQUEST, query.response().getStatus()); final String json = query.response().getContent().toString(Charset.forName("UTF-8")); assertTrue(json.contains("No such name for &#39;foo&#39;: &#39;metrics&#39;")); }
[ "CWE-74" ]
CVE-2023-36812
CRITICAL
9.8
OpenTSDB/opentsdb
executeNSU
test/tsd/TestQueryRpc.java
fa88d3e4b5369f9fb73da384fab0b23e246309ba
1
Analyze the following code function for security vulnerabilities
@Override public void registerFocusObserver(IWindowFocusObserver observer) { final WindowState outer = mOuter.get(); if (outer != null) { outer.registerFocusObserver(observer); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerFocusObserver 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
registerFocusObserver
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
void removeEverBackedUp(String packageName) { if (DEBUG) Slog.v(TAG, "Removing backed-up knowledge of " + packageName); if (MORE_DEBUG) Slog.v(TAG, "New set:"); synchronized (mEverStoredApps) { // Rewrite the file and rename to overwrite. If we reboot in the middle, // we'll recognize on initialization time that the package no longer // exists and fix it up then. File tempKnownFile = new File(mBaseStateDir, "processed.new"); RandomAccessFile known = null; try { known = new RandomAccessFile(tempKnownFile, "rws"); mEverStoredApps.remove(packageName); for (String s : mEverStoredApps) { known.writeUTF(s); if (MORE_DEBUG) Slog.v(TAG, " " + s); } known.close(); known = null; if (!tempKnownFile.renameTo(mEverStored)) { throw new IOException("Can't rename " + tempKnownFile + " to " + mEverStored); } } catch (IOException e) { // Bad: we couldn't create the new copy. For safety's sake we // abandon the whole process and remove all what's-backed-up // state entirely, meaning we'll force a backup pass for every // participant on the next boot or [re]install. Slog.w(TAG, "Error rewriting " + mEverStored, e); mEverStoredApps.clear(); tempKnownFile.delete(); mEverStored.delete(); } finally { try { if (known != null) known.close(); } catch (IOException e) {} } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeEverBackedUp File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
removeEverBackedUp
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public List<MetaDataDiff> getMetaDataDiff(XWikiDocument fromDoc, XWikiDocument toDoc, XWikiContext context) throws XWikiException { List<MetaDataDiff> list = new ArrayList<MetaDataDiff>(); if (fromDoc == null || toDoc == null) { return list; } if (!fromDoc.getTitle().equals(toDoc.getTitle())) { list.add(new MetaDataDiff("title", fromDoc.getTitle(), toDoc.getTitle())); } if (ObjectUtils.notEqual(fromDoc.getRelativeParentReference(), toDoc.getRelativeParentReference())) { list.add(new MetaDataDiff("parent", fromDoc.getParent(), toDoc.getParent())); } if (ObjectUtils.notEqual(fromDoc.getAuthorReference(), toDoc.getAuthorReference())) { list.add(new MetaDataDiff("author", fromDoc.getAuthor(), toDoc.getAuthor())); } if (ObjectUtils.notEqual(fromDoc.getDocumentReference(), toDoc.getDocumentReference())) { list.add(new MetaDataDiff("reference", fromDoc.getDocumentReference(), toDoc.getDocumentReference())); } if (!fromDoc.getSpace().equals(toDoc.getSpace())) { list.add(new MetaDataDiff("web", fromDoc.getSpace(), toDoc.getSpace())); } if (!fromDoc.getName().equals(toDoc.getName())) { list.add(new MetaDataDiff("name", fromDoc.getName(), toDoc.getName())); } if (ObjectUtils.notEqual(fromDoc.getLocale(), toDoc.getLocale())) { list.add(new MetaDataDiff("language", fromDoc.getLanguage(), toDoc.getLanguage())); } if (ObjectUtils.notEqual(fromDoc.getDefaultLocale(), toDoc.getDefaultLocale())) { list.add(new MetaDataDiff("defaultLanguage", fromDoc.getDefaultLanguage(), toDoc.getDefaultLanguage())); } if (ObjectUtils.notEqual(fromDoc.getSyntax(), toDoc.getSyntax())) { list.add(new MetaDataDiff("syntax", fromDoc.getSyntax(), toDoc.getSyntax())); } if (fromDoc.isHidden() != toDoc.isHidden()) { list.add(new MetaDataDiff("hidden", fromDoc.isHidden(), toDoc.isHidden())); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataDiff 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
getMetaDataDiff
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
@NonNull public BigPictureStyle bigPicture(@Nullable Bitmap b) { mPictureIcon = b == null ? null : Icon.createWithBitmap(b); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bigPicture File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bigPicture
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public static int getTypeFromKey(int key) { return SettingsState.getTypeFromKey(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTypeFromKey File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
getTypeFromKey
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public Bundle getAssistContextExtras(int requestType) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(requestType); mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0); reply.readException(); Bundle res = reply.readBundle(); data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssistContextExtras File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getAssistContextExtras
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void apiPermission(Invocation ai) { ai.invoke(); ApiStandardResponse apiStandardResponse = new ApiStandardResponse(); if (ai.getController().getAttr("log") != null) { apiStandardResponse.setData((Object) ai.getController().getAttr("log")); } else if (ai.getController().getAttr("data") != null) { apiStandardResponse.setData((Object) ai.getController().getAttr("data")); } else { apiStandardResponse.setError(1); apiStandardResponse.setMessage("not found"); } ai.getController().renderJson(apiStandardResponse); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apiPermission File: web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
apiPermission
web/src/main/java/com/zrlog/web/interceptor/VisitorInterceptor.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
public String execute(BaseMessage message) throws Exception { CloseableHttpResponse response = null; try { response = getHttpResponse(message); validateResponseStatus(response); return getResponseString(response); } finally { if (response != null) { EntityUtils.consumeQuietly(response.getEntity()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java Repository: opendistro-for-elasticsearch/alerting The code follows secure coding practices.
[ "CWE-918" ]
CVE-2021-31828
MEDIUM
5.5
opendistro-for-elasticsearch/alerting
execute
notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
49cc584dd6bd38ca26129eeaca5cd04e40a27f25
0
Analyze the following code function for security vulnerabilities
@Exported public String getExcludedCommitMessages() { return excludedCommitMessages; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExcludedCommitMessages File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getExcludedCommitMessages
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInfinite() { return (flags & INFINITY_FLAG) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInfinite File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
isInfinite
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
public IRestoreSession beginRestoreSession(String packageName, String transport) { if (DEBUG) Slog.v(TAG, "beginRestoreSession: pkg=" + packageName + " transport=" + transport); boolean needPermission = true; if (transport == null) { transport = mCurrentTransport; if (packageName != null) { PackageInfo app = null; try { app = mPackageManager.getPackageInfo(packageName, 0); } catch (NameNotFoundException nnf) { Slog.w(TAG, "Asked to restore nonexistent pkg " + packageName); throw new IllegalArgumentException("Package " + packageName + " not found"); } if (app.applicationInfo.uid == Binder.getCallingUid()) { // So: using the current active transport, and the caller has asked // that its own package will be restored. In this narrow use case // we do not require the caller to hold the permission. needPermission = false; } } } if (needPermission) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "beginRestoreSession"); } else { if (DEBUG) Slog.d(TAG, "restoring self on current transport; no permission needed"); } synchronized(this) { if (mActiveRestoreSession != null) { Slog.d(TAG, "Restore session requested but one already active"); return null; } mActiveRestoreSession = new ActiveRestoreSession(packageName, transport); mBackupHandler.sendEmptyMessageDelayed(MSG_RESTORE_TIMEOUT, TIMEOUT_RESTORE_INTERVAL); } return mActiveRestoreSession; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginRestoreSession File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
beginRestoreSession
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
final <T> T binderWithCleanCallingIdentity(@NonNull ThrowingSupplier<T> action) { return Binder.withCleanCallingIdentity(action); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: binderWithCleanCallingIdentity 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
binderWithCleanCallingIdentity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setShortSupportMessage(@Nullable ComponentName who, String callerPackageName, CharSequence message) { if (!mHasFeature) { return; } CallerIdentity caller; ActiveAdmin admin; message = truncateIfLonger(message, MAX_SHORT_SUPPORT_MESSAGE_LENGTH); if (isPermissionCheckFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE, caller.getPackageName(), caller.getUserId()); admin = enforcingAdmin.getActiveAdmin(); } else { caller = getCallerIdentity(who); Objects.requireNonNull(who, "ComponentName is null"); synchronized (getLockObject()) { admin = getActiveAdminForUidLocked(who, caller.getUid()); } } synchronized (getLockObject()) { if (!TextUtils.equals(admin.shortSupportMessage, message)) { admin.shortSupportMessage = message; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_SHORT_SUPPORT_MESSAGE) .setAdmin(caller.getPackageName()) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShortSupportMessage File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setShortSupportMessage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
protected int getStageType() { if (mForFingerprint) { return Stage.TYPE_FINGERPRINT; } else if (mForFace) { return Stage.TYPE_FACE; } else if (mForBiometrics) { return Stage.TYPE_BIOMETRIC; } else { return Stage.TYPE_NONE; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStageType File: src/com/android/settings/password/ChooseLockPassword.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
getStageType
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
protected int getNextNum(String projectId) { Issues issue = extIssuesMapper.getNextNum(projectId); if (issue == null || issue.getNum() == null) { return 100001; } else { return Optional.of(issue.getNum() + 1).orElse(100001); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextNum 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
getNextNum
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Exported public String getExcludedRevprop() { return excludedRevprop; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExcludedRevprop File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getExcludedRevprop
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public void deleteDocument(XWikiDocument doc, XWikiContext context) throws XWikiException { deleteDocument(doc, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDocument 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
deleteDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public int getScmCheckoutRetryCount() { return scmCheckoutRetryCount !=null ? scmCheckoutRetryCount : Jenkins.getInstance().getScmCheckoutRetryCount(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getScmCheckoutRetryCount File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getScmCheckoutRetryCount
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
protected String getAttribute(Node node, String attName) { final Node attNode = node.getAttributes().getNamedItem(attName); if (attNode == null) { return null; } return getTextContent(attNode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttribute File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
getAttribute
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected String appendFileterPath(final StringBuilder buf, final String v) { if (StringUtil.isBlank(v)) { return StringUtil.EMPTY; } if (v.startsWith("^")) { buf.append(v); if (!v.endsWith("$")) { buf.append(".*"); } } else if (v.endsWith("$")) { buf.append(".*"); buf.append(v); } else if (v.endsWith("/\\E")) { buf.append(".*"); buf.append(v); buf.append(".*"); } else { buf.append(v); } return buf.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendFileterPath File: src/main/java/org/codelibs/fess/util/GsaConfigParser.java Repository: codelibs/fess The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000822
HIGH
7.5
codelibs/fess
appendFileterPath
src/main/java/org/codelibs/fess/util/GsaConfigParser.java
faa265b8d8f1c71e1bf3229fba5f8cc58a5611b7
0
Analyze the following code function for security vulnerabilities
public @Nullable String getNString(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getNString columnIndex: {0}", columnIndex); throw org.postgresql.Driver.notImplemented(this.getClass(), "getNString(int)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNString 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
getNString
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private boolean upgrade(final NativeRequest request) { Optional<String> upgrade = request.header(UPGRADE); return upgrade.isPresent() && upgrade.get().equalsIgnoreCase(WEB_SOCKET); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: upgrade File: jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
upgrade
jooby/src/main/java/org/jooby/internal/HttpHandlerImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
final void addObject(CharSequence name, Iterable<?> values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); for (Object v : values) { requireNonNullElement(values, v); addObject(normalizedName, v); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: addObject File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void addObject(CharSequence name, Iterable<?> values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); for (Object v : values) { requireNonNullElement(values, v); addObject(normalizedName, v); } }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
addObject
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
public synchronized Http2HeadersStreamSinkChannel sendPushPromise(int associatedStreamId, HeaderMap requestHeaders, HeaderMap responseHeaders) throws IOException { if (!isOpen()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } if (isClient()) { throw UndertowMessages.MESSAGES.pushPromiseCanOnlyBeCreatedByServer(); } sendConcurrentStreamsAtomicUpdater.incrementAndGet(this); if(sendMaxConcurrentStreams > 0 && sendConcurrentStreams > sendMaxConcurrentStreams) { throw UndertowMessages.MESSAGES.streamLimitExceeded(); } int streamId = streamIdCounter; streamIdCounter += 2; Http2PushPromiseStreamSinkChannel pushPromise = new Http2PushPromiseStreamSinkChannel(this, requestHeaders, associatedStreamId, streamId); flushChannel(pushPromise); Http2HeadersStreamSinkChannel http2SynStreamStreamSinkChannel = new Http2HeadersStreamSinkChannel(this, streamId, responseHeaders); currentStreams.put(streamId, new StreamHolder(http2SynStreamStreamSinkChannel)); return http2SynStreamStreamSinkChannel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendPushPromise File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
sendPushPromise
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
private void enforcePermission(String permission, String callerPackageName) throws SecurityException { if (!hasPermission(permission, callerPackageName)) { throw new SecurityException("Caller does not have the required permissions for " + "this user. Permission required: " + permission + "."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforcePermission File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
enforcePermission
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void saveUser(@UserIdInt int userId) { try (ResilientAtomicFile file = getUserFile(userId)) { FileOutputStream os = null; try { if (DEBUG || DEBUG_REBOOT) { Slog.d(TAG, "Saving to " + file); } synchronized (mLock) { os = file.startWrite(); saveUserInternalLocked(userId, os, /* forBackup= */ false); } file.finishWrite(os); // Remove all dangling bitmap files. cleanupDanglingBitmapDirectoriesLocked(userId); } catch (XmlPullParserException | IOException e) { Slog.e(TAG, "Failed to write to file " + file, e); file.failWrite(os); } } getUserShortcutsLocked(userId).logSharingShortcutStats(mMetricsLogger); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveUser File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
saveUser
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public static boolean isWindows() { return IS_WINDOWS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWindows 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
isWindows
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public Integer getAllowComment() { return allowComment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllowComment File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
getAllowComment
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
void sendCloseSystemWindows(String reason) { sendCloseSystemWindows(mContext, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendCloseSystemWindows 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
sendCloseSystemWindows
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public UserHandle createAndProvisionManagedProfile( @NonNull ManagedProfileProvisioningParams provisioningParams, @NonNull String callerPackage) { Objects.requireNonNull(provisioningParams, "provisioningParams is null"); Objects.requireNonNull(callerPackage, "callerPackage is null"); final ComponentName admin = provisioningParams.getProfileAdminComponentName(); Objects.requireNonNull(admin, "admin is null"); final CallerIdentity caller = getCallerIdentity(callerPackage); Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS)); provisioningParams.logParams(callerPackage); UserInfo userInfo = null; final long identity = Binder.clearCallingIdentity(); try { final int result = checkProvisioningPreconditionSkipPermission( ACTION_PROVISION_MANAGED_PROFILE, admin.getPackageName(), caller.getUserId()); if (result != STATUS_OK) { throw new ServiceSpecificException( ERROR_PRE_CONDITION_FAILED, "Provisioning preconditions failed with result: " + result); } final long startTime = SystemClock.elapsedRealtime(); onCreateAndProvisionManagedProfileStarted(provisioningParams); final Set<String> nonRequiredApps = provisioningParams.isLeaveAllSystemAppsEnabled() ? Collections.emptySet() : mOverlayPackagesProvider.getNonRequiredApps( admin, caller.getUserId(), ACTION_PROVISION_MANAGED_PROFILE); if (nonRequiredApps.isEmpty()) { Slogf.i(LOG_TAG, "No disallowed packages for the managed profile."); } else { for (String packageName : nonRequiredApps) { Slogf.i(LOG_TAG, "Disallowed package [" + packageName + "]"); } } userInfo = mUserManager.createProfileForUserEvenWhenDisallowed( provisioningParams.getProfileName(), UserManager.USER_TYPE_PROFILE_MANAGED, UserInfo.FLAG_DISABLED, caller.getUserId(), nonRequiredApps.toArray(new String[nonRequiredApps.size()])); if (userInfo == null) { throw new ServiceSpecificException( ERROR_PROFILE_CREATION_FAILED, "Error creating profile, createProfileForUserEvenWhenDisallowed " + "returned null."); } resetInteractAcrossProfilesAppOps(caller.getUserId()); logEventDuration( DevicePolicyEnums.PLATFORM_PROVISIONING_CREATE_PROFILE_MS, startTime, callerPackage); maybeInstallDevicePolicyManagementRoleHolderInUser(userInfo.id); installExistingAdminPackage(userInfo.id, admin.getPackageName()); if (!enableAdminAndSetProfileOwner(userInfo.id, caller.getUserId(), admin)) { throw new ServiceSpecificException( ERROR_SETTING_PROFILE_OWNER_FAILED, "Error setting profile owner."); } setUserSetupComplete(userInfo.id); startProfileForSetup(userInfo.id, callerPackage); maybeMigrateAccount( userInfo.id, caller.getUserId(), provisioningParams.getAccountToMigrate(), provisioningParams.isKeepingAccountOnMigration(), callerPackage); if (provisioningParams.isOrganizationOwnedProvisioning()) { synchronized (getLockObject()) { setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked(admin, userInfo.id, true); } } onCreateAndProvisionManagedProfileCompleted(provisioningParams); sendProvisioningCompletedBroadcast( userInfo.id, ACTION_PROVISION_MANAGED_PROFILE, provisioningParams.isLeaveAllSystemAppsEnabled()); return userInfo.getUserHandle(); } catch (Exception e) { DevicePolicyEventLogger .createEvent(DevicePolicyEnums.PLATFORM_PROVISIONING_ERROR) .setStrings(callerPackage) .write(); // In case of any errors during provisioning, remove the newly created profile. if (userInfo != null) { mUserManager.removeUserEvenWhenDisallowed(userInfo.id); } throw e; } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createAndProvisionManagedProfile File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
createAndProvisionManagedProfile
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public JSON getJSON() { return json; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSON File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getJSON
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0