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
@Nonnull @MustNotContainNull public static List<Element> findDirectChildrenForName(@Nonnull final Element element, @Nonnull final String childElementname) { final NodeList found = element.getElementsByTagName(childElementname); final List<Element> resultList = new ArrayList<Element>(); for (int i = 0; i < found.getLength(); i++) { if (found.item(i).getParentNode().equals(element) && found.item(i) instanceof Element) { resultList.add((Element) found.item(i)); } } return resultList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findDirectChildrenForName File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
findDirectChildrenForName
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
@Override public void registerRemoteAnimations(IBinder token, RemoteAnimationDefinition definition) throws RemoteException { enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, "registerRemoteAnimations"); definition.setCallingPid(Binder.getCallingPid()); synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return; } final long origId = Binder.clearCallingIdentity(); try { r.registerRemoteAnimations(definition); } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerRemoteAnimations 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
registerRemoteAnimations
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private ArrayMap<ComponentName, ArrayList<ShortcutInfo>> sortShortcutsToActivities() { final ArrayMap<ComponentName, ArrayList<ShortcutInfo>> activitiesToShortcuts = new ArrayMap<>(); forEachShortcut(si -> { if (si.isFloating()) { return; // Ignore floating shortcuts, which are not tied to any activities. } final ComponentName activity = si.getActivity(); if (activity == null) { mShortcutUser.mService.wtf("null activity detected."); return; } ArrayList<ShortcutInfo> list = activitiesToShortcuts.computeIfAbsent(activity, k -> new ArrayList<>()); list.add(si); }); return activitiesToShortcuts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sortShortcutsToActivities File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
sortShortcutsToActivities
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public void removeColumnResizeListener(ColumnResizeListener listener) { removeListener(ColumnResizeEvent.class, listener, COLUMN_RESIZE_METHOD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeColumnResizeListener 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
removeColumnResizeListener
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") @WithBridgeMethods(Future.class) public QueueTaskFuture<R> scheduleBuild2(int quietPeriod, Cause c, Collection<? extends Action> actions) { if (!isBuildable()) return null; List<Action> queueActions = new ArrayList<Action>(actions); if (isParameterized() && Util.filter(queueActions, ParametersAction.class).isEmpty()) { queueActions.add(new ParametersAction(getDefaultParametersValues())); } if (c != null) { queueActions.add(new CauseAction(c)); } WaitingItem i = Jenkins.getInstance().getQueue().schedule(this, quietPeriod, queueActions); if(i!=null) return (QueueTaskFuture)i.getFuture(); return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleBuild2 File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
scheduleBuild2
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override public boolean isVideo() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVideo File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isVideo
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public static void setClassLoader(ClassLoader classLoader) { MappingUtil.classLoader = classLoader; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClassLoader File: ff4j-core/src/main/java/org/ff4j/utils/MappingUtil.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
setClassLoader
ff4j-core/src/main/java/org/ff4j/utils/MappingUtil.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
protected void finalize() throws Throwable { close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finalize File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
finalize
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public ApiClient setAccessToken(String accessToken) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).setAccessToken(accessToken); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAccessToken File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setAccessToken
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public static void execute(String url, String modulePathInBaloCache, String moduleNameWithOrg, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String supportedVersionRange, boolean isBuild, boolean isNightlyBuild, String langSpecVersion, String platform) { if (isBuild) { logFormatter = new BuildLogFormatter(); } HttpURLConnection conn = null; try { initializeSsl(); conn = createHttpUrlConnection(convertToUrl(url + supportedVersionRange), proxyHost, proxyPort, proxyUsername, proxyPassword); conn.setInstanceFollowRedirects(false); setRequestMethod(conn, Utils.RequestMethod.GET); // Set headers conn.setRequestProperty(BALLERINA_PLATFORM, platform); conn.setRequestProperty(BAL_LANG_SPEC_VERSION, langSpecVersion); conn.setRequestProperty(HttpHeaders.ACCEPT_ENCODING, IDENTITY); boolean redirect = false; // 302 - Module is found // Other - Error occurred, json returned with the error message if (getStatusCode(conn) == HttpURLConnection.HTTP_MOVED_TEMP) { redirect = true; } else { handleErrorResponse(conn, url, moduleNameWithOrg); } if (redirect) { // get redirect url from "location" header field String newUrl = conn.getHeaderField(HttpHeaders.LOCATION); String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); conn = createHttpUrlConnection(convertToUrl(newUrl), proxyHost, proxyPort, proxyUsername, proxyPassword); conn.setRequestProperty(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); createBaloInHomeRepo(conn, modulePathInBaloCache, moduleNameWithOrg, isNightlyBuild, newUrl, contentDisposition); } } catch (Exception e) { throw ErrorUtil.createCommandException(e.getMessage()); } finally { if (conn != null) { conn.disconnect(); } Authenticator.setDefault(null); } }
Vulnerability Classification: - CWE: CWE-306 - CVE: CVE-2021-32700 - Severity: MEDIUM - CVSS Score: 5.8 Description: Fix central connection Function: execute File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java Repository: ballerina-platform/ballerina-lang Fixed Code: public static void execute(String url, String modulePathInBaloCache, String moduleNameWithOrg, String proxyHost, int proxyPort, String proxyUsername, String proxyPassword, String supportedVersionRange, boolean isBuild, boolean isNightlyBuild, String langSpecVersion, String platform) { if (isBuild) { logFormatter = new BuildLogFormatter(); } HttpsURLConnection conn = null; try { conn = createHttpsUrlConnection(convertToUrl(url + supportedVersionRange), proxyHost, proxyPort, proxyUsername, proxyPassword); conn.setInstanceFollowRedirects(false); setRequestMethod(conn, Utils.RequestMethod.GET); // Set headers conn.setRequestProperty(BALLERINA_PLATFORM, platform); conn.setRequestProperty(BAL_LANG_SPEC_VERSION, langSpecVersion); conn.setRequestProperty(HttpHeaders.ACCEPT_ENCODING, IDENTITY); boolean redirect = false; // 302 - Module is found // Other - Error occurred, json returned with the error message if (getStatusCode(conn) == HttpsURLConnection.HTTP_MOVED_TEMP) { redirect = true; } else { handleErrorResponse(conn, url, moduleNameWithOrg); } if (redirect) { // get redirect url from "location" header field String newUrl = conn.getHeaderField(HttpHeaders.LOCATION); String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); conn = createHttpsUrlConnection(convertToUrl(newUrl), proxyHost, proxyPort, proxyUsername, proxyPassword); conn.setRequestProperty(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); createBaloInHomeRepo(conn, modulePathInBaloCache, moduleNameWithOrg, isNightlyBuild, newUrl, contentDisposition); } } catch (Exception e) { throw ErrorUtil.createCommandException(e.getMessage()); } finally { if (conn != null) { conn.disconnect(); } Authenticator.setDefault(null); } }
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
execute
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java
4609ffee1744ecd16aac09303b1783bf0a525816
1
Analyze the following code function for security vulnerabilities
public Integer getFetchSizeDefaultMaximum() { return myFetchSizeDefaultMaximum; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFetchSizeDefaultMaximum File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getFetchSizeDefaultMaximum
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
private static void _expand(Iterable<AccessControlledResource.Priviledge> privs, Set<AccessControlledResource.Priviledge> output) { if( privs == null ) { return ; } for( Priviledge p : privs ) { output.add(p); _expand(p.contains, output); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2015-7326 - Severity: HIGH - CVSS Score: 7.5 Description: log returning null ACL Function: _expand File: milton-api/src/main/java/io/milton/http/AclUtils.java Repository: miltonio/milton2 Fixed Code: private static void _expand(Iterable<AccessControlledResource.Priviledge> privs, Set<AccessControlledResource.Priviledge> output) { if( privs == null ) { return ; } for( Priviledge p : privs ) { output.add(p); _expand(p.contains, output); } }
[ "CWE-611" ]
CVE-2015-7326
HIGH
7.5
miltonio/milton2
_expand
milton-api/src/main/java/io/milton/http/AclUtils.java
b5851c1
1
Analyze the following code function for security vulnerabilities
@Override public Route.Definition connect(final String path, final Route.Filter filter) { return appendDefinition(CONNECT, path, filter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connect File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
connect
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static int resolveCallingUserIdEnforcingPermissionsLocked(int requestingUserId) { if (requestingUserId == UserHandle.getCallingUserId()) { return requestingUserId; } return ActivityManager.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), requestingUserId, false, true, "get/set setting for user", null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveCallingUserIdEnforcingPermissionsLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
resolveCallingUserIdEnforcingPermissionsLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public void agentDisconnected(String packageName) { // TODO: handle backup being interrupted synchronized(mAgentConnectLock) { if (Binder.getCallingUid() == Process.SYSTEM_UID) { mConnectedAgent = null; mConnecting = false; } else { Slog.w(TAG, "Non-system process uid=" + Binder.getCallingUid() + " claiming agent disconnected"); } mAgentConnectLock.notifyAll(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: agentDisconnected File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
agentDisconnected
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public T newInstance(StaplerRequest req, JSONObject formData) throws FormException { try { Method m = getClass().getMethod("newInstance", StaplerRequest.class); if(!Modifier.isAbstract(m.getDeclaringClass().getModifiers())) { // this class overrides newInstance(StaplerRequest). // maintain the backward compatible behavior return verifyNewInstance(newInstance(req)); } else { if (req==null) { // yes, req is supposed to be always non-null, but see the note above return verifyNewInstance(clazz.newInstance()); } // new behavior as of 1.206 return verifyNewInstance(req.bindJSON(clazz,formData)); } } catch (NoSuchMethodException e) { throw new AssertionError(e); // impossible } catch (InstantiationException e) { throw new Error("Failed to instantiate "+clazz+" from "+formData,e); } catch (IllegalAccessException e) { throw new Error("Failed to instantiate "+clazz+" from "+formData,e); } catch (RuntimeException e) { throw new RuntimeException("Failed to instantiate "+clazz+" from "+formData,e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newInstance File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
newInstance
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private void maybeDeleteXWikiSpace(XWikiDocument deletedDocument, Session session) { if (deletedDocument.getLocale().equals(Locale.ROOT)) { DocumentReference documentReference = deletedDocument.getDocumentReference(); maybeDeleteXWikiSpace(documentReference.getLastSpaceReference(), this.localEntityReferenceSerializer.serialize(documentReference), session); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeDeleteXWikiSpace File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
maybeDeleteXWikiSpace
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private void setHeader(View decor, FillResponse response) { final RemoteViews presentation = response.getDialogHeader(); if (presentation == null) { return; } final ViewGroup container = decor.findViewById(R.id.autofill_dialog_header); 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); }
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: setHeader File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android Fixed Code: private void setHeader(View decor, FillResponse response) { final RemoteViews presentation = Helper.sanitizeRemoteView(response.getDialogHeader()); if (presentation == null) { return; } final ViewGroup container = decor.findViewById(R.id.autofill_dialog_header); 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); }
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
setHeader
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
1
Analyze the following code function for security vulnerabilities
private static DocumentReferenceResolver<EntityReference> getCurrentReferenceDocumentReferenceResolver() { return Utils.getComponent(DocumentReferenceResolver.TYPE_REFERENCE, "current"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentReferenceDocumentReferenceResolver File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getCurrentReferenceDocumentReferenceResolver
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private Stream<MapResult> xmlXpathToMapResult(@Name("url") String url, boolean simpleMode, String path, Map<String, Object> config) throws Exception { if (config == null) config = Collections.emptyMap(); boolean failOnError = (boolean) config.getOrDefault("failOnError", true); List<MapResult> result = new ArrayList<>(); try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementContentWhitespace(true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); FileUtils.checkReadAllowed(url); Map<String, Object> headers = (Map) config.getOrDefault( "headers", Collections.emptyMap() ); Document doc = documentBuilder.parse(Util.openInputStream(url, headers, null)); XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); path = StringUtils.isEmpty(path) ? "/" : path; XPathExpression xPathExpression = xPath.compile(path); NodeList nodeList = (NodeList) xPathExpression.evaluate(doc, XPathConstants.NODESET); for (int i = 0; i < nodeList.getLength(); i++) { final Deque<Map<String, Object>> stack = new LinkedList<>(); handleNode(stack, nodeList.item(i), simpleMode); for (int index = 0; index < stack.size(); index++) { result.add(new MapResult(stack.pollFirst())); } } } catch (FileNotFoundException e){ if(!failOnError) return Stream.of(new MapResult(Collections.emptyMap())); else throw new FileNotFoundException(e.getMessage()); } catch (Exception e){ if(!failOnError) return Stream.of(new MapResult(Collections.emptyMap())); else throw new Exception(e); } return result.stream(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000820 - Severity: HIGH - CVSS Score: 7.5 Description: Fixes #931 (#962) Function: xmlXpathToMapResult File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures Fixed Code: private Stream<MapResult> xmlXpathToMapResult(@Name("url") String url, boolean simpleMode, String path, Map<String, Object> config) throws Exception { if (config == null) config = Collections.emptyMap(); boolean failOnError = (boolean) config.getOrDefault("failOnError", true); List<MapResult> result = new ArrayList<>(); try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementContentWhitespace(true); documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); FileUtils.checkReadAllowed(url); Map<String, Object> headers = (Map) config.getOrDefault( "headers", Collections.emptyMap() ); Document doc = documentBuilder.parse(Util.openInputStream(url, headers, null)); XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xPath = xPathFactory.newXPath(); path = StringUtils.isEmpty(path) ? "/" : path; XPathExpression xPathExpression = xPath.compile(path); NodeList nodeList = (NodeList) xPathExpression.evaluate(doc, XPathConstants.NODESET); for (int i = 0; i < nodeList.getLength(); i++) { final Deque<Map<String, Object>> stack = new LinkedList<>(); handleNode(stack, nodeList.item(i), simpleMode); for (int index = 0; index < stack.size(); index++) { result.add(new MapResult(stack.pollFirst())); } } } catch (FileNotFoundException e){ if(!failOnError) return Stream.of(new MapResult(Collections.emptyMap())); else throw new FileNotFoundException(e.getMessage()); } catch (Exception e){ if(!failOnError) return Stream.of(new MapResult(Collections.emptyMap())); else throw new Exception(e); } return result.stream(); }
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
xmlXpathToMapResult
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
1
Analyze the following code function for security vulnerabilities
int getMaxHeaderListSize() { return maxHeaderListSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxHeaderListSize File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getMaxHeaderListSize
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public String getXMLContent(XWikiContext context) throws XWikiException { XWikiDocument tdoc = getTranslatedDocument(context); return tdoc.toXML(true, true, false, false, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXMLContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getXMLContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void sendStringsUpdatedBroadcast(List<String> stringIds) { sendResourceUpdatedBroadcast(EXTRA_RESOURCE_TYPE_STRING, stringIds); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStringsUpdatedBroadcast File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
sendStringsUpdatedBroadcast
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHttpClient File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setHttpClient
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean isSupervisionComponent(@NonNull ComponentName who) { if (mService != null) { try { return getService().isSupervisionComponent(who); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSupervisionComponent 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
isSupervisionComponent
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static boolean isWindows() { return File.pathSeparatorChar==';'; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isWindows File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
isWindows
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private void revertToNitzTimeZone() { if (Settings.Global.getInt(mPhone.getContext().getContentResolver(), Settings.Global.AUTO_TIME_ZONE, 0) == 0) { return; } if (DBG) log("Reverting to NITZ TimeZone: tz='" + mSavedTimeZone); if (mSavedTimeZone != null) { setAndBroadcastNetworkSetTimeZone(mSavedTimeZone); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revertToNitzTimeZone File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
revertToNitzTimeZone
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
@Override protected OrganizationDirectoryService getOrganizationDirectoryService() { return organizationDirectoryService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrganizationDirectoryService 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
getOrganizationDirectoryService
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
boolean waitingForReplacement() { if (mWillReplaceWindow) { return true; } for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState c = mChildren.get(i); if (c.waitingForReplacement()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: waitingForReplacement 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
waitingForReplacement
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public byte[] processBlock( byte[] in, int inOff, int inLen) throws InvalidCipherTextException { if (forEncryption) { if (keyPairGenerator != null) { EphemeralKeyPair ephKeyPair = keyPairGenerator.generate(); this.privParam = ephKeyPair.getKeyPair().getPrivate(); this.V = ephKeyPair.getEncodedPublicKey(); } } else { if (keyParser != null) { ByteArrayInputStream bIn = new ByteArrayInputStream(in, inOff, inLen); try { this.pubParam = keyParser.readKey(bIn); } catch (IOException e) { throw new InvalidCipherTextException("unable to recover ephemeral public key: " + e.getMessage(), e); } int encLength = (inLen - bIn.available()); this.V = Arrays.copyOfRange(in, inOff, inOff + encLength); } } // Compute the common value and convert to byte array. agree.init(privParam); BigInteger z = agree.calculateAgreement(pubParam); byte[] Z = BigIntegers.asUnsignedByteArray(agree.getFieldSize(), z); // Create input to KDF. if (V.length != 0) { byte[] VZ = Arrays.concatenate(V, Z); Arrays.fill(Z, (byte)0); Z = VZ; } try { // Initialise the KDF. KDFParameters kdfParam = new KDFParameters(Z, param.getDerivationV()); kdf.init(kdfParam); return forEncryption ? encryptBlock(in, inOff, inLen) : decryptBlock(in, inOff, inLen); } finally { Arrays.fill(Z, (byte)0); } }
Vulnerability Classification: - CWE: CWE-320 - CVE: CVE-2016-1000346 - Severity: MEDIUM - CVSS Score: 4.3 Description: Added TLS validation check for DH keys Added further agreement result checks Function: processBlock File: core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java Repository: bcgit/bc-java Fixed Code: public byte[] processBlock( byte[] in, int inOff, int inLen) throws InvalidCipherTextException { if (forEncryption) { if (keyPairGenerator != null) { EphemeralKeyPair ephKeyPair = keyPairGenerator.generate(); this.privParam = ephKeyPair.getKeyPair().getPrivate(); this.V = ephKeyPair.getEncodedPublicKey(); } } else { if (keyParser != null) { ByteArrayInputStream bIn = new ByteArrayInputStream(in, inOff, inLen); try { this.pubParam = keyParser.readKey(bIn); } catch (IOException e) { throw new InvalidCipherTextException("unable to recover ephemeral public key: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new InvalidCipherTextException("unable to recover ephemeral public key: " + e.getMessage(), e); } int encLength = (inLen - bIn.available()); this.V = Arrays.copyOfRange(in, inOff, inOff + encLength); } } // Compute the common value and convert to byte array. agree.init(privParam); BigInteger z = agree.calculateAgreement(pubParam); byte[] Z = BigIntegers.asUnsignedByteArray(agree.getFieldSize(), z); // Create input to KDF. if (V.length != 0) { byte[] VZ = Arrays.concatenate(V, Z); Arrays.fill(Z, (byte)0); Z = VZ; } try { // Initialise the KDF. KDFParameters kdfParam = new KDFParameters(Z, param.getDerivationV()); kdf.init(kdfParam); return forEncryption ? encryptBlock(in, inOff, inLen) : decryptBlock(in, inOff, inLen); } finally { Arrays.fill(Z, (byte)0); } }
[ "CWE-320" ]
CVE-2016-1000346
MEDIUM
4.3
bcgit/bc-java
processBlock
core/src/main/java/org/bouncycastle/crypto/engines/IESEngine.java
1127131c89021612c6eefa26dbe5714c194e7495
1
Analyze the following code function for security vulnerabilities
@ApiOperation(value = "新增页面", notes = "新增页面") @GetMapping("/add") @RequiresPermissions("novel:friendLink:add") String add() { return "novel/friendLink/add"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add File: novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java Repository: 201206030/novel-plus The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-7171
LOW
3.3
201206030/novel-plus
add
novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java
d6093d8182362422370d7eaf6c53afde9ee45215
0
Analyze the following code function for security vulnerabilities
public static int countChar(String s, char c) { int counter = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == c) { counter++; } } return counter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countChar File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
countChar
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public <T> WebSocket.Definition ws(final String path, final Class<? extends WebSocket.OnMessage<T>> handler) { String fpath = Optional.ofNullable(handler.getAnnotation(org.jooby.mvc.Path.class)) .map(it -> path + "/" + it.value()[0]) .orElse(path); WebSocket.Definition ws = ws(fpath, MvcWebSocket.newWebSocket(handler)); Optional.ofNullable(handler.getAnnotation(Consumes.class)) .ifPresent(consumes -> Arrays.asList(consumes.value()).forEach(ws::consumes)); Optional.ofNullable(handler.getAnnotation(Produces.class)) .ifPresent(produces -> Arrays.asList(produces.value()).forEach(ws::produces)); return ws; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ws File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
ws
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public JobDomainPeasSessionController createComponentSessionController( MainSessionController mainSessionCtrl, ComponentContext componentContext) { return new JobDomainPeasSessionController(mainSessionCtrl, componentContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createComponentSessionController File: core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
createComponentSessionController
core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
protected void onQsExpansionStarted(int overscrollAmount) { cancelQsAnimation(); cancelHeightAnimator(); // Reset scroll position and apply that position to the expanded height. float height = mQsExpansionHeight - overscrollAmount; setQsExpansion(height); requestPanelHeightUpdate(); mNotificationStackScroller.checkSnoozeLeavebehind(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onQsExpansionStarted 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
onQsExpansionStarted
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void notifyKeyguardFlagsChanged(@Nullable Runnable callback) { synchronized (ActivityManagerService.this) { // We might change the visibilities here, so prepare an empty app transition which // might be overridden later if we actually change visibilities. final boolean wasTransitionSet = mWindowManager.getPendingAppTransition() != TRANSIT_NONE; if (!wasTransitionSet) { mWindowManager.prepareAppTransition(TRANSIT_NONE, false /* alwaysKeepCurrent */); } mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS); // If there was a transition set already we don't want to interfere with it as we // might be starting it too early. if (!wasTransitionSet) { mWindowManager.executeAppTransition(); } } if (callback != null) { callback.run(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyKeyguardFlagsChanged 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
notifyKeyguardFlagsChanged
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public Oort getOort() { return (Oort)getSource(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOort File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
getOort
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
@Override public Syntax getTargetSyntax() { return this.configuration.getTargetSyntax(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTargetSyntax File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-26471
HIGH
8.8
xwiki/xwiki-platform
getTargetSyntax
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-api/src/main/java/org/xwiki/rendering/async/internal/block/DefaultBlockAsyncRenderer.java
00532d9f1404287cf3ec3a05056640d809516006
0
Analyze the following code function for security vulnerabilities
protected BarTransitions getStatusBarTransitions() { return mStatusBarView.getBarTransitions(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatusBarTransitions File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
getStatusBarTransitions
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public AccessibilityNodeProvider getAccessibilityNodeProvider() { if (mBrowserAccessibilityManager != null) { return mBrowserAccessibilityManager.getAccessibilityNodeProvider(); } if (mNativeAccessibilityAllowed && !mNativeAccessibilityEnabled && mNativeContentViewCore != 0 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { mNativeAccessibilityEnabled = true; nativeSetAccessibilityEnabled(mNativeContentViewCore, true); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccessibilityNodeProvider File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
getAccessibilityNodeProvider
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
boolean isNextTransitionForward() { int transit = mWindowManager.getPendingAppTransition(); return transit == AppTransition.TRANSIT_ACTIVITY_OPEN || transit == AppTransition.TRANSIT_TASK_OPEN || transit == AppTransition.TRANSIT_TASK_TO_FRONT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNextTransitionForward File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
isNextTransitionForward
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private int getConversationLayoutResource() { return R.layout.notification_template_material_conversation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConversationLayoutResource File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getConversationLayoutResource
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInputMethodPermittedByAdmin(ComponentName who, String packageName, int userHandle, boolean calledOnParentInstance) { if (!mHasFeature) { return true; } Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkStringNotEmpty(packageName, "packageName is null"); Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity()), String.format(NOT_SYSTEM_CALLER_MSG, "query if an input method is disabled by admin")); if (isPolicyEngineForFinanceFlagEnabled()) { int affectedUser = calledOnParentInstance ? getProfileParentId(userHandle) : userHandle; Map<EnforcingAdmin, PolicyValue<Set<String>>> policies = mDevicePolicyEngine.getLocalPoliciesSetByAdmins( PolicyDefinition.PERMITTED_INPUT_METHODS, affectedUser); EnforcingAdmin admin = null; for (EnforcingAdmin a : policies.keySet()) { if (a.getPackageName().equals(who.getPackageName())) { if (policies.get(a).getValue() == null) { return true; } else { return checkPackagesInPermittedListOrSystem( Collections.singletonList(packageName), new ArrayList<>(policies.get(a).getValue()), affectedUser); } } } // Admin didn't set a policy return false; } else { synchronized (getLockObject()) { ActiveAdmin admin = getParentOfAdminIfRequired( getActiveAdminUncheckedLocked(who, userHandle), calledOnParentInstance); if (admin == null) { return false; } if (admin.permittedInputMethods == null) { return true; } return checkPackagesInPermittedListOrSystem(Collections.singletonList(packageName), admin.permittedInputMethods, userHandle); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInputMethodPermittedByAdmin 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
isInputMethodPermittedByAdmin
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void finishLayoutLw() { return; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishLayoutLw File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
finishLayoutLw
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, String name, String callerPackage) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleIncomingUser File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
handleIncomingUser
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void setCompanionAppUids(int userId, Set<Integer> companionAppUids) { synchronized (ActivityManagerService.this) { mCompanionAppUidsMap.put(userId, companionAppUids); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCompanionAppUids 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
setCompanionAppUids
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNotificationListenerServicePermitted(String packageName, int userId) { if (!mHasFeature) { return true; } Preconditions.checkStringNotEmpty(packageName, "packageName is null or empty"); Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity()), String.format(NOT_SYSTEM_CALLER_MSG, "query if a notification listener service is permitted")); synchronized (getLockObject()) { ActiveAdmin profileOwner = getProfileOwnerAdminLocked(userId); if (profileOwner == null || profileOwner.permittedNotificationListeners == null) { return true; } return checkPackagesInPermittedListOrSystem(Collections.singletonList(packageName), profileOwner.permittedNotificationListeners, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNotificationListenerServicePermitted File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
isNotificationListenerServicePermitted
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { ((HttpBearerAuth) auth).setBearerToken(bearerToken); return this; } } throw new RuntimeException("No Bearer authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBearerToken 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
setBearerToken
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void stopDtmfTone(Call call) { if (!mCalls.contains(call)) { Log.i(this, "Request to stop DTMF in a non-existent call %s", call); } else { call.stopDtmfTone(); mDtmfLocalTonePlayer.stopTone(call); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopDtmfTone File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
stopDtmfTone
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public boolean canCover(int nbArg, Set<String> namedArgument) { return nbArg == 1 || nbArg == 2 || nbArg == 3; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canCover File: src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
canCover
src/net/sourceforge/plantuml/tim/stdlib/LoadJson.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
boolean isUidActiveLocked(int uid) { final UidRecord uidRecord = mActiveUids.get(uid); return uidRecord != null && !uidRecord.setIdle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUidActiveLocked 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
isUidActiveLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private String getUserAgent() { try { String userAgent = System.getProperty("http.agent"); if(userAgent != null){ return userAgent; } } catch (Exception e) { } if (getActivity() == null) { return "Android-CN1"; } try { Constructor<WebSettings> constructor = WebSettings.class.getDeclaredConstructor(Context.class, WebView.class); constructor.setAccessible(true); try { WebSettings settings = constructor.newInstance(getActivity(), null); return settings.getUserAgentString(); } finally { constructor.setAccessible(false); } } catch (Exception e) { final StringBuffer ua = new StringBuffer(); if (Thread.currentThread().getName().equalsIgnoreCase("main")) { WebView m_webview = new WebView(getActivity()); ua.append(m_webview.getSettings().getUserAgentString()); m_webview.destroy(); } else { final boolean[] flag = new boolean[1]; Thread thread = new Thread() { public void run() { Looper.prepare(); WebView m_webview = new WebView(getActivity()); ua.append(m_webview.getSettings().getUserAgentString()); m_webview.destroy(); Looper.loop(); flag[0] = true; synchronized (flag) { flag.notify(); } } }; thread.setUncaughtExceptionHandler(AndroidImplementation.exceptionHandler); thread.start(); while (!flag[0]) { synchronized (flag) { try { flag.wait(100); } catch (InterruptedException ex) { } } } } return ua.toString(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserAgent File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getUserAgent
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
void launchTapAgain(ApduServiceInfo service, String category) { Intent dialogIntent = new Intent(mContext, TapAgainDialog.class); dialogIntent.putExtra(TapAgainDialog.EXTRA_CATEGORY, category); dialogIntent.putExtra(TapAgainDialog.EXTRA_APDU_SERVICE, service); dialogIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); mContext.startActivityAsUser(dialogIntent, UserHandle.getUserHandleForUid(service.getUid())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: launchTapAgain File: src/com/android/nfc/cardemulation/HostEmulationManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35671
MEDIUM
5.5
android
launchTapAgain
src/com/android/nfc/cardemulation/HostEmulationManager.java
745632835f3d97513a9c2a96e56e1dc06c4e4176
0
Analyze the following code function for security vulnerabilities
static void logSurface(SurfaceControl s, String title, String msg, RuntimeException where) { String str = " SURFACE " + s + ": " + msg + " / " + title; if (where != null) { Slog.i(TAG, str, where); } else { Slog.i(TAG, str); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logSurface 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
logSurface
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private static void checkSystemOrRoot(String message) { final int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID && uid != 0) { throw new SecurityException("Only system may call: " + message); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkSystemOrRoot File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
checkSystemOrRoot
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
float translateToWindowY(float y) { float winY = y - mWindowFrames.mFrame.top; if (hasCompatScale()) { winY *= mGlobalScale; } return winY; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: translateToWindowY 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
translateToWindowY
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private boolean isFileDragAndDrop(HttpServletRequest request) { return request.getRequestURI().contains("DragAndDrop/"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFileDragAndDrop File: core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
isFileDragAndDrop
core-war/src/main/java/org/silverpeas/web/token/SessionSynchronizerTokenValidator.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M1") public void setxWikiClassXML(String xClassXML) { setXClassXML(xClassXML); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setxWikiClassXML 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
setxWikiClassXML
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
protected void fillAttributeValues(Node node, BeanDefinitionBuilder builder, String... excludeNames) { Collection<String> epn = excludeNames != null && excludeNames.length > 0 ? new HashSet<String>(asList(excludeNames)) : null; fillAttributeValues(node, builder, epn); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillAttributeValues File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
fillAttributeValues
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public void setQuotedArgumentsEnabled( boolean quotedArgumentsEnabled ) { this.quotedArgumentsEnabled = quotedArgumentsEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQuotedArgumentsEnabled File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setQuotedArgumentsEnabled
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@Override public boolean installExistingPackage(ComponentName who, String callerPackage, String packageName) { final CallerIdentity caller = getCallerIdentity(who, callerPackage); Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isProfileOwner(caller) || isDefaultDeviceOwner(caller))) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_INSTALL_EXISTING_PACKAGE))); boolean result; synchronized (getLockObject()) { Preconditions.checkCallAuthorization( isUserAffiliatedWithDeviceLocked(caller.getUserId()), "Admin %s is neither the device owner or " + "affiliated user's profile owner.", who); final long id = mInjector.binderClearCallingIdentity(); try { if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "installing " + packageName + " for " + caller.getUserId()); } // Install the package. result = mIPackageManager.installExistingPackageAsUser(packageName, caller.getUserId(), PackageManager.INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS, PackageManager.INSTALL_REASON_POLICY, null) == PackageManager.INSTALL_SUCCEEDED; } catch (RemoteException re) { // shouldn't happen Slogf.wtf(LOG_TAG, "Error installing package", re); return false; } finally { mInjector.binderRestoreCallingIdentity(id); } } if (result) { DevicePolicyEventLogger .createEvent(DevicePolicyEnums.INSTALL_EXISTING_PACKAGE) .setAdmin(caller.getPackageName()) .setBoolean(/* isDelegate */ who == null) .setStrings(packageName) .write(); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installExistingPackage 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
installExistingPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int actualPort() { return server.actualPort(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: actualPort File: src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java Repository: vert-x3/vertx-stomp The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-32081
MEDIUM
6.5
vert-x3/vertx-stomp
actualPort
src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
0de4bc5a44ddb57e74d92c445f16456fa03f265b
0
Analyze the following code function for security vulnerabilities
@Override public ComponentName startService(IApplicationThread caller, Intent service, String resolvedType, boolean requireForeground, String callingPackage, String callingFeatureId, int userId) throws TransactionTooLargeException { enforceNotIsolatedCaller("startService"); enforceAllowedToStartOrBindServiceIfSdkSandbox(service); // Refuse possible leaked file descriptors if (service != null && service.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } if (callingPackage == null) { throw new IllegalArgumentException("callingPackage cannot be null"); } if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "*** startService: " + service + " type=" + resolvedType + " fg=" + requireForeground); synchronized(this) { final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); ComponentName res; try { res = mServices.startServiceLocked(caller, service, resolvedType, callingPid, callingUid, requireForeground, callingPackage, callingFeatureId, userId); } finally { Binder.restoreCallingIdentity(origId); } return res; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startService 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
startService
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private Header[] applyHeaderFilters(Map<String, List<String>> theAllHeaders) { ArrayList<Header> retVal = new ArrayList<Header>(); for (String nextKey : theAllHeaders.keySet()) { for (String nextValue : theAllHeaders.get(nextKey)) { if (myFilterHeaders == null || !myFilterHeaders.contains(nextKey.toLowerCase())) { retVal.add(new BasicHeader(nextKey, nextValue)); } } } return retVal.toArray(new Header[retVal.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyHeaderFilters File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-12741
MEDIUM
4.3
hapifhir/hapi-fhir
applyHeaderFilters
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
8f41159eb147eeb964cad68b28eff97acac6ea9a
0
Analyze the following code function for security vulnerabilities
public static XMLFilter getXMLFilterForNamespace(final String namespace) throws SAXException { XMLFilter filter = namespace == null ? new SimpleNamespaceFilter("", false) : new SimpleNamespaceFilter(namespace, true); LOG.trace("namespace filter for namespace {}: {}", namespace, filter); final XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); xmlReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false); xmlReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); filter.setParent(xmlReader); return filter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXMLFilterForNamespace File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
getXMLFilterForNamespace
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
@CalledByNative private static Rect createRect(int x, int y, int right, int bottom) { return new Rect(x, y, right, bottom); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRect File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
createRect
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public User getUser(DocumentReference userReference, XWikiContext context) { XWikiUser xwikiUser = new XWikiUser(userReference); User user = new User(xwikiUser, context); return user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUser File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getUser
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public static boolean isBeginningOfStep(HttpServletRequest request) { Boolean stepStart = (Boolean) request.getAttribute("step.start"); if (stepStart != null) { return stepStart.booleanValue(); } else { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBeginningOfStep File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
isBeginningOfStep
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
private void setJsonFormData(PageModel model, Account account, OtherAccountData otherAccountData) throws IOException { ObjectMapper mapper = new ObjectMapper(); SimpleObject simplePerson = new SimpleObject(); simplePerson.put("familyName", account.getFamilyName()); simplePerson.put("givenName", account.getGivenName()); simplePerson.put("gender", account.getGender() != null ? account.getGender() : ""); model.addAttribute("personJson", mapper.writeValueAsString(simplePerson)); SimpleObject simpleUser = new SimpleObject(); SimpleObject simpleProvider = new SimpleObject(); if (otherAccountData != null) { if (otherAccountData.getAddUserAccount()) { User u = account.getUserAccounts().get(0); simpleUser.put("username", u.getUsername()); simpleUser.put("privilegeLevel", account.getPrivilegeLevel(u).getUuid()); SimpleObject userProperties = new SimpleObject(); userProperties .put(OpenmrsConstants.USER_PROPERTY_CHANGE_PASSWORD, otherAccountData.getForceChangePassword()); simpleUser.put("userProperties", userProperties); SimpleObject simpleUserCapabilities = new SimpleObject(); for (Role cap : account.getCapabilities(u)) { simpleUserCapabilities.put(cap.getUuid(), true); } simpleUser.put("capabilities", simpleUserCapabilities); } if (otherAccountData.getAddProviderAccount()) { Provider prov = (Provider) account.getProviderAccounts().get(0); simpleProvider.put("identifier", prov.getIdentifier()); simpleProvider.put("providerRole", prov.getProviderRole().getUuid()); } } model.addAttribute("userJson", mapper.writeValueAsString(simpleUser)); model.addAttribute("providerJson", mapper.writeValueAsString(simpleProvider)); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-36636 - Severity: MEDIUM - CVSS Score: 6.1 Description: RA-1865: Fix possible xss in account setup (#57) Function: setJsonFormData File: omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java Repository: openmrs/openmrs-module-adminui Fixed Code: private void setJsonFormData(PageModel model, Account account, OtherAccountData otherAccountData, UiUtils uu) throws IOException { ObjectMapper mapper = new ObjectMapper(); SimpleObject simplePerson = new SimpleObject(); simplePerson.put("familyName", uu.encodeHtml(account.getFamilyName())); simplePerson.put("givenName", uu.encodeHtml(account.getGivenName())); simplePerson.put("gender", uu.encodeHtml(account.getGender()) != null ? uu.encodeHtml(account.getGender()) : ""); model.addAttribute("personJson", mapper.writeValueAsString(simplePerson)); SimpleObject simpleUser = new SimpleObject(); SimpleObject simpleProvider = new SimpleObject(); if (otherAccountData != null) { if (otherAccountData.getAddUserAccount()) { User u = account.getUserAccounts().get(0); simpleUser.put("username", uu.encodeHtml(u.getUsername())); simpleUser.put("privilegeLevel", account.getPrivilegeLevel(u).getUuid()); SimpleObject userProperties = new SimpleObject(); userProperties .put(OpenmrsConstants.USER_PROPERTY_CHANGE_PASSWORD, otherAccountData.getForceChangePassword()); simpleUser.put("userProperties", userProperties); SimpleObject simpleUserCapabilities = new SimpleObject(); for (Role cap : account.getCapabilities(u)) { simpleUserCapabilities.put(cap.getUuid(), true); } simpleUser.put("capabilities", simpleUserCapabilities); } if (otherAccountData.getAddProviderAccount()) { Provider prov = (Provider) account.getProviderAccounts().get(0); simpleProvider.put("identifier", prov.getIdentifier()); simpleProvider.put("providerRole", prov.getProviderRole().getUuid()); } } model.addAttribute("userJson", mapper.writeValueAsString(simpleUser)); model.addAttribute("providerJson", mapper.writeValueAsString(simpleProvider)); }
[ "CWE-79" ]
CVE-2020-36636
MEDIUM
6.1
openmrs/openmrs-module-adminui
setJsonFormData
omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java
702fbfdac7c4418f23bb5f6452482b4a88020061
1
Analyze the following code function for security vulnerabilities
@Deprecated public int getContentIconGravity() { return mContentIconGravity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentIconGravity File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getContentIconGravity
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@ErrorHandler public ModelAndView handleError(HttpServletRequest request, HttpServletResponse response, Exception e) { LOGGER.error("Error loading artifacts: ", e); Map model = new HashMap(); model.put(ERROR_FOR_PAGE, "Artifact does not exist."); return new ModelAndView("exceptions_page", model); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleError File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java Repository: gocd The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-43289
MEDIUM
5
gocd
handleError
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
0
Analyze the following code function for security vulnerabilities
void pushTempAllowlist() { final int N; final PendingTempAllowlist[] list; // First copy out the pending changes... we need to leave them in the map for now, // in case someone needs to check what is coming up while we don't have the lock held. synchronized (this) { synchronized (mProcLock) { N = mPendingTempAllowlist.size(); list = new PendingTempAllowlist[N]; for (int i = 0; i < N; i++) { list[i] = mPendingTempAllowlist.valueAt(i); } } } // Now safely dispatch changes to device idle controller. Skip this if we're early // in boot and the controller hasn't yet been brought online: we do not apply // device idle policy anyway at this phase. if (mLocalDeviceIdleController != null) { for (int i = 0; i < N; i++) { PendingTempAllowlist ptw = list[i]; mLocalDeviceIdleController.addPowerSaveTempWhitelistAppDirect(ptw.targetUid, ptw.duration, ptw.type, true, ptw.reasonCode, ptw.tag, ptw.callingUid); } } // And now we can safely remove them from the map. synchronized (this) { synchronized (mProcLock) { for (int i = 0; i < N; i++) { PendingTempAllowlist ptw = list[i]; int index = mPendingTempAllowlist.indexOfKey(ptw.targetUid); if (index >= 0 && mPendingTempAllowlist.valueAt(index) == ptw) { mPendingTempAllowlist.removeAt(index); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushTempAllowlist 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
pushTempAllowlist
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public String getUniquePageName(String space, XWikiContext context) { String pageName = generateRandomString(16); return getUniquePageName(space, pageName, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUniquePageName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getUniquePageName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override int getLayoutResource() { return R.layout.chooser_grid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLayoutResource File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
getLayoutResource
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
public void setCertTypeSSLServer(String SSLServer) { this.certTypeSSLServer = SSLServer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCertTypeSSLServer 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
setCertTypeSSLServer
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void wOpen() throws SQLException { db = dbHelper.getWritableDatabase(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wOpen File: app/src/main/java/com/dimtion/shaarlier/TagsSource.java Repository: dimtion/Shaarlier The code follows secure coding practices.
[ "CWE-89" ]
CVE-2015-10076
MEDIUM
5.2
dimtion/Shaarlier
wOpen
app/src/main/java/com/dimtion/shaarlier/TagsSource.java
3d1d9b239d9b3cd87e8bed45a0f02da583ad371e
0
Analyze the following code function for security vulnerabilities
@Override public XDOM parse(String content, Syntax syntax) throws ParseException, MissingParserException { return getParser(syntax).parse(new StringReader(content == null ? "" : content)); }
Vulnerability Classification: - CWE: CWE-755 - CVE: CVE-2023-26479 - Severity: MEDIUM - CVSS Score: 6.5 Description: XWIKI-19838: Improve handling of unexpected parser errors Function: parse File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-parser/src/main/java/org/xwiki/rendering/internal/parser/DefaultContentParser.java Repository: xwiki/xwiki-platform Fixed Code: @Override public XDOM parse(String content, Syntax syntax) throws ParseException, MissingParserException { Parser parser = getParser(syntax); try { return parser.parse(new StringReader(content == null ? "" : content)); } catch (StackOverflowError | Exception e) { // All exceptions as well as stack overflow errors are captured and wrapped in parse exceptions to make sure // that they are handled correctly by the callers. Without this, some parsing issues can be badly handled, // leading to instability issues. throw new ParseException(String.format("Failed to parse with syntax [%s].", syntax.toIdString()), e); } }
[ "CWE-755" ]
CVE-2023-26479
MEDIUM
6.5
xwiki/xwiki-platform
parse
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-parser/src/main/java/org/xwiki/rendering/internal/parser/DefaultContentParser.java
e5b82cd98072464196a468b8f7fe6396dce142a7
1
Analyze the following code function for security vulnerabilities
@GET @Path("survey/{nodeId}/configuration") @Operation(summary = "Retrieve configuration", description = "Retrieves configuration of the survey course node") @ApiResponse(responseCode = "200", description = "The course node configuration", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = SurveyConfigVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = SurveyConfigVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or task node not found") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response getSurveyConfiguration(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @Context HttpServletRequest httpRequest) { ICourse course = CoursesWebService.loadCourse(courseId); if(course == null) { return Response.serverError().status(Status.NOT_FOUND).build(); } if(!isAuthorEditor(course, httpRequest)) { return Response.serverError().status(Status.UNAUTHORIZED).build(); } SurveyConfigVO config = new SurveyConfigVO(); CourseNode courseNode = getParentNode(course, nodeId).getCourseNode(); ModuleConfiguration moduleConfig = courseNode.getModuleConfiguration(); //build configuration with fallback to default values Boolean allowCancel = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLECANCEL); config.setAllowCancel(allowCancel == null ? false : allowCancel); Boolean allowNavi = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLEMENU); config.setAllowNavigation(allowNavi == null ? false : allowNavi); Boolean allowSuspend = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_ENABLESUSPEND); config.setAllowSuspend(allowSuspend == null ? false : allowSuspend); config.setSequencePresentation(moduleConfig.getStringValue(IQEditController.CONFIG_KEY_SEQUENCE, AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM)); Boolean showNavi = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU); config.setShowNavigation(showNavi == null ? true : showNavi); Boolean showQuestionTitle = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_QUESTIONTITLE); config.setShowQuestionTitle(showQuestionTitle == null ? true : showQuestionTitle); Boolean showSectionsOnly = (Boolean)moduleConfig.get(IQEditController.CONFIG_KEY_RENDERMENUOPTION); config.setShowSectionsOnly(showSectionsOnly == null ? false : showSectionsOnly); return Response.ok(config).build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSurveyConfiguration File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
getSurveyConfiguration
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
private void setBundledAppAbisAndRoots(PackageParser.Package pkg, PackageSetting pkgSetting) { final String apkName = deriveCodePathName(pkg.applicationInfo.getCodePath()); // If "/system/lib64/apkname" exists, assume that is the per-package // native library directory to use; otherwise use "/system/lib/apkname". final String apkRoot = calculateBundledApkRoot(pkg.applicationInfo.sourceDir); setBundledAppAbi(pkg, apkRoot, apkName); // pkgSetting might be null during rescan following uninstall of updates // to a bundled app, so accommodate that possibility. The settings in // that case will be established later from the parsed package. // // If the settings aren't null, sync them up with what we've just derived. // note that apkRoot isn't stored in the package settings. if (pkgSetting != null) { pkgSetting.primaryCpuAbiString = pkg.applicationInfo.primaryCpuAbi; pkgSetting.secondaryCpuAbiString = pkg.applicationInfo.secondaryCpuAbi; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBundledAppAbisAndRoots 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
setBundledAppAbisAndRoots
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
static final void dumpMemItems(PrintWriter pw, String prefix, String tag, ArrayList<MemItem> items, boolean sort, boolean isCompact, boolean dumpPss, boolean dumpSwapPss) { if (sort && !isCompact) { sortMemItems(items, dumpPss); } for (int i=0; i<items.size(); i++) { MemItem mi = items.get(i); if (!isCompact) { if (dumpPss && dumpSwapPss) { pw.printf("%s%s: %-60s (%s in swap)\n", prefix, stringifyKBSize(mi.pss), mi.label, stringifyKBSize(mi.swapPss)); } else { pw.printf("%s%s: %s\n", prefix, stringifyKBSize(dumpPss ? mi.pss : mi.mRss), mi.label); } } else if (mi.isProc) { pw.print("proc,"); pw.print(tag); pw.print(","); pw.print(mi.shortLabel); pw.print(","); pw.print(mi.id); pw.print(","); pw.print(dumpPss ? mi.pss : mi.mRss); pw.print(","); pw.print(dumpSwapPss ? mi.swapPss : "N/A"); pw.println(mi.hasActivities ? ",a" : ",e"); } else { pw.print(tag); pw.print(","); pw.print(mi.shortLabel); pw.print(","); pw.print(dumpPss ? mi.pss : mi.mRss); pw.print(","); pw.println(dumpSwapPss ? mi.swapPss : "N/A"); } if (mi.subitems != null) { dumpMemItems(pw, prefix + " ", mi.shortLabel, mi.subitems, true, isCompact, dumpPss, dumpSwapPss); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpMemItems 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
dumpMemItems
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private ApplicationCreatePage goToAppCreatePage(TestUtils testUtils, TestReference testReference) { // Register a simple user, login and go to the App Within Minutes home page. String userName = "SimpleUser"; String password = "SimplePassword"; testUtils.createUserAndLogin(userName, password); // Make sure the application location exists so that we can select it with the location picker. testUtils.createPage(Arrays.asList(getClass().getSimpleName(), testReference.getLastSpaceReference().getName()), "WebHome", null, null); AppWithinMinutesHomePage appWithinMinutesHomePage = AppWithinMinutesHomePage.gotoPage(); // Click the Create Application button. return appWithinMinutesHomePage.clickCreateApplication(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-29515 - Severity: MEDIUM - CVSS Score: 5.4 Description: XWIKI-20190: Properly handle AWM creation without script right * Warn when the user doesn't have script right. * Ensure that in integration tests the users have script right. * Add an explicit test for the behavior without script right. * Fix missing dependency. * Actually delete the preferences in AppsLiveTableIT. Function: goToAppCreatePage File: xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/WizardIT.java Repository: xwiki/xwiki-platform Fixed Code: private ApplicationCreatePage goToAppCreatePage(TestUtils testUtils, TestReference testReference) { // Login and go to the App Within Minutes home page. testUtils.login(USER_NAME, PASSWORD); // Make sure the application location exists so that we can select it with the location picker. testUtils.createPage(Arrays.asList(getClass().getSimpleName(), testReference.getLastSpaceReference().getName()), "WebHome", null, null); AppWithinMinutesHomePage appWithinMinutesHomePage = AppWithinMinutesHomePage.gotoPage(); // Click the Create Application button. return appWithinMinutesHomePage.clickCreateApplication(); }
[ "CWE-79" ]
CVE-2023-29515
MEDIUM
5.4
xwiki/xwiki-platform
goToAppCreatePage
xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/WizardIT.java
e73b890623efa604adc484ad82f37e31596fe1a6
1
Analyze the following code function for security vulnerabilities
public void writeUncachedStringResponse(VaadinResponse response, String contentType, String responseString) throws IOException { // Response might contain sensitive information, so prevent all forms of // caching response.setNoCacheHeaders(); writeStringResponse(response, contentType, responseString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeUncachedStringResponse File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
writeUncachedStringResponse
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
@Nullable PersistableBundle getPersistentSavedState() { return mPersistentState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPersistentSavedState 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
getPersistentSavedState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public float getX() { return x; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getX File: svg-core/src/main/java/com/kitfox/svg/ImageSVG.java Repository: blackears/svgSalamander The code follows secure coding practices.
[ "CWE-918" ]
CVE-2017-5617
MEDIUM
5.8
blackears/svgSalamander
getX
svg-core/src/main/java/com/kitfox/svg/ImageSVG.java
826555b0a3229b6cf4671fe4de7aa51b5946b63d
0
Analyze the following code function for security vulnerabilities
public static void delete(Path path) throws IOException { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { if (!attrs.isSymbolicLink()) { Files.delete(path); } return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: pf4j/src/main/java/org/pf4j/util/FileUtils.java Repository: pf4j The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-40827
HIGH
7.5
pf4j
delete
pf4j/src/main/java/org/pf4j/util/FileUtils.java
ed9392069fe14c6c30d9f876710e5ad40f7ea8c1
0
Analyze the following code function for security vulnerabilities
private URL getJnlpFileCodebase() { final URL codebase; if (file.getCodeBase() != null) { codebase = file.getCodeBase(); } else { // FIXME: codebase should be the codebase of the Main Jar not // the location. Although, it still works in the current state. codebase = file.getResources().getMainJAR().getLocation(); } return codebase; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJnlpFileCodebase File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getJnlpFileCodebase
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public boolean startNextMatchingActivity(IBinder callingActivity, Intent intent, Bundle options) { // Refuse possible leaked file descriptors if (intent != null && intent.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } synchronized (this) { final ActivityRecord r = ActivityRecord.isInStackLocked(callingActivity); if (r == null) { ActivityOptions.abort(options); return false; } if (r.app == null || r.app.thread == null) { // The caller is not running... d'oh! ActivityOptions.abort(options); return false; } intent = new Intent(intent); // The caller is not allowed to change the data. intent.setDataAndType(r.intent.getData(), r.intent.getType()); // And we are resetting to find the next component... intent.setComponent(null); final boolean debug = ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0); ActivityInfo aInfo = null; try { List<ResolveInfo> resolves = AppGlobals.getPackageManager().queryIntentActivities( intent, r.resolvedType, PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS, UserHandle.getCallingUserId()); // Look for the original activity in the list... final int N = resolves != null ? resolves.size() : 0; for (int i=0; i<N; i++) { ResolveInfo rInfo = resolves.get(i); if (rInfo.activityInfo.packageName.equals(r.packageName) && rInfo.activityInfo.name.equals(r.info.name)) { // We found the current one... the next matching is // after it. i++; if (i<N) { aInfo = resolves.get(i).activityInfo; } if (debug) { Slog.v(TAG, "Next matching activity: found current " + r.packageName + "/" + r.info.name); Slog.v(TAG, "Next matching activity: next is " + aInfo.packageName + "/" + aInfo.name); } break; } } } catch (RemoteException e) { } if (aInfo == null) { // Nobody who is next! ActivityOptions.abort(options); if (debug) Slog.d(TAG, "Next matching activity: nothing found"); return false; } intent.setComponent(new ComponentName( aInfo.applicationInfo.packageName, aInfo.name)); intent.setFlags(intent.getFlags()&~( Intent.FLAG_ACTIVITY_FORWARD_RESULT| Intent.FLAG_ACTIVITY_CLEAR_TOP| Intent.FLAG_ACTIVITY_MULTIPLE_TASK| Intent.FLAG_ACTIVITY_NEW_TASK)); // Okay now we need to start the new activity, replacing the // currently running activity. This is a little tricky because // we want to start the new one as if the current one is finished, // but not finish the current one first so that there is no flicker. // And thus... final boolean wasFinishing = r.finishing; r.finishing = true; // Propagate reply information over to the new activity. final ActivityRecord resultTo = r.resultTo; final String resultWho = r.resultWho; final int requestCode = r.requestCode; r.resultTo = null; if (resultTo != null) { resultTo.removeResultsLocked(r, resultWho, requestCode); } final long origId = Binder.clearCallingIdentity(); int res = mStackSupervisor.startActivityLocked(r.app.thread, intent, r.resolvedType, aInfo, null, null, resultTo != null ? resultTo.appToken : null, resultWho, requestCode, -1, r.launchedFromUid, r.launchedFromPackage, -1, r.launchedFromUid, 0, options, false, null, null, null); Binder.restoreCallingIdentity(origId); r.finishing = wasFinishing; if (res != ActivityManager.START_SUCCESS) { return false; } return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startNextMatchingActivity File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
startNextMatchingActivity
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void handleCdmaSubscriptionSource(int newSubscriptionSource) { log("Subscription Source : " + newSubscriptionSource); mIsSubscriptionFromRuim = (newSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM); log("isFromRuim: " + mIsSubscriptionFromRuim); saveCdmaSubscriptionSource(newSubscriptionSource); if (!mIsSubscriptionFromRuim) { // NV is ready when subscription source is NV sendMessage(obtainMessage(EVENT_NV_READY)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleCdmaSubscriptionSource File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
handleCdmaSubscriptionSource
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public String getVersionHashCode() { return this.doc.getVersionHashCode(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersionHashCode File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getVersionHashCode
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public boolean hasSectionEdit(XWikiContext context) { return getConfiguration().getProperty("xwiki.section.edit", 0) == 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasSectionEdit File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
hasSectionEdit
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public List<User> getAllUsers() { List<User> r = new ArrayList<User>(); for (User u : User.getAll()) { if(u.getProperty(Details.class)!=null) r.add(u); } Collections.sort(r); return r; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllUsers File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
getAllUsers
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
public final FilePath getWorkspace() { AbstractBuild b = getBuildForDeprecatedMethods(); return b != null ? b.getWorkspace() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWorkspace File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getWorkspace
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private static String getCanonicalJcaMessageDigestAlgorithm(String algorithm) { return UPPER_CASE_JCA_DIGEST_ALG_TO_CANONICAL.get(algorithm.toUpperCase(Locale.US)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCanonicalJcaMessageDigestAlgorithm File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getCanonicalJcaMessageDigestAlgorithm
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public void pending() { final List<ConnectionModel> connectionOnDBList = database .findConnectionModel(model.getId()); //inspect model can be resumed or not, if false, the previous sofar cannot be used inspectTaskModelResumeAvailableOnDB(connectionOnDBList); statusCallback.onPending(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pending File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
pending
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public static boolean deleteOlderFiles(File dir, int minCount, long minAgeMs) { if (minCount < 0 || minAgeMs < 0) { throw new IllegalArgumentException("Constraints must be positive or 0"); } final File[] files = dir.listFiles(); if (files == null) return false; // Sort with newest files first Arrays.sort(files, new Comparator<File>() { @Override public int compare(File lhs, File rhs) { return Long.compare(rhs.lastModified(), lhs.lastModified()); } }); // Keep at least minCount files boolean deleted = false; for (int i = minCount; i < files.length; i++) { final File file = files[i]; // Keep files newer than minAgeMs final long age = System.currentTimeMillis() - file.lastModified(); if (age > minAgeMs) { if (file.delete()) { Log.d(TAG, "Deleted old file " + file); deleted = true; } } } return deleted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteOlderFiles File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
deleteOlderFiles
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
void tearDownAgent(ApplicationInfo app) { if (mAgent != null) { try { // unbind and tidy up even on timeout or failure, just in case mActivityManager.unbindBackupAgent(app); // The agent was running with a stub Application object, so shut it down. // !!! We hardcode the confirmation UI's package name here rather than use a // manifest flag! TODO something less direct. if (app.uid != Process.SYSTEM_UID && !app.packageName.equals("com.android.backupconfirm")) { if (DEBUG) Slog.d(TAG, "Killing host process"); mActivityManager.killApplicationProcess(app.processName, app.uid); } else { if (DEBUG) Slog.d(TAG, "Not killing after full restore"); } } catch (RemoteException e) { Slog.d(TAG, "Lost app trying to shut down"); } mAgent = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tearDownAgent File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
tearDownAgent
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
boolean shouldUseCached(HttpServerRequest request) { String ifModifiedSince = request.headers().get("if-modified-since"); if (ifModifiedSince == null) { // Not a conditional request return false; } Date ifModifiedSinceDate = parseDate(ifModifiedSince); boolean modifiedSince = Utils.secondsFactor(props.lastModifiedTime()) > ifModifiedSinceDate.getTime(); return !modifiedSince; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUseCached File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
shouldUseCached
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
private void addRouterUsageStatistics() { if (UsageStatistics.getEntries().anyMatch( e -> Constants.STATISTIC_ROUTING_CLIENT.equals(e.getName()))) { UsageStatistics.removeEntry(Constants.STATISTIC_ROUTING_CLIENT); UsageStatistics.markAsUsed(Constants.STATISTIC_ROUTING_HYBRID, Version.getFullVersion()); } else if (UsageStatistics.getEntries() .noneMatch(e -> Constants.STATISTIC_FLOW_BOOTSTRAPHANDLER .equals(e.getName()))) { UsageStatistics.markAsUsed(Constants.STATISTIC_ROUTING_SERVER, Version.getFullVersion()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addRouterUsageStatistics File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
addRouterUsageStatistics
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Override public void cancelNotificationsFromListener(INotificationListener token, String[] keys) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); long identity = Binder.clearCallingIdentity(); try { synchronized (mNotificationList) { final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token); if (keys != null) { final int N = keys.length; for (int i = 0; i < N; i++) { NotificationRecord r = mNotificationsByKey.get(keys[i]); if (r == null) continue; final int userId = r.sbn.getUserId(); if (userId != info.userid && userId != UserHandle.USER_ALL && !mUserProfiles.isCurrentProfile(userId)) { throw new SecurityException("Disallowed call from listener: " + info.service); } cancelNotificationFromListenerLocked(info, callingUid, callingPid, r.sbn.getPackageName(), r.sbn.getTag(), r.sbn.getId(), userId); } } else { cancelAllLocked(callingUid, callingPid, info.userid, REASON_LISTENER_CANCEL_ALL, info, info.supportsProfiles()); } } } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelNotificationsFromListener 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
cancelNotificationsFromListener
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private void processPluginConfigs(PluginsType xmlPlugins, PackageType xmlPackage, PluginPackages pluginPackageEntity) { if (xmlPlugins == null) { return; } List<PluginType> xmlPluginList = xmlPlugins.getPlugin(); if (xmlPluginList == null || xmlPluginList.isEmpty()) { return; } for (PluginType xmlPlugin : xmlPluginList) { processSinglePlugin(xmlPlugin, pluginPackageEntity, xmlPackage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processPluginConfigs File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
processPluginConfigs
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0