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
private void setFormat(CWLElement inputOutput, String format) { inputOutput.setFormat(format); try { if (!rdfService.ontPropertyExists(format)) { Model ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM); ontModel.read(format, null, "RDF/XML"); rdfService.addToOntologies(ontModel); } String formatLabel = rdfService.getOntLabel(format); inputOutput.setType(inputOutput.getType() + " [" + formatLabel + "]"); } catch (RiotException ex) { inputOutput.setType(inputOutput.getType() + " [format]"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFormat File: src/main/java/org/commonwl/view/cwl/CWLService.java Repository: common-workflow-language/cwlviewer The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-41110
HIGH
7.5
common-workflow-language/cwlviewer
setFormat
src/main/java/org/commonwl/view/cwl/CWLService.java
f6066f09edb70033a2ce80200e9fa9e70a5c29de
0
Analyze the following code function for security vulnerabilities
@Override protected void throwNotConnectedExceptionIfAppropriate() throws NotConnectedException { if (packetWriter == null) { throw new NotConnectedException(); } packetWriter.throwNotConnectedExceptionIfDoneAndResumptionNotPossible(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwNotConnectedExceptionIfAppropriate 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
throwNotConnectedExceptionIfAppropriate
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public String getDeRegisteredTitle() { return deRegisteredTitle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeRegisteredTitle File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getDeRegisteredTitle
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public void setChannel(@Nullable String channel) { this.channel = channel; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setChannel File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setChannel
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/SlackNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private void clearConnectChoiceInternal(WifiConfiguration config) { config.getNetworkSelectionStatus().setConnectChoice(null); config.getNetworkSelectionStatus().setConnectChoiceRssi(0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearConnectChoiceInternal File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
clearConnectChoiceInternal
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override String getCodePath() { return (codeFile != null) ? codeFile.getAbsolutePath() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCodePath 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
getCodePath
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public ByteBuffer loadBinaryResource(final File file) { return load(file); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadBinaryResource File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java Repository: jlangch/venice The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-36007
LOW
3.3
jlangch/venice
loadBinaryResource
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
c942c73136333bc493050910f171a48e6f575b23
0
Analyze the following code function for security vulnerabilities
public void sendSetDialing(String id) throws Exception { mConnectionById.get(id).state = Connection.STATE_DIALING; for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setDialing(id, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetDialing 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
sendSetDialing
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static ByteSink asByteSink(File file, FileWriteMode... modes) { return new FileByteSink(file, modes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asByteSink File: guava/src/com/google/common/io/Files.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
asByteSink
guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public boolean isExpungeEnabled() { return myExpungeEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExpungeEnabled 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
isExpungeEnabled
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
public static String formatResourceName(String name, int maxLength) { if (name == null) { return null; } if (name.length() <= maxLength) { return name; } int total = name.length(); String[] names = CmsStringUtil.splitAsArray(name, "/"); if (name.endsWith("/")) { names[names.length - 1] = names[names.length - 1] + "/"; } for (int i = 1; (total > maxLength) && (i < (names.length - 1)); i++) { if (i > 1) { names[i - 1] = ""; } names[i] = "..."; total = 0; for (int j = 0; j < names.length; j++) { int l = names[j].length(); total += l + ((l > 0) ? 1 : 0); } } if (total > maxLength) { names[0] = (names.length > 2) ? "" : (names.length > 1) ? "..." : names[0]; } StringBuffer result = new StringBuffer(); for (int i = 0; i < names.length; i++) { if (names[i].length() > 0) { result.append("/"); result.append(names[i]); } } return result.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatResourceName File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
formatResourceName
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private boolean isOwnerUpdatedInRequest(ServiceProvider serviceProvider) { return serviceProvider.getOwner() != null && StringUtils.isNotEmpty(serviceProvider.getOwner().getUserName()) && !CarbonConstants.REGISTRY_SYSTEM_USERNAME.equals(serviceProvider.getOwner().getUserName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOwnerUpdatedInRequest File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
isOwnerUpdatedInRequest
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
public String include(String topic, boolean isForm, XWikiContext context) throws XWikiException { String database = null, incdatabase = null; String prefixedTopic, localTopic; // Save current documents in script context Document currentAPIdoc = null, currentAPIcdoc = null, currentAPItdoc = null; ScriptContextManager scritContextManager = Utils.getComponent(ScriptContextManager.class); ScriptContext scontext = scritContextManager.getScriptContext(); String currentDocName = context.getWikiId() + ":" + context.getDoc().getFullName(); if (scontext != null) { currentAPIdoc = (Document) scontext.getAttribute("doc"); currentAPIcdoc = (Document) scontext.getAttribute("cdoc"); currentAPItdoc = (Document) scontext.getAttribute("tdoc"); } try { int i0 = topic.indexOf(':'); if (i0 != -1) { incdatabase = topic.substring(0, i0); database = context.getWikiId(); context.setWikiId(incdatabase); prefixedTopic = topic; localTopic = topic.substring(i0 + 1); } else { prefixedTopic = context.getWikiId() + ":" + topic; localTopic = topic; } XWikiDocument doc = null; try { LOGGER.debug("Including Topic " + topic); try { @SuppressWarnings("unchecked") Set<String> includedDocs = (Set<String>) context.get("included_docs"); if (includedDocs == null) { includedDocs = new HashSet<String>(); context.put("included_docs", includedDocs); } if (includedDocs.contains(prefixedTopic) || currentDocName.equals(prefixedTopic)) { LOGGER.warn("Error on too many recursive includes for topic " + topic); return "Cannot make recursive include"; } includedDocs.add(prefixedTopic); } catch (Exception e) { } // Get document to include DocumentReference targetDocumentReference = getCurrentMixedDocumentReferenceResolver().resolve(localTopic); doc = getDocument(targetDocumentReference, context); if (checkAccess("view", doc, context) == false) { throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access to this document is denied: " + doc); } } catch (XWikiException e) { LOGGER.warn("Exception Including Topic " + topic, e); return "Topic " + topic + " does not exist"; } XWikiDocument contentdoc = doc.getTranslatedDocument(context); String result; if (isForm) { // We do everything in the context of the including document if (database != null) { context.setWikiId(database); } // Note: the Script macro in the new rendering checks for programming rights for the document in // the xwiki context. result = getRenderedContent(contentdoc, (XWikiDocument) context.get("doc"), context); } else { // We stay in the included document context // Since the Script macro checks for programming rights in the current document, we need to // temporarily set the contentdoc as the current doc before rendering it. XWikiDocument originalDoc = null; try { originalDoc = context.getDoc(); context.put("doc", doc); result = getRenderedContent(contentdoc, doc, context); } finally { context.put("doc", originalDoc); } } try { @SuppressWarnings("unchecked") Set<String> includedDocs = (Set<String>) context.get("included_docs"); if (includedDocs != null) { includedDocs.remove(prefixedTopic); } } catch (Exception e) { } return result; } finally { if (database != null) { context.setWikiId(database); } if (currentAPIdoc != null) { if (scontext != null) { scontext.setAttribute("doc", currentAPIdoc, ScriptContext.ENGINE_SCOPE); } } if (currentAPIcdoc != null) { if (scontext != null) { scontext.setAttribute("cdoc", currentAPIcdoc, ScriptContext.ENGINE_SCOPE); } } if (currentAPItdoc != null) { if (scontext != null) { scontext.setAttribute("tdoc", currentAPItdoc, ScriptContext.ENGINE_SCOPE); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: include 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
include
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public int engineGetBlockSize() { if (engine.getCipher() != null) { return engine.getCipher().getBlockSize(); } else { return 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetBlockSize File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineGetBlockSize
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
private void processChildren(NodeList childNodes, int currentStackDepth ) throws ScanException { Node tmp; for (int i = 0; i < childNodes.getLength(); i++) { tmp = childNodes.item(i); recursiveValidateTag(tmp, currentStackDepth); /* * This indicates the node was removed/failed validation. */ if (tmp.getParentNode() == null) { i--; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processChildren File: src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-28367
MEDIUM
4.3
nahsra/antisamy
processChildren
src/main/java/org/owasp/validator/html/scan/AntiSamyDOMScanner.java
0199e7e194dba5e7d7197703f43ebe22401e61ae
0
Analyze the following code function for security vulnerabilities
void initSoundPool() { synchronized (this) { if (mSoundPool == null) { mSoundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0); mStartSound = mSoundPool.load(mContext, R.raw.start, 1); mEndSound = mSoundPool.load(mContext, R.raw.end, 1); mErrorSound = mSoundPool.load(mContext, R.raw.error, 1); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initSoundPool File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
initSoundPool
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void setSystemReady(boolean systemReady) { mSystemReady = systemReady; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSystemReady File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
setSystemReady
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public static Profile fromUser(User u) { Profile p = new Profile(u.getId(), u.getName()); p.setUser(u); p.setOriginalName(u.getName()); p.setPicture(u.getPicture()); p.setAppid(u.getAppid()); p.setCreatorid(u.getId()); p.setTimestamp(u.getTimestamp()); p.setGroups(ScooldUtils.getInstance().isRecognizedAsAdmin(u) ? User.Groups.ADMINS.toString() : u.getGroups()); // auto-assign spaces to new users String space = StringUtils.substringBefore(ScooldUtils.getConfig().autoAssignSpaces(), ","); if (!StringUtils.isBlank(space) && !ScooldUtils.getInstance().isDefaultSpace(space)) { Sysprop s = client().read(ScooldUtils.getInstance().getSpaceId(space)); if (s == null) { s = ScooldUtils.getInstance().buildSpaceObject(space); client().create(s); // create the space it it's missing } if (ScooldUtils.getConfig().resetSpacesOnNewAssignment(u.isOAuth2User() || u.isLDAPUser() || u.isSAMLUser())) { p.setSpaces(Collections.singleton(s.getId() + Para.getConfig().separator() + s.getName())); } else { p.getSpaces().add(s.getId() + Para.getConfig().separator() + s.getName()); } } return p; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromUser File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
fromUser
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public synchronized void updateAsciiStream(@Positive int columnIndex, java.io.@Nullable InputStream x, int length) throws SQLException { if (x == null) { updateNull(columnIndex); return; } try { InputStreamReader reader = new InputStreamReader(x, StandardCharsets.US_ASCII); char[] data = new char[length]; int numRead = 0; while (true) { int n = reader.read(data, numRead, length - numRead); if (n == -1) { break; } numRead += n; if (numRead == length) { break; } } updateString(columnIndex, new String(data, 0, numRead)); } catch (IOException ie) { throw new PSQLException(GT.tr("Provided InputStream failed."), null, ie); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAsciiStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateAsciiStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public boolean startUserApprovalIfNecessary(boolean isUserSelected) { if (null == mConnectingConfig || null == mCurrentTofuConfig) return false; if (mConnectingConfig.networkId != mCurrentTofuConfig.networkId) return false; // If Trust On First Use is supported and insecure enterprise configuration // is not allowed, TOFU must be used for an Enterprise network without certs. This should // not happen because the TOFU flag will be set during boot if these conditions are met. if (mIsTrustOnFirstUseSupported && !mIsInsecureEnterpriseConfigurationAllowed && !mCurrentTofuConfig.enterpriseConfig.isTrustOnFirstUseEnabled()) { Log.e(TAG, "Upgrade insecure connection to TOFU."); mCurrentTofuConfig.enterpriseConfig.enableTrustOnFirstUse(true); } if (useTrustOnFirstUse()) { if (null == mPendingRootCaCert) { Log.e(TAG, "No valid CA cert for TLS-based connection."); handleError(mCurrentTofuConfig.SSID); return false; } if (null == mPendingServerCert) { Log.e(TAG, "No valid Server cert for TLS-based connection."); handleError(mCurrentTofuConfig.SSID); return false; } if (!isServerCertChainValid()) { Log.e(TAG, "Server cert chain is invalid."); String ssid = mCurrentTofuConfig.SSID; handleError(ssid); createCertificateErrorNotification(isUserSelected, ssid); return false; } } else if (mIsInsecureEnterpriseConfigurationAllowed) { Log.i(TAG, "Insecure networks without a Root CA cert are allowed."); return false; } Log.d(TAG, "startUserApprovalIfNecessaryForInsecureEapNetwork: mIsUserSelected=" + isUserSelected); if (isUserSelected) { askForUserApprovalForCaCertificate(); } else { notifyUserForCaCertificate(); } return true; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21242 - Severity: CRITICAL - CVSS Score: 9.8 Description: [TOFU] Validate full cert chains before displaying dialog When a full chain including a Root CA is provided by the server, perform a full validation of the chain before displaying the TOFU dialog. If validation passes: Display a TOFU dialog and ask the user if they trust this network. Saying yes means that the Root can be installed safely for that network. They might say no - this is possible if an attacker creates a full chain they control which results in a different SHA-256 (everything else looks correct). If they say no, we stop the connection. If validation fails: Display an error message saying that the validation failed, we stop the connection and won't display the TOFU dialog. Use server certificate pinning for servers that send only a leaf or a partial chain with no Root CA. Additionally: clean up the debug logs to reduce the noise and focus only on the important details. Bug: 277824547 Test: atest InsecureEapNetworkHandler Test: Connect to various Enterprise networks Negative test: Confirm verification fails for invalid chains (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b0ee00ddf38bb677876a6cffb876e6f511e2c139) Merged-In: I224c80e2787497634d3e68760122dac5f177585a Change-Id: I224c80e2787497634d3e68760122dac5f177585a Function: startUserApprovalIfNecessary File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android Fixed Code: public boolean startUserApprovalIfNecessary(boolean isUserSelected) { if (null == mConnectingConfig || null == mCurrentTofuConfig) return false; if (mConnectingConfig.networkId != mCurrentTofuConfig.networkId) return false; // If Trust On First Use is supported and insecure enterprise configuration // is not allowed, TOFU must be used for an Enterprise network without certs. This should // not happen because the TOFU flag will be set during boot if these conditions are met. if (mIsTrustOnFirstUseSupported && !mIsInsecureEnterpriseConfigurationAllowed && !mCurrentTofuConfig.enterpriseConfig.isTrustOnFirstUseEnabled()) { Log.e(TAG, "Upgrade insecure connection to TOFU."); mCurrentTofuConfig.enterpriseConfig.enableTrustOnFirstUse(true); } if (useTrustOnFirstUse()) { if (null == mPendingRootCaCert) { Log.e(TAG, "No valid CA cert for TLS-based connection."); handleError(mCurrentTofuConfig.SSID); return false; } if (null == mPendingServerCert) { Log.e(TAG, "No valid Server cert for TLS-based connection."); handleError(mCurrentTofuConfig.SSID); return false; } Log.d(TAG, "TOFU certificate chain:"); for (X509Certificate cert : mServerCertChain) { Log.d(TAG, cert.getSubjectX500Principal().getName()); } if (!configureServerValidationMethod()) { Log.e(TAG, "Server cert chain is invalid."); String ssid = mCurrentTofuConfig.SSID; handleError(ssid); createCertificateErrorNotification(isUserSelected, ssid); return false; } } else if (mIsInsecureEnterpriseConfigurationAllowed) { Log.i(TAG, "Insecure networks without a Root CA cert are allowed."); return false; } if (isUserSelected) { askForUserApprovalForCaCertificate(); } else { notifyUserForCaCertificate(); } return true; }
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
startUserApprovalIfNecessary
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
1
Analyze the following code function for security vulnerabilities
protected JsonDeserializer<?> _findCustomMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { for (Deserializers d : _factoryConfig.deserializers()) { JsonDeserializer<?> deser = d.findMapLikeDeserializer(type, config, beanDesc, keyDeserializer, elementTypeDeserializer, elementDeserializer); if (deser != null) { return deser; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _findCustomMapLikeDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
_findCustomMapLikeDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unused") @CalledByNative private void onShowUnhandledTapUIIfNeeded(int x, int y) { if (mContextualSearchClient != null) { mContextualSearchClient.showUnhandledTapUIIfNeeded(x, y); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onShowUnhandledTapUIIfNeeded File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
onShowUnhandledTapUIIfNeeded
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
private Stream<Tuple2<CertificateRepositoryObjectValidationContext, ValidationResult>> getCertificateRepositoryObjectValidationContext(TrustAnchor trustAnchor, CertificateRepositoryObjectValidationContext context, List<Key> validatedObjects, URI crlUri, X509Crl crl, Tuple3<URI, RpkiObject, ValidationResult> e) { final URI location = e.v1(); final RpkiObject rpkiObject = e.v2(); final ValidationResult temporary = e.v3(); final Optional<CertificateRepositoryObject> maybeCertificateRepositoryObject = Bench.mark(trustAnchor.getName(), "rpkiObject.get", () -> rpkiObject.get(CertificateRepositoryObject.class, temporary)); if (!temporary.hasFailureForCurrentLocation()) { if (maybeCertificateRepositoryObject.isPresent()) { CertificateRepositoryObject certificateRepositoryObject = maybeCertificateRepositoryObject.get(); Bench.mark0(trustAnchor.getName(), "certificateRepositoryObject.validate", () -> certificateRepositoryObject.validate(location.toASCIIString(), context, crl, crlUri, validationConfig.validationOptions(), temporary)); if (!temporary.hasFailureForCurrentLocation()) { validatedObjects.add(rpkiObject.key()); } if (certificateRepositoryObject instanceof X509ResourceCertificate && ((X509ResourceCertificate) certificateRepositoryObject).isCa() && !temporary.hasFailureForCurrentLocation()) { final CertificateRepositoryObjectValidationContext childContext = context.createChildContext(location, (X509ResourceCertificate) certificateRepositoryObject); return Stream.of(new Tuple2<>(childContext, temporary)); } } } if(validationConfig.isStrictValidation()){ throw new StrictValidationException("Can't get certificat context"); } else { return Stream.empty(); } }
Vulnerability Classification: - CWE: CWE-295 - CVE: CVE-2020-16162 - Severity: MEDIUM - CVSS Score: 5.0 Description: Revert behaviour of repo validation context creation. Function: getCertificateRepositoryObjectValidationContext File: rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java Repository: RIPE-NCC/rpki-validator-3 Fixed Code: private Stream<Tuple2<CertificateRepositoryObjectValidationContext, ValidationResult>> getCertificateRepositoryObjectValidationContext(TrustAnchor trustAnchor, CertificateRepositoryObjectValidationContext context, List<Key> validatedObjects, URI crlUri, X509Crl crl, Tuple3<URI, RpkiObject, ValidationResult> e) { final URI location = e.v1(); final RpkiObject rpkiObject = e.v2(); final ValidationResult temporary = e.v3(); final Optional<CertificateRepositoryObject> maybeCertificateRepositoryObject = Bench.mark(trustAnchor.getName(), "rpkiObject.get", () -> rpkiObject.get(CertificateRepositoryObject.class, temporary)); if (!temporary.hasFailureForCurrentLocation()) { if (maybeCertificateRepositoryObject.isPresent()) { CertificateRepositoryObject certificateRepositoryObject = maybeCertificateRepositoryObject.get(); Bench.mark0(trustAnchor.getName(), "certificateRepositoryObject.validate", () -> certificateRepositoryObject.validate(location.toASCIIString(), context, crl, crlUri, validationConfig.validationOptions(), temporary)); if (!temporary.hasFailureForCurrentLocation()) { validatedObjects.add(rpkiObject.key()); } if (certificateRepositoryObject instanceof X509ResourceCertificate && ((X509ResourceCertificate) certificateRepositoryObject).isCa() && !temporary.hasFailureForCurrentLocation()) { final CertificateRepositoryObjectValidationContext childContext = context.createChildContext(location, (X509ResourceCertificate) certificateRepositoryObject); return Stream.of(new Tuple2<>(childContext, temporary)); } } } return Stream.empty(); }
[ "CWE-295" ]
CVE-2020-16162
MEDIUM
5
RIPE-NCC/rpki-validator-3
getCertificateRepositoryObjectValidationContext
rpki-validator/src/main/java/net/ripe/rpki/validator3/domain/validation/CertificateTreeValidationService.java
33bd2f4d900c278bb0c988590e6ba368e8cb757a
1
Analyze the following code function for security vulnerabilities
@Override public void setSplitScreenResizing(boolean resizing) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "setSplitScreenResizing()"); final long ident = Binder.clearCallingIdentity(); try { synchronized (this) { mStackSupervisor.setSplitScreenResizing(resizing); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSplitScreenResizing 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
setSplitScreenResizing
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Test public void createsCountQueriesCorrectlyForCapitalLetterJPQL() { assertCountQuery("FROM User u WHERE u.foo.bar = ?", "select count(u) FROM User u WHERE u.foo.bar = ?"); assertCountQuery("SELECT u FROM User u where u.foo.bar = ?", "select count(u) FROM User u where u.foo.bar = ?"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createsCountQueriesCorrectlyForCapitalLetterJPQL File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
createsCountQueriesCorrectlyForCapitalLetterJPQL
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
public Document getDocument(EntityReference reference) throws XWikiException { return getDocument(this.xwiki.getDocumentReference(reference, getXWikiContext())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocument 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
getDocument
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
private String[] getCacheNames(String[] cacheNames) { if (ArrayUtils.isEmpty(cacheNames)) { return defaultConfig.get(MEMBER_CACHE_NAMES, String[].class).orElse(StringUtils.EMPTY_STRING_ARRAY); } else { return cacheNames; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheNames File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getCacheNames
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (obj != null && obj instanceof BaseXMLBuilder) { BaseXMLBuilder other = (BaseXMLBuilder) obj; return this.xmlDocument.equals(other.getDocument()) && this.xmlNode.equals(other.getElement()); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
equals
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void quoteText(String text) { if (binding.textinput.isEnabled()) { binding.textinput.insertAsQuote(text); binding.textinput.requestFocus(); InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); if (inputMethodManager != null) { inputMethodManager.showSoftInput(binding.textinput, InputMethodManager.SHOW_IMPLICIT); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: quoteText File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
quoteText
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected void engineInitSign( PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { this.random = random; engineInitSign(privateKey); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineInitSign File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSASigner.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-347" ]
CVE-2016-1000338
MEDIUM
5
bcgit/bc-java
engineInitSign
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dsa/DSASigner.java
b0c3ce99d43d73a096268831d0d120ffc89eac7f
0
Analyze the following code function for security vulnerabilities
public void setStatusBar(StatusBar statusBar) { mStatusBar = statusBar; updateCameraVisibility(); // in case onFinishInflate() was called too early }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStatusBar File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
setStatusBar
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected static native int convertITableIndexToVTableIndex(long interfaceClass, int itableIndex, long receiverClass);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertITableIndexToVTableIndex File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java Repository: eclipse-openj9/openj9 The code follows secure coding practices.
[ "CWE-440", "CWE-250" ]
CVE-2021-41035
HIGH
7.5
eclipse-openj9/openj9
convertITableIndexToVTableIndex
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
c6e0d9296ff9a3084965d83e207403de373c0bad
0
Analyze the following code function for security vulnerabilities
@Override public boolean getAutoTimeZoneEnabled(@Nullable ComponentName who, String callerPackageName) { if (!mHasFeature) { return false; } CallerIdentity caller; if (isUnicornFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } if (isUnicornFlagEnabled()) { // The effect of this policy is device-wide. enforceCanQuery(SET_TIME_ZONE, caller.getPackageName(), UserHandle.USER_ALL); } else { Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller) || isDefaultDeviceOwner( caller)); } return mInjector.settingsGlobalGetInt(Global.AUTO_TIME_ZONE, 0) > 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAutoTimeZoneEnabled 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
getAutoTimeZoneEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void notifyListenerHintsChangedLocked(final int hints) { for (final ManagedServiceInfo serviceInfo : mServices) { if (!serviceInfo.isEnabledForCurrentProfiles()) { continue; } mHandler.post(new Runnable() { @Override public void run() { notifyListenerHintsChanged(serviceInfo, hints); } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyListenerHintsChangedLocked File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
notifyListenerHintsChangedLocked
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject, boolean useVersion, String relation) { String objectUri; if (useVersion) { objectUri = Utils.createURI(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), Utils.getSpacesFromSpaceId(doc.getSpace()), doc.getDocumentReference().getName(), doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber()).toString(); } else { objectUri = Utils .createURI(baseUri, ObjectResource.class, doc.getWiki(), Utils.getSpacesFromSpaceId(doc.getSpace()), doc.getDocumentReference().getName(), xwikiObject.getClassName(), xwikiObject.getNumber()) .toString(); } Link objectLink = objectFactory.createLink(); objectLink.setHref(objectUri); objectLink.setRel(relation); return objectLink; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectLink File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
getObjectLink
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
@Override protected FooterCell createCell() { return new FooterCell(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createCell 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
createCell
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
static public IActivityManager asInterface(IBinder obj) { if (obj == null) { return null; } IActivityManager in = (IActivityManager)obj.queryLocalInterface(descriptor); if (in != null) { return in; } return new ActivityManagerProxy(obj); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asInterface File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
asInterface
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public int getBufferSize() { return 1024; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBufferSize File: servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-862" ]
CVE-2019-10184
MEDIUM
5
undertow-io/undertow
getBufferSize
servlet/src/main/java/io/undertow/servlet/handlers/ServletInitialHandler.java
d2715e3afa13f50deaa19643676816ce391551e9
0
Analyze the following code function for security vulnerabilities
@Override public boolean getBluetoothContactSharingDisabled(ComponentName who) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); return admin.disableBluetoothContactSharing; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBluetoothContactSharingDisabled 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
getBluetoothContactSharingDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public Object getObject(String classname, String key, String value) { try { BaseObject obj = this.getDoc().getObject(classname, key, value); if (obj == null) { return null; } else { return newObjectApi(obj, getXWikiContext()); } } catch (Exception e) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObject 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
getObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public void setXClassXML(String xClassXML) { this.xClassXML = xClassXML; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setXClassXML File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setXClassXML
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void setIsFullWidth(boolean isFullWidth) { mIsFullWidth = isFullWidth; mNotificationStackScroller.setIsFullWidth(isFullWidth); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIsFullWidth File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
setIsFullWidth
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean getHintShowBackgroundOnly() { return (mFlags & FLAG_HINT_SHOW_BACKGROUND_ONLY) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHintShowBackgroundOnly File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getHintShowBackgroundOnly
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private UserSummary toUserResponse(User user, AllUserSessions sessions) { return toUserResponse(user, true, Optional.of(sessions)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toUserResponse File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
toUserResponse
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
private ClusterConfig findClusterConfig(String key) { return dbCollection.findOne(DBQuery.is("type", key)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findClusterConfig File: graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
findClusterConfig
graylog2-server/src/main/java/org/graylog2/cluster/ClusterConfigServiceImpl.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
@Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (drawerToggle != null && drawerToggle.onOptionsItemSelected(item)) return true; int itemId = item.getItemId(); if (itemId == android.R.id.home) { if (handlePodcastBackPressed()) return true; } else if (itemId == R.id.menu_update) { startSync(); } else if (itemId == R.id.menu_StartImageCaching) { final DatabaseConnectionOrm dbConn = new DatabaseConnectionOrm(this); long highestItemId = dbConn.getLowestRssItemIdUnread(); Intent data = new Intent(); data.putExtra(DownloadImagesService.LAST_ITEM_ID, highestItemId); data.putExtra(DownloadImagesService.DOWNLOAD_MODE_STRING, DownloadImagesService.DownloadMode.PICTURES_ONLY); DownloadImagesService.enqueueWork(this, data); } else if (itemId == R.id.menu_CreateDatabaseDump) { DatabaseUtils.CopyDatabaseToSdCard(this); new AlertDialog.Builder(this) .setMessage("Created dump at: " + DatabaseUtils.GetPath(this)) .setNeutralButton(getString(android.R.string.ok), null) .show(); } else if (itemId == R.id.menu_markAllAsRead) { NewsReaderDetailFragment ndf = getNewsReaderDetailFragment(); if (ndf != null) { DatabaseConnectionOrm dbConn2 = new DatabaseConnectionOrm(this); dbConn2.markAllItemsAsReadForCurrentView(); reloadCountNumbersOfSlidingPaneAdapter(); ndf.refreshCurrentRssView(); } return true; } else if (itemId == R.id.menu_downloadMoreItems) { DownloadMoreItems(); return true; } else if (itemId == R.id.menu_search) { mSearchView.setIconified(false); mSearchView.setFocusable(true); mSearchView.requestFocusFromTouch(); return true; } else if (itemId == R.id.menu_download_web_archive) { checkAndStartDownloadWebPagesForOfflineReadingPermission(); return true; } return super.onOptionsItemSelected(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onOptionsItemSelected File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
onOptionsItemSelected
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
@Override public void setImmersive(IBinder token, boolean immersive) { synchronized(this) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { throw new IllegalArgumentException(); } r.immersive = immersive; // update associated state if we're frontmost if (r == mFocusedActivity) { if (DEBUG_IMMERSIVE) { Slog.d(TAG, "Frontmost changed immersion: "+ r); } applyUpdateLockStateLocked(r); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setImmersive 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
setImmersive
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void addBroadcastEventListener(@NonNull BroadcastEventListener listener) { // It's a CopyOnWriteArrayList, so no lock is needed. mBroadcastEventListeners.add(listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBroadcastEventListener File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
addBroadcastEventListener
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
boolean hasMaterialsWithNoDestinationFolder() { for (Material material : this) { AbstractMaterial abstractMaterial = (AbstractMaterial) material; if (abstractMaterial.supportsDestinationFolder() && !abstractMaterial.hasDestinationFolder()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasMaterialsWithNoDestinationFolder 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
hasMaterialsWithNoDestinationFolder
domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
static boolean compareStrings(CharSequence s1, CharSequence s2) { if (s1 == null) { return s2 == null; } if (s2 == null) { return false; } if (s1.getClass() != s2.getClass()) { return false; } return s1.equals(s2); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compareStrings 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
compareStrings
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String getLaunchedFromPackage(IBinder activityToken) { ActivityRecord srec = ActivityRecord.forToken(activityToken); if (srec == null) { return null; } return srec.launchedFromPackage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLaunchedFromPackage 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
getLaunchedFromPackage
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public Document getDocumentAsAuthor(DocumentReference reference) throws XWikiException { if (!getAuthorizationManager().hasAccess(Right.VIEW, getEffectiveAuthorReference(), reference)) { return null; } return this.xwiki.getDocument(reference, getXWikiContext()).newDocument(getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentAsAuthor 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
getDocumentAsAuthor
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
@Override public void onPanelRevealed(boolean clearEffects, int items) { EventLogTags.writeNotificationPanelRevealed(items); if (clearEffects) { clearEffects(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPanelRevealed File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
onPanelRevealed
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private static void copyNamespace( Connection connSource, Connection connTarget, List<String> dbObjects, List<String> valuePatterns, List<String> valueReplacements, PrintStream out ) { String currentStatement = null; try { out.println("Processing tables:"); int ii = 0; for(String dbObject: dbObjects) { out.println(ii + ": " + dbObject); ii++; } Set<String> processedDbObjects = new HashSet<String>(); for (String dbObject: dbObjects) { if((dbObject != null) && !dbObject.isEmpty() && !processedDbObjects.contains(dbObject)) { out.println("Copying table: " + dbObject); CopyDb.copyDbObject( dbObject, false, connSource, connTarget, valuePatterns, valueReplacements, out ); out.println("Copying table: " + dbObject + "_"); CopyDb.copyDbObject( dbObject, true, connSource, connTarget, valuePatterns, valueReplacements, out ); processedDbObjects.add(dbObject); } } } catch (SQLException e) { ServiceException e0 = new ServiceException(e); e0.log(); out.println("statement: " + currentStatement + " (message=" + e0.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyNamespace File: core/src/main/java/org/opencrx/kernel/tools/CopyDb.java Repository: opencrx The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-25959
MEDIUM
4.3
opencrx
copyNamespace
core/src/main/java/org/opencrx/kernel/tools/CopyDb.java
14e75f95e5f56fbe7ee897bdf5d858788072e818
0
Analyze the following code function for security vulnerabilities
@Nonnull private Number _parseNumber (@Nonnull final IJsonParsePosition aStartPos, final boolean bIsDecimal, final boolean bHasExponent, final boolean bHasPositiveExponent, @Nonnull final JsonStringBuilder aNumChars) throws JsonParseException { try { final int nCharCount = aNumChars.getLength (); if (bIsDecimal) { // Decimal number if (nCharCount > 18 || m_bAlwaysUseBigNumber) return aNumChars.getAsBigDecimal (); return aNumChars.getAsDouble (); } if (bHasExponent) { // Integer number if (bHasPositiveExponent) { // Required for correct "e" handling return aNumChars.getAsBigDecimal ().toBigIntegerExact (); } // Required for correct "e" handling return aNumChars.getAsBigDecimal (); } // No exponent present if (m_bAlwaysUseBigNumber) return aNumChars.getAsBigInteger (); return _parseNumberInt (aNumChars); } catch (final NumberFormatException ex) { // This should never happen, as our consistency check beforehand are quite // okay :) throw _parseEx (aStartPos, "Invalid JSON Number '" + aNumChars.getAsString () + "'"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _parseNumber File: ph-json/src/main/java/com/helger/json/parser/JsonParser.java Repository: phax/ph-commons The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34612
HIGH
7.5
phax/ph-commons
_parseNumber
ph-json/src/main/java/com/helger/json/parser/JsonParser.java
02a4d034dcfb2b6e1796b25f519bf57a6796edce
0
Analyze the following code function for security vulnerabilities
public Iterator<WorkUnit> getWorkUnitIterator() { return workUnitList.iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWorkUnitIterator File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
getWorkUnitIterator
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
private void verifyReadOperation(boolean authoritative) { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } PartitionedTopicMetadata partitionMetadata = getPartitionedTopicMetadata(topicName, authoritative, false); if (partitionMetadata.partitions > 0) { throw new RestException(Status.METHOD_NOT_ALLOWED, "Peek messages on a partitioned topic is not allowed"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyReadOperation 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
verifyReadOperation
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public Float getFloat(K name) { V v = get(name); try { return v != null ? toFloat(name, v) : null; } catch (RuntimeException ignore) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFloat File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
getFloat
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
private void replacePackageLI(PackageParser.Package pkg, int parseFlags, int scanFlags, UserHandle user, String installerPackageName, String volumeUuid, PackageInstalledInfo res) { final PackageParser.Package oldPackage; final String pkgName = pkg.packageName; final int[] allUsers; final boolean[] perUserInstalled; // First find the old package info and check signatures synchronized(mPackages) { oldPackage = mPackages.get(pkgName); if (DEBUG_INSTALL) Slog.d(TAG, "replacePackageLI: new=" + pkg + ", old=" + oldPackage); final PackageSetting ps = mSettings.mPackages.get(pkgName); if (shouldCheckUpgradeKeySetLP(ps, scanFlags)) { if(!checkUpgradeKeySetLP(ps, pkg)) { res.setError(INSTALL_FAILED_UPDATE_INCOMPATIBLE, "New package not signed by keys specified by upgrade-keysets: " + pkgName); return; } } else { // default to original signature matching if (compareSignatures(oldPackage.mSignatures, pkg.mSignatures) != PackageManager.SIGNATURE_MATCH) { res.setError(INSTALL_FAILED_UPDATE_INCOMPATIBLE, "New package has a different signature: " + pkgName); return; } } // In case of rollback, remember per-user/profile install state allUsers = sUserManager.getUserIds(); perUserInstalled = new boolean[allUsers.length]; for (int i = 0; i < allUsers.length; i++) { perUserInstalled[i] = ps != null ? ps.getInstalled(allUsers[i]) : false; } } boolean sysPkg = (isSystemApp(oldPackage)); if (sysPkg) { replaceSystemPackageLI(oldPackage, pkg, parseFlags, scanFlags, user, allUsers, perUserInstalled, installerPackageName, volumeUuid, res); } else { replaceNonSystemPackageLI(oldPackage, pkg, parseFlags, scanFlags, user, allUsers, perUserInstalled, installerPackageName, volumeUuid, res); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replacePackageLI 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
replacePackageLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected NullValueProvider findContentNullProvider(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?> valueDeser) throws JsonMappingException { final Nulls nulls = findContentNullStyle(ctxt, prop); if (nulls == Nulls.SKIP) { return NullsConstantProvider.skipper(); } // 09-Dec-2019, tatu: [databind#2567] need to ensure correct target type (element, // not container), so inlined here before calling _findNullProvider if (nulls == Nulls.FAIL) { if (prop == null) { JavaType type = ctxt.constructType(valueDeser.handledType()); // should always be container? But let's double-check just in case: if (type.isContainerType()) { type = type.getContentType(); } return NullsFailProvider.constructForRootValue(type); } return NullsFailProvider.constructForProperty(prop, prop.getType().getContentType()); } NullValueProvider prov = _findNullProvider(ctxt, prop, nulls, valueDeser); if (prov != null) { return prov; } return valueDeser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findContentNullProvider File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
findContentNullProvider
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public Column getColumn(Object propertyId) { return columns.get(propertyId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getColumn 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
getColumn
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public Bitmap getTaskDescriptionIcon(String filename) { if (!FileUtils.isValidExtFilename(filename) || !filename.contains(ActivityRecord.ACTIVITY_ICON_SUFFIX)) { throw new IllegalArgumentException("Bad filename: " + filename); } return mTaskPersister.getTaskDescriptionIcon(filename); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskDescriptionIcon 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
getTaskDescriptionIcon
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public void addObjectsToRemove(BaseObject object) { addXObjectToRemove(object); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObjectsToRemove 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
addObjectsToRemove
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
private int doSaveCurrentState(Context context, HttpServletRequest request, HttpServletResponse response, SubmissionInfo subInfo, SubmissionStepConfig stepConfig) throws ServletException { int result = -1; // As long as we're not uploading a file, go ahead and SAVE // all of the user's inputs for later try { // call post-processing on Step (to save any inputs from JSP) log .debug("Cancel/Save or Jump/Previous Request: calling processing for Step: '" + stepConfig.getProcessingClassName() + "'"); try { // load the step class (using the current class loader) ClassLoader loader = this.getClass().getClassLoader(); Class stepClass = loader.loadClass(stepConfig .getProcessingClassName()); // load the JSPStepManager object for this step AbstractProcessingStep step = (AbstractProcessingStep) stepClass .newInstance(); result = step.doProcessing(context, request, response, subInfo); } catch (Exception e) { log.error("Error loading step class'" + stepConfig.getProcessingClassName() + "':", e); JSPManager.showInternalError(request, response); } } catch(Exception e) { throw new ServletException(e); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doSaveCurrentState File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
doSaveCurrentState
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
void keepProcessAliveLocked(int pid) { int toastCount = 0; // toasts from this pid ArrayList<ToastRecord> list = mToastQueue; int N = list.size(); for (int i=0; i<N; i++) { ToastRecord r = list.get(i); if (r.pid == pid) { toastCount++; } } try { mAm.setProcessForeground(mForegroundToken, pid, toastCount > 0); } catch (RemoteException e) { // Shouldn't happen. } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keepProcessAliveLocked File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
keepProcessAliveLocked
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
static public File getFile(ImportingJob job, ObjectNode fileRecord) { return getFile(job, JSONUtilities.getString(fileRecord, "location", "")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFile File: main/src/com/google/refine/importing/ImportingUtilities.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
getFile
main/src/com/google/refine/importing/ImportingUtilities.java
e243e73e4064de87a913946bd320fbbe246da656
0
Analyze the following code function for security vulnerabilities
protected Map<Node,Computer> getComputerMap() { return computers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getComputerMap File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getComputerMap
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@Override public void replaceItems(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template) throws Exception { // verify the source directory File d = new java.io.File(sourceDir); if (d == null || !d.isDirectory()) { throw new Exception("Error, cannot open source directory " + sourceDir); } // read in HashMap first, to get list of handles & source dirs Map<String, String> myHash = readMapFile(mapFile); // for each handle, re-import the item, discard the new handle // and re-assign the old handle for (Map.Entry<String, String> mapEntry : myHash.entrySet()) { // get the old handle String newItemName = mapEntry.getKey(); String oldHandle = mapEntry.getValue(); Item oldItem = null; if (oldHandle.indexOf('/') != -1) { System.out.println("\tReplacing: " + oldHandle); // add new item, locate old one oldItem = (Item) handleService.resolveToObject(c, oldHandle); } else { oldItem = itemService.findByIdOrLegacyId(c, oldHandle); } /* Rather than exposing public item methods to change handles -- * two handles can't exist at the same time due to key constraints * so would require temp handle being stored, old being copied to new and * new being copied to old, all a bit messy -- a handle file is written to * the import directory containing the old handle, the existing item is * deleted and then the import runs as though it were loading an item which * had already been assigned a handle (so a new handle is not even assigned). * As a commit does not occur until after a successful add, it is safe to * do a delete as any error results in an aborted transaction without harming * the original item */ File handleFile = new File(sourceDir + File.separatorChar + newItemName + File.separatorChar + "handle"); PrintWriter handleOut = new PrintWriter(new FileWriter(handleFile, true)); if (handleOut == null) { throw new Exception("can't open handle file: " + handleFile.getCanonicalPath()); } handleOut.println(oldHandle); handleOut.close(); deleteItem(c, oldItem); Item newItem = addItem(c, mycollections, sourceDir, newItemName, null, template); c.uncacheEntity(oldItem); c.uncacheEntity(newItem); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceItems File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
replaceItems
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
ApplicationInfo getAppInfoForUser(ApplicationInfo info, int userId) { if (info == null) return null; ApplicationInfo newInfo = new ApplicationInfo(info); newInfo.initForUser(userId); return newInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppInfoForUser 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
getAppInfoForUser
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public boolean clearTargetBssid(String dbg) { WifiConfiguration config = mWifiConfigManager.getConfiguredNetwork(mTargetNetworkId); if (config == null) { return false; } String bssid = SUPPLICANT_BSSID_ANY; if (config.BSSID != null) { bssid = config.BSSID; if (mVerboseLoggingEnabled) { Log.d(getTag(), "force BSSID to " + bssid + "due to config"); } } if (mVerboseLoggingEnabled) { logd(dbg + " clearTargetBssid " + bssid + " key=" + config.getProfileKey()); } mTargetBssid = bssid; return mWifiNative.setNetworkBSSID(mInterfaceName, bssid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearTargetBssid 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
clearTargetBssid
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected void hide() { if (mContentViewCore != null) mContentViewCore.onHide(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hide File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
hide
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
void visitNodeTreeBottomUp(Consumer<StateNode> visitor) { LinkedList<StateNode> stack = new LinkedList<>(); stack.add(this); // not done inside loop to please Sonarcube forEachChild(stack::addFirst); StateNode previousParent = this; Set<StateNode> childrenAdded = new HashSet<>(); while (!stack.isEmpty()) { StateNode current = stack.getFirst(); assert current != null; if (current == previousParent) { visitor.accept(stack.removeFirst()); previousParent = current.getParent(); } else if (childrenAdded.contains(current)) { previousParent = current; } else { current.forEachChild(stack::addFirst); childrenAdded.add(current); previousParent = current; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: visitNodeTreeBottomUp File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
visitNodeTreeBottomUp
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
public void readTranslationMetaFromForm(EditForm eform, XWikiContext context) throws XWikiException { String content = eform.getContent(); if (content != null) { // Cleanup in case we use HTMLAREA // content = context.getUtil().substitute("s/<br class=\\\"htmlarea\\\"\\/>/\\r\\n/g", // content); content = context.getUtil().substitute("s/<br class=\"htmlarea\" \\/>/\r\n/g", content); setContent(content); } String title = eform.getTitle(); if (title != null) { setTitle(title); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readTranslationMetaFromForm File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
readTranslationMetaFromForm
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
@Override public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken) { if (permission == null) { return PackageManager.PERMISSION_DENIED; } // We might be performing an operation on behalf of an indirect binder // invocation, e.g. via {@link #openContentUri}. Check and adjust the // client identity accordingly before proceeding. Identity tlsIdentity = sCallerIdentity.get(); if (tlsIdentity != null && tlsIdentity.token == callerToken) { Slog.d(TAG, "checkComponentPermission() adjusting {pid,uid} to {" + tlsIdentity.pid + "," + tlsIdentity.uid + "}"); uid = tlsIdentity.uid; pid = tlsIdentity.pid; } return checkComponentPermission(permission, pid, UserHandle.getAppId(uid), -1, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermissionWithToken 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
checkPermissionWithToken
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected String onHtmlifyEnd(String html, Object extras) { return html; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onHtmlifyEnd 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
onHtmlifyEnd
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void setPasswordInternal(UserAccounts accounts, Account account, String password, int callingUid) { if (account == null) { return; } boolean isChanged = false; synchronized (accounts.dbLock) { synchronized (accounts.cacheLock) { accounts.accountsDb.beginTransaction(); try { final long accountId = accounts.accountsDb.findDeAccountId(account); if (accountId >= 0) { accounts.accountsDb.updateCeAccountPassword(accountId, password); accounts.accountsDb.deleteAuthTokensByAccountId(accountId); accounts.authTokenCache.remove(account); accounts.accountTokenCaches.remove(account); accounts.accountsDb.setTransactionSuccessful(); // If there is an account whose password will be updated and the database // transactions succeed, then we say that a change has occured. Even if the // new password is the same as the old and there were no authtokens to // delete. isChanged = true; String action = (password == null || password.length() == 0) ? AccountsDb.DEBUG_ACTION_CLEAR_PASSWORD : AccountsDb.DEBUG_ACTION_SET_PASSWORD; logRecord(action, AccountsDb.TABLE_ACCOUNTS, accountId, accounts, callingUid); } } finally { accounts.accountsDb.endTransaction(); if (isChanged) { // Send LOGIN_ACCOUNTS_CHANGED only if the something changed. sendNotificationAccountUpdated(account, accounts); sendAccountsChangedBroadcast(accounts.userId); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPasswordInternal File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
setPasswordInternal
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private Configuration updateOrientationFromAppTokensLocked( Configuration currentConfig, IBinder freezeThisOneIfNeeded) { if (!mDisplayReady) { return null; } Configuration config = null; if (updateOrientationFromAppTokensLocked(false)) { if (freezeThisOneIfNeeded != null) { AppWindowToken atoken = findAppWindowToken(freezeThisOneIfNeeded); if (atoken != null) { startAppFreezingScreenLocked(atoken); } } config = computeNewConfigurationLocked(); } else if (currentConfig != null) { // No obvious action we need to take, but if our current // state mismatches the activity manager's, update it, // disregarding font scale, which should remain set to // the value of the previous configuration. mTempConfiguration.setToDefaults(); mTempConfiguration.fontScale = currentConfig.fontScale; computeScreenConfigurationLocked(mTempConfiguration); if (currentConfig.diff(mTempConfiguration) != 0) { mWaitingForConfig = true; final DisplayContent displayContent = getDefaultDisplayContentLocked(); displayContent.layoutNeeded = true; int anim[] = new int[2]; if (displayContent.isDimming()) { anim[0] = anim[1] = 0; } else { mPolicy.selectRotationAnimationLw(anim); } startFreezingDisplayLocked(false, anim[0], anim[1]); config = new Configuration(mTempConfiguration); } } return config; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOrientationFromAppTokensLocked 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
updateOrientationFromAppTokensLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void saveDocument(String comment, boolean minorEdit, boolean checkSaving) throws XWikiException { XWikiDocument doc = getDoc(); DocumentReference currentUserReference = getXWikiContext().getUserReference(); doc.setAuthorReference(currentUserReference); if (doc.isNew()) { doc.setCreatorReference(currentUserReference); } if (checkSaving) { // Make sure the user is allowed to make this modification getXWikiContext().getWiki().checkSavingDocument(doc.getAuthorReference(), doc, comment, minorEdit, getXWikiContext()); } getXWikiContext().getWiki().saveDocument(doc, comment, minorEdit, getXWikiContext()); this.initialDoc = this.doc; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveDocument 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
saveDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public String getWikiOwner(String wikiName, XWikiContext context) throws XWikiException { String wikiOwner; String currentdatabase = context.getWikiId(); try { context.setWikiId(context.getMainXWiki()); String serverwikipage = getServerWikiPage(wikiName); XWikiDocument doc = getDocument(serverwikipage, context); if (doc.isNew()) { if (!context.isMainWiki(wikiName)) { throw new XWikiException(XWikiException.MODULE_XWIKI, XWikiException.ERROR_XWIKI_DOES_NOT_EXIST, "The wiki " + wikiName + " does not exist"); } else { wikiOwner = null; } } else { wikiOwner = doc.getStringValue(VIRTUAL_WIKI_DEFINITION_CLASS_REFERENCE, "owner"); if (wikiOwner.indexOf(':') == -1) { wikiOwner = context.getMainXWiki() + ":" + wikiOwner; } } } finally { context.setWikiId(currentdatabase); } return wikiOwner; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWikiOwner 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
getWikiOwner
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void toggleRecentApps() { mPreloadedRecentApps = false; // preloading no longer needs to be canceled try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { statusbar.toggleRecentApps(); } } catch (RemoteException e) { Slog.e(TAG, "RemoteException when toggling recent apps", e); // re-acquire status bar service next time it is needed. mStatusBarService = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toggleRecentApps File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
toggleRecentApps
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
void acquireLaunchWakelock() { if (VALIDATE_WAKE_LOCK_CALLER && Binder.getCallingUid() != Process.myUid()) { throw new IllegalStateException("Calling must be system uid"); } mLaunchingActivity.acquire(); if (!mHandler.hasMessages(LAUNCH_TIMEOUT_MSG)) { // To be safe, don't allow the wake lock to be held for too long. mHandler.sendEmptyMessageDelayed(LAUNCH_TIMEOUT_MSG, LAUNCH_TIMEOUT); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: acquireLaunchWakelock 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
acquireLaunchWakelock
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public void deleteIssueRelate(IssuesRequest request) { String caseResourceId = request.getCaseResourceId(); String id = request.getId(); TestCaseIssuesExample example = new TestCaseIssuesExample(); if (request.getIsPlanEdit() == true) { example.createCriteria().andResourceIdEqualTo(caseResourceId).andIssuesIdEqualTo(id); testCaseIssuesMapper.deleteByExample(example); testCaseIssueService.updateIssuesCount(caseResourceId); } else { IssuesUpdateRequest updateRequest = new IssuesUpdateRequest(); updateRequest.setId(request.getId()); updateRequest.setResourceId(request.getCaseResourceId()); updateRequest.setProjectId(request.getProjectId()); updateRequest.setWorkspaceId(request.getWorkspaceId()); List<IssuesPlatform> platformList = getUpdatePlatforms(updateRequest); platformList.forEach(platform -> { platform.removeIssueParentLink(updateRequest); }); extIssuesMapper.deleteIssues(id, caseResourceId); TestPlanTestCaseExample testPlanTestCaseExample = new TestPlanTestCaseExample(); testPlanTestCaseExample.createCriteria().andCaseIdEqualTo(caseResourceId); List<TestPlanTestCase> list = testPlanTestCaseMapper.selectByExample(testPlanTestCaseExample); list.forEach(item -> { testCaseIssueService.updateIssuesCount(item.getId()); }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteIssueRelate File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
deleteIssueRelate
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
private Map<String, Feature> parseFeatureGroupTag(Element featGroupTag) { NamedNodeMap nnm = featGroupTag.getAttributes(); String groupName; if (nnm.getNamedItem(FEATUREGROUP_ATTNAME) == null) { throw new IllegalArgumentException("Error syntax in configuration featuregroup : must have 'name' attribute"); } groupName = nnm.getNamedItem(FEATUREGROUP_ATTNAME).getNodeValue(); Map<String, Feature> groupFeatures = new HashMap<String, Feature>(); NodeList listOfFeat = featGroupTag.getElementsByTagName(FEATURE_TAG); for (int k = 0; k < listOfFeat.getLength(); k++) { Feature f = parseFeatureTag((Element) listOfFeat.item(k)); // Insert feature into group f.setGroup(groupName); groupFeatures.put(f.getUid(), f); } return groupFeatures; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseFeatureGroupTag File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
parseFeatureGroupTag
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
void showAllWindowsLocked() { forAllWindows(windowState -> { if (DEBUG_VISIBILITY) Slog.v(TAG, "performing show on: " + windowState); windowState.performShowLocked(); }, false /* traverseTopToBottom */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showAllWindowsLocked 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
showAllWindowsLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public HttpData touch() { return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: touch File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
touch
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
public static List<String> articleRouterList() { return Collections.singletonList("/" + com.zrlog.common.Constants.getArticleRoute()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: articleRouterList File: web/src/main/java/com/zrlog/web/config/ZrLogConfig.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
articleRouterList
web/src/main/java/com/zrlog/web/config/ZrLogConfig.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public void resetApplicationPreferences(int userId) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.SET_PREFERRED_APPLICATIONS, null); // writer synchronized (mPackages) { final long identity = Binder.clearCallingIdentity(); try { clearPackagePreferredActivitiesLPw(null, userId); mSettings.applyDefaultPreferredAppsLPw(this, userId); // TODO: We have to reset the default SMS and Phone. This requires // significant refactoring to keep all default apps in the package // manager (cleaner but more work) or have the services provide // callbacks to the package manager to request a default app reset. applyFactoryDefaultBrowserLPw(userId); clearIntentFilterVerificationsLPw(userId); primeDomainVerificationsLPw(userId); resetUserChangesToRuntimePermissionsAndFlagsLPw(userId); scheduleWritePackageRestrictionsLocked(userId); } finally { Binder.restoreCallingIdentity(identity); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetApplicationPreferences 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
resetApplicationPreferences
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void getCursorPath(int point, Path dest, CharSequence editingBuffer) { dest.reset(); int line = getLineForOffset(point); int top = getLineTop(line); int bottom = getLineTop(line+1); boolean clamped = shouldClampCursor(line); float h1 = getPrimaryHorizontal(point, clamped) - 0.5f; float h2 = isLevelBoundary(point) ? getSecondaryHorizontal(point, clamped) - 0.5f : h1; int caps = TextKeyListener.getMetaState(editingBuffer, TextKeyListener.META_SHIFT_ON) | TextKeyListener.getMetaState(editingBuffer, TextKeyListener.META_SELECTING); int fn = TextKeyListener.getMetaState(editingBuffer, TextKeyListener.META_ALT_ON); int dist = 0; if (caps != 0 || fn != 0) { dist = (bottom - top) >> 2; if (fn != 0) top += dist; if (caps != 0) bottom -= dist; } if (h1 < 0.5f) h1 = 0.5f; if (h2 < 0.5f) h2 = 0.5f; if (Float.compare(h1, h2) == 0) { dest.moveTo(h1, top); dest.lineTo(h1, bottom); } else { dest.moveTo(h1, top); dest.lineTo(h1, (top + bottom) >> 1); dest.moveTo(h2, (top + bottom) >> 1); dest.lineTo(h2, bottom); } if (caps == 2) { dest.moveTo(h2, bottom); dest.lineTo(h2 - dist, bottom + dist); dest.lineTo(h2, bottom); dest.lineTo(h2 + dist, bottom + dist); } else if (caps == 1) { dest.moveTo(h2, bottom); dest.lineTo(h2 - dist, bottom + dist); dest.moveTo(h2 - dist, bottom + dist - 0.5f); dest.lineTo(h2 + dist, bottom + dist - 0.5f); dest.moveTo(h2 + dist, bottom + dist); dest.lineTo(h2, bottom); } if (fn == 2) { dest.moveTo(h1, top); dest.lineTo(h1 - dist, top - dist); dest.lineTo(h1, top); dest.lineTo(h1 + dist, top - dist); } else if (fn == 1) { dest.moveTo(h1, top); dest.lineTo(h1 - dist, top - dist); dest.moveTo(h1 - dist, top - dist + 0.5f); dest.lineTo(h1 + dist, top - dist + 0.5f); dest.moveTo(h1 + dist, top - dist); dest.lineTo(h1, top); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCursorPath File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getCursorPath
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
public void loadIfNecessary() { if (mNativeContentViewCore != 0) nativeLoadIfNecessary(mNativeContentViewCore); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadIfNecessary 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
loadIfNecessary
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected void updateStage(Stage stage) { final Stage previousStage = mUiStage; mUiStage = stage; // header text, footer text, visibility and // enabled state all known from the stage if (stage == Stage.ChoiceTooShort) { mHeaderText.setText( getResources().getString( stage.headerMessage, LockPatternUtils.MIN_LOCK_PATTERN_SIZE)); } else { mHeaderText.setText(stage.headerMessage); } final GlifLayout layout = getActivity().findViewById(R.id.setup_wizard_layout); final boolean forAnyBiometric = mForFingerprint || mForFace || mForBiometrics; if (forAnyBiometric) { if (stage.messageForBiometrics == ID_EMPTY_MESSAGE) { layout.setDescriptionText(""); } else { layout.setDescriptionText(stage.messageForBiometrics); } } else { layout.getDescriptionTextView().setVisibility(View.GONE); } if (stage.footerMessage == ID_EMPTY_MESSAGE) { mFooterText.setText(""); } else { mFooterText.setText(stage.footerMessage); } if (stage == Stage.ConfirmWrong || stage == Stage.ChoiceTooShort) { TypedValue typedValue = new TypedValue(); Theme theme = getActivity().getTheme(); theme.resolveAttribute(R.attr.colorError, typedValue, true); mHeaderText.setTextColor(typedValue.data); } else { if (mDefaultHeaderColorList != null) { mHeaderText.setTextColor(mDefaultHeaderColorList); } if (stage == Stage.NeedToConfirm && forAnyBiometric) { mHeaderText.setText(""); layout.setHeaderText(R.string.lockpassword_draw_your_pattern_again_header); } } updateFooterLeftButton(stage); setRightButtonText(stage.rightMode.text); setRightButtonEnabled(stage.rightMode.enabled); // same for whether the pattern is enabled if (stage.patternEnabled) { mLockPatternView.enableInput(); } else { mLockPatternView.disableInput(); } // the rest of the stuff varies enough that it is easier just to handle // on a case by case basis. mLockPatternView.setDisplayMode(DisplayMode.Correct); boolean announceAlways = false; switch (mUiStage) { case Introduction: mLockPatternView.clearPattern(); break; case HelpScreen: mLockPatternView.setPattern(DisplayMode.Animate, mAnimatePattern); break; case ChoiceTooShort: mLockPatternView.setDisplayMode(DisplayMode.Wrong); postClearPatternRunnable(); announceAlways = true; break; case FirstChoiceValid: break; case NeedToConfirm: mLockPatternView.clearPattern(); break; case ConfirmWrong: mLockPatternView.setDisplayMode(DisplayMode.Wrong); postClearPatternRunnable(); announceAlways = true; break; case ChoiceConfirmed: break; } // If the stage changed, announce the header for accessibility. This // is a no-op when accessibility is disabled. if (previousStage != stage || announceAlways) { mHeaderText.announceForAccessibility(mHeaderText.getText()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateStage File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
updateStage
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
private void retrieveSettings() { final ContentResolver resolver = mContext.getContentResolver(); String debugApp = Settings.Global.getString( resolver, Settings.Global.DEBUG_APP); boolean waitForDebugger = Settings.Global.getInt( resolver, Settings.Global.WAIT_FOR_DEBUGGER, 0) != 0; boolean alwaysFinishActivities = Settings.Global.getInt( resolver, Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0) != 0; boolean forceRtl = Settings.Global.getInt( resolver, Settings.Global.DEVELOPMENT_FORCE_RTL, 0) != 0; // Transfer any global setting for forcing RTL layout, into a System Property SystemProperties.set(Settings.Global.DEVELOPMENT_FORCE_RTL, forceRtl ? "1":"0"); Configuration configuration = new Configuration(); Settings.System.getConfiguration(resolver, configuration); if (forceRtl) { // This will take care of setting the correct layout direction flags configuration.setLayoutDirection(configuration.locale); } synchronized (this) { mDebugApp = mOrigDebugApp = debugApp; mWaitForDebugger = mOrigWaitForDebugger = waitForDebugger; mAlwaysFinishActivities = alwaysFinishActivities; // This happens before any activities are started, so we can // change mConfiguration in-place. updateConfigurationLocked(configuration, null, false, true); if (DEBUG_CONFIGURATION) Slog.v(TAG, "Initial config: " + mConfiguration); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveSettings 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
retrieveSettings
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private EntityReferenceSerializer<String> getDefaultEntityReferenceSerializer() { if (this.defaultEntityReferenceSerializer == null) { this.defaultEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING); } return this.defaultEntityReferenceSerializer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultEntityReferenceSerializer 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
getDefaultEntityReferenceSerializer
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 Message getDeregisteredMessage(Instance instance, StandardEvaluationContext context) { String activitySubtitle = evaluateExpression(context, deregisterActivitySubtitle); return createMessage(instance, deRegisteredTitle, activitySubtitle, context); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getDeregisteredMessage File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: protected Message getDeregisteredMessage(Instance instance, EvaluationContext context) { String activitySubtitle = evaluateExpression(context, deregisterActivitySubtitle); return createMessage(instance, deRegisteredTitle, activitySubtitle, context); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getDeregisteredMessage
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
public void loadDataSyncWithCharset(final AwContents awContents, CallbackHelper onPageFinishedHelper, final String data, final String mimeType, final boolean isBase64Encoded, final String charset) throws Exception { int currentCallCount = onPageFinishedHelper.getCallCount(); getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { awContents.loadUrl(LoadUrlParams.createLoadDataParams( data, mimeType, isBase64Encoded, charset)); } }); onPageFinishedHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_MS, TimeUnit.MILLISECONDS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadDataSyncWithCharset File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
loadDataSyncWithCharset
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
private boolean isTrustDisabled(int userId) { // Don't allow trust agent if device is secured with a SIM PIN. This is here // mainly because there's no other way to prompt the user to enter their SIM PIN // once they get past the keyguard screen. final boolean disabledBySimPin = isSimPinSecure(); return disabledBySimPin; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTrustDisabled File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isTrustDisabled
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public void skipArray() { if (currentEvent == Event.START_ARRAY) { currentContext.skip(); currentContext = stack.pop(); currentEvent = Event.END_ARRAY; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: skipArray File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
skipArray
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
@Override public void onRewind() { super.onRewind(); RemoteControlCallback.rewind(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRewind File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onRewind
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setPackageAskScreenCompat(String packageName, boolean ask) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(packageName); data.writeInt(ask ? 1 : 0); mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); reply.readException(); reply.recycle(); data.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageAskScreenCompat File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setPackageAskScreenCompat
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static SubmissionInfo getSubmissionInfo(Context context, HttpServletRequest request) throws SQLException, ServletException { SubmissionInfo info = null; // Is full Submission Info in Request Attribute? if (request.getAttribute("submission.info") != null) { // load from cache info = (SubmissionInfo) request.getAttribute("submission.info"); } else { // Need to rebuild Submission Info from Request Parameters if (request.getParameter("workflow_id") != null) { int workflowID = UIUtil.getIntParameter(request, "workflow_id"); info = SubmissionInfo.load(request, WorkflowItem.find(context, workflowID)); } else if(request.getParameter("workspace_item_id") != null) { int workspaceID = UIUtil.getIntParameter(request, "workspace_item_id"); info = SubmissionInfo.load(request, WorkspaceItem.find(context, workspaceID)); } else { //by default, initialize Submission Info with no item info = SubmissionInfo.load(request, null); } // We must have a submission object if after the first step, // otherwise something is wrong! if ((getStepReached(info) > FIRST_STEP) && (info.getSubmissionItem() == null)) { log.warn(LogManager.getHeader(context, "cannot_load_submission_info", "InProgressSubmission is null!")); return null; } if (request.getParameter("bundle_id") != null) { int bundleID = UIUtil.getIntParameter(request, "bundle_id"); info.setBundle(Bundle.find(context, bundleID)); } if (request.getParameter("bitstream_id") != null) { int bitstreamID = UIUtil.getIntParameter(request, "bitstream_id"); info.setBitstream(Bitstream.find(context, bitstreamID)); } // save to Request Attribute saveSubmissionInfo(request, info); }// end if unable to load SubInfo from Request Attribute return info; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubmissionInfo File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
getSubmissionInfo
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
private static ArrayList<String> buildEmailAddressList(String[] recips) { // Tokenize them all and put them in the list. final ArrayList<String> recipAddresses = Lists.newArrayListWithCapacity(recips.length); for (int i = 0; i < recips.length; i++) { recipAddresses.add(Rfc822Tokenizer.tokenize(recips[i])[0].getAddress()); } return recipAddresses; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildEmailAddressList 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
buildEmailAddressList
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0