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
@Primary @Bean public JpaTransactionManager hapiTransactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager retVal = new JpaTransactionManager(); retVal.setEntityManagerFactory(entityManagerFactory); return retVal; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hapiTransactionManager File: hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/TestDstu2Config.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
hapiTransactionManager
hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/config/TestDstu2Config.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
boolean decProviderCountLocked(ContentProviderConnection conn, ContentProviderRecord cpr, IBinder externalProcessToken, boolean stable) { if (conn != null) { cpr = conn.provider; if (DEBUG_PROVIDER) Slog.v(TAG_PROVIDER, "Removing provider requested by " + conn.client.processName + " from process " + cpr.info.processName + ": " + cpr.name.flattenToShortString() + " scnt=" + conn.stableCount + " uscnt=" + conn.unstableCount); if (stable) { conn.stableCount--; } else { conn.unstableCount--; } if (conn.stableCount == 0 && conn.unstableCount == 0) { cpr.connections.remove(conn); conn.client.conProviders.remove(conn); if (conn.client.setProcState < ActivityManager.PROCESS_STATE_LAST_ACTIVITY) { // The client is more important than last activity -- note the time this // is happening, so we keep the old provider process around a bit as last // activity to avoid thrashing it. if (cpr.proc != null) { cpr.proc.lastProviderTime = SystemClock.uptimeMillis(); } } stopAssociationLocked(conn.client.uid, conn.client.processName, cpr.uid, cpr.name); return true; } return false; } cpr.removeExternalProcessHandleLocked(externalProcessToken); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decProviderCountLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
decProviderCountLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private final ProcessRecord removeProcessNameLocked(final String name, final int uid) { ProcessRecord old = mProcessNames.remove(name, uid); if (old != null) { old.uidRecord.numProcs--; if (old.uidRecord.numProcs == 0) { // No more processes using this uid, tell clients it is gone. if (DEBUG_UID_OBSERVERS) Slog.i(TAG_UID_OBSERVERS, "No more processes in " + old.uidRecord); enqueueUidChangeLocked(old.uidRecord, -1, UidRecord.CHANGE_GONE); mActiveUids.remove(uid); noteUidProcessState(uid, ActivityManager.PROCESS_STATE_NONEXISTENT); } old.uidRecord = null; } mIsolatedProcesses.remove(uid); return old; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeProcessNameLocked 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
removeProcessNameLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setWebRoot(String webRoot) { setRoot(webRoot); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWebRoot File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setWebRoot
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private Object mapValue(Map<String, Object> options, String key, Map<String, Object> map) { Object out = null; if (map.containsKey(key)) { out = map.get(key); } else if (key.contains(".")) { String[] keys = key.split("\\."); out = map.get(keys[0]); for (int i = 1; i < keys.length; i++) { if (out instanceof Map) { Map<String, Object> m = keysToString((Map<Object, Object>) out); out = m.get(keys[i]); } else if (canConvert(out)) { out = engine.toMap(out).get(keys[i]); } else { break; } } } if (!(out instanceof Map) && canConvert(out)) { out = objectToMap(options, out); } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mapValue File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
mapValue
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public boolean canGetSSLCertificates() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canGetSSLCertificates File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
canGetSSLCertificates
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public boolean isFollowRedirects() { return this.followRedirects; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFollowRedirects File: src/main/java/jodd/http/HttpRequest.java Repository: oblac/jodd-http The code follows secure coding practices.
[ "CWE-74" ]
CVE-2022-29631
MEDIUM
5
oblac/jodd-http
isFollowRedirects
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
public boolean isIssueHandshake() { return issueHandshake; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIssueHandshake File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
isIssueHandshake
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public void schedule(MediaPackage mediaPackage, String workflowDefinitionID, Map<String, String> properties) throws IllegalStateException, IngestException, NotFoundException, UnauthorizedException, SchedulerException { MediaPackageElement[] mediaPackageElements = mediaPackage.getElementsByFlavor(MediaPackageElements.EPISODE); if (mediaPackageElements.length != 1) { logger.debug("There can be only one (and exactly one) episode dublin core catalog: https://youtu.be/_J3VeogFUOs"); throw new IngestException("There can be only one (and exactly one) episode dublin core catalog"); } InputStream inputStream; DublinCoreCatalog dublinCoreCatalog; try { inputStream = workingFileRepository.get(mediaPackage.getIdentifier().toString(), mediaPackageElements[0].getIdentifier()); dublinCoreCatalog = dublinCoreService.load(inputStream); } catch (IOException e) { throw new IngestException(e); } EName temporal = new EName(DublinCore.TERMS_NS_URI, "temporal"); List<DublinCoreValue> periods = dublinCoreCatalog.get(temporal); if (periods.size() != 1) { logger.debug("There can be only one (and exactly one) period"); throw new IngestException("There can be only one (and exactly one) period"); } DCMIPeriod period = EncodingSchemeUtils.decodeMandatoryPeriod(periods.get(0)); if (!period.hasStart() || !period.hasEnd()) { logger.debug("A scheduled recording needs to have a start and end."); throw new IngestException("A scheduled recording needs to have a start and end."); } EName createdEName = new EName(DublinCore.TERMS_NS_URI, "created"); List<DublinCoreValue> created = dublinCoreCatalog.get(createdEName); if (created.size() == 0) { logger.debug("Created not set"); } else if (created.size() == 1) { Date date = EncodingSchemeUtils.decodeMandatoryDate(created.get(0)); if (date.getTime() != period.getStart().getTime()) { logger.debug("start and created date differ ({} vs {})", date.getTime(), period.getStart().getTime()); throw new IngestException("Temporal start and created date differ"); } } else { logger.debug("There can be only one created date"); throw new IngestException("There can be only one created date"); } // spatial EName spatial = new EName(DublinCore.TERMS_NS_URI, "spatial"); List<DublinCoreValue> captureAgents = dublinCoreCatalog.get(spatial); if (captureAgents.size() != 1) { logger.debug("Exactly one capture agent needs to be set"); throw new IngestException("Exactly one capture agent needs to be set"); } String captureAgent = captureAgents.get(0).getValue(); // Go through properties Map<String, String> agentProperties = new HashMap<>(); Map<String, String> workflowProperties = new HashMap<>(); for (String key : properties.keySet()) { if (key.startsWith("org.opencastproject.workflow.config.")) { workflowProperties.put(key, properties.get(key)); } else { agentProperties.put(key, properties.get(key)); } } try { schedulerService.addEvent(period.getStart(), period.getEnd(), captureAgent, new HashSet<>(), mediaPackage, workflowProperties, agentProperties, Opt.none()); } finally { for (MediaPackageElement mediaPackageElement : mediaPackage.getElements()) { try { workingFileRepository.delete(mediaPackage.getIdentifier().toString(), mediaPackageElement.getIdentifier()); } catch (IOException e) { logger.warn("Failed to delete media package element", e); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: schedule 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
schedule
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
protected void initModulePlugIns (ModuleConfig config) throws ServletException { if (log.isDebugEnabled()) { log.debug("Initializing module path '" + config.getPrefix() + "' plug ins"); } PlugInConfig plugInConfigs[] = config.findPlugInConfigs(); PlugIn plugIns[] = new PlugIn[plugInConfigs.length]; getServletContext().setAttribute(Globals.PLUG_INS_KEY + config.getPrefix(), plugIns); for (int i = 0; i < plugIns.length; i++) { try { plugIns[i] = (PlugIn)RequestUtils.applicationInstance(plugInConfigs[i].getClassName()); BeanUtils.populate(plugIns[i], plugInConfigs[i].getProperties()); // Pass the current plugIn config object to the PlugIn. // The property is set only if the plugin declares it. // This plugin config object is needed by Tiles try { PropertyUtils.setProperty( plugIns[i], "currentPlugInConfigObject", plugInConfigs[i]); } catch (Exception e) { // FIXME Whenever we fail silently, we must document a valid reason // for doing so. Why should we fail silently if a property can't be set on // the plugin? /** * Between version 1.138-1.140 cedric made these changes. * The exceptions are caught to deal with containers applying strict security. * This was in response to bug #15736 * * Recommend that we make the currentPlugInConfigObject part of the PlugIn Interface if we can, Rob */ } plugIns[i].init(this, config); } catch (ServletException e) { throw e; } catch (Exception e) { String errMsg = internal.getMessage( "plugIn.init", plugInConfigs[i].getClassName()); log(errMsg, e); throw new UnavailableException(errMsg); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initModulePlugIns File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever The code follows secure coding practices.
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
initModulePlugIns
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
public IHttpResponse getLastResponse() { return myLastResponse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastResponse File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
getLastResponse
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
private static void durableExecutorXmlGenerator(XmlGenerator gen, Config config) { for (DurableExecutorConfig ex : config.getDurableExecutorConfigs().values()) { gen.open("durable-executor-service", "name", ex.getName()) .node("pool-size", ex.getPoolSize()) .node("durability", ex.getDurability()) .node("capacity", ex.getCapacity()) .node("quorum-ref", ex.getQuorumName()) .close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: durableExecutorXmlGenerator 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
durableExecutorXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
boolean isTrustedOverlay() { return mInputWindowHandle.isTrustedOverlay(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTrustedOverlay 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
isTrustedOverlay
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private final void processStartTimedOutLocked(ProcessRecord app) { final int pid = app.pid; boolean gone = false; synchronized (mPidsSelfLocked) { ProcessRecord knownApp = mPidsSelfLocked.get(pid); if (knownApp != null && knownApp.thread == null) { mPidsSelfLocked.remove(pid); gone = true; } } if (gone) { Slog.w(TAG, "Process " + app + " failed to attach"); EventLog.writeEvent(EventLogTags.AM_PROCESS_START_TIMEOUT, app.userId, pid, app.uid, app.processName); removeProcessNameLocked(app.processName, app.uid); if (mHeavyWeightProcess == app) { mHandler.sendMessage(mHandler.obtainMessage(CANCEL_HEAVY_NOTIFICATION_MSG, mHeavyWeightProcess.userId, 0)); mHeavyWeightProcess = null; } mBatteryStatsService.noteProcessFinish(app.processName, app.info.uid); if (app.isolated) { mBatteryStatsService.removeIsolatedUid(app.uid, app.info.uid); } // Take care of any launching providers waiting for this process. cleanupAppInLaunchingProvidersLocked(app, true); // Take care of any services that are waiting for the process. mServices.processStartTimedOutLocked(app); app.kill("start timeout", true); removeLruProcessLocked(app); if (mBackupTarget != null && mBackupTarget.app.pid == pid) { Slog.w(TAG, "Unattached app died before backup, skipping"); try { IBackupManager bm = IBackupManager.Stub.asInterface( ServiceManager.getService(Context.BACKUP_SERVICE)); bm.agentDisconnected(app.info.packageName); } catch (RemoteException e) { // Can't happen; the backup manager is local } } if (isPendingBroadcastProcessLocked(pid)) { Slog.w(TAG, "Unattached app died before broadcast acknowledged, skipping"); skipPendingBroadcastLocked(pid); } } else { Slog.w(TAG, "Spurious process start timeout - pid not known for " + app); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processStartTimedOutLocked 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
processStartTimedOutLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Override public void moveTaskToFront(IApplicationThread appThread, String callingPackage, int taskId, int flags, Bundle bOptions) { mAmInternal.enforceCallingPermission(android.Manifest.permission.REORDER_TASKS, "moveTaskToFront()"); ProtoLog.d(WM_DEBUG_TASKS, "moveTaskToFront: moving taskId=%d", taskId); synchronized (mGlobalLock) { moveTaskToFrontLocked(appThread, callingPackage, taskId, flags, SafeActivityOptions.fromBundle(bOptions)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToFront 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
moveTaskToFront
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public <T extends JiffleRuntime> T getRuntimeInstance(Class<T> baseClass) throws it.geosolutions.jaiext.jiffle.JiffleException { RuntimeModel model = RuntimeModel.get(baseClass); if (model == null) { throw new it.geosolutions.jaiext.jiffle.JiffleException(baseClass.getName() + " does not implement a required Jiffle runtime interface"); } return (T) createRuntimeInstance(model, baseClass, false); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-24816 - Severity: HIGH - CVSS Score: 7.5 Description: Validate Jiffle input variable names according to grammar, escape javadocs when including Jiffle sources in output Function: getRuntimeInstance File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext Fixed Code: public <T extends JiffleRuntime> T getRuntimeInstance(Class<T> baseClass) throws it.geosolutions.jaiext.jiffle.JiffleException { RuntimeModel model = RuntimeModel.get(baseClass); if (model == null) { throw new it.geosolutions.jaiext.jiffle.JiffleException(baseClass.getName() + " does not implement a required Jiffle runtime interface"); } return (T) createRuntimeInstance(model, baseClass, includeScript); }
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
getRuntimeInstance
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
1
Analyze the following code function for security vulnerabilities
private static ConversationFragment findConversationFragment(Activity activity) { Fragment fragment = activity.getFragmentManager().findFragmentById(R.id.main_fragment); if (fragment != null && fragment instanceof ConversationFragment) { return (ConversationFragment) fragment; } fragment = activity.getFragmentManager().findFragmentById(R.id.secondary_fragment); if (fragment != null && fragment instanceof ConversationFragment) { return (ConversationFragment) fragment; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findConversationFragment File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
findConversationFragment
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void service(HttpServletRequest request, HttpServletResponse response) { String pathInfo = request.getPathInfo(); if (pathInfo == null) { response.setStatus(HttpServletResponse.SC_NOT_FOUND); } else { try { // Handle JSP requests. if (pathInfo.endsWith(".jsp")) { if (handleDevJSP(pathInfo, request, response)) { return; } handleJSP(pathInfo, request, response); } // Handle servlet requests. else if (getServlet(pathInfo) != null) { handleServlet(pathInfo, request, response); } // Handle image/other requests. else { handleOtherRequest(pathInfo, response); } } catch (Exception e) { Log.error(e.getMessage(), e); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: service File: xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java Repository: igniterealtime/Openfire The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18393
MEDIUM
5
igniterealtime/Openfire
service
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginServlet.java
5af6e03c25b121d01e752927c401124a4da569f7
0
Analyze the following code function for security vulnerabilities
public static ApkSigningBlockUtils.SigningSchemeBlockAndDigests generateApkSignatureSchemeV2Block(RunnablesExecutor executor, DataSource beforeCentralDir, DataSource centralDir, DataSource eocd, List<SignerConfig> signerConfigs, boolean v3SigningEnabled) throws IOException, InvalidKeyException, NoSuchAlgorithmException, SignatureException { return generateApkSignatureSchemeV2Block(executor, beforeCentralDir, centralDir, eocd, signerConfigs, v3SigningEnabled, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateApkSignatureSchemeV2Block File: src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
generateApkSignatureSchemeV2Block
src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
private static void appendAttributes(StringBuilder xml, Object... attributes) { for (int i = 0; i < attributes.length; ) { xml.append(" ").append(attributes[i++]).append("=\"").append(attributes[i++]).append("\""); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendAttributes 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
appendAttributes
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
void setActionsReadyListener(ScreenshotController.ActionsReadyListener listener) { mParams.mActionsReadyListener = listener; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActionsReadyListener File: packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35676
HIGH
7.8
android
setActionsReadyListener
packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
109e58b62dc9fedcee93983678ef9d4931e72afa
0
Analyze the following code function for security vulnerabilities
public static long getContextLastRefreshedTime() { return contextLastRefreshedTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContextLastRefreshedTime File: api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java Repository: openmrs/openmrs-module-uiframework The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-uiframework
getContextLastRefreshedTime
api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java
0422fa52c7eba3d96cce2936cb92897dca4b680a
0
Analyze the following code function for security vulnerabilities
private void initRecipients() { setupRecipients(mTo); setupRecipients(mCc); setupRecipients(mBcc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initRecipients File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
initRecipients
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private boolean isGlobalOrSecureSettingRestrictedForUser(String setting, int userId, String value) { String restriction; switch (setting) { case Settings.Secure.LOCATION_MODE: // Note LOCATION_MODE will be converted into LOCATION_PROVIDERS_ALLOWED // in android.provider.Settings.Secure.putStringForUser(), so we shouldn't come // here normally, but we still protect it here from a direct provider write. if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value)) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.LOCATION_PROVIDERS_ALLOWED: // See SettingsProvider.updateLocationProvidersAllowedLocked. "-" is to disable // a provider, which should be allowed even if the user restriction is set. if (value != null && value.startsWith("-")) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.INSTALL_NON_MARKET_APPS: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; break; case Settings.Global.ADB_ENABLED: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DEBUGGING_FEATURES; break; case Settings.Global.PACKAGE_VERIFIER_ENABLE: case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB: if ("1".equals(value)) return false; restriction = UserManager.ENSURE_VERIFY_APPS; break; case Settings.Global.PREFERRED_NETWORK_MODE: restriction = UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DATA_ROAMING; break; } return false; } return mUserManager.hasUserRestriction(restriction, UserHandle.of(userId)); }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3887 - Severity: MEDIUM - CVSS Score: 6.8 Description: Disallow shell to mutate always-on vpn when DISALLOW_CONFIG_VPN user restriction is set Fix: 29899712 Change-Id: I38cc9d0e584c3f2674c9ff1d91f77a11479d8943 (cherry picked from commit 9c7b706cf4332b4aeea39c166abca04b56685280) Function: isGlobalOrSecureSettingRestrictedForUser File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android Fixed Code: private boolean isGlobalOrSecureSettingRestrictedForUser(String setting, int userId, String value, int callingUid) { String restriction; switch (setting) { case Settings.Secure.LOCATION_MODE: // Note LOCATION_MODE will be converted into LOCATION_PROVIDERS_ALLOWED // in android.provider.Settings.Secure.putStringForUser(), so we shouldn't come // here normally, but we still protect it here from a direct provider write. if (String.valueOf(Settings.Secure.LOCATION_MODE_OFF).equals(value)) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.LOCATION_PROVIDERS_ALLOWED: // See SettingsProvider.updateLocationProvidersAllowedLocked. "-" is to disable // a provider, which should be allowed even if the user restriction is set. if (value != null && value.startsWith("-")) return false; restriction = UserManager.DISALLOW_SHARE_LOCATION; break; case Settings.Secure.INSTALL_NON_MARKET_APPS: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES; break; case Settings.Global.ADB_ENABLED: if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DEBUGGING_FEATURES; break; case Settings.Global.PACKAGE_VERIFIER_ENABLE: case Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB: if ("1".equals(value)) return false; restriction = UserManager.ENSURE_VERIFY_APPS; break; case Settings.Global.PREFERRED_NETWORK_MODE: restriction = UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS; break; case Settings.Secure.ALWAYS_ON_VPN_APP: case Settings.Secure.ALWAYS_ON_VPN_LOCKDOWN: // Whitelist system uid (ConnectivityService) and root uid to change always-on vpn if (callingUid == Process.SYSTEM_UID || callingUid == Process.ROOT_UID) { return false; } restriction = UserManager.DISALLOW_CONFIG_VPN; break; default: if (setting != null && setting.startsWith(Settings.Global.DATA_ROAMING)) { if ("0".equals(value)) return false; restriction = UserManager.DISALLOW_DATA_ROAMING; break; } return false; } return mUserManager.hasUserRestriction(restriction, UserHandle.of(userId)); }
[ "CWE-264" ]
CVE-2016-3887
MEDIUM
6.8
android
isGlobalOrSecureSettingRestrictedForUser
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
335702d106797bce8a88044783fa1fc1d5f751d0
1
Analyze the following code function for security vulnerabilities
boolean isAllowedWhileBooting(ApplicationInfo ai) { return (ai.flags&ApplicationInfo.FLAG_PERSISTENT) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAllowedWhileBooting File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
isAllowedWhileBooting
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public String getCipherName() { return "AESGCM"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCipherName File: src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
getCipherName
src/main/java/com/southernstorm/noise/protocol/AESGCMOnCtrCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
private void maybeNotifyProfiles(int type, int userId, Uri uri, String name, Set<String> keysCloned) { if (keysCloned.contains(name)) { for (int profileId : mUserManager.getProfileIdsWithDisabled(userId)) { // the notification for userId has already been sent. if (profileId != userId) { mHandler.obtainMessage(MyHandler.MSG_NOTIFY_URI_CHANGED, profileId, 0, uri).sendToTarget(); final int key = makeKey(type, profileId); mGenerationRegistry.incrementGeneration(key); mHandler.obtainMessage(MyHandler.MSG_NOTIFY_DATA_CHANGED).sendToTarget(); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeNotifyProfiles File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
maybeNotifyProfiles
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage long createTheme() { synchronized (this) { ensureValidLocked(); long themePtr = nativeThemeCreate(mObject); incRefsLocked(themePtr); return themePtr; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTheme File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
createTheme
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public int getIdleConnectionTimeoutInMs() { return idleConnectionTimeoutInMs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIdleConnectionTimeoutInMs File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getIdleConnectionTimeoutInMs
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public void setWorkingDirectory( String path ) { if ( path != null ) { workingDir = path; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWorkingDirectory File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
setWorkingDirectory
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
public void destroy() { }
Vulnerability Classification: - CWE: CWE-434 - CVE: CVE-2017-11466 - Severity: HIGH - CVSS Score: 9.0 Description: #12131 fixes arbitrary upload (#12134) * #12131 fixes arbitrary upload * #12131 fixes jenkins feedback Function: destroy File: dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java Repository: dotCMS/core Fixed Code: @Override public void destroy() { }
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
destroy
dotCMS/src/main/java/com/dotmarketing/filters/CMSFilter.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
1
Analyze the following code function for security vulnerabilities
private void installOemDefaultDialerAndSmsApp(int targetUserId) { try { String defaultDialerPackageName = getOemDefaultDialerPackage(); String defaultSmsPackageName = getOemDefaultSmsPackage(); if (defaultDialerPackageName != null) { mIPackageManager.installExistingPackageAsUser(defaultDialerPackageName, targetUserId, PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, PackageManager.INSTALL_REASON_POLICY, null); } else { Slogf.w(LOG_TAG, "Couldn't install dialer app, dialer app package is null"); } if (defaultSmsPackageName != null) { mIPackageManager.installExistingPackageAsUser(defaultSmsPackageName, targetUserId, PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, PackageManager.INSTALL_REASON_POLICY, null); } else { Slogf.w(LOG_TAG, "Couldn't install sms app, sms app package is null"); } updateDialerAndSmsManagedShortcutsOverrideCache(); } catch (RemoteException re) { // shouldn't happen Slogf.wtf(LOG_TAG, "Failed to install dialer/sms app", re); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installOemDefaultDialerAndSmsApp 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
installOemDefaultDialerAndSmsApp
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public char[] getTextCharacters() throws IOException { if (_currToken != null) { // null only before/after document if (_tokenIncomplete) { _finishToken(); } if (_currToken == JsonToken.VALUE_STRING) { return _textBuffer.getTextBuffer(); } if (_currToken == JsonToken.FIELD_NAME) { return _parsingContext.getCurrentName().toCharArray(); } if ((_currToken == JsonToken.VALUE_NUMBER_INT) || (_currToken == JsonToken.VALUE_NUMBER_FLOAT)) { return getNumberValue().toString().toCharArray(); } return _currToken.asCharArray(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTextCharacters File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getTextCharacters
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@Override public void onSendMultipartSmsComplete(int result, int[] messageRefs) { mSmsSender.disposeConnection(mContext); if (mSmsSender.mTrackers == null) { Rlog.e(TAG, "Unexpected onSendMultipartSmsComplete call with null trackers."); return; } checkCallerIsPhoneOrCarrierApp(); final long identity = Binder.clearCallingIdentity(); try { for (int i = 0; i < mSmsSender.mTrackers.length; i++) { int messageRef = 0; if (messageRefs != null && messageRefs.length > i) { messageRef = messageRefs[i]; } processSendSmsResponse(mSmsSender.mTrackers[i], result, messageRef); } } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSendMultipartSmsComplete File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
onSendMultipartSmsComplete
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
@Override public DecimalQuantity createCopy() { return new DecimalQuantity_DualStorageBCD(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCopy File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
createCopy
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
static boolean scheduleAsFifoPriority(int tid, boolean suppressLogs) { try { Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK, 1); return true; } catch (IllegalArgumentException e) { if (!suppressLogs) { Slog.w(TAG, "Failed to set scheduling policy, thread does not exist:\n" + e); } } catch (SecurityException e) { if (!suppressLogs) { Slog.w(TAG, "Failed to set scheduling policy, not allowed:\n" + e); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleAsFifoPriority File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
scheduleAsFifoPriority
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void setDozing(boolean dozing, boolean animate) { if (dozing == mDozing) return; mDozing = dozing; if (mStatusBarState == StatusBarState.KEYGUARD) { updateDozingVisibilities(animate); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDozing 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
setDozing
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public SaslConfig getSaslConfig() { return saslConfig; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSaslConfig File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
getSaslConfig
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean yieldIfContended() { return yieldIfContendedHelper(false /* do not check yielding */, -1 /* sleepAfterYieldDelay */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: yieldIfContended File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
yieldIfContended
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Override public Response processMessageDispatch(MessageDispatch dispatch) throws Exception { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processMessageDispatch File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processMessageDispatch
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
private static void dumpStackTraces(String tracesPath, ArrayList<Integer> firstPids, ProcessCpuTracker processCpuTracker, SparseArray<Boolean> lastPids, String[] nativeProcs) { // Use a FileObserver to detect when traces finish writing. // The order of traces is considered important to maintain for legibility. FileObserver observer = new FileObserver(tracesPath, FileObserver.CLOSE_WRITE) { @Override public synchronized void onEvent(int event, String path) { notify(); } }; try { observer.startWatching(); // First collect all of the stacks of the most important pids. if (firstPids != null) { try { int num = firstPids.size(); for (int i = 0; i < num; i++) { synchronized (observer) { Process.sendSignal(firstPids.get(i), Process.SIGNAL_QUIT); observer.wait(200); // Wait for write-close, give up after 200msec } } } catch (InterruptedException e) { Slog.wtf(TAG, e); } } // Next collect the stacks of the native pids if (nativeProcs != null) { int[] pids = Process.getPidsForCommands(nativeProcs); if (pids != null) { for (int pid : pids) { Debug.dumpNativeBacktraceToFile(pid, tracesPath); } } } // Lastly, measure CPU usage. if (processCpuTracker != null) { processCpuTracker.init(); System.gc(); processCpuTracker.update(); try { synchronized (processCpuTracker) { processCpuTracker.wait(500); // measure over 1/2 second. } } catch (InterruptedException e) { } processCpuTracker.update(); // We'll take the stack crawls of just the top apps using CPU. final int N = processCpuTracker.countWorkingStats(); int numProcs = 0; for (int i=0; i<N && numProcs<5; i++) { ProcessCpuTracker.Stats stats = processCpuTracker.getWorkingStats(i); if (lastPids.indexOfKey(stats.pid) >= 0) { numProcs++; try { synchronized (observer) { Process.sendSignal(stats.pid, Process.SIGNAL_QUIT); observer.wait(200); // Wait for write-close, give up after 200msec } } catch (InterruptedException e) { Slog.wtf(TAG, e); } } } } } finally { observer.stopWatching(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpStackTraces File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
dumpStackTraces
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void fireDetachListeners() { if (detachListeners != null) { List<Command> copy = new ArrayList<>(detachListeners); copy.forEach(Command::execute); } forEachFeature(NodeFeature::onDetach); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fireDetachListeners File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
fireDetachListeners
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
public static String convertToPsqlStandard(String tenantId){ return tenantId.toLowerCase() + "_" + MODULE_NAME; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertToPsqlStandard 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
convertToPsqlStandard
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public ManifestDigest getManifestDigest() { if (verificationParams == null) { return null; } return verificationParams.getManifestDigest(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManifestDigest File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getManifestDigest
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean commitText(CharSequence text, int newCursorPosition) { Editable currentText = getText(); if (currentText == null) return super.commitText(text, newCursorPosition); int selectionStart = Selection.getSelectionStart(currentText); int selectionEnd = Selection.getSelectionEnd(currentText); int autocompleteIndex = currentText.getSpanStart(mAutocompleteSpan); // If the text being committed is a single character that matches the next character // in the selection (assumed to be the autocomplete text), we only move the text // selection instead clearing the autocomplete text causing flickering as the // autocomplete text will appear once the next suggestions are received. // // To be confident that the selection is an autocomplete, we ensure the selection // is at least one character and the end of the selection is the end of the // currently entered text. if (newCursorPosition == 1 && selectionStart > 0 && selectionStart != selectionEnd && selectionEnd >= currentText.length() && autocompleteIndex == selectionStart && text.length() == 1) { currentText.getChars(selectionStart, selectionStart + 1, mTempSelectionChar, 0); if (mTempSelectionChar[0] == text.charAt(0)) { // Since the text isn't changing, TalkBack won't read out the typed characters. // To work around this, explicitly send an accessibility event. crbug.com/416595 if (mAccessibilityManager != null && mAccessibilityManager.isEnabled()) { AccessibilityEvent event = AccessibilityEvent.obtain( AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); event.setFromIndex(selectionStart); event.setRemovedCount(0); event.setAddedCount(1); event.setBeforeText(currentText.toString().substring(0, selectionStart)); sendAccessibilityEventUnchecked(event); } setAutocompleteText( currentText.subSequence(0, selectionStart + 1), currentText.subSequence(selectionStart + 1, selectionEnd)); if (!mInBatchEditMode) { notifyAutocompleteTextStateChanged(false); } return true; } } boolean retVal = super.commitText(text, newCursorPosition); // Ensure the autocomplete span is removed if it is no longer valid after committing the // text. if (getText().getSpanStart(mAutocompleteSpan) >= 0) clearAutocompleteSpanIfInvalid(); return retVal; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: commitText File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
commitText
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
private FormDetailsBean setSectionBean(FormDetailsBean formDetail,Integer crfVId){ HashMap variables = new HashMap(); variables.put(new Integer(1), new Integer(crfVId)); ArrayList<SectionDetails>sectionBeans = new ArrayList<SectionDetails>(); SectionDAO secdao = new SectionDAO(this.ds); ArrayList sections = secdao.findAllByCRFVersionId (crfVId); Iterator iter = sections.iterator(); while(iter.hasNext()){ SectionDetails sectionDetails = new SectionDetails(); SectionBean sectionBean = (SectionBean) iter.next(); sectionDetails.setSectionId(sectionBean.getId()); sectionDetails.setSectionLabel(sectionBean.getLabel()); sectionDetails.setSectionTitle(sectionBean.getTitle()); sectionDetails.setSectionSubtitle(sectionBean.getSubtitle()); sectionDetails.setSectionInstructions(sectionBean.getInstructions()); sectionDetails.setSectionPageNumber(sectionBean.getPageNumberLabel()); sectionBeans.add(sectionDetails); } formDetail.setSectionDetails(sectionBeans); return formDetail; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSectionBean 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
setSectionBean
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
public void doRssChangelog( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { class FeedItem { ChangeLogSet.Entry e; int idx; public FeedItem(Entry e, int idx) { this.e = e; this.idx = idx; } AbstractBuild<?,?> getBuild() { return e.getParent().build; } } List<FeedItem> entries = new ArrayList<FeedItem>(); for(R r=getLastBuild(); r!=null; r=r.getPreviousBuild()) { int idx=0; for( ChangeLogSet.Entry e : r.getChangeSet()) entries.add(new FeedItem(e,idx++)); } RSS.forwardToRss( getDisplayName()+' '+getScm().getDescriptor().getDisplayName()+" changes", getUrl()+"changes", entries, new FeedAdapter<FeedItem>() { public String getEntryTitle(FeedItem item) { return "#"+item.getBuild().number+' '+item.e.getMsg()+" ("+item.e.getAuthor()+")"; } public String getEntryUrl(FeedItem item) { return item.getBuild().getUrl()+"changes#detail"+item.idx; } public String getEntryID(FeedItem item) { return getEntryUrl(item); } public String getEntryDescription(FeedItem item) { StringBuilder buf = new StringBuilder(); for(String path : item.e.getAffectedPaths()) buf.append(path).append('\n'); return buf.toString(); } public Calendar getEntryTimestamp(FeedItem item) { return item.getBuild().getTimestamp(); } public String getEntryAuthor(FeedItem entry) { return JenkinsLocationConfiguration.get().getAdminAddress(); } }, req, rsp ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doRssChangelog 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
doRssChangelog
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public Date removeUserInfoExpirationDate() { return removeSessionAttribute(PROP_SESSION_USERINFO_EXPORATIONDATE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUserInfoExpirationDate 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
removeUserInfoExpirationDate
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
final void idleUids() { synchronized (this) { final int N = mActiveUids.size(); if (N <= 0) { return; } final long nowElapsed = SystemClock.elapsedRealtime(); final long maxBgTime = nowElapsed - mConstants.BACKGROUND_SETTLE_TIME; long nextTime = 0; if (mLocalPowerManager != null) { mLocalPowerManager.startUidChanges(); } for (int i=N-1; i>=0; i--) { final UidRecord uidRec = mActiveUids.valueAt(i); final long bgTime = uidRec.lastBackgroundTime; if (bgTime > 0 && !uidRec.idle) { if (bgTime <= maxBgTime) { EventLogTags.writeAmUidIdle(uidRec.uid); uidRec.idle = true; uidRec.setIdle = true; doStopUidLocked(uidRec.uid, uidRec); } else { if (nextTime == 0 || nextTime > bgTime) { nextTime = bgTime; } } } } if (mLocalPowerManager != null) { mLocalPowerManager.finishUidChanges(); } if (nextTime > 0) { mHandler.removeMessages(IDLE_UIDS_MSG); mHandler.sendEmptyMessageDelayed(IDLE_UIDS_MSG, nextTime + mConstants.BACKGROUND_SETTLE_TIME - nowElapsed); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: idleUids File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
idleUids
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder cdata(String data);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cdata File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
cdata
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void sendProfileRemovedBroadcast(int parentUserId, int removedUserId) { Intent managedProfileIntent = new Intent(Intent.ACTION_MANAGED_PROFILE_REMOVED); managedProfileIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); managedProfileIntent.putExtra(Intent.EXTRA_USER, new UserHandle(removedUserId)); mContext.sendBroadcastAsUser(managedProfileIntent, new UserHandle(parentUserId), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendProfileRemovedBroadcast 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
sendProfileRemovedBroadcast
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Override public BlockVector3 getSpawnPosition() { return BukkitAdapter.asBlockVector(getWorld().getSpawnLocation()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpawnPosition File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
getSpawnPosition
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
protected void initModuleMessageResources(ModuleConfig config) throws ServletException { MessageResourcesConfig mrcs[] = config.findMessageResourcesConfigs(); for (int i = 0; i < mrcs.length; i++) { if ((mrcs[i].getFactory() == null) || (mrcs[i].getParameter() == null)) { continue; } if (log.isDebugEnabled()) { log.debug( "Initializing module path '" + config.getPrefix() + "' message resources from '" + mrcs[i].getParameter() + "'"); } String factory = mrcs[i].getFactory(); MessageResourcesFactory.setFactoryClass(factory); MessageResourcesFactory factoryObject = MessageResourcesFactory.createFactory(); factoryObject.setConfig(mrcs[i]); MessageResources resources = factoryObject.createResources(mrcs[i].getParameter()); resources.setReturnNull(mrcs[i].getNull()); resources.setEscape(mrcs[i].isEscape()); getServletContext().setAttribute( mrcs[i].getKey() + config.getPrefix(), resources); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initModuleMessageResources File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever The code follows secure coding practices.
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
initModuleMessageResources
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
0
Analyze the following code function for security vulnerabilities
@Deprecated @Override public String getProviderMimeType(Uri uri, int userId) { return mCpHelper.getProviderMimeType(uri, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProviderMimeType 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
getProviderMimeType
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public boolean getAutoExpandBubble() { return (mFlags & FLAG_AUTO_EXPAND_BUBBLE) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAutoExpandBubble File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getAutoExpandBubble
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private BaseObject put(int index, BaseObject element) { BaseObject old; if (element == null) { // We don't want to keep null values in memory old = this.map.remove(index); } else { // Make sure the object number is right element.setNumber(index); old = this.map.put(index, element); } // Increment size if needed if (this.size <= index) { this.size = index + 1; } return old; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
put
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/doc/BaseObjects.java
fdfce062642b0ac062da5cda033d25482f4600fa
0
Analyze the following code function for security vulnerabilities
@Override public Response processRemoveSubscription(RemoveSubscriptionInfo info) throws Exception { broker.removeSubscription(lookupConnectionState(info.getConnectionId()).getContext(), info); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processRemoveSubscription File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processRemoveSubscription
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public void setFocusedActivity(IBinder token) { synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r == null) { throw new IllegalArgumentException( "setFocusedActivity: No activity record matching token=" + token); } if (r.moveFocusableActivityToTop("setFocusedActivity")) { mRootWindowContainer.resumeFocusedTasksTopActivities(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFocusedActivity 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
setFocusedActivity
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
void setNotificationsEnabledForPackageImpl(String pkg, int uid, boolean enabled) { Slog.v(TAG, (enabled?"en":"dis") + "abling notifications for " + pkg); mAppOps.setMode(AppOpsManager.OP_POST_NOTIFICATION, uid, pkg, enabled ? AppOpsManager.MODE_ALLOWED : AppOpsManager.MODE_IGNORED); // Now, cancel any outstanding notifications that are part of a just-disabled app if (ENABLE_BLOCKED_NOTIFICATIONS && !enabled) { cancelAllNotificationsInt(MY_UID, MY_PID, pkg, 0, 0, true, UserHandle.getUserId(uid), REASON_PACKAGE_BANNED, null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNotificationsEnabledForPackageImpl File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
setNotificationsEnabledForPackageImpl
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@Override public int getMaxRunningUsers() { return mUserController.getMaxRunningUsers(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxRunningUsers 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
getMaxRunningUsers
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public float optFloat(String key, float defaultValue) { Number val = this.optNumber(key); if (val == null) { return defaultValue; } final float floatValue = val.floatValue(); // if (Float.isNaN(floatValue) || Float.isInfinite(floatValue)) { // return defaultValue; // } return floatValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optFloat File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
optFloat
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public void forward() { act.runOnUiThread(new Runnable() { public void run() { web.goForward(); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forward File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
forward
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean shouldSleepLocked() { // Resume applications while running a voice interactor. if (mRunningVoice != null) { return false; } // TODO: Transform the lock screen state into a sleep token instead. switch (mWakefulness) { case PowerManagerInternal.WAKEFULNESS_AWAKE: case PowerManagerInternal.WAKEFULNESS_DREAMING: case PowerManagerInternal.WAKEFULNESS_DOZING: // Pause applications whenever the lock screen is shown or any sleep // tokens have been acquired. return (mLockScreenShown != LOCK_SCREEN_HIDDEN || !mSleepTokens.isEmpty()); case PowerManagerInternal.WAKEFULNESS_ASLEEP: default: // If we're asleep then pause applications unconditionally. return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldSleepLocked 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
shouldSleepLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public WebClient.Builder getWebClientBuilder(ActionConfiguration actionConfiguration, DatasourceConfiguration datasourceConfiguration) { HttpClient httpClient = getHttpClient(datasourceConfiguration); WebClient.Builder webClientBuilder = WebClientUtils.builder(httpClient); addAllHeaders(webClientBuilder, actionConfiguration, datasourceConfiguration); addSecretKey(webClientBuilder, datasourceConfiguration); return webClientBuilder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWebClientBuilder File: app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java Repository: appsmithorg/appsmith The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-4096
MEDIUM
6.5
appsmithorg/appsmith
getWebClientBuilder
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/TriggerUtils.java
769719ccfe667f059fe0b107a19ec9feb90f2e40
0
Analyze the following code function for security vulnerabilities
private boolean processStyleTag(Element ele, Node parentNode) { /* * Invoke the css parser on this element. */ CssScanner styleScanner = new CssScanner(policy, messages, policy.isEmbedStyleSheets()); try { Node firstChild = ele.getFirstChild(); if (firstChild != null) { String toScan = firstChild.getNodeValue(); CleanResults cr = styleScanner.scanStyleSheet(toScan, policy.getMaxInputSize()); errorMessages.addAll(cr.getErrorMessages()); /* * If IE gets an empty style tag, i.e. <style/> it will * break all CSS on the page. I wish I was kidding. So, * if after validation no CSS properties are left, we * would normally be left with an empty style tag and * break all CSS. To prevent that, we have this check. */ final String cleanHTML = cr.getCleanHTML(); if (cleanHTML == null || cleanHTML.equals("")) { firstChild.setNodeValue("/* */"); } else { firstChild.setNodeValue(cleanHTML); } } } catch (DOMException | ScanException | ParseException | NumberFormatException e) { /* * ParseException shouldn't be possible anymore, but we'll leave it * here because I (Arshan) am hilariously dumb sometimes. * Batik can throw NumberFormatExceptions (see bug #48). */ addError(ErrorMessageUtil.ERROR_CSS_TAG_MALFORMED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(ele.getFirstChild().getNodeValue())}); parentNode.removeChild(ele); return true; } return false; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-28367 - Severity: MEDIUM - CVSS Score: 4.3 Description: Support multiple children handling on style tags Function: processStyleTag File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java Repository: nahsra/antisamy Fixed Code: private boolean processStyleTag(Element ele, Node parentNode) { /* * Invoke the css parser on this element. */ CssScanner styleScanner = new CssScanner(policy, messages, policy.isEmbedStyleSheets()); try { if (ele.getChildNodes().getLength() > 0) { String toScan = ""; for (int i = 0; i < ele.getChildNodes().getLength(); i++) { Node childNode = ele.getChildNodes().item(i); if (!toScan.isEmpty()){ toScan += "\n"; } toScan += childNode.getTextContent(); } CleanResults cr = styleScanner.scanStyleSheet(toScan, policy.getMaxInputSize()); errorMessages.addAll(cr.getErrorMessages()); /* * If IE gets an empty style tag, i.e. <style/> it will * break all CSS on the page. I wish I was kidding. So, * if after validation no CSS properties are left, we * would normally be left with an empty style tag and * break all CSS. To prevent that, we have this check. */ String cleanHTML = cr.getCleanHTML(); cleanHTML = cleanHTML == null || cleanHTML.equals("") ? "/* */" : cleanHTML; ele.getFirstChild().setNodeValue(cleanHTML); /* * Remove every other node after cleaning CSS, there will * be only one node in the end, as it always should have. */ for (int i = 1; i < ele.getChildNodes().getLength(); i++) { Node childNode = ele.getChildNodes().item(i); ele.removeChild(childNode); } } } catch (DOMException | ScanException | ParseException | NumberFormatException e) { /* * ParseException shouldn't be possible anymore, but we'll leave it * here because I (Arshan) am hilariously dumb sometimes. * Batik can throw NumberFormatExceptions (see bug #48). */ addError(ErrorMessageUtil.ERROR_CSS_TAG_MALFORMED, new Object[]{HTMLEntityEncoder.htmlEntityEncode(ele.getFirstChild().getNodeValue())}); parentNode.removeChild(ele); return true; } return false; }
[ "CWE-79" ]
CVE-2022-28367
MEDIUM
4.3
nahsra/antisamy
processStyleTag
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
0199e7e194dba5e7d7197703f43ebe22401e61ae
1
Analyze the following code function for security vulnerabilities
void onCallStateChanged(Call call, int oldState, int newState);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCallStateChanged 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
onCallStateChanged
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
@Deprecated List<DictModel> queryAllTableDictItems(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryAllTableDictItems File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45207
CRITICAL
9.8
jeecgboot/jeecg-boot
queryAllTableDictItems
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
8632a835c23f558dfee3584d7658cc6a13ccec6f
0
Analyze the following code function for security vulnerabilities
public void addDatatransferProgressListener( OnDatatransferProgressListener listener, User user, OCFile file ) { if (user == null || file == null || listener == null) { return; } String targetKey = buildRemoteName(user.getAccountName(), file.getRemotePath()); mBoundListeners.put(targetKey, listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDatatransferProgressListener File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
addDatatransferProgressListener
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public WearableExtender setBridgeTag(String bridgeTag) { mBridgeTag = bridgeTag; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBridgeTag File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setBridgeTag
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static String getToken(String uri) { String[] uriParts = uri.split("/"); return uriParts[uriParts.length - 1]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getToken File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/TokenUpdater.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
getToken
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/TokenUpdater.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
private void notifyResetProtectionPolicyChanged(int frpManagementAgentUid) { final Intent intent = new Intent( DevicePolicyManager.ACTION_RESET_PROTECTION_POLICY_CHANGED).addFlags( Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND | Intent.FLAG_RECEIVER_FOREGROUND); mContext.sendBroadcastAsUser(intent, UserHandle.getUserHandleForUid(frpManagementAgentUid), permission.MANAGE_FACTORY_RESET_PROTECTION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyResetProtectionPolicyChanged 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
notifyResetProtectionPolicyChanged
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void restoreObbFile(String pkgName, ParcelFileDescriptor data, long fileSize, int type, String path, long mode, long mtime, int token, IBackupManager callbackBinder) { waitForConnection(); try { mService.restoreObbFile(pkgName, data, fileSize, type, path, mode, mtime, token, callbackBinder); } catch (Exception e) { Slog.w(TAG, "Unable to restore OBBs for " + pkgName, e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreObbFile 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
restoreObbFile
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private void replace(int start, int end, char ch) { elide(start, end); sanitizedJson.append(ch); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replace File: src/main/java/com/google/json/JsonSanitizer.java Repository: OWASP/json-sanitizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-13973
MEDIUM
4.3
OWASP/json-sanitizer
replace
src/main/java/com/google/json/JsonSanitizer.java
53ceaac3e0a10e86d512ce96a0056578f2d1978f
0
Analyze the following code function for security vulnerabilities
private <T extends NodeFeature> int getFeatureIndex(Class<T> featureType) { assert featureType != null; Integer featureIndex = featureSet.mappings.get(featureType); if (featureIndex == null) { throw new IllegalStateException( "Node does not have the feature " + featureType); } return featureIndex.intValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFeatureIndex File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getFeatureIndex
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public boolean providesMaxBounds() { // System should always be able to access the DisplayArea bounds, so do not provide it with // compat max window bounds. if (getUid() == SYSTEM_UID) { return false; } // Do not sandbox to activity window bounds if the feature is disabled. if (mDisplayContent != null && !mDisplayContent.sandboxDisplayApis()) { return false; } // Never apply sandboxing to an app that should be explicitly excluded from the config. if (info.neverSandboxDisplayApis(sConstrainDisplayApisConfig)) { return false; } // Always apply sandboxing to an app that should be explicitly included from the config. if (info.alwaysSandboxDisplayApis(sConstrainDisplayApisConfig)) { return true; } // Max bounds should be sandboxed when an activity should have compatDisplayInsets, and it // will keep the same bounds and screen configuration when it was first launched regardless // how its parent window changes, so that the sandbox API will provide a consistent result. if (mCompatDisplayInsets != null || shouldCreateCompatDisplayInsets()) { return true; } // No need to sandbox for resizable apps in (including in multi-window) because // resizableActivity=true indicates that they support multi-window. Likewise, do not sandbox // for activities in letterbox since the activity has declared it can handle resizing. return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: providesMaxBounds 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
providesMaxBounds
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
final void appDiedLocked(ProcessRecord app) { appDiedLocked(app, app.pid, app.thread, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appDiedLocked 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
appDiedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
private static String getClassTag(String className) { return "!" + StringUtils.substringAfterLast(className, "."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClassTag File: server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-538" ]
CVE-2021-21250
MEDIUM
4
theonedev/onedev
getClassTag
server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
9196fd795e87dab069b4260a3590a0ea886e770f
0
Analyze the following code function for security vulnerabilities
@Override protected void throwAlreadyLoggedInExceptionIfAppropriate() throws AlreadyLoggedInException { if (isAuthenticated() && !disconnectedButResumeable) { throw new AlreadyLoggedInException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwAlreadyLoggedInExceptionIfAppropriate File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
throwAlreadyLoggedInExceptionIfAppropriate
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
@Override protected boolean isPermitted() { return SecurityUtils.canReadCode(getProject()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPermitted File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
isPermitted
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
@Override public String buildInvalidTestingPostAuthnRequest(AuthenticationRequest request, boolean sign, PrivateKey privateKey, X509Certificate certificate, Algorithm algorithm, String xmlSignatureC14nMethod) throws SAMLException { AuthnRequestType authnRequest = toAuthnRequest(request, "bad"); return buildPostAuthnRequest(authnRequest, sign, privateKey, certificate, algorithm, xmlSignatureC14nMethod); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildInvalidTestingPostAuthnRequest File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java Repository: FusionAuth/fusionauth-samlv2 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-27736
MEDIUM
4
FusionAuth/fusionauth-samlv2
buildInvalidTestingPostAuthnRequest
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
c66fb689d50010662f705d5b585c6388ce555dbd
0
Analyze the following code function for security vulnerabilities
private String getEngineSessionId() { return (String) getSession().getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEngineSessionId File: frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java Repository: oVirt/ovirt-engine The code follows secure coding practices.
[ "CWE-287" ]
CVE-2024-0822
HIGH
7.5
oVirt/ovirt-engine
getEngineSessionId
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/GenericApiGWTServiceImpl.java
036f617316f6d7077cd213eb613eb4816e33d1fc
0
Analyze the following code function for security vulnerabilities
public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() { enforceNotIsolatedCaller("getRunningAppProcesses"); // Lazy instantiation of list List<ActivityManager.RunningAppProcessInfo> runList = null; final boolean allUsers = ActivityManager.checkUidPermission(INTERACT_ACROSS_USERS_FULL, Binder.getCallingUid()) == PackageManager.PERMISSION_GRANTED; int userId = UserHandle.getUserId(Binder.getCallingUid()); synchronized (this) { // Iterate across all processes for (int i=mLruProcesses.size()-1; i>=0; i--) { ProcessRecord app = mLruProcesses.get(i); if (!allUsers && app.userId != userId) { continue; } if ((app.thread != null) && (!app.crashing && !app.notResponding)) { // Generate process state info for running application ActivityManager.RunningAppProcessInfo currApp = new ActivityManager.RunningAppProcessInfo(app.processName, app.pid, app.getPackageList()); fillInProcMemInfo(app, currApp); if (app.adjSource instanceof ProcessRecord) { currApp.importanceReasonPid = ((ProcessRecord)app.adjSource).pid; currApp.importanceReasonImportance = ActivityManager.RunningAppProcessInfo.procStateToImportance( app.adjSourceProcState); } else if (app.adjSource instanceof ActivityRecord) { ActivityRecord r = (ActivityRecord)app.adjSource; if (r.app != null) currApp.importanceReasonPid = r.app.pid; } if (app.adjTarget instanceof ComponentName) { currApp.importanceReasonComponent = (ComponentName)app.adjTarget; } //Slog.v(TAG, "Proc " + app.processName + ": imp=" + currApp.importance // + " lru=" + currApp.lru); if (runList == null) { runList = new ArrayList<ActivityManager.RunningAppProcessInfo>(); } runList.add(currApp); } } } return runList; }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2015-3833 - Severity: MEDIUM - CVSS Score: 4.3 Description: Lockdown AM.getRunningAppProcesses API with permission.REAL_GET_TASKS * Applications must now have ...permission.REAL_GET_TASKS to be able to get process information for all applications. * Only the process information for the calling application will be returned if the app doesn't have the permission. * Privilages apps will temporarily be able to get process information for all applications if they don't have the new permission, but have deprecated ...permission.GET_TASKS. Bug: 20034603 Change-Id: I67ae9491f65d2280adb6a81593693d499714a216 (cherry picked from commit 9dbaa54f6834e013a63f18bd51ace554de811d80) Function: getRunningAppProcesses File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android Fixed Code: public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() { enforceNotIsolatedCaller("getRunningAppProcesses"); final int callingUid = Binder.getCallingUid(); // Lazy instantiation of list List<ActivityManager.RunningAppProcessInfo> runList = null; final boolean allUsers = ActivityManager.checkUidPermission(INTERACT_ACROSS_USERS_FULL, callingUid) == PackageManager.PERMISSION_GRANTED; final int userId = UserHandle.getUserId(callingUid); final boolean allUids = isGetTasksAllowed( "getRunningAppProcesses", Binder.getCallingPid(), callingUid); synchronized (this) { // Iterate across all processes for (int i = mLruProcesses.size() - 1; i >= 0; i--) { ProcessRecord app = mLruProcesses.get(i); if ((!allUsers && app.userId != userId) || (!allUids && app.uid != callingUid)) { continue; } if ((app.thread != null) && (!app.crashing && !app.notResponding)) { // Generate process state info for running application ActivityManager.RunningAppProcessInfo currApp = new ActivityManager.RunningAppProcessInfo(app.processName, app.pid, app.getPackageList()); fillInProcMemInfo(app, currApp); if (app.adjSource instanceof ProcessRecord) { currApp.importanceReasonPid = ((ProcessRecord)app.adjSource).pid; currApp.importanceReasonImportance = ActivityManager.RunningAppProcessInfo.procStateToImportance( app.adjSourceProcState); } else if (app.adjSource instanceof ActivityRecord) { ActivityRecord r = (ActivityRecord)app.adjSource; if (r.app != null) currApp.importanceReasonPid = r.app.pid; } if (app.adjTarget instanceof ComponentName) { currApp.importanceReasonComponent = (ComponentName)app.adjTarget; } //Slog.v(TAG, "Proc " + app.processName + ": imp=" + currApp.importance // + " lru=" + currApp.lru); if (runList == null) { runList = new ArrayList<>(); } runList.add(currApp); } } } return runList; }
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
getRunningAppProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
1
Analyze the following code function for security vulnerabilities
@Override public void updateDeviceOwner(String packageName) { final int callingUid = Binder.getCallingUid(); if (callingUid != 0 && callingUid != SYSTEM_UID) { throw new SecurityException("updateDeviceOwner called from non-system process"); } synchronized (this) { mDeviceOwnerName = packageName; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDeviceOwner File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
updateDeviceOwner
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public boolean handleEvent(final ValidationEvent event) { LOG.trace("event = {}", event, event.getLinkedException()); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleEvent File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
handleEvent
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
public void shear(Object nativeGraphics, float x, float y) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shear File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
shear
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Test public void parseHistogramQueryTSUIDType() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&tsuid=sum:percentiles[0.98]:010101"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals(1, sub.getTsuids().size()); assertEquals("010101", sub.getTsuids().get(0)); assertEquals(0.98f, sub.getPercentiles().get(0).floatValue(), 0.0001); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseHistogramQueryTSUIDType File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseHistogramQueryTSUIDType
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public Policy cloneWithDirective(String name, String value) { Map<String, String> directives = new HashMap<String, String>(this.directives); directives.put(name, value); return new InternalPolicy(this, Collections.unmodifiableMap(directives), tagRules); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cloneWithDirective File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
cloneWithDirective
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
private void verifySignature(Document document, KeySelector keySelector) throws SAMLException { // Fix the IDs in the entire document per the suggestions at http://stackoverflow.com/questions/17331187/xml-dig-sig-error-after-upgrade-to-java7u25 fixIDs(document.getDocumentElement()); NodeList nl = document.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature"); if (nl.getLength() == 0) { throw new SignatureNotFoundException("Invalid SAML v2.0 operation. The signature is missing from the XML but is required."); } for (int i = 0; i < nl.getLength(); i++) { DOMValidateContext validateContext = new DOMValidateContext(keySelector, nl.item(i)); XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); try { XMLSignature signature = factory.unmarshalXMLSignature(validateContext); boolean valid = signature.validate(validateContext); if (!valid) { throw new SAMLException("Invalid SAML v2.0 operation. The signature is invalid."); } } catch (MarshalException e) { throw new SAMLException("Unable to verify XML signature in the SAML v2.0 XML. We couldn't unmarshall the XML Signature element.", e); } catch (XMLSignatureException e) { throw new SAMLException("Unable to verify XML signature in the SAML v2.0 XML. The signature was unmarshalled but we couldn't validate it. Possible reasons include a key was not provided that was eligible to verify the signature, or an un-expected exception occurred.", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifySignature File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java Repository: FusionAuth/fusionauth-samlv2 The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-27736
MEDIUM
4
FusionAuth/fusionauth-samlv2
verifySignature
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
c66fb689d50010662f705d5b585c6388ce555dbd
0
Analyze the following code function for security vulnerabilities
public static void createSchema(DataSource dataSource, String name) { try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) { statement.executeUpdate(String.format(DDL_CREATE_SCHEMA, name)); } catch (SQLException e) { throw new RuntimeException("Can not connect to database", e); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15557 - Severity: HIGH - CVSS Score: 7.5 Description: add assertTenantKeyValid Function: createSchema File: src/main/java/com/icthh/xm/uaa/util/DatabaseUtil.java Repository: xm-online/xm-uaa Fixed Code: public static void createSchema(DataSource dataSource, String name) { assertTenantKeyValid(name); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) { statement.executeUpdate(String.format(DDL_CREATE_SCHEMA, name)); } catch (SQLException e) { throw new RuntimeException("Can not connect to database", e); } }
[ "CWE-89" ]
CVE-2019-15557
HIGH
7.5
xm-online/xm-uaa
createSchema
src/main/java/com/icthh/xm/uaa/util/DatabaseUtil.java
ffa9609c809c17e7a39ae1d92843c4463e3ca739
1
Analyze the following code function for security vulnerabilities
@Override public void setCrossProfileContactsSearchDisabled(ComponentName who, boolean disabled) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerLocked(caller); if (admin.disableContactsSearch != disabled) { admin.disableContactsSearch = disabled; saveSettingsLocked(caller.getUserId()); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_CROSS_PROFILE_CONTACTS_SEARCH_DISABLED) .setAdmin(who) .setBoolean(disabled) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCrossProfileContactsSearchDisabled 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
setCrossProfileContactsSearchDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj){ return true; } if (!(obj instanceof JsonNumber)) { return false; } JsonNumber other = (JsonNumber)obj; return bigDecimalValue().equals(other.bigDecimalValue()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
equals
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
84764ffbe3d0376da242b27a9a526138d0dfb8e6
0
Analyze the following code function for security vulnerabilities
@CLIMethod(name="safe-shutdown") public HttpResponse doSafeExit(StaplerRequest req) throws IOException { checkPermission(ADMINISTER); isQuietingDown = true; final String exitUser = getAuthentication().getName(); final String exitAddr = req!=null ? req.getRemoteAddr() : "unknown"; new Thread("safe-exit thread") { @Override public void run() { try { ACL.impersonate(ACL.SYSTEM); LOGGER.severe(String.format("Shutting down VM as requested by %s from %s", exitUser, exitAddr)); // Wait 'til we have no active executors. while (isQuietingDown && (overallLoad.computeTotalExecutors() > overallLoad.computeIdleExecutors())) { Thread.sleep(5000); } // Make sure isQuietingDown is still true. if (isQuietingDown) { cleanUp(); System.exit(0); } } catch (InterruptedException e) { LOGGER.log(Level.WARNING, "Failed to shutdown Hudson",e); } } }.start(); return HttpResponses.plainText("Shutting down as soon as all jobs are complete"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doSafeExit File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doSafeExit
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override public void setBoolean(String key, boolean value, int userId) throws RemoteException { checkWritePermission(userId); setStringUnchecked(key, userId, value ? "1" : "0"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBoolean File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
setBoolean
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
public IntentBuilder setForBiometrics(boolean forBiometrics) { mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, forBiometrics); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setForBiometrics 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
setForBiometrics
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@Override public Resource createResource(URI uri) { ArchimateResource resource = new ArchimateResource(uri); // Ensure we have ExtendedMetaData for both Saving and Loading ExtendedMetaData ext = new ConverterExtendedMetadata(); resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, ext); resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, ext); resource.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE); resource.setIntrinsicIDToEObjectMap(new HashMap<String, EObject>()); Map<String, Object> parserFeatures = new HashMap<String, Object>(); // Don't allow DTD loading in case of XSS exploits parserFeatures.put("http://apache.org/xml/features/disallow-doctype-decl", Boolean.TRUE); //$NON-NLS-1$ parserFeatures.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", Boolean.FALSE); //$NON-NLS-1$ parserFeatures.put("http://xml.org/sax/features/external-general-entities", Boolean.FALSE); //$NON-NLS-1$ parserFeatures.put("http://xml.org/sax/features/external-parameter-entities", Boolean.FALSE); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_PARSER_FEATURES, parserFeatures); // Not sure about this // resource.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); // Don't set this as it prefixes a hash # to ID references // resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); // resource.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); // Not sure about this // resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); return resource; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-40235 - Severity: MEDIUM - CVSS Score: 6.5 Description: Set OPTION_USE_PACKAGE_NS_URI_AS_LOCATION to false - See https://github.com/archimatetool/archi/issues/946 Function: createResource File: com.archimatetool.model/src/com/archimatetool/model/util/ArchimateResourceFactory.java Repository: archimatetool/archi Fixed Code: @Override public Resource createResource(URI uri) { ArchimateResource resource = new ArchimateResource(uri); // Ensure we have ExtendedMetaData for both Saving and Loading ExtendedMetaData ext = new ConverterExtendedMetadata(); resource.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, ext); resource.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, ext); resource.getDefaultSaveOptions().put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE); resource.setIntrinsicIDToEObjectMap(new HashMap<String, EObject>()); // Don't allow loading an unregistered URI in case of exploits resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_PACKAGE_NS_URI_AS_LOCATION, false); Map<String, Object> parserFeatures = new HashMap<String, Object>(); // Don't allow DTD loading in case of XSS exploits parserFeatures.put("http://apache.org/xml/features/disallow-doctype-decl", Boolean.TRUE); //$NON-NLS-1$ parserFeatures.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", Boolean.FALSE); //$NON-NLS-1$ parserFeatures.put("http://xml.org/sax/features/external-general-entities", Boolean.FALSE); //$NON-NLS-1$ parserFeatures.put("http://xml.org/sax/features/external-parameter-entities", Boolean.FALSE); //$NON-NLS-1$ resource.getDefaultLoadOptions().put(XMLResource.OPTION_PARSER_FEATURES, parserFeatures); // Not sure about this // resource.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); // Don't set this as it prefixes a hash # to ID references // resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); // resource.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); // Not sure about this // resource.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); return resource; }
[ "CWE-Other" ]
CVE-2023-40235
MEDIUM
6.5
archimatetool/archi
createResource
com.archimatetool.model/src/com/archimatetool/model/util/ArchimateResourceFactory.java
bcab676beddfbeddffecacf755b6692f0b0151f1
1
Analyze the following code function for security vulnerabilities
@Override public void onProvisioningSuccess(LinkProperties newLp) { addPasspointInfoToLinkProperties(newLp); mWifiMetrics.logStaEvent(mInterfaceName, StaEvent.TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL); sendMessage(CMD_UPDATE_LINKPROPERTIES, newLp); sendMessage(CMD_IP_CONFIGURATION_SUCCESSFUL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onProvisioningSuccess File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onProvisioningSuccess
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public SerializationServiceBuilder setManagedContext(ManagedContext managedContext) { this.managedContext = managedContext; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setManagedContext File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
setManagedContext
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private static byte[] generateDefaultPersonalizationString() { return Arrays.concatenate(Strings.toByteArray("Default"), Strings.toUTF8ByteArray(getVIMID()), Pack.longToBigEndian(Thread.currentThread().getId()), Pack.longToBigEndian(System.currentTimeMillis())); }
Vulnerability Classification: - CWE: CWE-310 - CVE: CVE-2016-1000339 - Severity: MEDIUM - CVSS Score: 5.0 Description: Added table use obfuscation to AESFastEngine JDK 1.4 compiler updates. Function: generateDefaultPersonalizationString File: prov/src/main/java/org/bouncycastle/jcajce/provider/drbg/DRBG.java Repository: bcgit/bc-java Fixed Code: private static byte[] generateDefaultPersonalizationString(SecureRandom random) { return Arrays.concatenate(Strings.toByteArray("Default"), random.generateSeed(16), Pack.longToBigEndian(Thread.currentThread().getId()), Pack.longToBigEndian(System.currentTimeMillis())); }
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
generateDefaultPersonalizationString
prov/src/main/java/org/bouncycastle/jcajce/provider/drbg/DRBG.java
8a73f08931450c17c749af067b6a8185abdfd2c0
1
Analyze the following code function for security vulnerabilities
private DocumentReference userStringToReference(String userString) { DocumentReference userReference; if (StringUtils.isEmpty(userString)) { userReference = null; } else { userReference = getExplicitReferenceDocumentReferenceResolver().resolve( getXClassEntityReferenceResolver().resolve(userString, EntityType.DOCUMENT), getDocumentReference()); if (userReference.getName().equals(XWikiRightService.GUEST_USER)) { userReference = null; } } return userReference; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userStringToReference 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
userStringToReference
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
public boolean contentAlwaysAllowed(String url) { return url.toLowerCase() .startsWith("https://trello-attachments.s3.amazonaws.com/") || url.toLowerCase().startsWith("https://docs.google.com/"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: contentAlwaysAllowed File: src/main/java/com/mxgraph/online/ProxyServlet.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-1713
MEDIUM
5
jgraph/drawio
contentAlwaysAllowed
src/main/java/com/mxgraph/online/ProxyServlet.java
283d41ec80ad410d68634245cf56114bc19331ee
0