instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static void setBeginningOfStep(HttpServletRequest request, boolean beginningOfStep) { request.setAttribute("step.start", Boolean.valueOf(beginningOfStep)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBeginningOfStep 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
setBeginningOfStep
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNativeEditorVisible(Component c) { return super.isNativeEditorVisible(c) && !InPlaceEditView.isActiveTextEditorHidden(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNativeEditorVisible File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
isNativeEditorVisible
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getSpacePreferenceFor(String preference, SpaceReference spaceReference, String defaultValue) { return this.xwiki.getSpacePreference(preference, spaceReference, defaultValue, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpacePreferenceFor 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
getSpacePreferenceFor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public void unregisterReceiver(IIntentReceiver receiver) { if (DEBUG_BROADCAST) Slog.v(TAG, "Unregister receiver: " + receiver); final long origId = Binder.clearCallingIdentity(); try { boolean doTrim = false; synchronized(this) { ReceiverList rl = mRegisteredReceivers.get(receiver.asBinder()); if (rl != null) { if (rl.curBroadcast != null) { BroadcastRecord r = rl.curBroadcast; final boolean doNext = finishReceiverLocked( receiver.asBinder(), r.resultCode, r.resultData, r.resultExtras, r.resultAbort); if (doNext) { doTrim = true; r.queue.processNextBroadcast(false); } } if (rl.app != null) { rl.app.receivers.remove(rl); } removeReceiverLocked(rl); if (rl.linkedToDeath) { rl.linkedToDeath = false; rl.receiver.asBinder().unlinkToDeath(rl, 0); } } } // If we actually concluded any broadcasts, we might now be able // to trim the recipients' apps from our working set if (doTrim) { trimApplications(); return; } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterReceiver 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
unregisterReceiver
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private static Element getFirstTag(Element element, String tag) { try { NodeList nodeList = element.getElementsByTagName(tag); if (nodeList.getLength() == 0) return null; for (int i=0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) return (Element) node; } } catch (Exception e) { log.warning("Error getting first tag "+tag+" under element="+element); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstTag File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
getFirstTag
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
private VersionInfo getSettingsVersionForPackage(PackageParser.Package pkg) { if (isExternal(pkg)) { if (TextUtils.isEmpty(pkg.volumeUuid)) { return mSettings.getExternalVersion(); } else { return mSettings.findOrCreateVersion(pkg.volumeUuid); } } else { return mSettings.getInternalVersion(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingsVersionForPackage 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
getSettingsVersionForPackage
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void saveWikiPageProperties(OLATResourceable ores, WikiPage page) { VFSContainer wikiContentContainer = getWikiContainer(ores, WIKI_RESOURCE_FOLDER_NAME); VFSLeaf leaf = (VFSLeaf) wikiContentContainer.resolve(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX); if (leaf == null) leaf = wikiContentContainer.createChildLeaf(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX); Properties p = getPageProperties(page); try { p.store(leaf.getOutputStream(false), "wiki page meta properties"); } catch (IOException e) { throw new OLATRuntimeException(WikiManager.class, "failed to save wiki page properties for page with id: " + page.getPageId() +" and olatresource: " + ores.getResourceableId(), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveWikiPageProperties File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
saveWikiPageProperties
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
private byte[] getOutput() throws BadPaddingException { try { byte[] bytes = bOut.toByteArray(); return cipher.processBlock(bytes, 0, bytes.length); } catch (final InvalidCipherTextException e) { throw new BadPaddingException("unable to decrypt block") { public synchronized Throwable getCause() { return e; } }; } finally { bOut.reset(); } }
Vulnerability Classification: - CWE: CWE-361 - CVE: CVE-2016-1000345 - Severity: MEDIUM - CVSS Score: 4.3 Description: modified IESEngine so that MAC check is the primary one added general BadBlockException class for asymmetric ciphers. Function: getOutput File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java Fixed Code: private byte[] getOutput() throws BadPaddingException { try { byte[] bytes = bOut.toByteArray(); return cipher.processBlock(bytes, 0, bytes.length); } catch (InvalidCipherTextException e) { throw new BadBlockException("unable to decrypt block", e); } finally { bOut.reset(); } }
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
getOutput
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("WeakerAccess") protected List<IBaseResource> toResourceList(ISearchBuilder theSearchBuilder, List<ResourcePersistentId> thePids) { Set<ResourcePersistentId> includedPids = new HashSet<>(); if (mySearchEntity.getSearchType() == SearchTypeEnum.SEARCH) { includedPids.addAll(theSearchBuilder.loadIncludes(myContext, myEntityManager, thePids, mySearchEntity.toRevIncludesList(), true, mySearchEntity.getLastUpdated(), myUuid, myRequest)); includedPids.addAll(theSearchBuilder.loadIncludes(myContext, myEntityManager, thePids, mySearchEntity.toIncludesList(), false, mySearchEntity.getLastUpdated(), myUuid, myRequest)); } List<ResourcePersistentId> includedPidList = new ArrayList<>(includedPids); // Execute the query and make sure we return distinct results List<IBaseResource> resources = new ArrayList<>(); theSearchBuilder.loadResourcesByPid(thePids, includedPidList, resources, false, myRequest); resources = InterceptorUtil.fireStoragePreshowResource(resources, myRequest, myInterceptorBroadcaster); return resources; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toResourceList File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
toResourceList
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
0
Analyze the following code function for security vulnerabilities
public String getDefaultEditMode(XWikiContext context) throws XWikiException { try { return getDefaultEditModeInternal(context); } catch (Exception e) { // If an error happens then we default to the "edit" mode. We don't want to fail by throwing an exception // since it'll lead to several errors in the UI (such as when evaluating contentview.vm for example). LOGGER.error("Failed to get the default edit mode for [{}]", getDocumentReference(), e); return "edit"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultEditMode 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
getDefaultEditMode
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public String getNameForJID(String jid) { if (jid.contains("/")) { // MUC-PM String[] jid_parts = jid.split("/", 2); return String.format("%s (%s)", jid_parts[1], ChatRoomHelper.getRoomName(mService, jid_parts[0])); } RosterEntry re = mRoster.getEntry(jid); if (null != re && null != re.getName() && re.getName().length() > 0) { return re.getName(); } else if (mucJIDs.contains(jid)) { return ChatRoomHelper.getRoomName(mService, jid); } else { return jid; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNameForJID File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
getNameForJID
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public CmsContent updateUrl(Serializable id, String url, boolean hasStatic) { CmsContent entity = getEntity(id); if (null != entity) { entity.setUrl(url); entity.setHasStatic(hasStatic); } return entity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUrl File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
updateUrl
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
private void onLocalVoiceInteractionStartedLocked(IBinder activity, IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor) { ActivityRecord activityToCallback = ActivityRecord.forTokenLocked(activity); if (activityToCallback == null) return; activityToCallback.setVoiceSessionLocked(voiceSession); // Inform the activity try { activityToCallback.app.getThread().scheduleLocalVoiceInteractionStarted(activity, voiceInteractor); final long token = Binder.clearCallingIdentity(); try { startRunningVoiceLocked(voiceSession, activityToCallback.info.applicationInfo.uid); } finally { Binder.restoreCallingIdentity(token); } // TODO: VI Should we cache the activity so that it's easier to find later // rather than scan through all the root tasks and activities? } catch (RemoteException re) { activityToCallback.clearVoiceSessionLocked(); // TODO: VI Should this terminate the voice session? } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLocalVoiceInteractionStartedLocked File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
onLocalVoiceInteractionStartedLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private ServletRequestHandler newPostHttpRequestHandler() { return new ServletRequestHandler() { /** {@inheritDoc} */ public JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp) throws IOException { String encoding = pReq.getCharacterEncoding(); InputStream is = pReq.getInputStream(); return requestHandler.handlePostRequest(pReq.getRequestURI(),is, encoding, getParameterMap(pReq)); } }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newPostHttpRequestHandler File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
newPostHttpRequestHandler
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public static List<SignatureAlgorithm> getSuggestedSignatureAlgorithms(PublicKey signingKey, int minSdkVersion, boolean verityEnabled, boolean deterministicDsaSigning) throws InvalidKeyException { String keyAlgorithm = signingKey.getAlgorithm(); if ("RSA".equalsIgnoreCase(keyAlgorithm)) { // Use RSASSA-PKCS1-v1_5 signature scheme instead of RSASSA-PSS to guarantee // deterministic signatures which make life easier for OTA updates (fewer files // changed when deterministic signature schemes are used). // Pick a digest which is no weaker than the key. int modulusLengthBits = ((RSAKey) signingKey).getModulus().bitLength(); if (modulusLengthBits <= 3072) { // 3072-bit RSA is roughly 128-bit strong, meaning SHA-256 is a good fit. List<SignatureAlgorithm> algorithms = new ArrayList<>(); algorithms.add(SignatureAlgorithm.RSA_PKCS1_V1_5_WITH_SHA256); if (verityEnabled) { algorithms.add(SignatureAlgorithm.VERITY_RSA_PKCS1_V1_5_WITH_SHA256); } return algorithms; } else { // Keys longer than 3072 bit need to be paired with a stronger digest to avoid the // digest being the weak link. SHA-512 is the next strongest supported digest. return Collections.singletonList(SignatureAlgorithm.RSA_PKCS1_V1_5_WITH_SHA512); } } else if ("DSA".equalsIgnoreCase(keyAlgorithm)) { // DSA is supported only with SHA-256. List<SignatureAlgorithm> algorithms = new ArrayList<>(); algorithms.add( deterministicDsaSigning ? SignatureAlgorithm.DETDSA_WITH_SHA256 : SignatureAlgorithm.DSA_WITH_SHA256); if (verityEnabled) { algorithms.add(SignatureAlgorithm.VERITY_DSA_WITH_SHA256); } return algorithms; } else if ("EC".equalsIgnoreCase(keyAlgorithm)) { // Pick a digest which is no weaker than the key. int keySizeBits = ((ECKey) signingKey).getParams().getOrder().bitLength(); if (keySizeBits <= 256) { // 256-bit Elliptic Curve is roughly 128-bit strong, meaning SHA-256 is a good fit. List<SignatureAlgorithm> algorithms = new ArrayList<>(); algorithms.add(SignatureAlgorithm.ECDSA_WITH_SHA256); if (verityEnabled) { algorithms.add(SignatureAlgorithm.VERITY_ECDSA_WITH_SHA256); } return algorithms; } else { // Keys longer than 256 bit need to be paired with a stronger digest to avoid the // digest being the weak link. SHA-512 is the next strongest supported digest. return Collections.singletonList(SignatureAlgorithm.ECDSA_WITH_SHA512); } } else { throw new InvalidKeyException("Unsupported key algorithm: " + keyAlgorithm); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSuggestedSignatureAlgorithms File: src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getSuggestedSignatureAlgorithms
src/main/java/com/android/apksig/internal/apk/v2/V2SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
private void rewind(int i) { offset -= i; characterOffset_ -= i; columnNumber_ -= i; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rewind File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
rewind
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public List<CaptureType> list() { return em.createQuery( "select ct from CaptureType ct", CaptureType.class ).getResultList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: list File: src/main/java/com/rtds/svc/CaptureTypeService.java Repository: jdhwpgmbca/pcapture The code follows secure coding practices.
[ "CWE-754" ]
CVE-2021-39196
MEDIUM
6.8
jdhwpgmbca/pcapture
list
src/main/java/com/rtds/svc/CaptureTypeService.java
0f74f431e0970a2e5784dbd955cfa4760e3b1ef7
0
Analyze the following code function for security vulnerabilities
public int findScanRssi(int netId, int scanRssiValidTimeMs) { int scanMaxRssi = WifiInfo.INVALID_RSSI; ScanDetailCache scanDetailCache = getScanDetailCacheForNetwork(netId); if (scanDetailCache == null || scanDetailCache.size() == 0) return scanMaxRssi; long nowInMillis = mClock.getWallClockMillis(); for (ScanDetail scanDetail : scanDetailCache.values()) { ScanResult result = scanDetail.getScanResult(); if (result == null) continue; boolean valid = (nowInMillis - result.seen) < scanRssiValidTimeMs; if (valid) { scanMaxRssi = Math.max(scanMaxRssi, result.level); } } return scanMaxRssi; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findScanRssi 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
findScanRssi
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public int countTotal(Context context) throws SQLException { return groupDAO.countRows(context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: countTotal File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
countTotal
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
public void setClosing(boolean closing) { mIsClosing = closing; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClosing 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
setClosing
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected int engineUpdate( byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) { bOut.write(input, inputOffset, inputLen); if (cipher instanceof RSABlindedEngine) { if (bOut.size() > cipher.getInputBlockSize() + 1) { throw new ArrayIndexOutOfBoundsException("too much data for RSA block"); } } else { if (bOut.size() > cipher.getInputBlockSize()) { throw new ArrayIndexOutOfBoundsException("too much data for RSA block"); } } return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineUpdate File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineUpdate
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/CipherSpi.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
public static void addFileToZip(String path, Path file, ZipOutputStream exportStream) { try(InputStream source = Files.newInputStream(file)) { exportStream.putNextEntry(new ZipEntry(path)); FileUtils.copy(source, exportStream); exportStream.closeEntry(); } catch(IOException e) { handleIOException("", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFileToZip File: src/main/java/org/olat/core/util/ZipUtil.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
addFileToZip
src/main/java/org/olat/core/util/ZipUtil.java
5668a41ab3f1753102a89757be013487544279d5
0
Analyze the following code function for security vulnerabilities
public void onScreenTurningOn() { mKeyguardStatusView.refreshTime(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onScreenTurningOn 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
onScreenTurningOn
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public DescriptorDigest getImageId() throws DigestException { return DescriptorDigest.fromDigest(imageId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getImageId File: jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java Repository: GoogleContainerTools/jib The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-25914
CRITICAL
9.8
GoogleContainerTools/jib
getImageId
jib-core/src/main/java/com/google/cloud/tools/jib/docker/CliDockerClient.java
67fa40bc2c484da0546333914ea07a89fe44eaaf
0
Analyze the following code function for security vulnerabilities
public boolean isReadWrite() { return readWrite; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isReadWrite File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java Repository: opensearch-project/security The code follows secure coding practices.
[ "CWE-612", "CWE-863" ]
CVE-2022-41918
MEDIUM
6.3
opensearch-project/security
isReadWrite
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
0
Analyze the following code function for security vulnerabilities
private void incrementIndexes(int c) { if(c > 0) { this.index++; if(c=='\r') { this.line++; this.characterPreviousLine = this.character; this.character=0; }else if (c=='\n') { if(this.previous != '\r') { this.line++; this.characterPreviousLine = this.character; } this.character=0; } else { this.character++; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementIndexes File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45690
HIGH
7.5
stleary/JSON-java
incrementIndexes
src/main/java/org/json/JSONTokener.java
7a124d857dc8da1165c87fa788e53359a317d0f7
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unused") @CalledByNative private void showDisambiguationPopup(Rect targetRect, Bitmap zoomedBitmap) { mPopupZoomer.setBitmap(zoomedBitmap); mPopupZoomer.show(targetRect); temporarilyHideTextHandles(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showDisambiguationPopup 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
showDisambiguationPopup
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public void onClick(RssItemViewHolder vh, int position) { if (mPrefs.getBoolean(SettingsActivity.CB_SKIP_DETAILVIEW_AND_OPEN_BROWSER_DIRECTLY_STRING, false)) { String currentUrl = vh.getRssItem().getLink(); //Choose Browser based on user settings //modified copy from NewsDetailFragment.java:loadUrl(String url) int selectedBrowser = Integer.parseInt(mPrefs.getString(SettingsActivity.SP_DISPLAY_BROWSER, "0")); if (selectedBrowser == 0) { // Custom Tabs CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder() .setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary)) .setShowTitle(true) .setStartAnimations(this, R.anim.slide_in_right, R.anim.slide_out_left) .setExitAnimations(this, R.anim.slide_in_left, R.anim.slide_out_right) .addDefaultShareMenuItem(); builder.build().launchUrl(this, Uri.parse(currentUrl)); } else { //External browser Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(currentUrl)); startActivity(browserIntent); } ((NewsListRecyclerAdapter) getNewsReaderDetailFragment().getRecyclerView().getAdapter()).changeReadStateOfItem(vh, true); } else { Intent intentNewsDetailAct = new Intent(this, NewsDetailActivity.class); intentNewsDetailAct.putExtra(NewsReaderListActivity.ITEM_ID, position); intentNewsDetailAct.putExtra(NewsReaderListActivity.TITLE, getNewsReaderDetailFragment().getTitel()); startActivityForResult(intentNewsDetailAct, Activity.RESULT_CANCELED); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClick 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
onClick
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
public boolean hasTileView() { return m_hasTileView; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasTileView File: src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-31544
MEDIUM
5.4
alkacon/opencms-core
hasTileView
src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
21bfbeaf6b038e2c03bb421ce7f0933dd7a7633e
0
Analyze the following code function for security vulnerabilities
private void checkUserProvisioningStateTransition(int currentState, int newState) { // Valid transitions for normal use-cases. switch (currentState) { case DevicePolicyManager.STATE_USER_UNMANAGED: // Can move to any state from unmanaged (except itself as an edge case).. if (newState != DevicePolicyManager.STATE_USER_UNMANAGED) { return; } break; case DevicePolicyManager.STATE_USER_SETUP_INCOMPLETE: case DevicePolicyManager.STATE_USER_SETUP_COMPLETE: // Can only move to finalized from these states. if (newState == STATE_USER_SETUP_FINALIZED) { return; } break; case DevicePolicyManager.STATE_USER_PROFILE_COMPLETE: // Current user has a managed-profile, but current user is not managed, so // rather than moving to finalized state, go back to unmanaged once // profile provisioning is complete. if (newState == DevicePolicyManager.STATE_USER_PROFILE_FINALIZED) { return; } break; case STATE_USER_SETUP_FINALIZED: // Cannot transition out of finalized. break; case DevicePolicyManager.STATE_USER_PROFILE_FINALIZED: // Should only move to an unmanaged state after removing the work profile. if (newState == DevicePolicyManager.STATE_USER_UNMANAGED) { return; } break; } // Didn't meet any of the accepted state transition checks above, throw appropriate error. throw new IllegalStateException("Cannot move to user provisioning state [" + newState + "] " + "from state [" + currentState + "]"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUserProvisioningStateTransition 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
checkUserProvisioningStateTransition
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setExitCallback(ExitCallback callBack) { this.callback = callBack; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExitCallback File: server-core/src/main/java/io/onedev/server/git/GitSshCommand.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
setExitCallback
server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element accountElement = toDOM(document); document.appendChild(accountElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element accountElement = toDOM(document); document.appendChild(accountElement); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unused") @CalledByNative private void updateFrameInfo( float scrollOffsetX, float scrollOffsetY, float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor, float contentWidth, float contentHeight, float viewportWidth, float viewportHeight, float controlsOffsetYCss, float contentOffsetYCss) { TraceEvent.begin("ContentViewCore:updateFrameInfo"); // Adjust contentWidth/Height to be always at least as big as // the actual viewport (as set by onSizeChanged). final float deviceScale = mRenderCoordinates.getDeviceScaleFactor(); contentWidth = Math.max(contentWidth, mViewportWidthPix / (deviceScale * pageScaleFactor)); contentHeight = Math.max(contentHeight, mViewportHeightPix / (deviceScale * pageScaleFactor)); final float contentOffsetYPix = mRenderCoordinates.fromDipToPix(contentOffsetYCss); final boolean contentSizeChanged = contentWidth != mRenderCoordinates.getContentWidthCss() || contentHeight != mRenderCoordinates.getContentHeightCss(); final boolean scaleLimitsChanged = minPageScaleFactor != mRenderCoordinates.getMinPageScaleFactor() || maxPageScaleFactor != mRenderCoordinates.getMaxPageScaleFactor(); final boolean pageScaleChanged = pageScaleFactor != mRenderCoordinates.getPageScaleFactor(); final boolean scrollChanged = pageScaleChanged || scrollOffsetX != mRenderCoordinates.getScrollX() || scrollOffsetY != mRenderCoordinates.getScrollY(); final boolean contentOffsetChanged = contentOffsetYPix != mRenderCoordinates.getContentOffsetYPix(); final boolean needHidePopupZoomer = contentSizeChanged || scrollChanged; final boolean needUpdateZoomControls = scaleLimitsChanged || scrollChanged; if (needHidePopupZoomer) mPopupZoomer.hide(true); if (scrollChanged) { mContainerViewInternals.onScrollChanged( (int) mRenderCoordinates.fromLocalCssToPix(scrollOffsetX), (int) mRenderCoordinates.fromLocalCssToPix(scrollOffsetY), (int) mRenderCoordinates.getScrollXPix(), (int) mRenderCoordinates.getScrollYPix()); } mRenderCoordinates.updateFrameInfo( scrollOffsetX, scrollOffsetY, contentWidth, contentHeight, viewportWidth, viewportHeight, pageScaleFactor, minPageScaleFactor, maxPageScaleFactor, contentOffsetYPix); if (scrollChanged || contentOffsetChanged) { for (mGestureStateListenersIterator.rewind(); mGestureStateListenersIterator.hasNext();) { mGestureStateListenersIterator.next().onScrollOffsetOrExtentChanged( computeVerticalScrollOffset(), computeVerticalScrollExtent()); } } if (needUpdateZoomControls) mZoomControlsDelegate.updateZoomControls(); // Update offsets for fullscreen. final float controlsOffsetPix = controlsOffsetYCss * deviceScale; // TODO(aelias): Remove last argument after downstream removes it. getContentViewClient().onOffsetsForFullscreenChanged( controlsOffsetPix, contentOffsetYPix, 0); if (mBrowserAccessibilityManager != null) { mBrowserAccessibilityManager.notifyFrameInfoInitialized(); } TraceEvent.end("ContentViewCore:updateFrameInfo"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFrameInfo 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
updateFrameInfo
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
private LogHandler createLogHandler(String pLogHandlerClass, String pDebug) { if (pLogHandlerClass != null) { return ClassUtil.newInstance(pLogHandlerClass); } else { final boolean debug = Boolean.valueOf(pDebug); return new LogHandler.StdoutLogHandler(debug); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createLogHandler File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
createLogHandler
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
private void showServerStatus() { if (mServerStatusIcon == NO_ICON && EMPTY_STRING.equals(mServerStatusText)) { mServerStatusView.setVisibility(View.INVISIBLE); } else { mServerStatusView.setText(mServerStatusText); mServerStatusView.setCompoundDrawablesWithIntrinsicBounds(mServerStatusIcon, 0, 0, 0); mServerStatusView.setVisibility(View.VISIBLE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showServerStatus File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
showServerStatus
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) boolean retrieveAttributes(@NonNull XmlBlock.Parser parser, @NonNull int[] inAttrs, @NonNull int[] outValues, @NonNull int[] outIndices) { Objects.requireNonNull(parser, "parser"); Objects.requireNonNull(inAttrs, "inAttrs"); Objects.requireNonNull(outValues, "outValues"); Objects.requireNonNull(outIndices, "outIndices"); synchronized (this) { // Need to synchronize on AssetManager because we will be accessing // the native implementation of AssetManager. ensureValidLocked(); return nativeRetrieveAttributes( mObject, parser.mParseState, inAttrs, outValues, outIndices); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveAttributes File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
retrieveAttributes
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private int getUserIdToWipeForFailedPasswords(ActiveAdmin admin) { final int userId = admin.getUserHandle().getIdentifier(); if (admin.isPermissionBased) { return userId; } final ComponentName component = admin.info.getComponent(); return isProfileOwnerOfOrganizationOwnedDevice(component, userId) ? getProfileParentId(userId) : userId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserIdToWipeForFailedPasswords 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
getUserIdToWipeForFailedPasswords
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static void killUid(int appId, int userId, String reason) { final long identity = Binder.clearCallingIdentity(); try { IActivityManager am = ActivityManager.getService(); if (am != null) { try { am.killUidForPermissionChange(appId, userId, reason); } catch (RemoteException e) { /* ignore - same process */ } } } finally { Binder.restoreCallingIdentity(identity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killUid File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
killUid
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public EditorErrorHandler getEditorErrorHandler() { return editorErrorHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEditorErrorHandler 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
getEditorErrorHandler
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public boolean isQsExpanded() { return mQsExpanded; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isQsExpanded 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
isQsExpanded
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public HttpHeaders setShort(CharSequence name, short value) { headers.setShort(name, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShort File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
setShort
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
private void handleInternalServerError() { sendMessages(SEND_HEADERS_INTERNAL_SERVER_ERROR_MSG, END_RESPONSE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleInternalServerError File: core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-252" ]
CVE-2022-1319
HIGH
7.5
undertow-io/undertow
handleInternalServerError
core/src/main/java/io/undertow/server/protocol/ajp/AjpReadListener.java
1443a1a2bbb8e32e56788109d8285db250d55c8b
0
Analyze the following code function for security vulnerabilities
public static EntityResolver getEntityResolver(Hints hints) { if (hints == null) { hints = getDefaultHints(); } if (hints.containsKey(Hints.ENTITY_RESOLVER)) { Object hint = hints.get(Hints.ENTITY_RESOLVER); if (hint == null) { return NullEntityResolver.INSTANCE; } else if (hint instanceof EntityResolver) { return (EntityResolver) hint; } else if (hint instanceof String) { String className = (String) hint; return instantiate( className, EntityResolver.class, PreventLocalEntityResolver.INSTANCE); } } return PreventLocalEntityResolver.INSTANCE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEntityResolver File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
getEntityResolver
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
protected final <T extends Describable<T>> List<T> buildDescribable(StaplerRequest req, List<? extends Descriptor<T>> descriptors) throws FormException, ServletException { JSONObject data = req.getSubmittedForm(); List<T> r = new Vector<T>(); for (Descriptor<T> d : descriptors) { String safeName = d.getJsonSafeClassName(); if (req.getParameter(safeName) != null) { T instance = d.newInstance(req, data.getJSONObject(safeName)); r.add(instance); } } return r; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildDescribable File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
buildDescribable
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String getClientCertificateAlias() { return getFieldValue(CLIENT_CERT_KEY, CLIENT_CERT_PREFIX); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClientCertificateAlias File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
getClientCertificateAlias
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
void swapConference(Call call) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("swapConference")) { try { logOutgoing("swapConference %s", callId); mServiceInterface.swapConference(callId, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException ignored) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: swapConference File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
swapConference
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public Object makeTransformCamera(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) { return CN1Matrix4f.makeCamera(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeTransformCamera File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
makeTransformCamera
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void setLastProcessedClientToServerId( int lastProcessedClientToServerId, byte[] lastProcessedMessageHash) { this.lastProcessedClientToServerId = lastProcessedClientToServerId; this.lastProcessedMessageHash = lastProcessedMessageHash; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLastProcessedClientToServerId File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
setLastProcessedClientToServerId
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
public boolean isCommentForceLogin() { return commentForceLogin; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCommentForceLogin File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
isCommentForceLogin
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
public void setId(String id) { this.id = id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setId File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setId
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void notifyAfterTextChanged() { removeMessages(ON_TEXT_CHANGED); sendEmptyMessageDelayed(ON_TEXT_CHANGED, DELAY_IN_MILLISECOND); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyAfterTextChanged File: src/com/android/settings/password/ChooseLockPassword.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
notifyAfterTextChanged
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
private void loginRender(Controller controller) throws MalformedURLException { HttpServletRequest request = controller.getRequest(); String url = controller.getRequest().getRequestURL().toString(); URL tUrl = new URL(url); AdminPageController.previewField(controller); controller.getRequest().setAttribute("redirectFrom", tUrl.getPath() + (request.getQueryString() != null ? "?" + request.getQueryString() : "")); controller.render(new FreeMarkerRender("/admin/login.ftl")); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-16643 - Severity: LOW - CVSS Score: 3.5 Description: Upgrade jar version & fix #54 Signed-off-by: xiaochun <xchun90@163.com> Function: loginRender File: web/src/main/java/com/zrlog/web/interceptor/AdminInterceptor.java Repository: 94fzb/zrlog Fixed Code: private void loginRender(Controller controller) throws MalformedURLException { HttpServletRequest request = controller.getRequest(); String url = controller.getRequest().getRequestURL().toString(); URL tUrl = new URL(url); previewField(controller.getRequest()); controller.getRequest().setAttribute("redirectFrom", tUrl.getPath() + (request.getQueryString() != null ? "?" + request.getQueryString() : "")); controller.render(new FreeMarkerRender("/admin/login.ftl")); }
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
loginRender
web/src/main/java/com/zrlog/web/interceptor/AdminInterceptor.java
4a91c83af669e31a22297c14f089d8911d353fa1
1
Analyze the following code function for security vulnerabilities
public void removerAluno(String RA)throws Exception{ // checa se o aluno já foi cadastrado String comSql = "select * from ACI_Aluno where RA='" + RA + "'"; ResultSet result = this.bancoConec.execConsulta(comSql); if(!result.first()){ result.close(); throw new Exception("Aluno Com Esse RA Não Existente"); } result.close(); comSql = "delete from ACI_Aluno where RA='" + RA + "'"; this.bancoConec.execComando(comSql); }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2015-10037 - Severity: MEDIUM - CVSS Score: 5.2 Description: Prooteçao contra SQL Injection Function: removerAluno File: Escola Eclipse/Escola/src/banco_de_dados/dao/Alunos.java Repository: marinaguimaraes/ACI_Escola Fixed Code: public void removerAluno(String RA)throws Exception{ // checa se o aluno já foi cadastrado String comSql = "select * from ACI_Aluno where RA='" + RA.replace("'", "") + "'"; ResultSet result = this.bancoConec.execConsulta(comSql); if(!result.first()){ result.close(); throw new Exception("Aluno Com Esse RA Não Existente"); } result.close(); comSql = "delete from ACI_Aluno where RA='" + RA + "'"; this.bancoConec.execComando(comSql); }
[ "CWE-89" ]
CVE-2015-10037
MEDIUM
5.2
marinaguimaraes/ACI_Escola
removerAluno
Escola Eclipse/Escola/src/banco_de_dados/dao/Alunos.java
34eed1f7b9295d1424912f79989d8aba5de41e9f
1
Analyze the following code function for security vulnerabilities
public int getConnectTimeout() { return connectionTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectTimeout File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getConnectTimeout
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private @NonNull Intent createLaunchIntent(@Nullable AuxiliaryResolveInfo auxiliaryResponse, Intent originalIntent, String callingPackage, @Nullable String callingFeatureId, Bundle verificationBundle, String resolvedType, int userId) { if (auxiliaryResponse != null && auxiliaryResponse.needsPhaseTwo) { // request phase two resolution PackageManagerInternal packageManager = mService.getPackageManagerInternalLocked(); boolean isRequesterInstantApp = packageManager.isInstantApp(callingPackage, userId); packageManager.requestInstantAppResolutionPhaseTwo( auxiliaryResponse, originalIntent, resolvedType, callingPackage, callingFeatureId, isRequesterInstantApp, verificationBundle, userId); } return InstantAppResolver.buildEphemeralInstallerIntent( originalIntent, InstantAppResolver.sanitizeIntent(originalIntent), auxiliaryResponse == null ? null : auxiliaryResponse.failureIntent, callingPackage, callingFeatureId, verificationBundle, resolvedType, userId, auxiliaryResponse == null ? null : auxiliaryResponse.installFailureActivity, auxiliaryResponse == null ? null : auxiliaryResponse.token, auxiliaryResponse != null && auxiliaryResponse.needsPhaseTwo, auxiliaryResponse == null ? null : auxiliaryResponse.filters); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createLaunchIntent File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
createLaunchIntent
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private void startVideoCapture() { if (videoCapturer != null) { videoCapturer.startCapture(1280, 720, 30); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startVideoCapture File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
startVideoCapture
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
private static List<File> getDirectories(String path) { List<File> files = new ArrayList<>(); try { DirectoryStream<Path> stream = Files.newDirectoryStream(FileSystems.getDefault().getPath(path)); Iterator<Path> iter = stream.iterator(); while (iter.hasNext()) { Path next = iter.next(); files.add(next.toFile()); } stream.close(); } catch (IOException e) { e.printStackTrace(); } return files; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDirectories File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
getDirectories
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public static TransformerHandler createTransformerHandler(final boolean indentOutput) throws TransformerConfigurationException { return createTransformerHandler(null, indentOutput); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTransformerHandler File: stroom-core-server/src/main/java/stroom/entity/server/util/XMLUtil.java Repository: gchq/stroom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
createTransformerHandler
stroom-core-server/src/main/java/stroom/entity/server/util/XMLUtil.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
0
Analyze the following code function for security vulnerabilities
public static void applyValidLabels(Element root, String nodeType, String attrType, Map<String, String> validLabels) throws IllegalArgumentException { assert (root != null); assert (nodeType != null); assert (attrType != null); assert (nodeType.length() > 0); assert (attrType.length() > 0); assert (validLabels != null); switch (nodeType) { case "circuit": replaceCircuitNodes(root, attrType, validLabels); break; case "comp": replaceCompNodes(root, validLabels); break; default: throw new IllegalArgumentException("Invalid node type requested: " + nodeType); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyValidLabels File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
applyValidLabels
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
@Override public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) { long start = System.currentTimeMillis(); REQUEST_START_TIME.set(start); String url = WebTools.getHomeUrl(request); request.setAttribute("basePath", url); request.setAttribute("baseWithHostPath", WebTools.getHomeUrlWithHostNotProtocol(request)); request.setAttribute("pageEndTag", PAGE_END_TAG); String ext = null; if (target.contains("/")) { String name = target.substring(target.lastIndexOf('/')); if (name.contains(".")) { ext = name.substring(name.lastIndexOf('.')); } } try { AdminTokenVO adminTokenVO = new AdminTokenService().getAdminTokenVO(request); final ResponseRenderPrintWriter responseRenderPrintWriter = new ResponseRenderPrintWriter(response.getOutputStream(), url, PAGE_END_TAG, request, response, adminTokenVO); response = new HttpServletResponseWrapper(response) { @Override public PrintWriter getWriter() { return responseRenderPrintWriter; } }; if (ext != null) { if (!FORBIDDEN_URI_EXT_SET.contains(ext)) { // 处理静态化文件,仅仅缓存文章页(变化较小) if (target.endsWith(".html") && target.startsWith("/" + Constants.getArticleUri())) { target = target.substring(0, target.lastIndexOf(".")); if (Constants.isStaticHtmlStatus() && adminTokenVO == null) { String path = new String(request.getServletPath().getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); responseHtmlFile(target, request, response, isHandled, responseRenderPrintWriter, new File(CACHE_HTML_PATH + I18nUtil.getAcceptLanguage(request) + path)); } else { this.next.handle(target, request, response, isHandled); } } else { this.next.handle(target, request, response, isHandled); } } else { //非法请求, 返回403 response.sendError(403); } } else { //首页静态化 if ("/".equals(target) && Constants.isStaticHtmlStatus() && adminTokenVO == null) { responseHtmlFile(target, request, response, isHandled, responseRenderPrintWriter, new File(CACHE_HTML_PATH + I18nUtil.getAcceptLanguage(request) + "/index.html")); } else { this.next.handle(target, request, response, isHandled); } } } catch (Exception e) { LOGGER.error("", e); } finally { I18nUtil.removeI18n(); //开发环境下面打印整个请求的耗时,便于优化代码 if (BlogBuildInfoUtil.isDev()) { LOGGER.info("{} used time {}", request.getServletPath(), System.currentTimeMillis() - start); } //仅保留非静态资源请求或者是以 .html结尾的 if (ZrLogConfig.isInstalled() && !target.contains(".") || target.endsWith(".html")) { RequestInfo requestInfo = new RequestInfo(); requestInfo.setIp(WebTools.getRealIp(request)); requestInfo.setUrl(url); requestInfo.setUserAgent(request.getHeader("User-Agent")); requestInfo.setRequestTime(System.currentTimeMillis()); requestInfo.setRequestUri(target); RequestStatisticsPlugin.record(requestInfo); } } REQUEST_START_TIME.remove(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2019-16643 - Severity: LOW - CVSS Score: 3.5 Description: Upgrade jar version & fix #54 Signed-off-by: xiaochun <xchun90@163.com> Function: handle File: web/src/main/java/com/zrlog/web/handler/GlobalResourceHandler.java Repository: 94fzb/zrlog Fixed Code: @Override public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) { long start = System.currentTimeMillis(); REQUEST_START_TIME.set(start); String url = WebTools.getHomeUrl(request); request.setAttribute("basePath", url); request.setAttribute("baseWithHostPath", WebTools.getHomeUrlWithHostNotProtocol(request)); request.setAttribute("pageEndTag", PAGE_END_TAG); String ext = null; if (target.contains("/")) { String name = target.substring(target.lastIndexOf('/')); if (name.contains(".")) { ext = name.substring(name.lastIndexOf('.')); } } try { AdminTokenVO adminTokenVO = new AdminTokenService().getAdminTokenVO(request); final ResponseRenderPrintWriter responseRenderPrintWriter = new ResponseRenderPrintWriter(response.getOutputStream(), url, PAGE_END_TAG, request, response, adminTokenVO); response = new MyHttpServletResponseWrapper(response,responseRenderPrintWriter); if (ext != null) { if (!FORBIDDEN_URI_EXT_SET.contains(ext)) { // 处理静态化文件,仅仅缓存文章页(变化较小) if (target.endsWith(".html") && target.startsWith("/" + Constants.getArticleUri())) { target = target.substring(0, target.lastIndexOf(".")); if (Constants.isStaticHtmlStatus() && adminTokenVO == null) { String path = new String(request.getServletPath().getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); responseHtmlFile(target, request, response, isHandled, responseRenderPrintWriter, new File(CACHE_HTML_PATH + I18nUtil.getAcceptLanguage(request) + path)); } else { this.next.handle(target, request, response, isHandled); } } else { this.next.handle(target, request, response, isHandled); } } else { //非法请求, 返回403 response.sendError(403); } } else { //首页静态化 if ("/".equals(target) && Constants.isStaticHtmlStatus() && adminTokenVO == null) { responseHtmlFile(target, request, response, isHandled, responseRenderPrintWriter, new File(CACHE_HTML_PATH + I18nUtil.getAcceptLanguage(request) + "/index.html")); } else { this.next.handle(target, request, response, isHandled); //JFinal, JsonRender 移除了 flush(),需要手动 flush,针对JFinal3.3 以后版本 response.getWriter().flush(); } } } catch (Exception e) { LOGGER.error("", e); } finally { I18nUtil.removeI18n(); //开发环境下面打印整个请求的耗时,便于优化代码 if (BlogBuildInfoUtil.isDev()) { LOGGER.info("{} used time {}", request.getServletPath(), System.currentTimeMillis() - start); } //仅保留非静态资源请求或者是以 .html结尾的 if (ZrLogConfig.isInstalled() && !target.contains(".") || target.endsWith(".html")) { RequestInfo requestInfo = new RequestInfo(); requestInfo.setIp(WebTools.getRealIp(request)); requestInfo.setUrl(url); requestInfo.setUserAgent(request.getHeader("User-Agent")); requestInfo.setRequestTime(System.currentTimeMillis()); requestInfo.setRequestUri(target); RequestStatisticsPlugin.record(requestInfo); } } REQUEST_START_TIME.remove(); }
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
handle
web/src/main/java/com/zrlog/web/handler/GlobalResourceHandler.java
4a91c83af669e31a22297c14f089d8911d353fa1
1
Analyze the following code function for security vulnerabilities
@Override public int getOrder() { return Ordered.HIGHEST_PRECEDENCE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrder File: http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getOrder
http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public void onWalletCardRetrievalError(@NonNull GetWalletCardsError error) { mIsWalletUpdating = false; mCardViewDrawable = null; mSelectedCard = null; refreshState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onWalletCardRetrievalError File: packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21289
MEDIUM
5.5
android
onWalletCardRetrievalError
packages/SystemUI/src/com/android/systemui/qs/tiles/QuickAccessWalletTile.java
7a5e51c918b7097be3c7e669e1825a4d159c4185
0
Analyze the following code function for security vulnerabilities
@Override public String getPathTranslated() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPathTranslated File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getPathTranslated
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public WindowList getWindowListLocked(final Display display) { return getWindowListLocked(display.getDisplayId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWindowListLocked 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
getWindowListLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2.3") public void setDocumentReference(DocumentReference reference) { // Don't allow setting a null reference for now, ie. don't do anything to preserve backward compatibility // with previous behavior (i.e. {@link #setFullName}. if (reference != null) { // Retro compatibility, make sure <code>this.documentReference</code> does not contain the Locale (for now) DocumentReference referenceWithoutLocale = reference.getLocale() != null ? new DocumentReference(reference, (Locale) null) : reference; if (!referenceWithoutLocale.equals(getDocumentReference())) { setDocumentReferenceInternal(referenceWithoutLocale); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDocumentReference 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
setDocumentReference
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
@Override public void init(ServletConfig pServletConfig) throws ServletException { super.init(pServletConfig); Configuration config = initConfig(pServletConfig); // Create a log handler early in the lifecycle, but not too early String logHandlerClass = config.get(ConfigKey.LOGHANDLER_CLASS); logHandler = logHandlerClass != null ? (LogHandler) ClassUtil.newInstance(logHandlerClass) : createLogHandler(pServletConfig,Boolean.valueOf(config.get(ConfigKey.DEBUG))); // Different HTTP request handlers httpGetHandler = newGetHttpRequestHandler(); httpPostHandler = newPostHttpRequestHandler(); if (restrictor == null) { restrictor = createRestrictor(config.get(ConfigKey.POLICY_LOCATION)); } else { logHandler.info("Using custom access restriction provided by " + restrictor); } configMimeType = config.get(ConfigKey.MIME_TYPE); backendManager = new BackendManager(config,logHandler, restrictor); requestHandler = new HttpRequestHandler(config,backendManager,logHandler); initDiscoveryMulticast(config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
init
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
void sendNewConfiguration() { try { mActivityManager.updateConfiguration(null); } catch (RemoteException e) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendNewConfiguration 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
sendNewConfiguration
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void updateQsState() { mNotificationStackScroller.setQsExpanded(mQsExpanded); mNotificationStackScroller.setScrollingEnabled( mStatusBarState != StatusBarState.KEYGUARD && (!mQsExpanded || mQsExpansionFromOverscroll)); updateEmptyShadeView(); mQsNavbarScrim.setVisibility(mStatusBarState == StatusBarState.SHADE && mQsExpanded && !mStackScrollerOverscrolling && mQsScrimEnabled ? View.VISIBLE : View.INVISIBLE); if (mKeyguardUserSwitcher != null && mQsExpanded && !mStackScrollerOverscrolling) { mKeyguardUserSwitcher.hideIfNotSimple(true /* animate */); } if (mQs == null) return; mQs.setExpanded(mQsExpanded); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateQsState 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
updateQsState
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private static void applyUserRestriction(Context context, int userId, String key, boolean newValue) { if (UserManagerService.DBG) { Log.d(TAG, "Applying user restriction: userId=" + userId + " key=" + key + " value=" + newValue); } // When certain restrictions are cleared, we don't update the system settings, // because these settings are changeable on the Settings UI and we don't know the original // value -- for example LOCATION_MODE might have been off already when the restriction was // set, and in that case even if the restriction is lifted, changing it to ON would be // wrong. So just don't do anything in such a case. If the user hopes to enable location // later, they can do it on the Settings UI. final ContentResolver cr = context.getContentResolver(); final long id = Binder.clearCallingIdentity(); try { switch (key) { case UserManager.DISALLOW_CONFIG_WIFI: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Global .WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0, userId); } break; case UserManager.DISALLOW_DATA_ROAMING: if (newValue) { // DISALLOW_DATA_ROAMING user restriction is set. // Multi sim device. SubscriptionManager subscriptionManager = new SubscriptionManager(context); final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager.getActiveSubscriptionInfoList(); if (subscriptionInfoList != null) { for (SubscriptionInfo subInfo : subscriptionInfoList) { android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.DATA_ROAMING + subInfo.getSubscriptionId(), "0", userId); } } // Single sim device. android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.DATA_ROAMING, "0", userId); } break; case UserManager.DISALLOW_SHARE_LOCATION: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Secure.LOCATION_MODE, android.provider.Settings.Secure.LOCATION_MODE_OFF, userId); } break; case UserManager.DISALLOW_DEBUGGING_FEATURES: if (newValue) { // Only disable adb if changing for system user, since it is global // TODO: should this be admin user? if (userId == UserHandle.USER_SYSTEM) { android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.ADB_ENABLED, "0", userId); } } break; case UserManager.ENSURE_VERIFY_APPS: if (newValue) { android.provider.Settings.Global.putStringForUser( context.getContentResolver(), android.provider.Settings.Global.PACKAGE_VERIFIER_ENABLE, "1", userId); android.provider.Settings.Global.putStringForUser( context.getContentResolver(), android.provider.Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, "1", userId); } break; case UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Secure.INSTALL_NON_MARKET_APPS, 0, userId); } break; case UserManager.DISALLOW_RUN_IN_BACKGROUND: if (newValue) { int currentUser = ActivityManager.getCurrentUser(); if (currentUser != userId && userId != UserHandle.USER_SYSTEM) { try { ActivityManagerNative.getDefault().stopUser(userId, false, null); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } } break; case UserManager.DISALLOW_SAFE_BOOT: // Unlike with the other restrictions, we want to propagate the new value to // the system settings even if it is false. The other restrictions modify // settings which could be manually changed by the user from the Settings app // after the policies enforcing these restrictions have been revoked, so we // leave re-setting of those settings to the user. android.provider.Settings.Global.putInt( context.getContentResolver(), android.provider.Settings.Global.SAFE_BOOT_DISALLOWED, newValue ? 1 : 0); break; } } finally { Binder.restoreCallingIdentity(id); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3876 - Severity: HIGH - CVSS Score: 7.2 Description: Block user from setting safe boot setting via adb Bug: 29900345 Change-Id: Id3b4472b59ded2c7c29762ddf008ee8486009dbb Function: applyUserRestriction File: services/core/java/com/android/server/pm/UserRestrictionsUtils.java Repository: android Fixed Code: private static void applyUserRestriction(Context context, int userId, String key, boolean newValue) { if (UserManagerService.DBG) { Log.d(TAG, "Applying user restriction: userId=" + userId + " key=" + key + " value=" + newValue); } // When certain restrictions are cleared, we don't update the system settings, // because these settings are changeable on the Settings UI and we don't know the original // value -- for example LOCATION_MODE might have been off already when the restriction was // set, and in that case even if the restriction is lifted, changing it to ON would be // wrong. So just don't do anything in such a case. If the user hopes to enable location // later, they can do it on the Settings UI. // WARNING: Remember that Settings.Global and Settings.Secure are changeable via adb. // To prevent this from happening for a given user restriction, you have to add a check to // SettingsProvider.isGlobalOrSecureSettingRestrictedForUser. final ContentResolver cr = context.getContentResolver(); final long id = Binder.clearCallingIdentity(); try { switch (key) { case UserManager.DISALLOW_CONFIG_WIFI: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Global .WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0, userId); } break; case UserManager.DISALLOW_DATA_ROAMING: if (newValue) { // DISALLOW_DATA_ROAMING user restriction is set. // Multi sim device. SubscriptionManager subscriptionManager = new SubscriptionManager(context); final List<SubscriptionInfo> subscriptionInfoList = subscriptionManager.getActiveSubscriptionInfoList(); if (subscriptionInfoList != null) { for (SubscriptionInfo subInfo : subscriptionInfoList) { android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.DATA_ROAMING + subInfo.getSubscriptionId(), "0", userId); } } // Single sim device. android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.DATA_ROAMING, "0", userId); } break; case UserManager.DISALLOW_SHARE_LOCATION: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Secure.LOCATION_MODE, android.provider.Settings.Secure.LOCATION_MODE_OFF, userId); } break; case UserManager.DISALLOW_DEBUGGING_FEATURES: if (newValue) { // Only disable adb if changing for system user, since it is global // TODO: should this be admin user? if (userId == UserHandle.USER_SYSTEM) { android.provider.Settings.Global.putStringForUser(cr, android.provider.Settings.Global.ADB_ENABLED, "0", userId); } } break; case UserManager.ENSURE_VERIFY_APPS: if (newValue) { android.provider.Settings.Global.putStringForUser( context.getContentResolver(), android.provider.Settings.Global.PACKAGE_VERIFIER_ENABLE, "1", userId); android.provider.Settings.Global.putStringForUser( context.getContentResolver(), android.provider.Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, "1", userId); } break; case UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES: if (newValue) { android.provider.Settings.Secure.putIntForUser(cr, android.provider.Settings.Secure.INSTALL_NON_MARKET_APPS, 0, userId); } break; case UserManager.DISALLOW_RUN_IN_BACKGROUND: if (newValue) { int currentUser = ActivityManager.getCurrentUser(); if (currentUser != userId && userId != UserHandle.USER_SYSTEM) { try { ActivityManagerNative.getDefault().stopUser(userId, false, null); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } } } break; case UserManager.DISALLOW_SAFE_BOOT: // Unlike with the other restrictions, we want to propagate the new value to // the system settings even if it is false. The other restrictions modify // settings which could be manually changed by the user from the Settings app // after the policies enforcing these restrictions have been revoked, so we // leave re-setting of those settings to the user. android.provider.Settings.Global.putInt( context.getContentResolver(), android.provider.Settings.Global.SAFE_BOOT_DISALLOWED, newValue ? 1 : 0); break; } } finally { Binder.restoreCallingIdentity(id); } }
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
applyUserRestriction
services/core/java/com/android/server/pm/UserRestrictionsUtils.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
1
Analyze the following code function for security vulnerabilities
@Deprecated public Page<DictModel> queryDictTablePageList(Page page, @Param("query") DictQuery query);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryDictTablePageList File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45207
CRITICAL
9.8
jeecgboot/jeecg-boot
queryDictTablePageList
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
8632a835c23f558dfee3584d7658cc6a13ccec6f
0
Analyze the following code function for security vulnerabilities
final void add(CharSequence name, String... values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); for (String v : values) { requireNonNullElement(values, v); add0(h, i, normalizedName, v); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: add File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void add(CharSequence name, String... values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); for (String v : values) { requireNonNullElement(values, v); add0(h, i, normalizedName, v); } }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
add
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
@Override public void setExcludeFromRecents(boolean exclude) { checkCaller(); synchronized (ActivityManagerService.this) { long origId = Binder.clearCallingIdentity(); try { TaskRecord tr = recentTaskForIdLocked(mTaskId); if (tr == null) { throw new IllegalArgumentException("Unable to find task ID " + mTaskId); } Intent intent = tr.getBaseIntent(); if (exclude) { intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); } else { intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); } } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExcludeFromRecents 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
setExcludeFromRecents
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void setWriteAheadLoggingEnabled(boolean enabled) { if (enabled) { addOpenFlags(ENABLE_WRITE_AHEAD_LOGGING); } else { removeOpenFlags(ENABLE_WRITE_AHEAD_LOGGING); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWriteAheadLoggingEnabled File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
setWriteAheadLoggingEnabled
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private void instrumentWithoutRestart(ActiveInstrumentation activeInstr, ApplicationInfo targetInfo) { ProcessRecord pr; synchronized (this) { pr = getProcessRecordLocked(targetInfo.processName, targetInfo.uid); } try { pr.getThread().instrumentWithoutRestart( activeInstr.mClass, activeInstr.mArguments, activeInstr.mWatcher, activeInstr.mUiAutomationConnection, targetInfo); } catch (RemoteException e) { Slog.i(TAG, "RemoteException from instrumentWithoutRestart", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: instrumentWithoutRestart 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
instrumentWithoutRestart
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void switchExecutor(int index) { this.currentExecutorIndex = index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchExecutor File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
switchExecutor
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private void dispatchProcessesChanged() { int N; synchronized (this) { N = mPendingProcessChanges.size(); if (mActiveProcessChanges.length < N) { mActiveProcessChanges = new ProcessChangeItem[N]; } mPendingProcessChanges.toArray(mActiveProcessChanges); mAvailProcessChanges.addAll(mPendingProcessChanges); mPendingProcessChanges.clear(); if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG, "*** Delivering " + N + " process changes"); } int i = mProcessObservers.beginBroadcast(); while (i > 0) { i--; final IProcessObserver observer = mProcessObservers.getBroadcastItem(i); if (observer != null) { try { for (int j=0; j<N; j++) { ProcessChangeItem item = mActiveProcessChanges[j]; if ((item.changes&ProcessChangeItem.CHANGE_ACTIVITIES) != 0) { if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG, "ACTIVITIES CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.foregroundActivities); observer.onForegroundActivitiesChanged(item.pid, item.uid, item.foregroundActivities); } if ((item.changes&ProcessChangeItem.CHANGE_PROCESS_STATE) != 0) { if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG, "PROCSTATE CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.processState); observer.onProcessStateChanged(item.pid, item.uid, item.processState); } } } catch (RemoteException e) { } } } mProcessObservers.finishBroadcast(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchProcessesChanged 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
dispatchProcessesChanged
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public String getResponseHeader(String name) { return response.headers().get(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponseHeader File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
getResponseHeader
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
@Override public void goingToSleep(int why) { EventLog.writeEvent(70000, 0); if (DEBUG_WAKEUP) Slog.i(TAG, "Going to sleep..."); // We must get this work done here because the power manager will drop // the wake lock and let the system suspend once this function returns. synchronized (mLock) { mAwake = false; mKeyguardDrawComplete = false; updateWakeGestureListenerLp(); updateOrientationListenerLp(); updateLockScreenTimeout(); } if (mKeyguardDelegate != null) { mKeyguardDelegate.onScreenTurnedOff(why); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: goingToSleep 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
goingToSleep
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public static Random threadLocalRandom() { return RANDOM_PROVIDER.current(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: threadLocalRandom File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
threadLocalRandom
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private static boolean hasResizeChange(int change) { return (change & (CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE | CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT)) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasResizeChange 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
hasResizeChange
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@ManagedAttribute(value = "The URL of this Oort", readonly = true) public String getURL() { return _url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
getURL
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
private void updateVoteGains(int rep) { Long updated = Optional.ofNullable(getUpdated()).orElse(getTimestamp()); LocalDateTime lastUpdate = LocalDateTime.ofInstant(Instant.ofEpochMilli(updated), ZoneId.systemDefault()); LocalDate now = LocalDate.now(); if (now.getYear() != lastUpdate.getYear()) { yearlyVotes = rep; } else { yearlyVotes += rep; } if (now.get(IsoFields.QUARTER_OF_YEAR) != lastUpdate.get(IsoFields.QUARTER_OF_YEAR)) { quarterlyVotes = rep; } else { quarterlyVotes += rep; } if (now.getMonthValue() != lastUpdate.getMonthValue()) { monthlyVotes = rep; } else { monthlyVotes += rep; } if (now.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR) != lastUpdate.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR)) { weeklyVotes = rep; } else { weeklyVotes += rep; } setUpdated(Utils.timestamp()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateVoteGains 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
updateVoteGains
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public Bundle getExtras() { return mExtras; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExtras File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getExtras
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
final void set(CharSequence name, String value) { final AsciiString normalizedName = normalizeName(name); requireNonNull(value, "value"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); add0(h, i, normalizedName, value); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: set File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void set(CharSequence name, String value) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(value, "value"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); add0(h, i, normalizedName, value); }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
set
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
public void registerChannel(Channel channel) { openChannels.add(channel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerChannel File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
registerChannel
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public static ProfileInput fromDOM(Element profileInputElement) { ProfileInput profileInput = new ProfileInput(); String id = profileInputElement.getAttribute("id"); profileInput.setId(id); NodeList classIDList = profileInputElement.getElementsByTagName("ClassID"); if (classIDList.getLength() > 0) { String value = classIDList.item(0).getTextContent(); profileInput.setClassId(value); } NodeList nameList = profileInputElement.getElementsByTagName("Name"); if (nameList.getLength() > 0) { String value = nameList.item(0).getTextContent(); profileInput.setName(value); } NodeList attributeList = profileInputElement.getElementsByTagName("Attribute"); for (int i = 0; i < attributeList.getLength(); i++) { Element attributeElement = (Element) attributeList.item(i); ProfileAttribute profileAttribute = new ProfileAttribute(); String attributeId = attributeElement.getAttribute("name"); profileAttribute.setName(attributeId); NodeList valueList = attributeElement.getElementsByTagName("Value"); if (valueList.getLength() > 0) { String value = valueList.item(0).getTextContent(); profileAttribute.setValue(value); } NodeList descriptorList = attributeElement.getElementsByTagName("Descriptor"); if (descriptorList.getLength() > 0) { Element descriptorElement = (Element) descriptorList.item(0); Descriptor descriptor = Descriptor.fromDOM(descriptorElement); profileAttribute.setDescriptor(descriptor); } profileInput.addAttribute(profileAttribute); } NodeList configAttributeList = profileInputElement.getElementsByTagName("ConfigAttribute"); for (int i = 0; i < configAttributeList.getLength(); i++) { Element configAttributeElement = (Element) configAttributeList.item(i); ProfileAttribute profileAttribute = new ProfileAttribute(); String configAttributeId = configAttributeElement.getAttribute("name"); profileAttribute.setName(configAttributeId); NodeList configAttributeNameList = configAttributeElement.getElementsByTagName("Name"); if (configAttributeNameList.getLength() > 0) { String name = configAttributeNameList.item(0).getTextContent(); profileAttribute.setName(name); } NodeList valueList = configAttributeElement.getElementsByTagName("Value"); if (valueList.getLength() > 0) { String value = valueList.item(0).getTextContent(); profileAttribute.setValue(value); } NodeList descriptorList = configAttributeElement.getElementsByTagName("Descriptor"); if (descriptorList.getLength() > 0) { Element descriptorElement = (Element) descriptorList.item(0); Descriptor descriptor = Descriptor.fromDOM(descriptorElement); profileAttribute.setDescriptor(descriptor); } profileInput.addConfigAttribute(profileAttribute); } return profileInput; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int getReceiveMaxFrameSize() { return receiveMaxFrameSize; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReceiveMaxFrameSize File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getReceiveMaxFrameSize
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override public void monitor() { synchronized (mWindowMap) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: monitor 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
monitor
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public void setValidationScript(String validationScript) { this.validationScript = validationScript; setMetaDataDirty(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidationScript 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
setValidationScript
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public List<V3SchemeSignerInfo> getV31SchemeSigners() { return mV31SchemeSigners; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getV31SchemeSigners File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getV31SchemeSigners
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
private static void atomicReferenceXmlGenerator(XmlGenerator gen, Config config) { Collection<AtomicReferenceConfig> configs = config.getAtomicReferenceConfigs().values(); for (AtomicReferenceConfig atomicReferenceConfig : configs) { MergePolicyConfig mergePolicyConfig = atomicReferenceConfig.getMergePolicyConfig(); gen.open("atomic-reference", "name", atomicReferenceConfig.getName()) .node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()) .node("quorum-ref", atomicReferenceConfig.getQuorumName()) .close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: atomicReferenceXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
atomicReferenceXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected Schema getEmbeddedLwM2mSchema() throws SAXException { InputStream inputStream = DDFFileValidator.class.getResourceAsStream(LWM2M_V1_SCHEMA_PATH); Source source = new StreamSource(inputStream); SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); return schemaFactory.newSchema(source); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2023-41034 - Severity: CRITICAL - CVSS Score: 9.8 Description: Make DDFFileParser and DefaultDDFFileValidator safer. Function: getEmbeddedLwM2mSchema File: leshan-core/src/main/java/org/eclipse/leshan/core/model/DefaultDDFFileValidator.java Repository: eclipse-leshan/leshan Fixed Code: protected Schema getEmbeddedLwM2mSchema() throws SAXException { InputStream inputStream = DDFFileValidator.class.getResourceAsStream(LWM2M_V1_SCHEMA_PATH); Source source = new StreamSource(inputStream); SchemaFactory schemaFactory = createSchemaFactory(); return schemaFactory.newSchema(source); }
[ "CWE-611" ]
CVE-2023-41034
CRITICAL
9.8
eclipse-leshan/leshan
getEmbeddedLwM2mSchema
leshan-core/src/main/java/org/eclipse/leshan/core/model/DefaultDDFFileValidator.java
4d3e63ac271a817f81fba3e3229c519af7a3049c
1
Analyze the following code function for security vulnerabilities
public void writeFieldStop() throws TException { writeByte(TType.STOP); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFieldStop File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeFieldStop
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private static char[] encodeHex(byte[] input) { int l = input.length; char[] out = new char[l << 1]; // two characters form the hex value. for (int i = 0, j = 0; i < l; i++) { out[j++] = DIGITS[(0xF0 & input[i]) >>> 4 ]; out[j++] = DIGITS[ 0x0F & input[i] ]; } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encodeHex File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
encodeHex
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public boolean shouldShowOnKeyguard(StatusBarNotification sbn) { return mShowLockscreenNotifications && !mNotificationData.isAmbient(sbn.getKey()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldShowOnKeyguard File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
shouldShowOnKeyguard
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public String getUserPreferenceFromCookie(String preference) { return this.xwiki.getUserPreferenceFromCookie(preference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserPreferenceFromCookie 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
getUserPreferenceFromCookie
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
protected RemoteViews makeMediaBigContentView(@Nullable RemoteViews customContent) { final int actionCount = Math.min(mBuilder.mActions.size(), MAX_MEDIA_BUTTONS); StandardTemplateParams p = mBuilder.mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_BIG) .hideProgress(true) .fillTextsFrom(mBuilder); TemplateBindResult result = new TemplateBindResult(); RemoteViews template = mBuilder.applyStandardTemplate( R.layout.notification_template_material_big_media, p , result); for (int i = 0; i < MAX_MEDIA_BUTTONS; i++) { if (i < actionCount) { bindMediaActionButton(template, MEDIA_BUTTON_IDS[i], mBuilder.mActions.get(i), p); } else { template.setViewVisibility(MEDIA_BUTTON_IDS[i], View.GONE); } } buildCustomContentIntoTemplate(mBuilder.mContext, template, customContent, p, result); return template; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeMediaBigContentView File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
makeMediaBigContentView
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private boolean renderSkin(String filename, XWikiDocument doc, XWikiContext context) throws XWikiException, IOException { LOGGER.debug("Rendering file [{}] within the [{}] document", filename, doc.getDocumentReference()); try { if (doc.isNew()) { LOGGER.debug("[{}] is not a document", doc.getDocumentReference().getName()); } else { return renderFileFromObjectField(filename, doc, context) || renderFileFromAttachment(filename, doc, context) || (SKINS_DIRECTORY.equals(doc.getSpace()) && renderFileFromFilesystem(getSkinFilePath(filename, doc.getName()), context)); } } catch (IOException e) { throw new XWikiException(XWikiException.MODULE_XWIKI_APP, XWikiException.ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION, "Exception while sending response:", e); } return renderFileFromFilesystem(getSkinFilePath(filename, doc.getName()), context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderSkin File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-36092
HIGH
7.5
xwiki/xwiki-platform
renderSkin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
0
Analyze the following code function for security vulnerabilities
@Contract(pure = true) public static MethodHandles.Lookup getTrusted(Class<?> k) { SecurityCheck.LIMITER.preGetTrustedLookup(k); return RootLookupHolder.trustedIn(k); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTrusted File: api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java Repository: Karlatemp/UnsafeAccessor The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-31139
MEDIUM
4.3
Karlatemp/UnsafeAccessor
getTrusted
api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java
4ef83000184e8f13239a1ea2847ee401d81585fd
0
Analyze the following code function for security vulnerabilities
protected String getAcceptCharset() { return this.acceptCharset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAcceptCharset File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
getAcceptCharset
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0