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
@Override public boolean setWifiConnectedNetworkScorer(IBinder binder, IWifiConnectedNetworkScorer scorer) { return mWifiScoreReport.setWifiConnectedNetworkScorer(binder, scorer); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWifiConnectedNetworkScorer File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
setWifiConnectedNetworkScorer
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInline() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInline File: xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/DocumentContentAsyncRenderer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
isInline
xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/DocumentContentAsyncRenderer.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@Override public void onReference(WikiReference reference) { // We need to handle 2 cases: // - when the passed reference is an instance of XWikiWikiReference, i.e. when a XHTML comment defining a XWiki // link has been specified and the XHTML parser has recognized it and thus is passing a typed reference to us. // - when the passed reference is not an instance of XWikiWikiReference which will happen if there's no special // XHTML comment defining a XWiki link. In this case, we need to figure out what how to consider the passed // reference. ResourceReference resourceReference; boolean isFreeStanding; if (!(reference instanceof XWikiWikiReference)) { resourceReference = computeResourceReference(reference.getLink()); isFreeStanding = false; } else { XWikiWikiReference xwikiReference = (XWikiWikiReference) reference; resourceReference = xwikiReference.getReference(); isFreeStanding = xwikiReference.isFreeStanding(); flushFormat(); } // Consider query string and anchor as ResourceReference parameters and the rest as generic parameters Pair<Map<String, String>, Map<String, String>> parameters = convertAndSeparateParameters(reference.getParameters()); resourceReference.setParameters(parameters.getLeft()); onReference(resourceReference, reference.getLabel(), isFreeStanding, parameters.getRight(), false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onReference File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
onReference
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") void updateSleepIfNeededLocked() { final boolean shouldSleep = !mStackSupervisor.hasAwakeDisplay(); final boolean wasSleeping = mSleeping; if (!shouldSleep) { // If wasSleeping is true, we need to wake up activity manager state from when // we started sleeping. In either case, we need to apply the sleep tokens, which // will wake up stacks or put them to sleep as appropriate. if (wasSleeping) { mSleeping = false; startTimeTrackingFocusedActivityLocked(); mTopProcessState = ActivityManager.PROCESS_STATE_TOP; mStackSupervisor.comeOutOfSleepIfNeededLocked(); } mStackSupervisor.applySleepTokensLocked(true /* applyToStacks */); if (wasSleeping) { updateOomAdjLocked(); } } else if (!mSleeping && shouldSleep) { mSleeping = true; if (mCurAppTimeTracker != null) { mCurAppTimeTracker.stop(); } mTopProcessState = ActivityManager.PROCESS_STATE_TOP_SLEEPING; mStackSupervisor.goingToSleepLocked(); updateResumedAppTrace(null /* resumed */); updateOomAdjLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSleepIfNeededLocked 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
updateSleepIfNeededLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private String getOemDefaultSmsPackage() { return mContext.getString(R.string.config_defaultSms); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOemDefaultSmsPackage 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
getOemDefaultSmsPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static String getScopeNamesbyKey(String scopeKey, Set<Scope> availableScopeSet) { //convert scope keys to names StringBuilder scopeBuilder = new StringBuilder(""); String prodKeyScope; if (scopeKey.equals(APIConstants.OAUTH2_DEFAULT_SCOPE)) { scopeBuilder.append("Default "); } else { List<String> inputScopeList = new ArrayList<String>(Arrays.asList(scopeKey.split(" "))); String scopeName = ""; for (String inputScope : inputScopeList) { for (Scope availableScope : availableScopeSet) { if (availableScope.getKey().equals(inputScope)) { scopeName = availableScope.getName(); break; } } if(scopeName != null && !scopeName.isEmpty()) { scopeBuilder.append(scopeName); scopeBuilder.append(", "); scopeName = ""; } } } prodKeyScope = scopeBuilder.toString(); if(prodKeyScope.length() > 1) { prodKeyScope = prodKeyScope.substring(0, prodKeyScope.length() - 2); } return prodKeyScope; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getScopeNamesbyKey File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
getScopeNamesbyKey
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection) throws DatabaseServiceException { try { // logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection); if (connection != null && !forceNewConnection) { // logger.debug("connection closed::{}", connection.isClosed()); if (!connection.isClosed()) { if (logger.isDebugEnabled()) { logger.debug("Returning existing connection::{}", connection); } return connection; } } Class.forName(type.getClassPath()); DriverManager.setLoginTimeout(10); String dbURL = getDatabaseUrl(databaseConfiguration); connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(), databaseConfiguration.getDatabasePassword()); if (logger.isDebugEnabled()) { logger.debug("*** Acquired New connection for ::{} **** ", dbURL); } return connection; } catch (ClassNotFoundException e) { logger.error("Jdbc Driver not found", e); throw new DatabaseServiceException(e.getMessage()); } catch (SQLException e) { logger.error("SQLException::Couldn't get a Connection!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-41887 - Severity: CRITICAL - CVSS Score: 9.8 Description: Properly escape JDBC URL components in database extension Function: getConnection File: extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java Repository: OpenRefine Fixed Code: public Connection getConnection(DatabaseConfiguration databaseConfiguration, boolean forceNewConnection) throws DatabaseServiceException { try { // logger.info("connection::{}, forceNewConnection: {}", connection, forceNewConnection); if (connection != null && !forceNewConnection) { // logger.debug("connection closed::{}", connection.isClosed()); if (!connection.isClosed()) { if (logger.isDebugEnabled()) { logger.debug("Returning existing connection::{}", connection); } return connection; } } Class.forName(type.getClassPath()); DriverManager.setLoginTimeout(10); String dbURL = databaseConfiguration.toURI().toString(); connection = DriverManager.getConnection(dbURL, databaseConfiguration.getDatabaseUser(), databaseConfiguration.getDatabasePassword()); if (logger.isDebugEnabled()) { logger.debug("*** Acquired New connection for ::{} **** ", dbURL); } return connection; } catch (ClassNotFoundException e) { logger.error("Jdbc Driver not found", e); throw new DatabaseServiceException(e.getMessage()); } catch (SQLException e) { logger.error("SQLException::Couldn't get a Connection!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
[ "CWE-89" ]
CVE-2023-41887
CRITICAL
9.8
OpenRefine
getConnection
extensions/database/src/com/google/refine/extension/database/mariadb/MariaDBConnectionManager.java
693fde606d4b5b78b16391c29d110389eb605511
1
Analyze the following code function for security vulnerabilities
@Override public void listen() { this.listenerThread = Thread.currentThread(); try { while (serverSocket != null) { Socket s = serverSocket.accept(); WebThread c = new WebThread(s, this); running.add(c); c.start(); } } catch (Exception e) { trace(e.toString()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listen File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
listen
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public List<DocumentSymbol> findDocumentSymbols(DOMDocument xmlDocument, CancelChecker cancelChecker) { return symbolsProvider.findDocumentSymbols(xmlDocument, cancelChecker); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findDocumentSymbols File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
findDocumentSymbols
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
XmlGenerator node(String name, Object contents, Object... attributes) { appendNode(xml, name, contents, attributes); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: node File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
node
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override boolean isEligibleForNewTasks() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEligibleForNewTasks File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
isEligibleForNewTasks
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public void remove() { if (currentNode_ == null) { throw new IllegalStateException("Unable to remove current node, because there is no current node."); } final DomNode current = currentNode_; while (nextNode_ != null && current.isAncestorOf(nextNode_)) { next(); } current.remove(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remove File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
remove
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
public Item getItem(File file, final FollowLinkType followlinks, List<String> followedLinkPaths ) throws FileIOException { try { Path path = file.toPath(); ItemType type; if (Files.isSymbolicLink(path)) { String target; target = Files.readSymbolicLink(path).toString(); final String firstChar = target.substring(0, 1); if (!firstChar.equals(Item.SEPARATOR)) { if (!firstChar.equals(".")) { target = "." + Item.SEPARATOR + target; } target = path.toString() + Item.SEPARATOR + target; } target = Paths.get(target).toFile().getCanonicalPath(); if (!followlinks.equals(FollowLinkType.NONE) && followlinks.equals(FollowLinkType.EXTERNAL) && !target.startsWith(localPath + Item.SEPARATOR) ) { boolean foundLink = false; for( String followedLinkPath: followedLinkPaths ) { // 1. if the link target is a child of a already followed link, then there is no need to follow again // 2. and the target should not be equal with a already followed link. Otherwise we are requesting the same item again. So we have to follow. if( target.startsWith(followedLinkPath) && !target.equals(followedLinkPath) ) { foundLink = true; break; } } if( !foundLink ) { final Path targetPath = Paths.get(target); if (Files.exists(targetPath, LinkOption.NOFOLLOW_LINKS)) { path = targetPath; followedLinkPaths.add(target); } } } } BasicFileAttributes basic_attr = Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); final Long filesize = basic_attr.size(); final FileTime creationTime = basic_attr.creationTime(); final FileTime modifyTime = basic_attr.lastModifiedTime(); final FileTime accessTime = basic_attr.lastAccessTime(); if (basic_attr.isDirectory()) { type = ItemType.FOLDER; } else if (basic_attr.isRegularFile()) { type = ItemType.FILE; } else if (basic_attr.isSymbolicLink()) { type = ItemType.LINK; } else { type = ItemType.UNKNOWN; } Map<String, String[]> attributes = new HashMap<>(); PosixFileAttributeView posixView = Files.getFileAttributeView(path, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (posixView != null) { final PosixFileAttributes attr = posixView.readAttributes(); if (type.equals(ItemType.LINK)) { attributes.put(Item.ATTRIBUTE_POSIX, new String[] { attr.group().getName(), attr.owner().getName() }); } else { attributes.put(Item.ATTRIBUTE_POSIX, new String[] { attr.group().getName(), attr.owner().getName(), fromPermissions(attr.permissions()).toString() }); } } else { DosFileAttributeView dosView = Files.getFileAttributeView(path, DosFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (dosView != null) { final DosFileAttributes attr = dosView.readAttributes(); attributes.put(Item.ATTRIBUTE_DOS, new String[] { attr.isArchive() ? "1" : "0", attr.isHidden() ? "1" : "0", attr.isReadOnly() ? "1" : "0", attr.isSystem() ? "1" : "0" }); } } if (!type.equals(ItemType.LINK)) { AclFileAttributeView aclView = Files.getFileAttributeView(path, AclFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (aclView != null) { if (!attributes.containsKey(Item.ATTRIBUTE_POSIX)) attributes.put(Item.ATTRIBUTE_OWNER, new String[] { aclView.getOwner().getName() }); AclFileAttributeView parentAclView = Files.getFileAttributeView(path.getParent(), AclFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); List<AclEntry> aclList = getLocalAclEntries(type, parentAclView.getAcl(), aclView.getAcl()); if (aclList.size() > 0) { List<String> aclData = new ArrayList<>(); for (AclEntry acl : aclList) { List<String> flags = new ArrayList<>(); for (AclEntryFlag flag : acl.flags()) { flags.add(flag.name()); } List<String> permissions = new ArrayList<>(); for (AclEntryPermission permission : acl.permissions()) { permissions.add(permission.name()); } aclData.add(acl.type().name()); aclData.add(acl.principal().getName()); aclData.add(StringUtils.join(flags, ",")); aclData.add(StringUtils.join(permissions, ",")); } String[] arr = new String[aclData.size()]; arr = aclData.toArray(arr); attributes.put(Item.ATTRIBUTE_ACL, arr); } } else if (!attributes.containsKey(Item.ATTRIBUTE_POSIX)) { FileOwnerAttributeView ownerView = Files.getFileAttributeView(path, FileOwnerAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (ownerView != null) { attributes.put(Item.ATTRIBUTE_OWNER, new String[] { ownerView.getOwner().getName() }); } } } return Item.fromLocalData(file.getName(), type, filesize, creationTime, modifyTime, accessTime, attributes); } catch (final IOException e) { throw new FileIOException("Can't read attributes of '" + file.getAbsolutePath() + "'", e); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2022-4773 - Severity: LOW - CVSS Score: 3.3 Description: vuln-fix: Partial Path Traversal Vulnerability This fixes a partial path traversal vulnerability. Replaces `dir.getCanonicalPath().startsWith(parent.getCanonicalPath())`, which is vulnerable to partial path traversal attacks, with the more secure `dir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())`. To demonstrate this vulnerability, consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. For example, on Linux, `println(new File("/var"))` will print `/var`, but `println(new File("/var", "/")` will print `/var/`; however, `println(new File("/var", "/").getCanonicalPath())` will print `/var`. Weakness: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Severity: Medium CVSSS: 6.1 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.PartialPathTraversalVulnerability) Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/13 Co-authored-by: Moderne <team@moderne.io> Function: getItem File: src/main/java/cloudsync/connector/LocalFilesystemConnector.java Repository: HolgerHees/cloudsync Fixed Code: public Item getItem(File file, final FollowLinkType followlinks, List<String> followedLinkPaths ) throws FileIOException { try { Path path = file.toPath(); ItemType type; if (Files.isSymbolicLink(path)) { String target; target = Files.readSymbolicLink(path).toString(); final String firstChar = target.substring(0, 1); if (!firstChar.equals(Item.SEPARATOR)) { if (!firstChar.equals(".")) { target = "." + Item.SEPARATOR + target; } target = path.toString() + Item.SEPARATOR + target; } target = Paths.get(target).toFile().getCanonicalPath(); if (!followlinks.equals(FollowLinkType.NONE) && followlinks.equals(FollowLinkType.EXTERNAL) && !Paths.get(target).toFile().getCanonicalFile().toPath().startsWith(localPath + Item.SEPARATOR) ) { boolean foundLink = false; for( String followedLinkPath: followedLinkPaths ) { // 1. if the link target is a child of a already followed link, then there is no need to follow again // 2. and the target should not be equal with a already followed link. Otherwise we are requesting the same item again. So we have to follow. if( target.startsWith(followedLinkPath) && !target.equals(followedLinkPath) ) { foundLink = true; break; } } if( !foundLink ) { final Path targetPath = Paths.get(target); if (Files.exists(targetPath, LinkOption.NOFOLLOW_LINKS)) { path = targetPath; followedLinkPaths.add(target); } } } } BasicFileAttributes basic_attr = Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); final Long filesize = basic_attr.size(); final FileTime creationTime = basic_attr.creationTime(); final FileTime modifyTime = basic_attr.lastModifiedTime(); final FileTime accessTime = basic_attr.lastAccessTime(); if (basic_attr.isDirectory()) { type = ItemType.FOLDER; } else if (basic_attr.isRegularFile()) { type = ItemType.FILE; } else if (basic_attr.isSymbolicLink()) { type = ItemType.LINK; } else { type = ItemType.UNKNOWN; } Map<String, String[]> attributes = new HashMap<>(); PosixFileAttributeView posixView = Files.getFileAttributeView(path, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (posixView != null) { final PosixFileAttributes attr = posixView.readAttributes(); if (type.equals(ItemType.LINK)) { attributes.put(Item.ATTRIBUTE_POSIX, new String[] { attr.group().getName(), attr.owner().getName() }); } else { attributes.put(Item.ATTRIBUTE_POSIX, new String[] { attr.group().getName(), attr.owner().getName(), fromPermissions(attr.permissions()).toString() }); } } else { DosFileAttributeView dosView = Files.getFileAttributeView(path, DosFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (dosView != null) { final DosFileAttributes attr = dosView.readAttributes(); attributes.put(Item.ATTRIBUTE_DOS, new String[] { attr.isArchive() ? "1" : "0", attr.isHidden() ? "1" : "0", attr.isReadOnly() ? "1" : "0", attr.isSystem() ? "1" : "0" }); } } if (!type.equals(ItemType.LINK)) { AclFileAttributeView aclView = Files.getFileAttributeView(path, AclFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (aclView != null) { if (!attributes.containsKey(Item.ATTRIBUTE_POSIX)) attributes.put(Item.ATTRIBUTE_OWNER, new String[] { aclView.getOwner().getName() }); AclFileAttributeView parentAclView = Files.getFileAttributeView(path.getParent(), AclFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); List<AclEntry> aclList = getLocalAclEntries(type, parentAclView.getAcl(), aclView.getAcl()); if (aclList.size() > 0) { List<String> aclData = new ArrayList<>(); for (AclEntry acl : aclList) { List<String> flags = new ArrayList<>(); for (AclEntryFlag flag : acl.flags()) { flags.add(flag.name()); } List<String> permissions = new ArrayList<>(); for (AclEntryPermission permission : acl.permissions()) { permissions.add(permission.name()); } aclData.add(acl.type().name()); aclData.add(acl.principal().getName()); aclData.add(StringUtils.join(flags, ",")); aclData.add(StringUtils.join(permissions, ",")); } String[] arr = new String[aclData.size()]; arr = aclData.toArray(arr); attributes.put(Item.ATTRIBUTE_ACL, arr); } } else if (!attributes.containsKey(Item.ATTRIBUTE_POSIX)) { FileOwnerAttributeView ownerView = Files.getFileAttributeView(path, FileOwnerAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (ownerView != null) { attributes.put(Item.ATTRIBUTE_OWNER, new String[] { ownerView.getOwner().getName() }); } } } return Item.fromLocalData(file.getName(), type, filesize, creationTime, modifyTime, accessTime, attributes); } catch (final IOException e) { throw new FileIOException("Can't read attributes of '" + file.getAbsolutePath() + "'", e); } }
[ "CWE-22" ]
CVE-2022-4773
LOW
3.3
HolgerHees/cloudsync
getItem
src/main/java/cloudsync/connector/LocalFilesystemConnector.java
3ad796833398af257c28e0ebeade68518e0e612a
1
Analyze the following code function for security vulnerabilities
public String parseTemplate(String template) { return this.xwiki.parseTemplate(template, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTemplate File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
parseTemplate
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
ArrayList<ActivityStack> getStacks() { ArrayList<ActivityStack> allStacks = new ArrayList<ActivityStack>(); for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { allStacks.addAll(mActivityDisplays.valueAt(displayNdx).mStacks); } return allStacks; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStacks File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getStacks
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public JsonBuilder append(final Object[] oArray) { sb.append(" ["); // begin array String separator = ""; for (final Object obj : oArray) { sb.append(separator); separator = ","; sb.append(escapeString(formatValue(obj))); } sb.append("]"); // end array return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: append File: src/main/java/org/projectforge/web/core/JsonBuilder.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-7250
LOW
3.5
micromata/projectforge-webapp
append
src/main/java/org/projectforge/web/core/JsonBuilder.java
5a6a25366491443b76e528a04a9e4ba26f08a83c
0
Analyze the following code function for security vulnerabilities
protected void internalDeleteTopicForcefully(boolean authoritative, boolean deleteSchema) { validateTopicOwnership(topicName, authoritative); validateNamespaceOperation(topicName.getNamespaceObject(), NamespaceOperation.DELETE_TOPIC); try { pulsar().getBrokerService().deleteTopic(topicName.toString(), true, deleteSchema).get(); } catch (Exception e) { if (e.getCause() instanceof MetadataNotFoundException) { log.info("[{}] Topic was already not existing {}", clientAppId(), topicName, e); } else { log.error("[{}] Failed to delete topic forcefully {}", clientAppId(), topicName, e); throw new RestException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalDeleteTopicForcefully File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalDeleteTopicForcefully
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public static void rename(File fileNow, File fileToBe) { if (fileNow.renameTo(fileToBe)) { return; } if (!fileNow.exists()) { throw new HazelcastException(format("Failed to rename %s to %s because %s doesn't exist.", fileNow, fileToBe, fileNow)); } if (!fileToBe.exists()) { throw new HazelcastException(format("Failed to rename %s to %s even though %s doesn't exist.", fileNow, fileToBe, fileToBe)); } if (!fileToBe.delete()) { throw new HazelcastException(format("Failed to rename %s to %s. %s exists and could not be deleted.", fileNow, fileToBe, fileToBe)); } if (!fileNow.renameTo(fileToBe)) { throw new HazelcastException(format("Failed to rename %s to %s even after deleting %s.", fileNow, fileToBe, fileToBe)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
rename
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected String[] splitTransformationConfig(String transformation) { Matcher matcher = EXTRACT_FUNCTION_PATTERN.matcher(transformation); if (!matcher.matches()) { throw new IllegalArgumentException("given transformation function '" + transformation + "' does not follow the expected pattern '<function>(<pattern>)'"); } matcher.reset(); matcher.find(); String type = matcher.group(1); String pattern = matcher.group(2); return new String[] { type, pattern }; }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2020-5242 - Severity: HIGH - CVSS Score: 9.3 Description: Merge pull request from GHSA-w698-693g-23hv * fix arbitrary code execution vulnerability Signed-off-by: Jan N. Klug <jan.n.klug@rub.de> * Update bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de> * address review comments Signed-off-by: Jan N. Klug <jan.n.klug@rub.de> Co-authored-by: Christoph Weitkamp <github@christophweitkamp.de> Function: splitTransformationConfig File: bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java Repository: openhab/openhab-addons Fixed Code: protected String[] splitTransformationConfig(String transformation) { Matcher matcher = EXTRACT_FUNCTION_PATTERN.matcher(transformation); if (!matcher.matches()) { throw new IllegalArgumentException( "given transformation function '" + transformation + "' does not follow the expected pattern '<function>(<pattern>)'"); } matcher.reset(); matcher.find(); String type = matcher.group(1); String pattern = matcher.group(2); return new String[] { type, pattern }; }
[ "CWE-863" ]
CVE-2020-5242
HIGH
9.3
openhab/openhab-addons
splitTransformationConfig
bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
1
Analyze the following code function for security vulnerabilities
private UserReferenceResolver<DocumentReference> getUserReferenceDocumentReferenceResolver() { return Utils.getComponent(UserReferenceResolver.TYPE_DOCUMENT_REFERENCE, "document"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserReferenceDocumentReferenceResolver 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
getUserReferenceDocumentReferenceResolver
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
public void setBackLabel(String backLabel) { _backLabel = backLabel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBackLabel File: util-taglib/src/com/liferay/taglib/ui/HeaderTag.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
setBackLabel
util-taglib/src/com/liferay/taglib/ui/HeaderTag.java
bd92daa70ab77a40eff0eb18e8e91f3e095694e1
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInEmergencyCall() { try { Log.startSession("TSI.iIEC"); enforceModifyPermission(); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { boolean isInEmergencyCall = mCallsManager.isInEmergencyCall(); Log.i(this, "isInEmergencyCall: %b", isInEmergencyCall); return isInEmergencyCall; } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInEmergencyCall File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
isInEmergencyCall
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private native boolean sspReplyNative(byte[] address, int type, boolean accept, int passkey);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sspReplyNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
sspReplyNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public boolean isInMultiWindowMode(IBinder token) { final long origId = Binder.clearCallingIdentity(); try { synchronized(this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return false; } // An activity is consider to be in multi-window mode if its task isn't fullscreen. return !r.task.mFullscreen; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInMultiWindowMode File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
isInMultiWindowMode
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private void setAuthors(SolrInputDocument solrDocument, XWikiDocument translatedDocument) { XWikiContext xcontext = this.xcontextProvider.get(); DocumentAuthors authors = translatedDocument.getAuthors(); UserReference originalAuthor = authors.getOriginalMetadataAuthor(); String authorString = this.userReferenceSerializer.serialize(originalAuthor); solrDocument.setField(FieldUtils.AUTHOR, authorString); String authorDisplayString = xcontext.getWiki().getPlainUserName( this.documentReferenceUserReferenceSerializer.serialize(originalAuthor), xcontext); solrDocument.setField(FieldUtils.AUTHOR_DISPLAY, authorDisplayString); UserReference creator = authors.getCreator(); String creatorString = this.userReferenceSerializer.serialize(creator); solrDocument.setField(FieldUtils.CREATOR, creatorString); String creatorDisplayString = xcontext.getWiki().getPlainUserName( this.documentReferenceUserReferenceSerializer.serialize(creator), xcontext); solrDocument.setField(FieldUtils.CREATOR_DISPLAY, creatorDisplayString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAuthors File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/DocumentSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
setAuthors
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/DocumentSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public void setIdentity(String identity) { setFieldValue(IDENTITY_KEY, identity, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIdentity File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
setIdentity
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private boolean needsNetworkVerificationLPr(ActivityIntentInfo filter) { final ComponentName cn = filter.activity.getComponentName(); final String packageName = cn.getPackageName(); IntentFilterVerificationInfo ivi = mSettings.getIntentFilterVerificationLPr( packageName); if (ivi == null) { return true; } int status = ivi.getStatus(); switch (status) { case INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED: case INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK: return true; default: // Nothing to do return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsNetworkVerificationLPr 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
needsNetworkVerificationLPr
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@JsonIgnore public Map<String, String> getAttributes() { return attributes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributes File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getAttributes
base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public static String getHostHeader(final HttpServletRequest request) { for (int i = 0; i < hostHeaders.length; ++i) { // Get the first value in the header (support for proxy-chaining) final String header = request.getHeader(hostHeaders[i]); if (header != null) { final String[] values = header.split(", *"); if (values.length >= 1) { return values[0]; } } } return request.getServerName() + ":" + Integer.toString(request.getServerPort()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHostHeader File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-0869
MEDIUM
6.1
OpenNMS/opennms
getHostHeader
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
66b4ba96a18b9952f25a350bbccc2a7e206238d1
0
Analyze the following code function for security vulnerabilities
private static void writeBundle(Bundle restrictions, XmlSerializer serializer) throws IOException { for (String key : restrictions.keySet()) { Object value = restrictions.get(key); serializer.startTag(null, TAG_ENTRY); serializer.attribute(null, ATTR_KEY, key); if (value instanceof Boolean) { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_BOOLEAN); serializer.text(value.toString()); } else if (value instanceof Integer) { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_INTEGER); serializer.text(value.toString()); } else if (value == null || value instanceof String) { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_STRING); serializer.text(value != null ? (String) value : ""); } else if (value instanceof Bundle) { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_BUNDLE); writeBundle((Bundle) value, serializer); } else if (value instanceof Parcelable[]) { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_BUNDLE_ARRAY); Parcelable[] array = (Parcelable[]) value; for (Parcelable parcelable : array) { if (!(parcelable instanceof Bundle)) { throw new IllegalArgumentException("bundle-array can only hold Bundles"); } serializer.startTag(null, TAG_ENTRY); serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_BUNDLE); writeBundle((Bundle) parcelable, serializer); serializer.endTag(null, TAG_ENTRY); } } else { serializer.attribute(null, ATTR_VALUE_TYPE, ATTR_TYPE_STRING_ARRAY); String[] values = (String[]) value; serializer.attribute(null, ATTR_MULTIPLE, Integer.toString(values.length)); for (String choice : values) { serializer.startTag(null, TAG_VALUE); serializer.text(choice != null ? choice : ""); serializer.endTag(null, TAG_VALUE); } } serializer.endTag(null, TAG_ENTRY); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeBundle 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
writeBundle
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private void writeZipFile(Path tmpDir) throws IOException { var zipFile = Path.of("." + BUNDLE_NAME_PREFIX + "-" + nowTimestamp() + ".zip"); try (ZipOutputStream zipStream = new ZipOutputStream(new FileOutputStream(bundleDir.resolve(zipFile).toFile()))) { try (final Stream<Path> walk = Files.walk(tmpDir)) { walk.filter(p -> !Files.isDirectory(p)).forEach(p -> { var zipEntry = new ZipEntry(tmpDir.relativize(p).toString()); try { zipStream.putNextEntry(zipEntry); Files.copy(p, zipStream); zipStream.closeEntry(); } catch (IOException e) { LOG.warn("Failure while creating ZipEntry <{}>", zipEntry, e); } }); } } catch (Exception e) { Files.delete(zipFile); LOG.warn("Failed to create zipfile <{}>", zipFile, e); throw e; } Files.move(bundleDir.resolve(zipFile), bundleDir.resolve(Path.of(zipFile.toString().substring(1)))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeZipFile File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
writeZipFile
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
public String getRealm() { return getFieldValue(REALM_KEY, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRealm File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getRealm
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
private void migrate13(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { try { String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8); content = StringUtils.replace(content, "gitplex", "turbodev"); content = StringUtils.replace(content, "GitPlex", "TurboDev"); FileUtils.writeFile(file, content, StandardCharsets.UTF_8.name()); } catch (IOException e) { throw new RuntimeException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate13 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate13
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getAssistContextExtras(int requestType) { PendingAssistExtras pae = enqueueAssistContext(requestType, null, null, null, null, UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_TIMEOUT); if (pae == null) { return null; } synchronized (pae) { while (!pae.haveResult) { try { pae.wait(); } catch (InterruptedException e) { } } } synchronized (this) { buildAssistBundleLocked(pae, pae.result); mPendingAssistExtras.remove(pae); mUiHandler.removeCallbacks(pae); } return pae.extras; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssistContextExtras File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
getAssistContextExtras
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static final native void setThreadGroup(int tid, int group) throws IllegalArgumentException, SecurityException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setThreadGroup File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
setThreadGroup
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
public void saveBatch(String table, JsonArray entities, Handler<AsyncResult<ResultSet>> replyHandler) { saveBatch(table, entities, DEFAULT_JSONB_FIELD_NAME, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveBatch File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
saveBatch
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public ProcessEngine getProcessEngine() { return processEngine; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessEngine File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
getProcessEngine
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
private @Nullable List<String> getPermittedInputMethodsUnchecked(@UserIdInt int userId) { synchronized (getLockObject()) { List<String> result = null; // Only device or profile owners can have permitted lists set. List<ActiveAdmin> admins = getActiveAdminsForAffectedUserLocked(userId); for (ActiveAdmin admin: admins) { List<String> fromAdmin = admin.permittedInputMethods; if (fromAdmin != null) { if (result == null) { result = new ArrayList<String>(fromAdmin); } else { result.retainAll(fromAdmin); } } } // If we have a permitted list add all system input methods. if (result != null) { List<InputMethodInfo> imes = InputMethodManagerInternal .get().getInputMethodListAsUser(userId); if (imes != null) { for (InputMethodInfo ime : imes) { ServiceInfo serviceInfo = ime.getServiceInfo(); ApplicationInfo applicationInfo = serviceInfo.applicationInfo; if ((applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { result.add(serviceInfo.packageName); } } } } return result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedInputMethodsUnchecked 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
getPermittedInputMethodsUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public float getSecondaryHorizontal(int offset) { return getSecondaryHorizontal(offset, false /* not clamped */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecondaryHorizontal File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getSecondaryHorizontal
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
@Nullable public String getEntity() { return entity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEntity File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getEntity
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 document() { return new XMLBuilder2(getDocument(), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: document File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
document
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
void onPostDialContinue(Call call, boolean proceed) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("onPostDialContinue")) { try { logOutgoing("onPostDialContinue %s %b", callId, proceed); mServiceInterface.onPostDialContinue(callId, proceed, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException ignored) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPostDialContinue File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
onPostDialContinue
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override boolean check(QuorumConfig c1, QuorumConfig c2) { if (c1 == c2) { return true; } if (c1 == null || c2 == null) { return false; } return ((c1.isEnabled() == c2.isEnabled()) && nullSafeEqual(c1.getName(), c2.getName()) && nullSafeEqual(c1.getType(), c2.getType()) && (c1.getSize() == c2.getSize()) && nullSafeEqual(c1.getQuorumFunctionClassName(), c2.getQuorumFunctionClassName()) && nullSafeEqual(c1.getQuorumFunctionImplementation(), c2.getQuorumFunctionImplementation()) && nullSafeEqual(c1.getListenerConfigs(), c2.getListenerConfigs())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public void selectSingle(AsyncResult<SQLConnection> conn, String sql, Handler<AsyncResult<JsonArray>> replyHandler) { try { if (conn.failed()) { replyHandler.handle(Future.failedFuture(conn.cause())); return; } conn.result().querySingle(sql, replyHandler); } catch (Exception e) { log.error("select single sql: " + e.getMessage() + " - " + sql, e); replyHandler.handle(Future.failedFuture(e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectSingle File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
selectSingle
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public boolean onKeyUp(int keyCode, KeyEvent event) { if (mPopupZoomer.isShowing() && keyCode == KeyEvent.KEYCODE_BACK) { mPopupZoomer.hide(true); return true; } return mContainerViewInternals.super_onKeyUp(keyCode, event); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKeyUp 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
onKeyUp
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void runPostCollapseRunnables() { ArrayList<Runnable> clonedList = new ArrayList<>(mPostCollapseRunnables); mPostCollapseRunnables.clear(); int size = clonedList.size(); for (int i = 0; i < size; i++) { clonedList.get(i).run(); } mStatusBarKeyguardViewManager.readyForKeyguardDone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runPostCollapseRunnables 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
runPostCollapseRunnables
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void connectUsingConfiguration() throws ConnectionException, IOException { List<HostAddress> failedAddresses = populateHostAddresses(); SocketFactory socketFactory = config.getSocketFactory(); ProxyInfo proxyInfo = config.getProxyInfo(); int timeout = config.getConnectTimeout(); if (socketFactory == null) { socketFactory = SocketFactory.getDefault(); } for (HostAddress hostAddress : hostAddresses) { Iterator<InetAddress> inetAddresses = null; String host = hostAddress.getFQDN(); int port = hostAddress.getPort(); if (proxyInfo == null) { inetAddresses = hostAddress.getInetAddresses().iterator(); assert(inetAddresses.hasNext()); innerloop: while (inetAddresses.hasNext()) { // Create a *new* Socket before every connection attempt, i.e. connect() call, since Sockets are not // re-usable after a failed connection attempt. See also SMACK-724. socket = socketFactory.createSocket(); final InetAddress inetAddress = inetAddresses.next(); final String inetAddressAndPort = inetAddress + " at port " + port; LOGGER.finer("Trying to establish TCP connection to " + inetAddressAndPort); try { socket.connect(new InetSocketAddress(inetAddress, port), timeout); } catch (Exception e) { hostAddress.setException(inetAddress, e); if (inetAddresses.hasNext()) { continue innerloop; } else { break innerloop; } } LOGGER.finer("Established TCP connection to " + inetAddressAndPort); // We found a host to connect to, return here this.host = host; this.port = port; return; } failedAddresses.add(hostAddress); } else { final String hostAndPort = host + " at port " + port; LOGGER.finer("Trying to establish TCP connection via Proxy to " + hostAndPort); try { proxyInfo.getProxySocketConnection().connect(socket, host, port, timeout); } catch (IOException e) { hostAddress.setException(e); continue; } LOGGER.finer("Established TCP connection to " + hostAndPort); // We found a host to connect to, return here this.host = host; this.port = port; return; } } // There are no more host addresses to try // throw an exception and report all tried // HostAddresses in the exception throw ConnectionException.from(failedAddresses); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectUsingConfiguration File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
connectUsingConfiguration
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public String getCommentsModeration() { return commentsModeration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommentsModeration File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
getCommentsModeration
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
@Override public boolean killProcessesBelowForeground(String reason) { if (Binder.getCallingUid() != Process.SYSTEM_UID) { throw new SecurityException("killProcessesBelowForeground() only available to system"); } return killProcessesBelowAdj(ProcessList.FOREGROUND_APP_ADJ, reason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killProcessesBelowForeground 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
killProcessesBelowForeground
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder tlsCustomizer(Consumer<? super SslContextBuilder> tlsCustomizer) { virtualHostTemplate.tlsCustomizer(tlsCustomizer); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tlsCustomizer File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
tlsCustomizer
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override public BigInteger getBigIntegerValue() throws IOException { if ((_numTypesValid & NR_BIGINT) == 0) { if (_numTypesValid == NR_UNKNOWN) { _checkNumericValue(NR_BIGINT); } if ((_numTypesValid & NR_BIGINT) == 0) { convertNumberToBigInteger(); } } return _numberBigInt; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBigIntegerValue File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getBigIntegerValue
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@GetMapping("read-labels") public RespBody referenceLabel(HttpServletRequest request) { final String ids = getParameter(request, "ids", getParameter(request, "id", null)); if (StringUtils.isBlank(ids)) return RespBody.ok(); final ID user = getRequestUser(request); // 不存在的记录不返回 boolean ignoreMiss = getBoolParameter(request, "ignoreMiss", false); // 检查权限,无权限的不返回 boolean checkPrivileges = getBoolParameter(request, "checkPrivileges", false); Map<String, String> labels = new HashMap<>(); for (String id : ids.split("[|,]")) { if (!ID.isId(id)) continue; ID recordId = ID.valueOf(id); if (checkPrivileges && !Application.getPrivilegesManager().allowRead(user, recordId)) continue; if (ignoreMiss) { try { labels.put(id, FieldValueHelper.getLabel(recordId)); } catch (NoRecordFoundException ignored) { } } else { labels.put(id, FieldValueHelper.getLabelNotry(recordId)); } } return RespBody.ok(labels); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: referenceLabel File: src/main/java/com/rebuild/web/general/ReferenceSearchController.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
referenceLabel
src/main/java/com/rebuild/web/general/ReferenceSearchController.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
private ParcelableConference parcelable(ConferenceInfo c) { return new ParcelableConference.Builder(c.phoneAccount, c.state) .setConnectionCapabilities(c.capabilities) .setConnectionProperties(c.properties) .setConnectionIds(c.connectionIds) .setVideoAttributes(c.videoProvider, c.videoState) .setConnectTimeMillis(c.connectTimeMillis, c.connectElapsedTimeMillis) .setStatusHints(c.statusHints) .setExtras(c.extras) .build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parcelable File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
parcelable
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M1") public String displayForm(String className, String header, String format, boolean linebreak, XWikiContext context) { return displayForm(resolveClassReference(className), header, format, linebreak, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayForm 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
displayForm
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
public boolean scmMaterialsHaveDestination() { for (ScmMaterial scmMaterial : filterScmMaterials()) { if (!scmMaterial.hasDestinationFolder()) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scmMaterialsHaveDestination File: domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
scmMaterialsHaveDestination
domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
public void save(String table, Object entity, Handler<AsyncResult<String>> replyHandler) { client.getConnection(conn -> save(conn, table, /* id */ null, entity, /* returnId */ true, /* upsert */ false, /* convertEntity */ true, closeAndHandleResult(conn, replyHandler))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
save
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Test public void saveTransId(TestContext context) { String id = randomUuid(); postgresClient = createFoo(context); postgresClient.startTx(asyncAssertTx(context, trans -> { postgresClient.save(trans, FOO, id, xPojo, context.asyncAssertSuccess(res -> { context.assertEquals(id, res); Criterion filter = new Criterion(new Criteria().addField("id").setJSONB(false) .setOperation("=").setVal(id)); postgresClient.get(trans, FOO, StringPojo.class, filter, false, false, context.asyncAssertSuccess(reply -> { context.assertEquals(1, reply.getResults().size()); context.assertEquals("x", reply.getResults().get(0).key); postgresClient.rollbackTx(trans, context.asyncAssertSuccess(rollback -> { postgresClient.get(FOO, StringPojo.class, filter, false, false, context.asyncAssertSuccess(reply2 -> { context.assertEquals(0, reply2.getResults().size()); })); })); })); })); })); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveTransId File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
saveTransId
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
protected Integer checkoutStateValue(Field field, Cell cell) { final String val = cell.asString(); try { return StateManager.instance.findState(field, val).getState(); } catch (MetadataModificationException ignored) { } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkoutStateValue File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
checkoutStateValue
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
private Map<String, Object> getObjectData( Map<String, String> data, Map<String, Http.MultipartFormData.FilePart<?>> files) { final Map<String, Object> dataAndFilesMerged = new HashMap<>(data); dataAndFilesMerged.putAll(files); if (rootName != null) { final Map<String, Object> objectData = new HashMap<>(); dataAndFilesMerged.forEach( (key, value) -> { if (key.startsWith(rootName + ".")) { objectData.put(key.substring(rootName.length() + 1), value); } }); return objectData; } return dataAndFilesMerged; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectData File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
getObjectData
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
boolean finishDisabledPackageActivitiesLocked(String packageName, Set<String> filterByClasses, boolean doit, boolean evenPersistent, int userId) { boolean didSomething = false; for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) { final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks; final int numStacks = stacks.size(); for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) { final ActivityStack stack = stacks.get(stackNdx); if (stack.finishDisabledPackageActivitiesLocked( packageName, filterByClasses, doit, evenPersistent, userId)) { didSomething = true; } } } return didSomething; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishDisabledPackageActivitiesLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
finishDisabledPackageActivitiesLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override // NotificationData.Environment public boolean isSecurelyLocked(int userId) { return isLockscreenPublicMode(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecurelyLocked 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
isSecurelyLocked
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { StringBuffer sb = new StringBuffer(); for (String key : mFields.keySet()) { // Don't display password in toString(). String value = (key == PASSWORD_KEY) ? "<removed>" : mFields.get(key); sb.append(key).append(" ").append(value).append("\n"); } return sb.toString(); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2016-3897 - Severity: MEDIUM - CVSS Score: 4.3 Description: Fix string equality comparison Don't use "==" to compare strings. Bug: 25624963 Change-Id: Id25696e4fdcbcf4d48ec74e8ed65c1a33716b30c Function: toString File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android Fixed Code: @Override public String toString() { StringBuffer sb = new StringBuffer(); for (String key : mFields.keySet()) { // Don't display password in toString(). String value = PASSWORD_KEY.equals(key) ? "<removed>" : mFields.get(key); sb.append(key).append(" ").append(value).append("\n"); } return sb.toString(); }
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
toString
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
1
Analyze the following code function for security vulnerabilities
public boolean inputDispatchingTimedOut(final ProcessRecord proc, final ActivityRecord activity, final ActivityRecord parent, final boolean aboveSystem, String reason) { if (checkCallingPermission(android.Manifest.permission.FILTER_EVENTS) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.FILTER_EVENTS); } final String annotation; if (reason == null) { annotation = "Input dispatching timed out"; } else { annotation = "Input dispatching timed out (" + reason + ")"; } if (proc != null) { synchronized (this) { if (proc.debugging) { return false; } if (mDidDexOpt) { // Give more time since we were dexopting. mDidDexOpt = false; return false; } if (proc.instrumentationClass != null) { Bundle info = new Bundle(); info.putString("shortMsg", "keyDispatchingTimedOut"); info.putString("longMsg", annotation); finishInstrumentationLocked(proc, Activity.RESULT_CANCELED, info); return true; } } mHandler.post(new Runnable() { @Override public void run() { appNotResponding(proc, activity, parent, aboveSystem, annotation); } }); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inputDispatchingTimedOut 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
inputDispatchingTimedOut
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { Yaml yaml = new Yaml(); OutputStreamWriter writer = new OutputStreamWriter(entityStream); yaml.dump(t, writer); writer.close(); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2023-46302 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix unsafe deserialization via SnakeYaml in YamlEntityProvider Function: writeTo File: submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java Repository: apache/submarine Fixed Code: @Override public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions())); try (OutputStreamWriter writer = new OutputStreamWriter(entityStream)) { yaml.dump(t, writer); } }
[ "CWE-502" ]
CVE-2023-46302
CRITICAL
9.8
apache/submarine
writeTo
submarine-server/server-core/src/main/java/org/apache/submarine/server/rest/provider/YamlEntityProvider.java
88e59027e644e81014ca5b5ae5a21de12ae8ca37
1
Analyze the following code function for security vulnerabilities
private final String checkContentProviderPermissionLocked( ProviderInfo cpi, ProcessRecord r, int userId, boolean checkUser) { final int callingPid = (r != null) ? r.pid : Binder.getCallingPid(); final int callingUid = (r != null) ? r.uid : Binder.getCallingUid(); boolean checkedGrants = false; if (checkUser) { // Looking for cross-user grants before enforcing the typical cross-users permissions int tmpTargetUserId = unsafeConvertIncomingUser(userId); if (tmpTargetUserId != UserHandle.getUserId(callingUid)) { if (checkAuthorityGrants(callingUid, cpi, tmpTargetUserId, checkUser)) { return null; } checkedGrants = true; } userId = handleIncomingUser(callingPid, callingUid, userId, false, ALLOW_NON_FULL, "checkContentProviderPermissionLocked " + cpi.authority, null); if (userId != tmpTargetUserId) { // When we actually went to determine the final targer user ID, this ended // up different than our initial check for the authority. This is because // they had asked for USER_CURRENT_OR_SELF and we ended up switching to // SELF. So we need to re-check the grants again. checkedGrants = false; } } if (checkComponentPermission(cpi.readPermission, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } if (checkComponentPermission(cpi.writePermission, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } PathPermission[] pps = cpi.pathPermissions; if (pps != null) { int i = pps.length; while (i > 0) { i--; PathPermission pp = pps[i]; String pprperm = pp.getReadPermission(); if (pprperm != null && checkComponentPermission(pprperm, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } String ppwperm = pp.getWritePermission(); if (ppwperm != null && checkComponentPermission(ppwperm, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } } } if (!checkedGrants && checkAuthorityGrants(callingUid, cpi, userId, checkUser)) { return null; } String msg; if (!cpi.exported) { msg = "Permission Denial: opening provider " + cpi.name + " from " + (r != null ? r : "(null)") + " (pid=" + callingPid + ", uid=" + callingUid + ") that is not exported from uid " + cpi.applicationInfo.uid; } else { msg = "Permission Denial: opening provider " + cpi.name + " from " + (r != null ? r : "(null)") + " (pid=" + callingPid + ", uid=" + callingUid + ") requires " + cpi.readPermission + " or " + cpi.writePermission; } Slog.w(TAG, msg); return msg; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkContentProviderPermissionLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
checkContentProviderPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public List<DeletedAttachment> getDeletedAttachments(String docName, String filename) { try { List<com.xpn.xwiki.doc.DeletedAttachment> attachments = this.xwiki.getDeletedAttachments(docName, filename, this.context); if (attachments == null) { attachments = Collections.emptyList(); } List<DeletedAttachment> result = new ArrayList<DeletedAttachment>(attachments.size()); for (com.xpn.xwiki.doc.DeletedAttachment attachment : attachments) { result.add(new DeletedAttachment(attachment, this.context)); } return result; } catch (Exception ex) { LOGGER.warn("Failed to retrieve deleted attachments", ex); } return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeletedAttachments File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getDeletedAttachments
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void setSystemSetting(@NonNull ComponentName admin, @NonNull @SystemSettingsWhitelist String setting, String value) { throwIfParentInstance("setSystemSetting"); if (mService != null) { try { mService.setSystemSetting(admin, setting, value); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSystemSetting 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
setSystemSetting
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public com.xpn.xwiki.api.Object getObjectFromRequest(String className) throws XWikiException { return new com.xpn.xwiki.api.Object(this.xwiki.getObjectFromRequest(className, getXWikiContext()), getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectFromRequest File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getObjectFromRequest
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public Object parseGroovyFromPage(String fullName, String jarWikiPage, XWikiContext context) throws XWikiException { XWikiDocument groovyDocument = context.getWiki().getDocument(fullName, context); Object sdoc = context.get(XWikiDocument.CKEY_SDOC); context.put(XWikiDocument.CKEY_SDOC, groovyDocument); try { return parseGroovyFromString(groovyDocument.getContent(), jarWikiPage, context); } finally { context.put(XWikiDocument.CKEY_SDOC, sdoc); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGroovyFromPage 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
parseGroovyFromPage
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 final int getLineBottom(int line) { return getLineTop(line + 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLineBottom File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getLineBottom
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public static File writeZipStreamToTempDir(InputStream inputStream) throws IOException { File dir = FileHelper.createTempDir(); try { processZipStream(dir, inputStream); } catch (ZipException ex) { // Java doesn't support zip files with zero byte entries. // We could use a different library which does handle these zip files, but // I'm reluctant to add new dependencies just for this. Rather than // propagating the error, we'll just stop at this point and see if we // can make sense of anything we have extracted from the zip file so far. // For what it's worth I haven't come across a valid compressed schedule file // which includes zero bytes files. if (!ex.getMessage().equals("only DEFLATED entries can have EXT descriptor")) { throw ex; } } return dir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeZipStreamToTempDir File: src/main/java/net/sf/mpxj/common/InputStreamHelper.java Repository: joniles/mpxj The code follows secure coding practices.
[ "CWE-377", "CWE-200" ]
CVE-2022-41954
LOW
3.3
joniles/mpxj
writeZipStreamToTempDir
src/main/java/net/sf/mpxj/common/InputStreamHelper.java
ae0af24345d79ad45705265d9927fe55e94a5721
0
Analyze the following code function for security vulnerabilities
protected void _reportUnexpectedBreak() throws IOException { if (_parsingContext.inRoot()) { throw _constructError("Unexpected Break (0xFF) token in Root context"); } throw _constructError("Unexpected Break (0xFF) token in definite length (" +_parsingContext.getExpectedLength()+") " +(_parsingContext.inObject() ? "Object" : "Array" )); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _reportUnexpectedBreak File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_reportUnexpectedBreak
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public void sort(String columnId) { sort(columnId, SortDirection.ASCENDING); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sort File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
sort
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public static int getDigestSize(Digest digest) { if (digest == null) { throw new NullPointerException("digest == null"); } String algorithmName = digest.getAlgorithmName(); if (algorithmName.equals("SHAKE128")) { return 32; } if (algorithmName.equals("SHAKE256")) { return 64; } return digest.getDigestSize(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDigestSize File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
getDigestSize
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
public String escapeString(String str) { try { return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { return str; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeString File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
escapeString
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Transactional(readOnly = false) public void completeFirstTask(String procInsId){ completeFirstTask(procInsId, null, null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: completeFirstTask File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
completeFirstTask
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
@Override public void onClockVisibilityChanged() { adjustStatusBarLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClockVisibilityChanged File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onClockVisibilityChanged
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private Config envConf(final Config source, final String env) { String name = Optional.ofNullable(this.confname).orElse(source.origin().resource()); Config result = ConfigFactory.empty(); if (name != null) { // load [resource].[env].[ext] int dot = name.lastIndexOf('.'); name = name.substring(0, dot); } else { name = "application"; } String envconfname = name + "." + env + ".conf"; Config envconf = fileConfig(envconfname); Config appconf = fileConfig(name + ".conf"); return result // file system: .withFallback(envconf) .withFallback(appconf) // classpath: .withFallback(ConfigFactory.parseResources(envconfname)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: envConf 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
envConf
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public ClientIdStrategyEnum getResourceClientIdStrategy() { return myResourceClientIdStrategy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceClientIdStrategy 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
getResourceClientIdStrategy
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
List<OwnerShellData> listAllOwners() { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_DEVICE_ADMINS)); return mInjector.binderWithCleanCallingIdentity(() -> { SparseArray<DevicePolicyData> userData; // Gets the owners of "full users" first (device owner and profile owners) List<OwnerShellData> owners = mOwners.listAllOwners(); synchronized (getLockObject()) { for (int i = 0; i < owners.size(); i++) { OwnerShellData owner = owners.get(i); owner.isAffiliated = isUserAffiliatedWithDeviceLocked(owner.userId); } userData = mUserData; } // Then the owners of profile users (managed profiles) for (int i = 0; i < userData.size(); i++) { DevicePolicyData policyData = mUserData.valueAt(i); int userId = userData.keyAt(i); int parentUserId = mUserManagerInternal.getProfileParentId(userId); boolean isProfile = parentUserId != userId; if (!isProfile) continue; for (int j = 0; j < policyData.mAdminList.size(); j++) { ActiveAdmin admin = policyData.mAdminList.get(j); OwnerShellData owner = OwnerShellData.forManagedProfileOwner(userId, parentUserId, admin.info.getComponent()); owners.add(owner); } } return owners; }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listAllOwners 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
listAllOwners
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private static Intent createActionIntent(final Context context, final Account account, final Uri messageUri, final int action) { final Intent intent = new Intent(ACTION_LAUNCH_COMPOSE); intent.setPackage(context.getPackageName()); updateActionIntent(account, messageUri, action, intent); return intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createActionIntent File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
createActionIntent
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private boolean shouldStartChangeTransition( @Nullable TaskFragment newParent, @Nullable TaskFragment oldParent) { if (newParent == null || oldParent == null || !canStartChangeTransition()) { return false; } // Transition change for the activity moving into a TaskFragment of different bounds. return newParent.isOrganizedTaskFragment() && !newParent.getBounds().equals(oldParent.getBounds()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldStartChangeTransition 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
shouldStartChangeTransition
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override protected void doDispose() { // }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doDispose File: src/main/java/org/olat/course/assessment/bulk/DataStepForm.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
doDispose
src/main/java/org/olat/course/assessment/bulk/DataStepForm.java
5668a41ab3f1753102a89757be013487544279d5
0
Analyze the following code function for security vulnerabilities
protected boolean isCometConnected(String oortURL) { return _membership.isCometConnected(oortURL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCometConnected 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
isCometConnected
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 XMLBuilder i(String target, String data) { return instruction(target, data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: i File: src/main/java/com/jamesmurty/utils/XMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
i
src/main/java/com/jamesmurty/utils/XMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void initClassMethod(Class<?> clazz) { RequestMapping requestMapping = clazz.getAnnotation(RequestMapping.class); for (String classPath : requestMapping.value()) { for (Method method : clazz.getMethods()) { if (!method.isAnnotationPresent(RequestMapping.class)) { parseSubAnnotations(method, classPath); continue; } requestMapping = method.getAnnotation(RequestMapping.class); RequestMethod[] requestMethods = requestMapping.method(); if (requestMethods.length == 0) { requestMethods = new RequestMethod[1]; requestMethods[0] = RequestMethod.GET; } for (String methodPath : requestMapping.value()) { String urlKey = requestMethods[0].name() + REQUEST_PATH_SEPARATOR + classPath + methodPath; addUrlAndMethodRelation(urlKey, requestMapping.params(), method); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initClassMethod File: core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java Repository: alibaba/nacos The code follows secure coding practices.
[ "CWE-290" ]
CVE-2021-29441
HIGH
7.5
alibaba/nacos
initClassMethod
core/src/main/java/com/alibaba/nacos/core/code/ControllerMethodsCache.java
91d16023d91ea21a5e58722c751485a0b9bbeeb3
0
Analyze the following code function for security vulnerabilities
private void relocateTools(Element src, Element dest, HashMap<String, String> labelMap) { if (src == null || src == dest) return; String srcLabel = src.getAttribute("name"); if (srcLabel == null) return; ArrayList<Element> toRemove = new ArrayList<Element>(); for (Element elt : XmlIterator.forChildElements(src, "tool")) { String name = elt.getAttribute("name"); if (name != null && labelMap.containsKey(srcLabel + ":" + name)) { toRemove.add(elt); } } for (Element elt : toRemove) { src.removeChild(elt); if (dest != null) { dest.appendChild(elt); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: relocateTools File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
relocateTools
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
public void signalPersistentProcesses(int signal) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: signalPersistentProcesses File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
signalPersistentProcesses
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
void dumpWindowsLocked(PrintWriter pw, boolean dumpAll, ArrayList<WindowState> windows) { pw.println("WINDOW MANAGER WINDOWS (dumpsys window windows)"); dumpWindowsNoHeaderLocked(pw, dumpAll, windows); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpWindowsLocked 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
dumpWindowsLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public String getAttachmentRevisionURL(String filename, String version) { return this.doc.getAttachmentRevisionURL(filename, version, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentRevisionURL 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
getAttachmentRevisionURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
protected String buildUrl() { if (url == null) { throw new IllegalStateException("'url' must not be null."); } return String.format("%s/room/%s/notification?auth_token=%s", url.toString(), roomId, authToken); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: buildUrl File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: protected String buildUrl() { if (url == null) { throw new IllegalStateException("'url' must not be null."); } return String.format("%s/room/%s/notification?auth_token=%s", url, roomId, authToken); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
buildUrl
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMyMemoryState File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getMyMemoryState
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public RemoteViews makeNotificationGroupHeader() { return makeNotificationHeader(mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_GROUP_HEADER) .fillTextsFrom(this)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeNotificationGroupHeader File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
makeNotificationGroupHeader
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private static boolean isNullOrEmpty(String string) { return string == null || string.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNullOrEmpty File: src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java Repository: steve-community/ocpp-jaxb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-52096
HIGH
7.5
steve-community/ocpp-jaxb
isNullOrEmpty
src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java
13667036f7a30c5e7aca796ef6e2a3b0926c679a
0
Analyze the following code function for security vulnerabilities
public void shutdown() { if (connection != null) { try { connection.close(); } catch (SQLException e) { logger.warn("Non-Managed connection could not be closed. Whoops!", e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shutdown File: extensions/database/src/com/google/refine/extension/database/sqlite/SQLiteConnectionManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-41886
HIGH
7.5
OpenRefine
shutdown
extensions/database/src/com/google/refine/extension/database/sqlite/SQLiteConnectionManager.java
2de1439f5be63d9d0e89bbacbd24fa28c8c3e29d
0
Analyze the following code function for security vulnerabilities
int getCount() { return count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCount File: android/guava/src/com/google/common/io/FileBackedOutputStream.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
getCount
android/guava/src/com/google/common/io/FileBackedOutputStream.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
private void restoreFull() { // None of this can run on the work looper here, so we spin asynchronous // work like this: // // StreamFeederThread: read data from mTransport.getNextFullRestoreDataChunk() // write it into the pipe to the engine // EngineThread: FullRestoreEngine thread communicating with the target app // // When finished, StreamFeederThread executes next state as appropriate on the // backup looper, and the overall unified restore task resumes try { StreamFeederThread feeder = new StreamFeederThread(); if (MORE_DEBUG) { Slog.i(TAG, "Spinning threads for stream restore of " + mCurrentPackage.packageName); } new Thread(feeder, "unified-stream-feeder").start(); // At this point the feeder is responsible for advancing the restore // state, so we're done here. } catch (IOException e) { // Unable to instantiate the feeder thread -- we need to bail on the // current target. We haven't asked the transport for data yet, though, // so we can do that simply by going back to running the restore queue. Slog.e(TAG, "Unable to construct pipes for stream restore!"); executeNextState(UnifiedRestoreState.RUNNING_QUEUE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: restoreFull 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
restoreFull
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
protected void doDSPost(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { // Treat as a GET doDSGet(context, request, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doDSPost File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java Repository: DSpace The code follows secure coding practices.
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
doDSPost
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/RequestItemServlet.java
28eb8158210d41168a62ed5f9e044f754513bc37
0
Analyze the following code function for security vulnerabilities
@Override public void setManagedProfileCallerIdAccessPolicy(PackagePolicy policy) { if (!mHasFeature) { return; } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization((isProfileOwner(caller) && isManagedProfile(caller.getUserId()))); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId()); admin.disableCallerId = false; admin.mManagedProfileCallerIdAccess = policy; saveSettingsLocked(caller.getUserId()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setManagedProfileCallerIdAccessPolicy 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
setManagedProfileCallerIdAccessPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public String render(XWikiContext context) throws XWikiException { return REGISTER; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: render File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/RegisterAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-36092
HIGH
7.5
xwiki/xwiki-platform
render
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/RegisterAction.java
9b7057d57a941592d763992d4299456300918208
0