instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public void run() { RecentsConfiguration config = RecentsConfiguration.getInstance(); if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) { RecentsTaskLoader loader = RecentsTaskLoader.getInstance(); SystemServicesProxy ssp = loader.getSystemServicesProxy(); ActivityManager.RunningTaskInfo runningTaskInfo = ssp.getTopMostTask(); // Load the next task only if we aren't svelte RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext); loader.preloadTasks(plan, true /* isTopTaskHome */); RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options(); // This callback is made when a new activity is launched and the old one is paused // so ignore the current activity and try and preload the thumbnail for the // previous one. if (runningTaskInfo != null) { launchOpts.runningTaskId = runningTaskInfo.id; } launchOpts.numVisibleTasks = 2; launchOpts.numVisibleTaskThumbnails = 2; launchOpts.onlyLoadForCache = true; launchOpts.onlyLoadPausedActivities = true; loader.loadTasks(mContext, plan, launchOpts); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0813
MEDIUM
6.6
android
run
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
0
Analyze the following code function for security vulnerabilities
public WorkflowInstance addZippedMediaPackage(InputStream zipStream) throws IngestException, IOException, MediaPackageException { try { return addZippedMediaPackage(zipStream, null, null); } catch (NotFoundException e) { throw new IllegalStateException("A not found exception was thrown without a lookup"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addZippedMediaPackage 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
addZippedMediaPackage
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public void onRemovalError(Fingerprint fp, int errMsgId, CharSequence errString) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRemovalError File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onRemovalError
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private void _writeUser(final String name, final User details) throws Exception { if (name == null || details == null) { throw new Exception("UserFactory:saveUser null"); } else { _assertSaltAcceptable(details); m_users.put(name, details); } _saveCurrent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _writeUser File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
_writeUser
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public void stop() { if (atomicHandler.get() == null) { return; } try { // The most reliable way to stop the webpack-dev-server is // by informing webpack to exit. We have implemented in webpack a // a listener that handles the stop command via HTTP and exits. prepareConnection("/stop", "GET").getResponseCode(); } catch (IOException e) { getLogger().debug( "webpack-dev-server does not support the `/stop` command.", e); } DevServerWatchDog watchDogInstance = watchDog.get(); if (watchDogInstance != null) { watchDogInstance.stop(); } Process process = webpackProcess.get(); if (process != null && process.isAlive()) { process.destroy(); } atomicHandler.set(null); removeRunningDevServerPort(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stop File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
stop
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
0
Analyze the following code function for security vulnerabilities
@Override public PageParameters getParamsBeforeEdit() { return paramsOf(getProject(), state); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamsBeforeEdit 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
getParamsBeforeEdit
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
private boolean isAuthenticatedUser(final Context context, final EPerson ePerson) { return Objects.equals(context.getCurrentUser(), ePerson); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAuthenticatedUser File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
isAuthenticatedUser
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; } if (valueCollection.isEmpty()){ return params; } // get the collection format (default: csv) String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { for (Object item : valueCollection) { params.add(new Pair(name, parameterToString(item))); } return params; } String delimiter = ","; if ("csv".equals(format)) { delimiter = ","; } else if ("ssv".equals(format)) { delimiter = " "; } else if ("tsv".equals(format)) { delimiter = "\t"; } else if ("pipes".equals(format)) { delimiter = "|"; } StringBuilder sb = new StringBuilder() ; for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); } params.add(new Pair(name, sb.substring(1))); return params; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToPairs File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parameterToPairs
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private String getBaseUrl(String pUrl, String pServletPath) { String sUrl; try { URL url = new URL(pUrl); String host = getIpIfPossible(url.getHost()); sUrl = new URL(url.getProtocol(),host,url.getPort(),pServletPath).toExternalForm(); } catch (MalformedURLException exp) { sUrl = plainReplacement(pUrl, pServletPath); } return sUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseUrl File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
getBaseUrl
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
private String getParent(XWikiRequest request, XWikiDocument doc, boolean isSpace, XWikiContext context) { // This template can be passed a parent document reference in parameter (using the "parent" parameter). // If a parent parameter is passed, use it to set the parent when creating the new Page or Space. // If no parent parameter was passed: // * use the current document // ** if we're creating a new page and if the current document exists or // * use the Main space's WebHome // ** if we're creating a new page and the current document does not exist. String parent = request.getParameter(PARENT); if (StringUtils.isEmpty(parent)) { EntityReferenceSerializer<String> localSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING, LOCAL_SERIALIZER_HINT); if (doc.isNew()) { // Use the Main space's WebHome. Provider<DocumentReference> defaultDocumentReferenceProvider = Utils.getComponent(DocumentReference.TYPE_PROVIDER); DocumentReference parentRef = defaultDocumentReferenceProvider.get().setWikiReference(context.getWikiReference()); parent = localSerializer.serialize(parentRef); } else { // Use the current document. DocumentReference parentRef = doc.getDocumentReference(); parent = localSerializer.serialize(parentRef); } } return parent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
getParent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
30c52b01559b8ef5ed1035dac7c34aaf805764d5
0
Analyze the following code function for security vulnerabilities
boolean pauseBackStacks(boolean userLeaving, boolean resuming, boolean dontWait) { boolean someActivityPaused = false; for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) { final ActivityStack stack = stacks.get(stackNdx); if (!isFrontStack(stack) && stack.mResumedActivity != null) { if (DEBUG_STATES) Slog.d(TAG_STATES, "pauseBackStacks: stack=" + stack + " mResumedActivity=" + stack.mResumedActivity); someActivityPaused |= stack.startPausingLocked(userLeaving, false, resuming, dontWait); } } } return someActivityPaused; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pauseBackStacks File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
pauseBackStacks
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public void setStatus(String status) { this.status = status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStatus File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setStatus
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private String hexToString(final byte[] data) { // check to see if the byte array has an even number of elements if ((data.length % 2) != 0) return null; // there will be two hexadecimal characters for each byte element final char[] buffer = new char[data.length * 2]; for (int i = 0; i < data.length; i++) { final int low = (int) (data[i] & 0x0f); final int high = (int) ((data[i] & 0xf0) >> 4); buffer[i * 2] = HEX[high]; buffer[i * 2 + 1] = HEX[low]; } return new String(buffer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hexToString File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
hexToString
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public boolean isAssistDataAllowedOnCurrentActivity() { int userId = mCurrentUserId; synchronized (this) { ActivityRecord activity = getFocusedStack().topActivity(); if (activity == null) { return false; } userId = activity.userId; } DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService( Context.DEVICE_POLICY_SERVICE); return (dpm == null) || (!dpm.getScreenCaptureDisabled(null, userId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAssistDataAllowedOnCurrentActivity 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
isAssistDataAllowedOnCurrentActivity
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public boolean getDismissKeyguardIfInsecure() { return mDismissKeyguardIfInsecure; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDismissKeyguardIfInsecure File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getDismissKeyguardIfInsecure
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@Override public SyncNotedAppOp noteProxyOperation(int code, @NonNull AttributionSource attributionSource, boolean shouldCollectAsyncNotedOp, @Nullable String message, boolean shouldCollectMessage, boolean skiProxyOperation, @NonNull HexFunction<Integer, AttributionSource, Boolean, String, Boolean, Boolean, SyncNotedAppOp> superImpl) { if (attributionSource.getUid() == mTargetUid && isTargetOp(code)) { final int shellUid = UserHandle.getUid(UserHandle.getUserId( attributionSource.getUid()), Process.SHELL_UID); final long identity = Binder.clearCallingIdentity(); try { return superImpl.apply(code, new AttributionSource(shellUid, "com.android.shell", attributionSource.getAttributionTag(), attributionSource.getToken(), attributionSource.getNext()), shouldCollectAsyncNotedOp, message, shouldCollectMessage, skiProxyOperation); } finally { Binder.restoreCallingIdentity(identity); } } return superImpl.apply(code, attributionSource, shouldCollectAsyncNotedOp, message, shouldCollectMessage, skiProxyOperation); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteProxyOperation 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
noteProxyOperation
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void process(RequestEvent event) throws IOException { FeatureManager featureManager = event.getFeatureManager(); HttpServletRequest request = event.getRequest(); HttpServletResponse response = event.getResponse(); // identify the feature Feature feature = null; String featureAsString = request.getParameter("f"); for (Feature f : featureManager.getFeatures()) { if (f.name().equals(featureAsString)) { feature = f; } } if (feature == null) { response.sendError(400); return; } FeatureMetaData metadata = featureManager.getMetaData(feature); List<ActivationStrategy> impls = featureManager.getActivationStrategies(); FeatureModel featureModel = new FeatureModel(feature, metadata, impls); // GET requests for this feature if ("GET".equals(request.getMethod())) { FeatureState state = featureManager.getFeatureState(feature); featureModel.populateFromFeatureState(state); renderEditPage(event, featureModel); } // POST requests for this feature if ("POST".equals(request.getMethod())) { featureModel.restoreFromRequest(request); // no validation errors if (featureModel.isValid()) { FeatureState state = featureModel.toFeatureState(); featureManager.setFeatureState(state); response.sendRedirect("index"); } // got validation errors else { renderEditPage(event, featureModel); } } }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2020-28191 - Severity: HIGH - CVSS Score: 8.8 Description: Added CSRF protection to the togglz console via a CSRF token passed between the server and the clinet. This remediates the vulnerabilty CVE-2020-28191 by blocking CSRF attacks as the attcker will not be able to guess the CSRF token value. (#495) This has been implemented with either the session timeout of the application the togglz console is embedded in. Or if no user session is available it defaults to a 10 minute timeout for the CSRF token. This CSRF token does not interfere with either OWASP's CSRFGuard or Spring-Security's CSRF protection if they are used within the application. Co-authored-by: Joseph Beeton <joseph.p.beeton1@aexp.com> Function: process File: console/src/main/java/org/togglz/console/handlers/edit/EditPageHandler.java Repository: togglz Fixed Code: @Override public void process(RequestEvent event) throws IOException { FeatureManager featureManager = event.getFeatureManager(); HttpServletRequest request = event.getRequest(); HttpServletResponse response = event.getResponse(); if(!validateCSRFToken(event)) { renderErrorPage(event); return; } // identify the feature Feature feature = null; String featureAsString = request.getParameter("f"); for (Feature f : featureManager.getFeatures()) { if (f.name().equals(featureAsString)) { feature = f; } } if (feature == null) { response.sendError(400); return; } FeatureMetaData metadata = featureManager.getMetaData(feature); List<ActivationStrategy> impls = featureManager.getActivationStrategies(); FeatureModel featureModel = new FeatureModel(feature, metadata, impls); // GET requests for this feature if ("GET".equals(request.getMethod())) { FeatureState state = featureManager.getFeatureState(feature); featureModel.populateFromFeatureState(state); renderEditPage(event, featureModel); } // POST requests for this feature if ("POST".equals(request.getMethod())) { featureModel.restoreFromRequest(request); // no validation errors if (featureModel.isValid()) { FeatureState state = featureModel.toFeatureState(); featureManager.setFeatureState(state); response.sendRedirect("index"); } // got validation errors else { renderEditPage(event, featureModel); } } }
[ "CWE-352" ]
CVE-2020-28191
HIGH
8.8
togglz
process
console/src/main/java/org/togglz/console/handlers/edit/EditPageHandler.java
ed66e3f584de954297ebaf98ea4a235286784707
1
Analyze the following code function for security vulnerabilities
protected synchronized void decorateWithTLS(TLSClientParameters tlsClientParameters, HttpURLConnection connection) throws GeneralSecurityException { int hash = tlsClientParameters.hashCode(); if (hash != lastTlsHash) { lastTlsHash = hash; socketFactory = null; } // always reload socketFactory from HttpsURLConnection.defaultSSLSocketFactory and // tlsClientParameters.sslSocketFactory to allow runtime configuration change if (tlsClientParameters.isUseHttpsURLConnectionDefaultSslSocketFactory()) { socketFactory = HttpsURLConnection.getDefaultSSLSocketFactory(); } else if (tlsClientParameters.getSSLSocketFactory() != null) { // see if an SSLSocketFactory was set. This allows easy interop // with not-yet-commons-ssl.jar, or even just people who like doing their // own JSSE. socketFactory = tlsClientParameters.getSSLSocketFactory(); } else if (socketFactory == null) { // ssl socket factory not yet instantiated, create a new one with tlsClientParameters's Trust // Managers, Key Managers, etc SSLContext ctx = org.apache.cxf.transport.https.SSLUtils.getSSLContext(tlsClientParameters); String[] cipherSuites = SSLUtils.getCiphersuitesToInclude(tlsClientParameters.getCipherSuites(), tlsClientParameters.getCipherSuitesFilter(), ctx.getSocketFactory().getDefaultCipherSuites(), SSLUtils.getSupportedCipherSuites(ctx), LOG); // The SSLSocketFactoryWrapper enables certain cipher suites // from the policy. String protocol = tlsClientParameters.getSecureSocketProtocol() != null ? tlsClientParameters .getSecureSocketProtocol() : "TLS"; socketFactory = new SSLSocketFactoryWrapper(ctx.getSocketFactory(), cipherSuites, protocol); //recalc the hashcode since some of the above MAY have changed the tlsClientParameters lastTlsHash = tlsClientParameters.hashCode(); } else { // ssl socket factory already initialized, reuse it to benefit of keep alive } HostnameVerifier verifier = org.apache.cxf.transport.https.SSLUtils .getHostnameVerifier(tlsClientParameters); if (connection instanceof HttpsURLConnection) { // handle the expected case (javax.net.ssl) HttpsURLConnection conn = (HttpsURLConnection) connection; conn.setHostnameVerifier(verifier); conn.setSSLSocketFactory(socketFactory); } else { // handle the deprecated sun case and other possible hidden API's // that are similar to the Sun cases try { Method method = connection.getClass().getMethod("getHostnameVerifier"); InvocationHandler handler = new ReflectionInvokationHandler(verifier) { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { return super.invoke(proxy, method, args); } catch (Exception ex) { return true; } } }; Object proxy = java.lang.reflect.Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {method.getReturnType()}, handler); method = connection.getClass().getMethod("setHostnameVerifier", method.getReturnType()); method.invoke(connection, proxy); } catch (Exception ex) { //Ignore this one } try { Method getSSLSocketFactory = connection.getClass().getMethod("getSSLSocketFactory"); Method setSSLSocketFactory = connection.getClass() .getMethod("setSSLSocketFactory", getSSLSocketFactory.getReturnType()); if (getSSLSocketFactory.getReturnType().isInstance(socketFactory)) { setSSLSocketFactory.invoke(connection, socketFactory); } else { //need to see if we can create one - mostly the weblogic case. The //weblogic SSLSocketFactory has a protected constructor that can take //a JSSE SSLSocketFactory so we'll try and use that Constructor<?> c = getSSLSocketFactory.getReturnType() .getDeclaredConstructor(SSLSocketFactory.class); ReflectionUtil.setAccessible(c); setSSLSocketFactory.invoke(connection, c.newInstance(socketFactory)); } } catch (Exception ex) { if (connection.getClass().getName().contains("weblogic")) { if (!weblogicWarned) { weblogicWarned = true; LOG.warning("Could not configure SSLSocketFactory on Weblogic. " + " Use the Weblogic control panel to configure the SSL settings."); } return; } //if we cannot set the SSLSocketFactory, we're in serious trouble. throw new IllegalArgumentException("Error decorating connection class " + connection.getClass().getName(), ex); } } }
Vulnerability Classification: - CWE: CWE-755 - CVE: CVE-2018-8039 - Severity: MEDIUM - CVSS Score: 6.8 Description: Fix hostname verification using the deprecated SSL stack Function: decorateWithTLS File: rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java Repository: apache/cxf Fixed Code: protected synchronized void decorateWithTLS(TLSClientParameters tlsClientParameters, HttpURLConnection connection) throws GeneralSecurityException { int hash = tlsClientParameters.hashCode(); if (hash != lastTlsHash) { lastTlsHash = hash; socketFactory = null; } // always reload socketFactory from HttpsURLConnection.defaultSSLSocketFactory and // tlsClientParameters.sslSocketFactory to allow runtime configuration change if (tlsClientParameters.isUseHttpsURLConnectionDefaultSslSocketFactory()) { socketFactory = HttpsURLConnection.getDefaultSSLSocketFactory(); } else if (tlsClientParameters.getSSLSocketFactory() != null) { // see if an SSLSocketFactory was set. This allows easy interop // with not-yet-commons-ssl.jar, or even just people who like doing their // own JSSE. socketFactory = tlsClientParameters.getSSLSocketFactory(); } else if (socketFactory == null) { // ssl socket factory not yet instantiated, create a new one with tlsClientParameters's Trust // Managers, Key Managers, etc SSLContext ctx = org.apache.cxf.transport.https.SSLUtils.getSSLContext(tlsClientParameters); String[] cipherSuites = SSLUtils.getCiphersuitesToInclude(tlsClientParameters.getCipherSuites(), tlsClientParameters.getCipherSuitesFilter(), ctx.getSocketFactory().getDefaultCipherSuites(), SSLUtils.getSupportedCipherSuites(ctx), LOG); // The SSLSocketFactoryWrapper enables certain cipher suites // from the policy. String protocol = tlsClientParameters.getSecureSocketProtocol() != null ? tlsClientParameters .getSecureSocketProtocol() : "TLS"; socketFactory = new SSLSocketFactoryWrapper(ctx.getSocketFactory(), cipherSuites, protocol); //recalc the hashcode since some of the above MAY have changed the tlsClientParameters lastTlsHash = tlsClientParameters.hashCode(); } else { // ssl socket factory already initialized, reuse it to benefit of keep alive } HostnameVerifier verifier = org.apache.cxf.transport.https.SSLUtils .getHostnameVerifier(tlsClientParameters); if (connection instanceof HttpsURLConnection) { // handle the expected case (javax.net.ssl) HttpsURLConnection conn = (HttpsURLConnection) connection; conn.setHostnameVerifier(verifier); conn.setSSLSocketFactory(socketFactory); } else { // handle the deprecated sun case and other possible hidden API's // that are similar to the Sun cases try { Method method = connection.getClass().getMethod("getHostnameVerifier"); InvocationHandler handler = new ReflectionInvokationHandler(verifier) { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { return super.invoke(proxy, method, args); } catch (Exception ex) { return false; } } }; Object proxy = java.lang.reflect.Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {method.getReturnType()}, handler); method = connection.getClass().getMethod("setHostnameVerifier", method.getReturnType()); method.invoke(connection, proxy); } catch (Exception ex) { //Ignore this one } try { Method getSSLSocketFactory = connection.getClass().getMethod("getSSLSocketFactory"); Method setSSLSocketFactory = connection.getClass() .getMethod("setSSLSocketFactory", getSSLSocketFactory.getReturnType()); if (getSSLSocketFactory.getReturnType().isInstance(socketFactory)) { setSSLSocketFactory.invoke(connection, socketFactory); } else { //need to see if we can create one - mostly the weblogic case. The //weblogic SSLSocketFactory has a protected constructor that can take //a JSSE SSLSocketFactory so we'll try and use that Constructor<?> c = getSSLSocketFactory.getReturnType() .getDeclaredConstructor(SSLSocketFactory.class); ReflectionUtil.setAccessible(c); setSSLSocketFactory.invoke(connection, c.newInstance(socketFactory)); } } catch (Exception ex) { if (connection.getClass().getName().contains("weblogic")) { if (!weblogicWarned) { weblogicWarned = true; LOG.warning("Could not configure SSLSocketFactory on Weblogic. " + " Use the Weblogic control panel to configure the SSL settings."); } return; } //if we cannot set the SSLSocketFactory, we're in serious trouble. throw new IllegalArgumentException("Error decorating connection class " + connection.getClass().getName(), ex); } } }
[ "CWE-755" ]
CVE-2018-8039
MEDIUM
6.8
apache/cxf
decorateWithTLS
rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
fae6fabf9bd7647f5e9cb68897a7d72b545b741b
1
Analyze the following code function for security vulnerabilities
@NonNull @Deprecated public BubbleMetadata.Builder createIntentBubble(@NonNull PendingIntent intent, @NonNull Icon icon) { if (intent == null) { throw new IllegalArgumentException("Bubble requires non-null pending intent"); } if (icon == null) { throw new IllegalArgumentException("Bubbles require non-null icon"); } if (icon.getType() != TYPE_URI_ADAPTIVE_BITMAP && icon.getType() != TYPE_URI) { Log.w(TAG, "Bubbles work best with icons of TYPE_URI or " + "TYPE_URI_ADAPTIVE_BITMAP. " + "In the future, using an icon of this type will be required."); } mShortcutId = null; mPendingIntent = intent; mIcon = icon; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createIntentBubble File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
createIntentBubble
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean isUnauthorized(Response response) { return response.getStatus() == HttpServletResponse.SC_FORBIDDEN; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnauthorized File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
isUnauthorized
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
@PostMapping("/update/password") @MsAuditLog(module = OperLogModule.SYSTEM_USER, type = OperLogConstants.UPDATE, title = "个人密码") public int updateCurrentUserPassword(@RequestBody EditPassWordRequest request) { return baseUserService.updateCurrentUserPassword(request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateCurrentUserPassword File: framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java Repository: metersphere The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-38494
HIGH
7.5
metersphere
updateCurrentUserPassword
framework/sdk-parent/sdk/src/main/java/io/metersphere/controller/BaseUserController.java
a23f75d93b666901fd148d834df9384f6f24cf28
0
Analyze the following code function for security vulnerabilities
boolean hasMethodWriteObject() { return (methodWriteObject != null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasMethodWriteObject File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
hasMethodWriteObject
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private void calculateHistoryCount() { MemoryCacheService.HistoryCountKey key; if (mySearchEntity.getResourceId() != null) { key = MemoryCacheService.HistoryCountKey.forInstance(mySearchEntity.getResourceId()); } else if (mySearchEntity.getResourceType() != null) { key = MemoryCacheService.HistoryCountKey.forType(mySearchEntity.getResourceType()); } else { key = MemoryCacheService.HistoryCountKey.forSystem(); } Function<MemoryCacheService.HistoryCountKey, Integer> supplier = k -> new TransactionTemplate(myTxManager).execute(t -> { HistoryBuilder historyBuilder = myHistoryBuilderFactory.newHistoryBuilder(mySearchEntity.getResourceType(), mySearchEntity.getResourceId(), mySearchEntity.getLastUpdatedLow(), mySearchEntity.getLastUpdatedHigh()); Long count = historyBuilder.fetchCount(getRequestPartitionId()); return count.intValue(); }); switch (myDaoConfig.getHistoryCountMode()) { case COUNT_ACCURATE: { int count = supplier.apply(key); mySearchEntity.setTotalCount(count); break; } case COUNT_CACHED: { int count = myMemoryCacheService.get(MemoryCacheService.CacheEnum.HISTORY_COUNT, key, supplier); mySearchEntity.setTotalCount(count); break; } case COUNT_DISABLED: { break; } } }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2021-32053 - Severity: MEDIUM - CVSS Score: 5.0 Description: Resolve test failures Function: calculateHistoryCount File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir Fixed Code: private void calculateHistoryCount() { MemoryCacheService.HistoryCountKey key; if (mySearchEntity.getResourceId() != null) { key = MemoryCacheService.HistoryCountKey.forInstance(mySearchEntity.getResourceId()); } else if (mySearchEntity.getResourceType() != null) { key = MemoryCacheService.HistoryCountKey.forType(mySearchEntity.getResourceType()); } else { key = MemoryCacheService.HistoryCountKey.forSystem(); } Function<MemoryCacheService.HistoryCountKey, Integer> supplier = k -> new TransactionTemplate(myTxManager).execute(t -> { HistoryBuilder historyBuilder = myHistoryBuilderFactory.newHistoryBuilder(mySearchEntity.getResourceType(), mySearchEntity.getResourceId(), mySearchEntity.getLastUpdatedLow(), mySearchEntity.getLastUpdatedHigh()); Long count = historyBuilder.fetchCount(getRequestPartitionId()); return count.intValue(); }); boolean haveOffset = mySearchEntity.getLastUpdatedLow() != null || mySearchEntity.getLastUpdatedHigh() != null; switch (myDaoConfig.getHistoryCountMode()) { case COUNT_ACCURATE: { int count = supplier.apply(key); mySearchEntity.setTotalCount(count); break; } case CACHED_ONLY_WITHOUT_OFFSET: { if (!haveOffset) { int count = myMemoryCacheService.get(MemoryCacheService.CacheEnum.HISTORY_COUNT, key, supplier); mySearchEntity.setTotalCount(count); } break; } case COUNT_DISABLED: { break; } } }
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
calculateHistoryCount
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
b53ae23e6fb8fdb6017aa9e8c688c49a4d91e9f4
1
Analyze the following code function for security vulnerabilities
private String getReportUrl(String filename, String urlBase) { String reportUrl = urlBase + "/pages/forms/migrate/" + filename + "/downloadLogFile"; return reportUrl; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReportUrl File: web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
getReportUrl
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
private PrintWriter openFile(File file) throws FileNotFoundException, UnsupportedEncodingException { PrintWriter writer = new PrintWriter(file.getPath(), "UTF-8"); return writer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openFile File: web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
openFile
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
void setHiddenWhileSuspended(boolean hide) { if (mOwnerCanAddInternalSystemWindow || (!isSystemAlertWindowType(mAttrs.type) && mAttrs.type != TYPE_TOAST)) { return; } if (mHiddenWhileSuspended == hide) { return; } mHiddenWhileSuspended = hide; if (hide) { hide(true /* doAnimation */, true /* requestAnim */); } else { show(true /* doAnimation */, true /* requestAnim */); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHiddenWhileSuspended 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
setHiddenWhileSuspended
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
void onRestoreStates(Bundle savedStates) { mBundle = (HashMap) savedStates.getSerializable(DATA_KEY); mName = savedStates.getString(KeyChain.EXTRA_NAME); byte[] bytes = savedStates.getByteArray(Credentials.USER_PRIVATE_KEY); if (bytes != null) { setPrivateKey(bytes); } ArrayList<byte[]> certs = Util.fromBytes(savedStates.getByteArray(CERTS_KEY)); for (byte[] cert : certs) { parseCert(cert); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-2422 - Severity: HIGH - CVSS Score: 9.3 Description: Trust CA certificates added for the whole OS only Excludes any CA certificates installed for wifi-only from being used for anything else. Does not take effect retroactively against certs which were already installed. The CAs will continue to be saved to a part of the keystore accessible by services running under WIFI_UID. Bug: 26324357 Bug: 25780055 Change-Id: Ifeb9daf24c9f9a22b2b2daf247d5622c707c9885 Function: onRestoreStates File: src/com/android/certinstaller/CredentialHelper.java Repository: android Fixed Code: void onRestoreStates(Bundle savedStates) { mBundle = (HashMap) savedStates.getSerializable(DATA_KEY); mName = savedStates.getString(KeyChain.EXTRA_NAME); mUid = savedStates.getInt(Credentials.EXTRA_INSTALL_AS_UID, -1); byte[] bytes = savedStates.getByteArray(Credentials.USER_PRIVATE_KEY); if (bytes != null) { setPrivateKey(bytes); } ArrayList<byte[]> certs = Util.fromBytes(savedStates.getByteArray(CERTS_KEY)); for (byte[] cert : certs) { parseCert(cert); } }
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
onRestoreStates
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
1
Analyze the following code function for security vulnerabilities
@Override public int getLocalPort() { return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalPort File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getLocalPort
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private void logUserRestrictionCall( String key, boolean enabled, boolean parent, CallerIdentity caller) { final int eventId = enabled ? DevicePolicyEnums.ADD_USER_RESTRICTION : DevicePolicyEnums.REMOVE_USER_RESTRICTION; DevicePolicyEventLogger .createEvent(eventId) .setAdmin(caller.getComponentName()) .setStrings(key, parent ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT) .write(); if (SecurityLog.isLoggingEnabled()) { final int eventTag = enabled ? SecurityLog.TAG_USER_RESTRICTION_ADDED : SecurityLog.TAG_USER_RESTRICTION_REMOVED; SecurityLog.writeEvent(eventTag, caller.getPackageName(), caller.getUserId(), key); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logUserRestrictionCall 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
logUserRestrictionCall
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public ROWTYPE getRow(int rowIndex) { if (rowIndex >= rows.size() || rowIndex < 0) { throw new IllegalArgumentException( "No row at given index " + rowIndex); } return rows.get(rowIndex); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRow File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getRow
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public void makeRemoteNamedDestinationsLocal() { if (remoteToLocalNamedDestinations) return; remoteToLocalNamedDestinations = true; HashMap names = getNamedDestination(true); if (names.isEmpty()) return; for (int k = 1; k <= pageRefs.size(); ++k) { PdfDictionary page = pageRefs.getPageN(k); PdfObject annotsRef; PdfArray annots = (PdfArray)getPdfObject(annotsRef = page.get(PdfName.ANNOTS)); int annotIdx = lastXrefPartial; releaseLastXrefPartial(); if (annots == null) { pageRefs.releasePage(k); continue; } boolean commitAnnots = false; for (int an = 0; an < annots.size(); ++an) { PdfObject objRef = annots.getPdfObject(an); if (convertNamedDestination(objRef, names) && !objRef.isIndirect()) commitAnnots = true; } if (commitAnnots) setXrefPartialObject(annotIdx, annots); if (!commitAnnots || annotsRef.isIndirect()) pageRefs.releasePage(k); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeRemoteNamedDestinationsLocal File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
makeRemoteNamedDestinationsLocal
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public void setCaptionsDir(String dir) { captionsDir = dir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCaptionsDir File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
setCaptionsDir
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
@Override protected void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { checkAndSetEncodedKey(opmode, key); engineInitInternal(this.encodedKey, params, random); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInit File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
engineInit
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
@Programming public XWikiDeletedDocument getDeletedDocument() { if (hasProgrammingRights()) { return this.deletedDoc; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeletedDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-29208
HIGH
7.5
xwiki/xwiki-platform
getDeletedDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java
d9e947559077e947315bf700c5703dfc7dd8a8d7
0
Analyze the following code function for security vulnerabilities
public void setEditorFieldFactory(FieldGroupFieldFactory fieldFactory) { editorFieldGroup.setFieldFactory(fieldFactory); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEditorFieldFactory File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setEditorFieldFactory
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public boolean matches(Path path) { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: matches File: src/main/java/org/olat/core/util/PathUtils.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
matches
src/main/java/org/olat/core/util/PathUtils.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override public Element toDOM(Document document) { Element certEnrollmentRequestElement = document.createElement("CertEnrollmentRequest"); toDOM(document, certEnrollmentRequestElement); return certEnrollmentRequestElement; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDOM File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toDOM
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void cancelNotificationFromListenerLocked(ManagedServiceInfo info, int callingUid, int callingPid, String pkg, String tag, int id, int userId) { cancelNotification(callingUid, callingPid, pkg, tag, id, 0, Notification.FLAG_ONGOING_EVENT | Notification.FLAG_FOREGROUND_SERVICE, true, userId, REASON_LISTENER_CANCEL, info); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelNotificationFromListenerLocked 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
cancelNotificationFromListenerLocked
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public Object nextValue() throws JSONException { char c = this.nextClean(); String string; switch (c) { case '"': case '\'': return this.nextString(c); case '{': this.back(); try { return new JSONObject(this); } catch (StackOverflowError e) { throw new JSONException("JSON Array or Object depth too large to process.", e); } case '[': this.back(); try { return new JSONArray(this); } catch (StackOverflowError e) { throw new JSONException("JSON Array or Object depth too large to process.", e); } } /* * Handle unquoted text. This could be the values true, false, or * null, or it can be a number. An implementation (such as this one) * is allowed to also accept non-standard forms. * * Accumulate characters until we reach the end of the text or a * formatting character. */ StringBuilder sb = new StringBuilder(); while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) { sb.append(c); c = this.next(); } if (!this.eof) { this.back(); } string = sb.toString().trim(); if ("".equals(string)) { throw this.syntaxError("Missing value"); } return JSONObject.stringToValue(string); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-5072 - Severity: HIGH - CVSS Score: 7.5 Description: Generalize the logic to disallow nested objects and arrays as keys in objects. Fixes #771. Function: nextValue File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java Fixed Code: public Object nextValue() throws JSONException { char c = this.nextClean(); switch (c) { case '{': this.back(); try { return new JSONObject(this); } catch (StackOverflowError e) { throw new JSONException("JSON Array or Object depth too large to process.", e); } case '[': this.back(); try { return new JSONArray(this); } catch (StackOverflowError e) { throw new JSONException("JSON Array or Object depth too large to process.", e); } } return nextSimpleValue(c); }
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
nextValue
src/main/java/org/json/JSONTokener.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
1
Analyze the following code function for security vulnerabilities
@Override public void setKeyguardDisabledFeatures( ComponentName who, String callerPackageName, int which, boolean parent) { if (!mHasFeature) { return; } CallerIdentity caller; if (isUnicornFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); Objects.requireNonNull(who, "ComponentName is null"); } final int userHandle = caller.getUserId(); int affectedUserId = parent ? getProfileParentId(userHandle) : userHandle; synchronized (getLockObject()) { if (isUnicornFlagEnabled()) { // SUPPORT USES_POLICY_DISABLE_KEYGUARD_FEATURES EnforcingAdmin admin = enforcePermissionAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_KEYGUARD, caller.getPackageName(), affectedUserId); if (which == 0) { mDevicePolicyEngine.removeLocalPolicy( PolicyDefinition.KEYGUARD_DISABLED_FEATURES, admin, affectedUserId); } else { // TODO(b/273723433): revisit silent masking of features if (isManagedProfile(userHandle)) { if (parent) { if (isProfileOwnerOfOrganizationOwnedDevice(caller)) { which = which & PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER; } else { which = which & NON_ORG_OWNED_PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER; } } else { which = which & PROFILE_KEYGUARD_FEATURES; } } mDevicePolicyEngine.setLocalPolicy(PolicyDefinition.KEYGUARD_DISABLED_FEATURES, admin, new IntegerPolicyValue(which), affectedUserId); } invalidateBinderCaches(); } else { ActiveAdmin ap = getActiveAdminForCallerLocked( who, DeviceAdminInfo.USES_POLICY_DISABLE_KEYGUARD_FEATURES, parent); if (isManagedProfile(userHandle)) { if (parent) { if (isProfileOwnerOfOrganizationOwnedDevice(caller)) { which = which & PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER; } else { which = which & NON_ORG_OWNED_PROFILE_KEYGUARD_FEATURES_AFFECT_OWNER; } } else { which = which & PROFILE_KEYGUARD_FEATURES; } } if (ap.disabledKeyguardFeatures != which) { ap.disabledKeyguardFeatures = which; saveSettingsLocked(userHandle); } } } if (SecurityLog.isLoggingEnabled()) { SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISABLED_FEATURES_SET, caller.getPackageName(), userHandle, affectedUserId, which); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_KEYGUARD_DISABLED_FEATURES) .setAdmin(caller.getPackageName()) .setInt(which) .setStrings(parent ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyguardDisabledFeatures 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
setKeyguardDisabledFeatures
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void reset(boolean clearRequest) { mStartActivity = null; mIntent = null; mCallingUid = -1; mOptions = null; mRestrictedBgActivity = false; mLaunchTaskBehind = false; mLaunchFlags = 0; mLaunchMode = INVALID_LAUNCH_MODE; mLaunchParams.reset(); mNotTop = null; mDoResume = false; mStartFlags = 0; mSourceRecord = null; mPreferredTaskDisplayArea = null; mPreferredWindowingMode = WINDOWING_MODE_UNDEFINED; mInTask = null; mInTaskFragment = null; mAddingToTask = false; mNewTaskInfo = null; mNewTaskIntent = null; mSourceRootTask = null; mTargetRootTask = null; mTargetTask = null; mIsTaskCleared = false; mMovedToFront = false; mNoAnimation = false; mAvoidMoveToFront = false; mFrozeTaskList = false; mTransientLaunch = false; mVoiceSession = null; mVoiceInteractor = null; mIntentDelivered = false; if (clearRequest) { mRequest.reset(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reset File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
reset
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private Intent putExtrasToIntent(@NonNull Intent intent, @NonNull Notification notification, @NonNull User user) { return intent .putExtra(EXTRA_ACCOUNT, user.getAccountName()) .putExtra(EXTRA_LINK, notification.getLink()) .putExtra(EXTRA_OBJECT_ID, notification.getObjectId()) .putExtra(EXTRA_SUBJECT, notification.getSubject()) .putExtra(EXTRA_SUBJECT_RICH, notification.getSubjectRich()) .putExtra(EXTRA_MESSAGE, notification.getMessage()) .putExtra(EXTRA_MESSAGE_RICH, notification.getMessageRich()) .putExtra(EXTRA_USER, notification.getUser()) .putExtra(EXTRA_NID, notification.getNotificationId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putExtrasToIntent File: src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
putExtrasToIntent
src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
@Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { copyAttrsFromParentChannel(this.parent, ctx.channel()); addHttp2StreamSpecificHandlers(ctx.pipeline()); addHttpHandlerFn.accept(ctx.pipeline()); ctx.pipeline().remove(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlerAdded File: zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2StreamInitializer.java Repository: Netflix/zuul The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-21295
LOW
2.6
Netflix/zuul
handlerAdded
zuul-core/src/main/java/com/netflix/zuul/netty/server/http2/Http2StreamInitializer.java
033d3c2de354e249f6d775bde8b67b0997888958
0
Analyze the following code function for security vulnerabilities
private int runListLibraries() { try { List<String> list = new ArrayList<String>(); String[] rawList = mPm.getSystemSharedLibraryNames(); for (int i=0; i<rawList.length; i++) { list.add(rawList[i]); } // Sort by name Collections.sort(list, new Comparator<String>() { public int compare(String o1, String o2) { if (o1 == o2) return 0; if (o1 == null) return -1; if (o2 == null) return 1; return o1.compareTo(o2); } }); int count = (list != null) ? list.size() : 0; for (int p = 0; p < count; p++) { String lib = list.get(p); System.out.print("library:"); System.out.println(lib); } return 0; } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runListLibraries File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runListLibraries
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
protected Map<String, Object> extractCustomAttributes(final String xml) { final SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(false); try { final SAXParser saxParser = spf.newSAXParser(); final XMLReader xmlReader = saxParser.getXMLReader(); final CustomAttributeHandler handler = new CustomAttributeHandler(); xmlReader.setContentHandler(handler); xmlReader.parse(new InputSource(new StringReader(xml))); return handler.getAttributes(); } catch (final Exception e) { logger.error(e.getMessage(), e); return Collections.emptyMap(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractCustomAttributes File: cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java Repository: apereo/java-cas-client The code follows secure coding practices.
[ "CWE-74" ]
CVE-2014-4172
HIGH
7.5
apereo/java-cas-client
extractCustomAttributes
cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ServiceTicketValidator.java
ae37092100c8eaec610dab6d83e5e05a8ee58814
0
Analyze the following code function for security vulnerabilities
public boolean setKeyguardDisabled(@NonNull ComponentName admin, boolean disabled) { throwIfParentInstance("setKeyguardDisabled"); try { return mService.setKeyguardDisabled(admin, disabled); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyguardDisabled File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setKeyguardDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public HttpRequest protocol(final String protocol) { this.protocol = protocol; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: protocol 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
protocol
src/main/java/jodd/http/HttpRequest.java
e50f573c8f6a39212ade68c6eb1256b2889fa8a6
0
Analyze the following code function for security vulnerabilities
@Override public CipherState fork(byte[] key, int offset) { CipherState cipher; cipher = new AESGCMFallbackCipherState(); cipher.initializeKey(key, offset); return cipher; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fork File: src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java Repository: rweather/noise-java The code follows secure coding practices.
[ "CWE-125", "CWE-787" ]
CVE-2020-25021
HIGH
7.5
rweather/noise-java
fork
src/main/java/com/southernstorm/noise/protocol/AESGCMFallbackCipherState.java
18e86b6f8bea7326934109aa9ffa705ebf4bde90
0
Analyze the following code function for security vulnerabilities
void installStage(String packageName, File stagedDir, String stagedCid, IPackageInstallObserver2 observer, PackageInstaller.SessionParams params, String installerPackageName, int installerUid, UserHandle user) { final VerificationParams verifParams = new VerificationParams(null, params.originatingUri, params.referrerUri, installerUid, null); verifParams.setInstallerUid(installerUid); final OriginInfo origin; if (stagedDir != null) { origin = OriginInfo.fromStagedFile(stagedDir); } else { origin = OriginInfo.fromStagedContainer(stagedCid); } final Message msg = mHandler.obtainMessage(INIT_COPY); msg.obj = new InstallParams(origin, null, observer, params.installFlags, installerPackageName, params.volumeUuid, verifParams, user, params.abiOverride, params.grantedRuntimePermissions); mHandler.sendMessage(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installStage 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
installStage
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasRunningActivity(int uid, @Nullable String packageName) { if (packageName == null) return false; synchronized (ActivityManagerService.this) { for (int i = 0; i < mLruProcesses.size(); i++) { final ProcessRecord processRecord = mLruProcesses.get(i); if (processRecord.uid == uid) { for (int j = 0; j < processRecord.activities.size(); j++) { final ActivityRecord activityRecord = processRecord.activities.get(j); if (packageName.equals(activityRecord.packageName)) { return true; } } } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasRunningActivity 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
hasRunningActivity
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder decorator( DecoratingHttpServiceFunction decoratingHttpServiceFunction) { virtualHostTemplate.decorator(decoratingHttpServiceFunction); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decorator File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
decorator
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private String getCreatorPackageName(WifiConfiguration config) { String creatorName = config.creatorName; // getNameForUid (Stored in WifiConfiguration.creatorName) returns a concatenation of name // and uid for shared UIDs ("name:uid"). if (!creatorName.contains(":")) { return creatorName; // regular app not using shared UID. } // Separate the package name from the string for app using shared UID. return creatorName.substring(0, creatorName.indexOf(":")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCreatorPackageName File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getCreatorPackageName
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
public Bundle sendWindowWallpaperCommandLocked(WindowState window, String action, int x, int y, int z, Bundle extras, boolean sync) { if (window == mWallpaperTarget || window == mLowerWallpaperTarget || window == mUpperWallpaperTarget) { boolean doWait = sync; for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) { final WindowList windows = mWallpaperTokens.get(curTokenNdx).windows; for (int wallpaperNdx = windows.size() - 1; wallpaperNdx >= 0; wallpaperNdx--) { WindowState wallpaper = windows.get(wallpaperNdx); try { wallpaper.mClient.dispatchWallpaperCommand(action, x, y, z, extras, sync); // We only want to be synchronous with one wallpaper. sync = false; } catch (RemoteException e) { } } } if (doWait) { // XXX Need to wait for result. } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendWindowWallpaperCommandLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
sendWindowWallpaperCommandLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void handleKeyguardDone() { Trace.beginSection("KeyguardViewMediator#handleKeyguardDone"); final int currentUser = KeyguardUpdateMonitor.getCurrentUser(); mUiBgExecutor.execute(() -> { if (mLockPatternUtils.isSecure(currentUser)) { mLockPatternUtils.getDevicePolicyManager().reportKeyguardDismissed(currentUser); } }); if (DEBUG) Log.d(TAG, "handleKeyguardDone"); synchronized (this) { resetKeyguardDonePendingLocked(); } if (mGoingToSleep) { mUpdateMonitor.clearBiometricRecognizedWhenKeyguardDone(currentUser); Log.i(TAG, "Device is going to sleep, aborting keyguardDone"); return; } setPendingLock(false); // user may have authenticated during the screen off animation if (mExitSecureCallback != null) { try { mExitSecureCallback.onKeyguardExitResult(true /* authenciated */); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onKeyguardExitResult()", e); } mExitSecureCallback = null; // after successfully exiting securely, no need to reshow // the keyguard when they've released the lock mExternallyEnabled = true; mNeedToReshowWhenReenabled = false; updateInputRestricted(); } handleHide(); mUpdateMonitor.clearBiometricRecognizedWhenKeyguardDone(currentUser); Trace.endSection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleKeyguardDone File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
handleKeyguardDone
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
protected boolean updateSeries(URI uri) throws IOException, IngestException { HttpResponse response = null; InputStream in = null; boolean isUpdated = false; try { HttpGet getDc = new HttpGet(uri); response = httpClient.execute(getDc); in = response.getEntity().getContent(); DublinCoreCatalog dc = dublinCoreService.load(in); String id = dc.getFirst(DublinCore.PROPERTY_IDENTIFIER); if (id == null) { logger.warn("Series dublin core document contains no identifier, rejecting ingested series cagtalog."); } else { try { try { seriesService.getSeries(id); if (isAllowModifySeries) { // Update existing series seriesService.updateSeries(dc); isUpdated = true; logger.debug("Ingest is overwriting the existing series {} with the ingested series", id); } else { logger.debug("Series {} already exists. Ignoring series catalog from ingest.", id); } } catch (NotFoundException e) { logger.info("Creating new series {} with default ACL", id); seriesService.updateSeries(dc); isUpdated = true; } } catch (Exception e) { throw new IngestException(e); } } in.close(); } catch (IOException e) { logger.error("Error updating series from DublinCoreCatalog: {}", e.getMessage()); } finally { IOUtils.closeQuietly(in); httpClient.close(response); } return isUpdated; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSeries 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
updateSeries
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public void setLaunchTransitionEndRunnable(Runnable r) { mLaunchAnimationEndRunnable = r; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLaunchTransitionEndRunnable 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
setLaunchTransitionEndRunnable
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Beta @Deprecated @CanIgnoreReturnValue // some processors won't return a useful result public static <T> T readBytes(File file, ByteProcessor<T> processor) throws IOException { return asByteSource(file).read(processor); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readBytes File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-8908
LOW
2.1
google/guava
readBytes
guava/src/com/google/common/io/Files.java
fec0dbc4634006a6162cfd4d0d09c962073ddf40
0
Analyze the following code function for security vulnerabilities
void updateAdapterState(int prevState, int newState){ if (mCallbacks !=null) { int n=mCallbacks.beginBroadcast(); debugLog("updateAdapterState() - Broadcasting state to " + n + " receivers."); for (int i=0; i <n;i++) { try { mCallbacks.getBroadcastItem(i).onBluetoothStateChange(prevState,newState); } catch (RemoteException e) { debugLog("updateAdapterState() - Callback #" + i + " failed (" + e + ")"); } } mCallbacks.finishBroadcast(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAdapterState File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
updateAdapterState
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private void onFingerprintAuthenticated(int userId) { mUserFingerprintAuthenticated.put(userId, true); // If fingerprint unlocking is allowed, this event will lead to a Keyguard dismiss or to a // wake-up (if Keyguard is not showing), so we don't need to listen until Keyguard is // fully gone. mFingerprintAlreadyAuthenticated = isUnlockingWithFingerprintAllowed(); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onFingerprintAuthenticated(userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFingerprintAuthenticated File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onFingerprintAuthenticated
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Deprecated @UnsupportedAppUsage public int addAssetPath(String path) { return addAssetPathInternal(path, false /*overlay*/, false /*appAsLib*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAssetPath 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
addAssetPath
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
protected abstract String getContextPath();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContextPath File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
getContextPath
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
protected void flingSettings(float vel, boolean expand, final Runnable onFinishRunnable, boolean isClick) { float target = expand ? mQsMaxExpansionHeight : mQsMinExpansionHeight; if (target == mQsExpansionHeight) { if (onFinishRunnable != null) { onFinishRunnable.run(); } return; } // If we move in the opposite direction, reset velocity and use a different duration. boolean oppositeDirection = false; if (vel > 0 && !expand || vel < 0 && expand) { vel = 0; oppositeDirection = true; } ValueAnimator animator = ValueAnimator.ofFloat(mQsExpansionHeight, target); if (isClick) { animator.setInterpolator(Interpolators.TOUCH_RESPONSE); animator.setDuration(368); } else { mFlingAnimationUtils.apply(animator, mQsExpansionHeight, target, vel); } if (oppositeDirection) { animator.setDuration(350); } animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { setQsExpansion((Float) animation.getAnimatedValue()); } }); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mNotificationStackScroller.resetCheckSnoozeLeavebehind(); mQsExpansionAnimator = null; if (onFinishRunnable != null) { onFinishRunnable.run(); } } }); animator.start(); mQsExpansionAnimator = animator; mQsAnimatorExpand = expand; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flingSettings 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
flingSettings
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public String getName() { return className; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
getName
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private void setQsExpansion(float height) { height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight); mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0; if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling) { setQsExpanded(true); } else if (height <= mQsMinExpansionHeight && mQsExpanded) { setQsExpanded(false); if (mLastAnnouncementWasQuickSettings && !mTracking && !isCollapsing()) { announceForAccessibility(getKeyguardOrLockScreenString()); mLastAnnouncementWasQuickSettings = false; } } mQsExpansionHeight = height; updateQsExpansion(); requestScrollerTopPaddingUpdate(false /* animate */); if (mKeyguardShowing) { updateHeaderKeyguardAlpha(); } if (mStatusBarState == StatusBarState.SHADE_LOCKED || mStatusBarState == StatusBarState.KEYGUARD) { updateKeyguardBottomAreaAlpha(); } if (mStatusBarState == StatusBarState.SHADE && mQsExpanded && !mStackScrollerOverscrolling && mQsScrimEnabled) { mQsNavbarScrim.setAlpha(getQsExpansionFraction()); } // Upon initialisation when we are not layouted yet we don't want to announce that we are // fully expanded, hence the != 0.0f check. if (height != 0.0f && mQsFullyExpanded && !mLastAnnouncementWasQuickSettings) { announceForAccessibility(getContext().getString( R.string.accessibility_desc_quick_settings)); mLastAnnouncementWasQuickSettings = true; } if (mQsFullyExpanded && mFalsingManager.shouldEnforceBouncer()) { mStatusBar.executeRunnableDismissingKeyguard(null, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */); } if (DEBUG) { invalidate(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQsExpansion 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
setQsExpansion
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private int installLocationPolicy(PackageInfoLite pkgLite) { String packageName = pkgLite.packageName; int installLocation = pkgLite.installLocation; boolean onSd = (installFlags & PackageManager.INSTALL_EXTERNAL) != 0; // reader synchronized (mPackages) { PackageParser.Package pkg = mPackages.get(packageName); if (pkg != null) { if ((installFlags & PackageManager.INSTALL_REPLACE_EXISTING) != 0) { // Check for downgrading. if ((installFlags & PackageManager.INSTALL_ALLOW_DOWNGRADE) == 0) { try { checkDowngrade(pkg, pkgLite); } catch (PackageManagerException e) { Slog.w(TAG, "Downgrade detected: " + e.getMessage()); return PackageHelper.RECOMMEND_FAILED_VERSION_DOWNGRADE; } } // Check for updated system application. if ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { if (onSd) { Slog.w(TAG, "Cannot install update to system app on sdcard"); return PackageHelper.RECOMMEND_FAILED_INVALID_LOCATION; } return PackageHelper.RECOMMEND_INSTALL_INTERNAL; } else { if (onSd) { // Install flag overrides everything. return PackageHelper.RECOMMEND_INSTALL_EXTERNAL; } // If current upgrade specifies particular preference if (installLocation == PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY) { // Application explicitly specified internal. return PackageHelper.RECOMMEND_INSTALL_INTERNAL; } else if (installLocation == PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL) { // App explictly prefers external. Let policy decide } else { // Prefer previous location if (isExternal(pkg)) { return PackageHelper.RECOMMEND_INSTALL_EXTERNAL; } return PackageHelper.RECOMMEND_INSTALL_INTERNAL; } } } else { // Invalid install. Return error code return PackageHelper.RECOMMEND_FAILED_ALREADY_EXISTS; } } } // All the special cases have been taken care of. // Return result based on recommended install location. if (onSd) { return PackageHelper.RECOMMEND_INSTALL_EXTERNAL; } return pkgLite.recommendedInstallLocation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installLocationPolicy 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
installLocationPolicy
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public int checkUriPermission(Uri uri, int pid, int uid, final int modeFlags, int userId, IBinder callerToken) { enforceNotIsolatedCaller("checkUriPermission"); // Another redirected-binder-call permissions check as in // {@link checkPermissionWithToken}. Identity tlsIdentity = sCallerIdentity.get(); if (tlsIdentity != null && tlsIdentity.token == callerToken) { uid = tlsIdentity.uid; pid = tlsIdentity.pid; } // Our own process gets to do everything. if (pid == MY_PID) { return PackageManager.PERMISSION_GRANTED; } synchronized (this) { return checkUriPermissionLocked(new GrantUri(userId, uri, false), uid, modeFlags) ? PackageManager.PERMISSION_GRANTED : PackageManager.PERMISSION_DENIED; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUriPermission 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
checkUriPermission
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public File readFrom(Class<File> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { File downloadedFile = File.createTempFile(PREFIX, SUFFIX); if (HeaderUtil.isContentLengthZero(httpHeaders)) { return downloadedFile; } try (OutputStream output = new BufferedOutputStream(new FileOutputStream(downloadedFile))) { entityStream.transferTo(output); } return downloadedFile; }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2023-0481 - Severity: LOW - CVSS Score: 3.3 Description: Use newer API for creating tmp files in RESTEasy Reactive Function: readFrom File: independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/providers/serialisers/FileBodyHandler.java Repository: quarkusio/quarkus Fixed Code: @Override public File readFrom(Class<File> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { File downloadedFile = Files.createTempFile(PREFIX, SUFFIX).toFile(); if (HeaderUtil.isContentLengthZero(httpHeaders)) { return downloadedFile; } try (OutputStream output = new BufferedOutputStream(new FileOutputStream(downloadedFile))) { entityStream.transferTo(output); } return downloadedFile; }
[ "CWE-668" ]
CVE-2023-0481
LOW
3.3
quarkusio/quarkus
readFrom
independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/providers/serialisers/FileBodyHandler.java
95d5904f7cf18c8165b97d8ca03b203d7f69c17e
1
Analyze the following code function for security vulnerabilities
public void setXObjects(DocumentReference classReference, List<BaseObject> objects) { // Remove existing objects List<BaseObject> existingbjects = this.xObjects.get(classReference); if (existingbjects != null) { existingbjects.clear(); } for (BaseObject obj : objects) { obj.setOwnerDocument(this); } // Add new objects if (objects.isEmpty()) { // Pretty wrong but can't remove that for retro compatibility reasons... // Note that it means that someone can put an unmodifiable list here make impossible to add any object of // this class. this.xObjects.put(classReference, objects); } else { for (BaseObject baseObject : objects) { addXObject(classReference, baseObject); } } setMetaDataDirty(true); }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-26470 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-19223: Improve xobject memory storage in XWikidocument Function: setXObjects File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform Fixed Code: public void setXObjects(DocumentReference classReference, List<BaseObject> objects) { // Remove existing objects List<BaseObject> existingbjects = this.xObjects.get(classReference); if (existingbjects != null) { existingbjects.clear(); } for (BaseObject obj : objects) { obj.setOwnerDocument(this); } // Add new objects this.xObjects.put(classReference, new BaseObjects(objects)); setMetaDataDirty(true); }
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setXObjects
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
1
Analyze the following code function for security vulnerabilities
@Override public RemoteViews makeContentView(boolean increasedHeight) { return makeMediaContentView(mBuilder.mN.contentView); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeContentView File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
makeContentView
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
final void scheme(String scheme) { requireNonNull(scheme, "scheme"); set(HttpHeaderNames.SCHEME, scheme); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheme File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
scheme
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public String getIssuedOnFrom() { return issuedOnFrom; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIssuedOnFrom File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getIssuedOnFrom
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { // First get the step int step = UIUtil.getIntParameter(request, "step"); try { switch (step) { case ENTER_FORM_PAGE: processForm(context, request, response); break; case ENTER_TOKEN: processToken(context, request, response); break; case APROVE_TOKEN: processLetter(context, request, response); break; case RESUME_REQUEST: processAttach(context, request, response); break; case RESUME_FREEACESS: processAdmin(context, request, response); break; default: processForm(context, request, response); } context.complete(); } catch (MessagingException e) { throw new RuntimeException(e.getMessage(), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doDSGet File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java Repository: DSpace The code follows secure coding practices.
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
doDSGet
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java
28eb8158210d41168a62ed5f9e044f754513bc37
0
Analyze the following code function for security vulnerabilities
public static String displayablePath(String path, int visibleChars) { /* * use a very simple method: prefix + "..." + suffix * * where prefix is the beginning part of path (as much as we can squeeze in) * and suffix is the end path of path */ if (path == null || path.length() <= visibleChars) { return path; } final String OMITTED = "..."; final int OMITTED_LENGTH = OMITTED.length(); final int MIN_PREFIX_LENGTH = 4; final int MIN_SUFFIX_LENGTH = 4; /* * we want to show things other than OMITTED. if we have too few for * suffix and prefix, then just return as much as we can of the filename */ if (visibleChars < (OMITTED_LENGTH + MIN_PREFIX_LENGTH + MIN_SUFFIX_LENGTH)) { return path.substring(path.length() - visibleChars); } int affixLength = (visibleChars - OMITTED_LENGTH) / 2; String prefix = path.substring(0, affixLength); String suffix = path.substring(path.length() - affixLength); return prefix + OMITTED + suffix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayablePath File: core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
displayablePath
core/src/main/java/net/sourceforge/jnlp/util/FileUtils.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
private void addItemsToAccept(final String[] items){ if (items == null){ return; } for (int i = 0; i < items.length; ++i) { String item = items[i]; this.addAccept(item); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItemsToAccept File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
addItemsToAccept
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
public Drawable getConversationDrawable(Context context, ShortcutInfo info, String pkg, int uid, boolean important) { if (info == null) { return null; } ConversationIconFactory iconFactory = new ConversationIconFactory(context, context.getSystemService(LauncherApps.class), context.getPackageManager(), IconDrawableFactory.newInstance(context, false), context.getResources().getDimensionPixelSize( R.dimen.conversation_icon_size)); return iconFactory.getConversationDrawable(info, pkg, uid, important); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConversationDrawable File: src/com/android/settings/notification/NotificationBackend.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
getConversationDrawable
src/com/android/settings/notification/NotificationBackend.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
private void writePendingOperationsLocked() { final int N = mPendingOperations.size(); FileOutputStream fos = null; try { if (N == 0) { if (Log.isLoggable(TAG_FILE, Log.VERBOSE)){ Log.v(TAG, "Truncating " + mPendingFile.getBaseFile()); } mPendingFile.truncate(); return; } if (Log.isLoggable(TAG_FILE, Log.VERBOSE)) { Log.v(TAG, "Writing new " + mPendingFile.getBaseFile()); } fos = mPendingFile.startWrite(); XmlSerializer out = new FastXmlSerializer(); out.setOutput(fos, "utf-8"); for (int i = 0; i < N; i++) { PendingOperation pop = mPendingOperations.get(i); writePendingOperationLocked(pop, out); } out.endDocument(); mPendingFile.finishWrite(fos); } catch (java.io.IOException e1) { Log.w(TAG, "Error writing pending operations", e1); if (fos != null) { mPendingFile.failWrite(fos); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writePendingOperationsLocked File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
writePendingOperationsLocked
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public int installLocationPolicy(PackageInfoLite pkgLite, int installFlags) { String packageName = pkgLite.packageName; int installLocation = pkgLite.installLocation; // reader synchronized (mPm.mLock) { // Currently installed package which the new package is attempting to replace or // null if no such package is installed. AndroidPackage installedPkg = mPm.mPackages.get(packageName); if (installedPkg != null) { if ((installFlags & PackageManager.INSTALL_REPLACE_EXISTING) != 0) { // Check for updated system application. if (installedPkg.isSystem()) { return InstallLocationUtils.RECOMMEND_INSTALL_INTERNAL; } else { // If current upgrade specifies particular preference if (installLocation == PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY) { // Application explicitly specified internal. return InstallLocationUtils.RECOMMEND_INSTALL_INTERNAL; } else if ( installLocation == PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL) { // App explicitly prefers external. Let policy decide } else { // Prefer previous location if (installedPkg.isExternalStorage()) { return InstallLocationUtils.RECOMMEND_INSTALL_EXTERNAL; } return InstallLocationUtils.RECOMMEND_INSTALL_INTERNAL; } } } else { // Invalid install. Return error code return InstallLocationUtils.RECOMMEND_FAILED_ALREADY_EXISTS; } } } return pkgLite.recommendedInstallLocation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installLocationPolicy File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
installLocationPolicy
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken, IActivityContainerCallback callback) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createVirtualActivityContainer File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
createVirtualActivityContainer
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override protected boolean isSelfAnimating(int flags, int typesToCheck) { if (mControllableInsetProvider != null) { return false; } return super.isSelfAnimating(flags, typesToCheck); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSelfAnimating 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
isSelfAnimating
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "5.1M2") public List<String> getTranslationList(XWikiContext context) throws XWikiException { // in few cases like accessing a deleted document, the store might be null. if (getStore() != null) { return getStore().getTranslationList(this, context); } else { return Collections.emptyList(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTranslationList File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
getTranslationList
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@Test public void createProjectMetadataTest() throws Exception { ObjectNode optionObj = ParsingUtilities.evaluateJsonStringToObjectNode( "{\"projectName\":\"acme\",\"projectTags\":[],\"created\":\"2017-12-18T13:28:40.659\",\"modified\":\"2017-12-20T09:28:06.654\",\"creator\":\"\",\"contributors\":\"\",\"subject\":\"\",\"description\":\"\",\"rowCount\":50,\"customMetadata\":{}}"); ProjectMetadata pm = ImportingUtilities.createProjectMetadata(optionObj); Assert.assertEquals(pm.getName(), "acme"); Assert.assertEquals(pm.getEncoding(), "UTF-8"); Assert.assertTrue(pm.getTags().length == 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createProjectMetadataTest File: main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
createProjectMetadataTest
main/tests/server/src/com/google/refine/tests/importing/ImportingUtilitiesTests.java
79994e86da1a3eecc62723f4ba90f14a63ad0e72
0
Analyze the following code function for security vulnerabilities
boolean canForceResizeNonResizable(int windowingMode) { if (windowingMode == WINDOWING_MODE_PINNED && info.supportsPictureInPicture()) { return false; } // Activity should be resizable if the task is. final boolean supportsMultiWindow = task != null ? task.supportsMultiWindow() || supportsMultiWindow() : supportsMultiWindow(); if (WindowConfiguration.inMultiWindowMode(windowingMode) && supportsMultiWindow && !mAtmService.mForceResizableActivities) { // The non resizable app will be letterboxed instead of being forced resizable. return false; } return info.resizeMode != RESIZE_MODE_RESIZEABLE && info.resizeMode != RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canForceResizeNonResizable 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
canForceResizeNonResizable
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_WIPE_DATA, conditional = true) public void wipeData(int flags, @NonNull CharSequence reason) { Objects.requireNonNull(reason, "reason string is null"); Preconditions.checkStringNotEmpty(reason, "reason string is empty"); Preconditions.checkArgument((flags & WIPE_SILENTLY) == 0, "WIPE_SILENTLY cannot be set"); wipeDataInternal(flags, reason.toString(), /* factoryReset= */ false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wipeData File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
wipeData
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
BroadcastQueue broadcastQueueForIntent(Intent intent) { final boolean isFg = (intent.getFlags() & Intent.FLAG_RECEIVER_FOREGROUND) != 0; if (DEBUG_BROADCAST_BACKGROUND) Slog.i(TAG_BROADCAST, "Broadcast intent " + intent + " on " + (isFg ? "foreground" : "background") + " queue"); return (isFg) ? mFgBroadcastQueue : mBgBroadcastQueue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastQueueForIntent 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
broadcastQueueForIntent
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public Map<String, String> getServerVariables() { return serverVariables; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerVariables File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getServerVariables
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
protected void startBrowserProcess() throws Exception { // The activity must be launched in order for proper webview statics to be setup. getActivity(); getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { AwBrowserProcess.start(); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startBrowserProcess File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
startBrowserProcess
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInPictureInPictureMode(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized(this) { return isInPictureInPictureMode(ActivityRecord.forTokenLocked(token)); } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInPictureInPictureMode 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
isInPictureInPictureMode
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static XMLBuilder parse(File xmlFile) throws ParserConfigurationException, SAXException, IOException { return XMLBuilder.parse(new InputSource(new FileReader(xmlFile))); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2014-125087 - Severity: MEDIUM - CVSS Score: 5.2 Description: Disable external entities by default to prevent XXE injection attacks, re #6 XML Builder classes now explicitly enable or disable 'external-general-entities' and 'external-parameter-entities' features of the DocumentBuilderFactory when #create or #parse methods are used. To prevent XML External Entity (XXE) injection attacks, these features are disabled by default. They can only be enabled by passing a true boolean value to new versions of the #create and #parse methods that accept a flag for this feature. Function: parse File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder Fixed Code: public static XMLBuilder parse(File xmlFile) throws ParserConfigurationException, SAXException, IOException { return XMLBuilder.parse(xmlFile, false); }
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
parse
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
1
Analyze the following code function for security vulnerabilities
private void initialAuthenticationLayout(View decor, FillResponse response) { RemoteViews presentation = response.getDialogPresentation(); if (presentation == null) { presentation = response.getPresentation(); } if (presentation == null) { throw new RuntimeException("No presentation for fill dialog authentication"); } // insert authentication item under autofill_dialog_container final ViewGroup container = decor.findViewById(R.id.autofill_dialog_container); final RemoteViews.InteractionHandler interceptionHandler = (view, pendingIntent, r) -> { if (pendingIntent != null) { mCallback.startIntentSender(pendingIntent.getIntentSender()); } return true; }; final View content = presentation.applyWithTheme( mContext, (ViewGroup) decor, interceptionHandler, mThemeId); container.addView(content); container.setVisibility(View.VISIBLE); container.setFocusable(true); container.setOnClickListener(v -> mCallback.onResponsePicked(response)); // just single item, set up continue button setContinueButton(decor, v -> mCallback.onResponsePicked(response)); }
Vulnerability Classification: - CWE: CWE-Other, CWE-610 - CVE: CVE-2023-40133 - Severity: MEDIUM - CVSS Score: 5.5 Description: [DO NOT MERGE] Verify URI Permissions in Autofill RemoteViews Check permissions of URI inside of FillResponse's RemoteViews. If the current user does not have the required permissions to view the URI, the RemoteView is dropped from displaying. This fixes a security spill in which a user can view content of another user through a malicious Autofill provider. Bug: 283137865 Fixes: b/283264674 b/281666022 b/281665050 b/281848557 b/281533566 b/281534749 b/283101289 Test: Verified by POC app attached in bugs Test: atest CtsAutoFillServiceTestCases (added new tests) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:93810ba1c0a4d31f49adbf9454731e2b7defdfc0) Merged-In: I6f4d2a35e89bbed7bd9e07bf5cd3e2d68b20af9a Change-Id: I6f4d2a35e89bbed7bd9e07bf5cd3e2d68b20af9a Function: initialAuthenticationLayout File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android Fixed Code: private void initialAuthenticationLayout(View decor, FillResponse response) { RemoteViews presentation = Helper.sanitizeRemoteView( response.getDialogPresentation()); if (presentation == null) { presentation = Helper.sanitizeRemoteView(response.getPresentation()); } if (presentation == null) { throw new RuntimeException("No presentation for fill dialog authentication"); } // insert authentication item under autofill_dialog_container final ViewGroup container = decor.findViewById(R.id.autofill_dialog_container); final RemoteViews.InteractionHandler interceptionHandler = (view, pendingIntent, r) -> { if (pendingIntent != null) { mCallback.startIntentSender(pendingIntent.getIntentSender()); } return true; }; final View content = presentation.applyWithTheme( mContext, (ViewGroup) decor, interceptionHandler, mThemeId); container.addView(content); container.setVisibility(View.VISIBLE); container.setFocusable(true); container.setOnClickListener(v -> mCallback.onResponsePicked(response)); // just single item, set up continue button setContinueButton(decor, v -> mCallback.onResponsePicked(response)); }
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
initialAuthenticationLayout
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
1
Analyze the following code function for security vulnerabilities
public boolean checkScenarioEnv(String scenarioId) { ApiScenarioWithBLOBs apiScenarioWithBLOBs = apiScenarioMapper.selectByPrimaryKey(scenarioId); apiScenarioEnvService.setScenarioEnv(apiScenarioWithBLOBs); return apiScenarioEnvService.checkScenarioEnv(apiScenarioWithBLOBs, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkScenarioEnv File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
checkScenarioEnv
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
@Deprecated public List<String> searchDocuments(String parameterizedWhereClause, int maxResults, int startOffset, List<?> parameterValues) throws XWikiException { return this.xwiki.getStore().searchDocumentsNames(parameterizedWhereClause, maxResults, startOffset, parameterValues, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocuments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
searchDocuments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public SQLType getType() { return this.type; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getType File: extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-41886
HIGH
7.5
OpenRefine
getType
extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java
2de1439f5be63d9d0e89bbacbd24fa28c8c3e29d
0
Analyze the following code function for security vulnerabilities
public String getVirtualHost() { return this.virtualHost; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVirtualHost 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
getVirtualHost
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
private void setVisibleRequested(boolean visible) { if (visible == mVisibleRequested) { return; } mVisibleRequested = visible; setInsetsFrozen(!visible); if (app != null) { mTaskSupervisor.onProcessActivityStateChanged(app, false /* forceBatch */); } logAppCompatState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVisibleRequested 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
setVisibleRequested
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_UID_REMOVED.equals(intent.getAction())) { int uid = intent.getIntExtra(Intent.EXTRA_UID, -1); PackageInactivityListener listener = mListeners.get(uid); if (listener != null) { if (DEBUG) { Log.d(LOG_TAG, "Removing the inactivity listener for " + uid); } listener.cancel(); mListeners.remove(uid); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onReceive File: services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
onReceive
services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
private void handleSimStateChange(int subId, int slotId, State state) { if (DEBUG_SIM_STATES) { Log.d(TAG, "handleSimStateChange(subId=" + subId + ", slotId=" + slotId + ", state=" + state +")"); } if (!SubscriptionManager.isValidSubscriptionId(subId)) { Log.w(TAG, "invalid subId in handleSimStateChange()"); return; } SimData data = mSimDatas.get(subId); final boolean changed; if (data == null) { data = new SimData(state, slotId, subId); mSimDatas.put(subId, data); changed = true; // no data yet; force update } else { changed = (data.simState != state || data.subId != subId || data.slotId != slotId); data.simState = state; data.subId = subId; data.slotId = slotId; } if (changed && state != State.UNKNOWN) { for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { cb.onSimStateChanged(subId, slotId, state); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSimStateChange File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
handleSimStateChange
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public int countCollectionsWithSubmit(String q, Context context, Community community, String entityType) throws SQLException, SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setMaxResults(0); discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE); DiscoverResult resp = retrieveCollectionsWithSubmit(context, discoverQuery, entityType, community, q); return (int) resp.getTotalSearchResults(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countCollectionsWithSubmit File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
countCollectionsWithSubmit
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
private void deleteSyncAttachment(AttachmentModuleRelationMapper batchAttachmentModuleRelationMapper, Set<String> jiraAttachmentSet, List<FileAttachmentMetadata> allMsAttachments) { // 删除Jira中不存在的附件 if (CollectionUtils.isNotEmpty(allMsAttachments)) { List<FileAttachmentMetadata> deleteMsAttachments = allMsAttachments.stream() .filter(msAttachment -> !jiraAttachmentSet.contains(msAttachment.getName())) .collect(Collectors.toList()); deleteMsAttachments.forEach(fileAttachmentMetadata -> { List<String> ids = List.of(fileAttachmentMetadata.getId()); AttachmentModuleRelationExample example = new AttachmentModuleRelationExample(); example.createCriteria().andAttachmentIdIn(ids).andRelationTypeEqualTo(AttachmentType.ISSUE.type()); // 删除MS附件及关联数据 attachmentService.deleteAttachmentByIds(ids); attachmentService.deleteFileAttachmentByIds(ids); batchAttachmentModuleRelationMapper.deleteByExample(example); }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteSyncAttachment File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
deleteSyncAttachment
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
@Override public void setContentLengthLong(long arg0) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentLengthLong File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
setContentLengthLong
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public void setAllowComment(Integer allowComment) { this.allowComment = allowComment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowComment File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
setAllowComment
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0