instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public void setDefaultLocale(Locale defaultLocale) { this.defaultLocale = defaultLocale; setMetaDataDirty(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultLocale 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
setDefaultLocale
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 Object createSoftWeakRef(Object o) { return new SoftReference(o); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createSoftWeakRef 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
createSoftWeakRef
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@SysUISingleton @Provides static NotificationsController provideNotificationsController( Context context, Provider<NotificationsControllerImpl> realController, Provider<NotificationsControllerStub> stubController) { if (context.getResources().getBoolean(R.bool.config_renderNotifications)) { return realController.get(); } else { return stubController.get(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: provideNotificationsController File: packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
provideNotificationsController
packages/SystemUI/src/com/android/systemui/statusbar/notification/dagger/NotificationsModule.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
public Element toDOM(Document document) { Element infosElement = document.createElement("CertRequestInfos"); Element totalElement = document.createElement("total"); totalElement.appendChild(document.createTextNode(Integer.toString(total))); infosElement.appendChild(totalElement); for (CertRequestInfo certRequestInfo : getEntries()) { Element infoElement = certRequestInfo.toDOM(document); infosElement.appendChild(infoElement); } return infosElement; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toDOM File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toDOM
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Deprecated public WearableExtender setContentIcon(int icon) { mContentIcon = icon; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContentIcon File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setContentIcon
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setName(String name) { this.name = name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setName
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void beginTable(Map<String, String> parameters) { getXHTMLWikiPrinter().printXMLStartElement("table", parameters); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginTable File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
beginTable
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
public void setJsonErrorResponse(boolean jsonErrorResponse) { this.jsonErrorResponse = jsonErrorResponse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setJsonErrorResponse File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
setJsonErrorResponse
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
@Override public ProfileTypeUID getProfileTypeUID() { return PROFILE_TYPE_UID; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProfileTypeUID File: bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java Repository: openhab/openhab-addons The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-5242
HIGH
9.3
openhab/openhab-addons
getProfileTypeUID
bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
0
Analyze the following code function for security vulnerabilities
public void removeAllStanzaIdAcknowledgedListeners() { stanzaIdAcknowledgedListeners.clear(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAllStanzaIdAcknowledgedListeners File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
removeAllStanzaIdAcknowledgedListeners
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected void replaceToast(String msg, boolean showlong) { hideToast(); mToast = Toast.makeText(this, msg, showlong ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT); mToast.show(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceToast File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
replaceToast
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private static boolean hasDomainURLs(PackageParser.Package pkg) { return (pkg.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_HAS_DOMAIN_URLS) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasDomainURLs 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
hasDomainURLs
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public AssetHandler etag(final boolean etag) { this.etag = etag; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: etag File: jooby/src/main/java/org/jooby/handlers/AssetHandler.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
etag
jooby/src/main/java/org/jooby/handlers/AssetHandler.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRequestedSessionIdFromCookie() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRequestedSessionIdFromCookie 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
isRequestedSessionIdFromCookie
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public void setProtocol(String protocol) { this.protocol = protocol; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProtocol File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
setProtocol
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public @NonNull XmlResourceParser openXmlResourceParser(int cookie, @NonNull String fileName) throws IOException { try (XmlBlock block = openXmlBlockAsset(cookie, fileName)) { XmlResourceParser parser = block.newParser(); // If openXmlBlockAsset doesn't throw, it will always return an XmlBlock object with // a valid native pointer, which makes newParser always return non-null. But let's // be careful. if (parser == null) { throw new AssertionError("block.newParser() returned a null parser"); } return parser; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openXmlResourceParser 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
openXmlResourceParser
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public void onResume() { super.onResume(); updateStage(mUiStage); if (mSaveAndFinishWorker != null) { mSaveAndFinishWorker.setListener(this); } else { mPasswordEntry.requestFocus(); mPasswordEntry.scheduleShowSoftInput(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume 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
onResume
src/com/android/settings/password/ChooseLockPassword.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
@Override protected void onTrackingStopped(boolean expand) { mFalsingManager.onTrackingStopped(); super.onTrackingStopped(expand); if (expand) { mNotificationStackScroller.setOverScrolledPixels( 0.0f, true /* onTop */, true /* animate */); } mNotificationStackScroller.onPanelTrackingStopped(); if (expand && (mStatusBar.getBarState() == StatusBarState.KEYGUARD || mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED)) { if (!mHintAnimationRunning) { mAffordanceHelper.reset(true); } } if (!expand && (mStatusBar.getBarState() == StatusBarState.KEYGUARD || mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED)) { KeyguardAffordanceView lockIcon = mKeyguardBottomArea.getLockIcon(); lockIcon.setImageAlpha(0.0f, true, 100, Interpolators.FAST_OUT_LINEAR_IN, null); lockIcon.setImageScale(2.0f, true, 100, Interpolators.FAST_OUT_LINEAR_IN); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTrackingStopped 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
onTrackingStopped
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; initializeVelocity(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: init File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java Repository: openmrs/openmrs-core The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23612
MEDIUM
5
openmrs/openmrs-core
init
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
db8454bf19a092a78d53ee4dba2af628b730a6e7
0
Analyze the following code function for security vulnerabilities
private void handleVmAndFwdSetSuccess(int dialogId) { if (DBG) log("handleVmAndFwdSetSuccess: key is " + mVoicemailProviders.getKey()); mPreviousVMProviderKey = mVoicemailProviders.getKey(); mChangingVMorFwdDueToProviderChange = false; showDialogIfForeground(dialogId); updateVoiceNumberField(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleVmAndFwdSetSuccess File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
handleVmAndFwdSetSuccess
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public void initReset() { resetConfigButton.addActionListener(e -> { reloadConfig(true, true); if (LANG == CHINESE) { JOptionPane.showMessageDialog(null, "已恢复"); } else { JOptionPane.showMessageDialog(null, "Success"); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initReset File: src/main/java/com/chaitin/xray/form/MainForm.java Repository: 4ra1n/super-xray The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-41958
HIGH
7.8
4ra1n/super-xray
initReset
src/main/java/com/chaitin/xray/form/MainForm.java
4d0d59663596db03f39d7edd2be251d48b52dcfc
0
Analyze the following code function for security vulnerabilities
public boolean userHasRole(final User user, final String roleid) throws FileNotFoundException, IOException { update(); m_readLock.lock(); try { return _userHasRole(user, roleid); } finally { m_readLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userHasRole File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
userHasRole
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public static byte[] readFileToByteArray(File file) throws IOException { return org.apache.commons.io.FileUtils.readFileToByteArray(file); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFileToByteArray File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
readFileToByteArray
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
private int getAliveUsersExcludingGuestsCountLocked() { int aliveUserCount = 0; final int totalUserCount = mUsers.size(); // Skip over users being removed for (int i = 0; i < totalUserCount; i++) { UserInfo user = mUsers.valueAt(i); if (!mRemovingUserIds.get(user.id) && !user.isGuest() && !user.partial) { aliveUserCount++; } } return aliveUserCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAliveUsersExcludingGuestsCountLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
getAliveUsersExcludingGuestsCountLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public static byte[] decrypt(final BlockCipher cipher, final SecretKey key, final byte[] data) throws CryptoException, EncodingException { final CiphertextHeader header = CiphertextHeader.decode(data); final PaddedBufferedBlockCipher padded = new PaddedBufferedBlockCipher(cipher, new PKCS7Padding()); padded.init(false, new ParametersWithIV(new KeyParameter(key.getEncoded()), header.getNonce())); return decrypt(new BufferedBlockCipherAdapter(padded), data, header.getLength()); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2020-7226 - Severity: MEDIUM - CVSS Score: 5.0 Description: Define new ciphertext header format. New format does not allocate any memory until HMAC check passes, which guards against untrusted input. All encryption components have been updated to use the new header, while preserving backward compatibility to decrypt messages encrypted with the old format. The decoding process for the old header has been hardened to impose reasonable limits on header fields: nonce sizes up to 255 bytes, key names up to 500 bytes. Fixes #52. Function: decrypt File: src/main/java/org/cryptacular/util/CipherUtil.java Repository: vt-middleware/cryptacular Fixed Code: public static byte[] decrypt(final BlockCipher cipher, final SecretKey key, final byte[] data) throws CryptoException, EncodingException { final CiphertextHeader header = decodeHeader(data, String -> key); final PaddedBufferedBlockCipher padded = new PaddedBufferedBlockCipher(cipher, new PKCS7Padding()); padded.init(false, new ParametersWithIV(new KeyParameter(key.getEncoded()), header.getNonce())); return decrypt(new BufferedBlockCipherAdapter(padded), data, header.getLength()); }
[ "CWE-770" ]
CVE-2020-7226
MEDIUM
5
vt-middleware/cryptacular
decrypt
src/main/java/org/cryptacular/util/CipherUtil.java
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
1
Analyze the following code function for security vulnerabilities
@Transactional(readOnly = false) public String startProcess(String procDefKey, String businessTable, String businessId) { return startProcess(procDefKey, businessTable, businessId, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startProcess File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
startProcess
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
public VirtualHostBuilder virtualHost(String defaultHostname, String hostnamePattern) { final VirtualHostBuilder virtualHostBuilder = new VirtualHostBuilder(this, false) .defaultHostname(defaultHostname) .hostnamePattern(hostnamePattern); virtualHostBuilders.add(virtualHostBuilder); return virtualHostBuilder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: virtualHost File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
virtualHost
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
private ModelAndView logsNotFound(JobIdentifier identifier) { String notFound = String.format("Console log for %s is unavailable as it may have been purged by Go or deleted externally.", identifier.toFullString()); return ResponseCodeView.create(SC_NOT_FOUND, notFound); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logsNotFound File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java Repository: gocd The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-43289
MEDIUM
5
gocd
logsNotFound
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
0
Analyze the following code function for security vulnerabilities
@Override public final int startActivityWithConfig(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Configuration config, Bundle bOptions, int userId) { enforceNotIsolatedCaller("startActivityWithConfig"); userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, false, ALLOW_FULL_ONLY, "startActivityWithConfig", null); // TODO: Switch to user app stacks here. int ret = mActivityStarter.startActivityMayWait(caller, -1, callingPackage, intent, resolvedType, null, null, resultTo, resultWho, requestCode, startFlags, null, null, config, bOptions, false, userId, null, null); return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityWithConfig File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startActivityWithConfig
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public HistoryCountModeEnum getHistoryCountMode() { return myHistoryCountMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHistoryCountMode File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getHistoryCountMode
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
@Override public void onBackendConnected() { Log.d(Config.LOGTAG, "ConversationFragment.onBackendConnected()"); String uuid = pendingConversationsUuid.pop(); if (uuid != null) { if (!findAndReInitByUuidOrArchive(uuid)) { return; } } else { if (!activity.xmppConnectionService.isConversationStillOpen(conversation)) { clearPending(); activity.onConversationArchived(conversation); return; } } ActivityResult activityResult = postponedActivityResult.pop(); if (activityResult != null) { handleActivityResult(activityResult); } clearPending(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBackendConnected File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onBackendConnected
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
boolean isRootOfTask() { if (task == null) { return false; } final ActivityRecord rootActivity = task.getRootActivity(true); return this == rootActivity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRootOfTask 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
isRootOfTask
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void deleteJohnSmith(TestUtils testUtils) throws Exception { testUtils.loginAsSuperAdmin(); testUtils.rest().deletePage("XWiki", "JohnSmith"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteJohnSmith File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2024-21650
CRITICAL
9.8
xwiki/xwiki-platform
deleteJohnSmith
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
0
Analyze the following code function for security vulnerabilities
private void setSurfaceLocked(Surface surface, int width, int height, int density) { if (mContainerState == CONTAINER_STATE_FINISHING) { return; } VirtualActivityDisplay virtualActivityDisplay = (VirtualActivityDisplay) mActivityDisplay; if (virtualActivityDisplay == null) { virtualActivityDisplay = new VirtualActivityDisplay(width, height, density); mActivityDisplay = virtualActivityDisplay; mActivityDisplays.put(virtualActivityDisplay.mDisplayId, virtualActivityDisplay); attachToDisplayLocked(virtualActivityDisplay); } if (mSurface != null) { mSurface.release(); } mSurface = surface; if (surface != null) { mStack.resumeTopActivityLocked(null); } else { mContainerState = CONTAINER_STATE_NO_SURFACE; ((VirtualActivityDisplay) mActivityDisplay).setSurface(null); if (mStack.mPausingActivity == null && mStack.mResumedActivity != null) { mStack.startPausingLocked(false, true, false, false); } } setSurfaceIfReadyLocked(); if (DEBUG_STACK) Slog.d(TAG_STACK, "setSurface: " + this + " to display=" + virtualActivityDisplay); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSurfaceLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
setSurfaceLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public int getEndColumnNumber() { return endColumnNumber_; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEndColumnNumber File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
getEndColumnNumber
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public ParceledListSlice<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, int flags, int userId) { final int callingUid = Binder.getCallingUid(); userId = mUserController.handleIncomingUser(Binder.getCallingPid(), callingUid, userId, false, ALLOW_FULL_ONLY, "getRecentTasks", null); final boolean allowed = isGetTasksAllowed("getRecentTasks", Binder.getCallingPid(), callingUid); final boolean detailed = checkCallingPermission( android.Manifest.permission.GET_DETAILED_TASKS) == PackageManager.PERMISSION_GRANTED; synchronized (this) { return mRecentTasks.getRecentTasks(maxNum, flags, allowed, detailed, userId, callingUid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRecentTasks File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
getRecentTasks
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getPath() { return path == null ? "" : path; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPath File: src/gribbit/auth/Cookie.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
getPath
src/gribbit/auth/Cookie.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
public JNLPClassLoader getParentJNLPClassLoader() { return parentJNLPClassLoader; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParentJNLPClassLoader File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getParentJNLPClassLoader
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Test public void usesReturnedVariableInCOuntProjectionIfSet() { assertCountQuery("select distinct m.genre from Media m where m.user = ?1 order by m.genre asc", "select count(distinct m.genre) from Media m where m.user = ?1"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: usesReturnedVariableInCOuntProjectionIfSet File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
usesReturnedVariableInCOuntProjectionIfSet
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
@Override public void onRemoveKeepalivePacketFilter(int slot) { if (!isThisCallbackActive()) return; ClientModeImpl.this.sendMessage(CMD_REMOVE_KEEPALIVE_PACKET_FILTER_FROM_APF, slot); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRemoveKeepalivePacketFilter File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onRemoveKeepalivePacketFilter
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void setClientAuth(ClientAuth mode) { if (clientMode) { return; } synchronized (this) { if (clientAuth == mode) { // No need to issue any JNI calls if the mode is the same return; } switch (mode) { case NONE: SSL.setVerify(ssl, SSL.SSL_CVERIFY_NONE, OpenSslContext.VERIFY_DEPTH); break; case REQUIRE: SSL.setVerify(ssl, SSL.SSL_CVERIFY_REQUIRE, OpenSslContext.VERIFY_DEPTH); break; case OPTIONAL: SSL.setVerify(ssl, SSL.SSL_CVERIFY_OPTIONAL, OpenSslContext.VERIFY_DEPTH); break; } clientAuth = mode; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientAuth File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
setClientAuth
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
EnterpriseSpecificIdCalculator newEnterpriseSpecificIdCalculator() { return new EnterpriseSpecificIdCalculator(mContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newEnterpriseSpecificIdCalculator 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
newEnterpriseSpecificIdCalculator
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public BytesLimitTerminateTimeTailPrettyLoggable<String, LogWatch> usingTimestamps() { return new PodOperationsImpl(getContext().withTimestamps(true)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: usingTimestamps File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
usingTimestamps
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
@Override public ParcelFileDescriptor getUserIcon(int userId) { String iconPath; synchronized (mPackagesLock) { UserInfo info = mUsers.get(userId); if (info == null || info.partial) { Slog.w(LOG_TAG, "getUserIcon: unknown user #" + userId); return null; } int callingGroupId = mUsers.get(UserHandle.getCallingUserId()).profileGroupId; if (callingGroupId == UserInfo.NO_PROFILE_GROUP_ID || callingGroupId != info.profileGroupId) { checkManageUsersPermission("get the icon of a user who is not related"); } if (info.iconPath == null) { return null; } iconPath = info.iconPath; } try { return ParcelFileDescriptor.open( new File(iconPath), ParcelFileDescriptor.MODE_READ_ONLY); } catch (FileNotFoundException e) { Log.e(LOG_TAG, "Couldn't find icon file", e); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserIcon File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
getUserIcon
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
static void dumpBarTransitions(PrintWriter pw, String var, BarTransitions transitions) { pw.print(" "); pw.print(var); pw.print(".BarTransitions.mMode="); pw.println(BarTransitions.modeToString(transitions.getMode())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpBarTransitions 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
dumpBarTransitions
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private boolean shouldReparentInTaskFragment(Task task) { // The task has not been embedded. We should reparent the task to TaskFragment. if (!task.isEmbedded()) { return true; } WindowContainer<?> parent = task.getParent(); // If the Activity is going to launch on top of embedded Task in the same TaskFragment, // we don't need to reparent the Task. Otherwise, the embedded Task should reparent to // another TaskFragment. return parent.asTaskFragment() != mInTaskFragment; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldReparentInTaskFragment 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
shouldReparentInTaskFragment
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private void startBroadcastObservers() { for (BroadcastQueue queue : mBroadcastQueues) { queue.start(mContext.getContentResolver()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startBroadcastObservers 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
startBroadcastObservers
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
boolean checkAppSwitchAllowedLocked(int sourcePid, int sourceUid, int callingPid, int callingUid, String name) { if (mAppSwitchesAllowedTime < SystemClock.uptimeMillis()) { return true; } if (mRecentTasks.isCallerRecents(sourceUid)) { return true; } int perm = checkComponentPermission(STOP_APP_SWITCHES, sourcePid, sourceUid, -1, true); if (perm == PackageManager.PERMISSION_GRANTED) { return true; } if (checkAllowAppSwitchUid(sourceUid)) { return true; } // If the actual IPC caller is different from the logical source, then // also see if they are allowed to control app switches. if (callingUid != -1 && callingUid != sourceUid) { perm = checkComponentPermission(STOP_APP_SWITCHES, callingPid, callingUid, -1, true); if (perm == PackageManager.PERMISSION_GRANTED) { return true; } if (checkAllowAppSwitchUid(callingUid)) { return true; } } Slog.w(TAG, name + " request from " + sourceUid + " stopped"); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAppSwitchAllowedLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
checkAppSwitchAllowedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getCertTypeSecureEmail() { return certTypeSecureEmail; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertTypeSecureEmail File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getCertTypeSecureEmail
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int readInt() throws IOException { return primitiveTypes.readInt(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readInt File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readInt
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public void handleShutdownSignal(ShutdownSignalException signal) { _blocker.setException(signal); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleShutdownSignal File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
handleShutdownSignal
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
void executeNextState(UnifiedRestoreState nextState) { if (MORE_DEBUG) Slog.i(TAG, " => executing next step on " + this + " nextState=" + nextState); mState = nextState; Message msg = mBackupHandler.obtainMessage(MSG_BACKUP_RESTORE_STEP, this); mBackupHandler.sendMessage(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeNextState File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
executeNextState
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
protected Header getHeader() { return header; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHeader 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
getHeader
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void setNonce(Long nonce) { this.nonce = nonce; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNonce File: base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setNonce
base/common/src/main/java/com/netscape/certsrv/cert/CertRevokeRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public String display(String fieldname, String type, String pref, BaseObject obj, boolean isolated, XWikiContext context) { return display(fieldname, type, pref, obj, context.getWiki().getCurrentContentSyntaxId(getSyntaxId(), context), isolated, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: display 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
display
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void fillInProcMemInfo(ProcessRecord app, ActivityManager.RunningAppProcessInfo outInfo, int clientTargetSdk) { outInfo.pid = app.pid; outInfo.uid = app.info.uid; if (mHeavyWeightProcess == app) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_CANT_SAVE_STATE; } if (app.persistent) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_PERSISTENT; } if (app.activities.size() > 0) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_HAS_ACTIVITIES; } outInfo.lastTrimLevel = app.trimMemoryLevel; int adj = app.curAdj; int procState = app.curProcState; outInfo.importance = procStateToImportance(procState, adj, outInfo, clientTargetSdk); outInfo.importanceReasonCode = app.adjTypeCode; outInfo.processState = app.curProcState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillInProcMemInfo File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
fillInProcMemInfo
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void resizeStack(int stackId, Rect destBounds, boolean allowResizeInDockedMode, boolean preserveWindows, boolean animate, int animationDuration) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "resizeStack()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { if (animate) { final PinnedActivityStack stack = mStackSupervisor.getStack(stackId); if (stack == null) { Slog.w(TAG, "resizeStack: stackId " + stackId + " not found."); return; } if (stack.getWindowingMode() != WINDOWING_MODE_PINNED) { throw new IllegalArgumentException("Stack: " + stackId + " doesn't support animated resize."); } stack.animateResizePinnedStack(null /* sourceHintBounds */, destBounds, animationDuration, false /* fromFullscreen */); } else { final ActivityStack stack = mStackSupervisor.getStack(stackId); if (stack == null) { Slog.w(TAG, "resizeStack: stackId " + stackId + " not found."); return; } mStackSupervisor.resizeStackLocked(stack, destBounds, null /* tempTaskBounds */, null /* tempTaskInsetBounds */, preserveWindows, allowResizeInDockedMode, !DEFER_RESUME); } } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeStack File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
resizeStack
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override boolean check(FlakeIdGeneratorConfig c1, FlakeIdGeneratorConfig c2) { if (c1 == c2) { return true; } if (c1 == null || c2 == null) { return false; } return nullSafeEqual(c1.getName(), c2.getName()) && c1.getPrefetchCount() == c2.getPrefetchCount() && c1.getPrefetchValidityMillis() == c2.getPrefetchValidityMillis() && c1.getIdOffset() == c2.getIdOffset() && c1.getNodeIdOffset() == c2.getNodeIdOffset() && c1.isStatisticsEnabled() == c2.isStatisticsEnabled(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public MvcClass produces(final List<MediaType> produces) { this.produces = produces; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: produces File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
produces
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Nullable private static Integer toInteger(@Nullable String v) { try { return v != null ? Integer.parseInt(v) : null; } catch (NumberFormatException ignore) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toInteger File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
toInteger
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
private SSLEngineResult readPendingBytesFromBIO( ByteBuffer dst, int bytesConsumed, int bytesProduced, HandshakeStatus status) throws SSLException { // Check to see if the engine wrote data into the network BIO int pendingNet = SSL.pendingWrittenBytesInBIO(networkBIO); if (pendingNet > 0) { // Do we have enough room in dst to write encrypted data? int capacity = dst.remaining(); if (capacity < pendingNet) { return new SSLEngineResult(BUFFER_OVERFLOW, mayFinishHandshake(status != FINISHED ? getHandshakeStatus(pendingNet) : status), bytesConsumed, bytesProduced); } // Write the pending data from the network BIO into the dst buffer int produced = readEncryptedData(dst, pendingNet); if (produced <= 0) { // We ignore BIO_* errors here as we use in memory BIO anyway and will do another SSL_* call later // on in which we will produce an exception in case of an error SSL.clearError(); } else { bytesProduced += produced; pendingNet -= produced; } // If isOuboundDone is set, then the data from the network BIO // was the close_notify message -- we are not required to wait // for the receipt the peer's close_notify message -- shutdown. if (isOutboundDone) { shutdown(); } return new SSLEngineResult(getEngineStatus(), mayFinishHandshake(status != FINISHED ? getHandshakeStatus(pendingNet) : status), bytesConsumed, bytesProduced); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readPendingBytesFromBIO File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
readPendingBytesFromBIO
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
private void addFreeWindowToListLocked(final WindowState win) { final WindowList windows = win.getWindowList(); // Figure out where window should go, based on layer. final int myLayer = win.mBaseLayer; int i; for (i = windows.size() - 1; i >= 0; i--) { if (windows.get(i).mBaseLayer <= myLayer) { break; } } i++; if (DEBUG_FOCUS_LIGHT || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "Free window: Adding window " + win + " at " + i + " of " + windows.size()); windows.add(i, win); mWindowsChanged = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFreeWindowToListLocked 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
addFreeWindowToListLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public List<String> walk(File base, File root) throws IOException { if (root == null) { root = base; } List<String> result = new LinkedList<String>(); String basePath = base.getCanonicalPath(); File[] list = root.listFiles(); if (list != null) { for (File f : list) { if (f.isDirectory()) { result.addAll(walk(base, f)); } else if (f.getCanonicalPath().toLowerCase().endsWith(".xml")) { String name = f.getCanonicalPath() .substring(basePath.length() + 1); result.add( "f['" + name + "'] = '" + processFile(f) + "';\n"); } } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: walk File: etc/build/Xml2Js.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-284", "CWE-79" ]
CVE-2022-3065
HIGH
7.5
jgraph/drawio
walk
etc/build/Xml2Js.java
59887e45b36f06c8dd4919a32bacd994d9f084da
0
Analyze the following code function for security vulnerabilities
private ArrayList<PackageParser.Package> updateAllSharedLibrariesLPw( PackageParser.Package changingPkg) { ArrayList<PackageParser.Package> res = null; for (PackageParser.Package pkg : mPackages.values()) { if (hasString(pkg.usesLibraries, changingPkg.libraryNames) || hasString(pkg.usesOptionalLibraries, changingPkg.libraryNames)) { if (res == null) { res = new ArrayList<PackageParser.Package>(); } res.add(pkg); try { updateSharedLibrariesLPw(pkg, changingPkg); } catch (PackageManagerException e) { Slog.e(TAG, "updateAllSharedLibrariesLPw failed: " + e.getMessage()); } } } return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAllSharedLibrariesLPw 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
updateAllSharedLibrariesLPw
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static Object decodeArg(Component instance, Method method, Class<?> type, int index, JsonValue argValue) { // come up with method to know that it's an id and should be gotten from // the model assert argValue != null; if (type.isPrimitive() && argValue.getType() == JsonType.NULL) { return JsonCodec.decodeAs(argValue, type); } else if (type.isArray()) { return decodeArray(method, type, index, argValue); } else { Class<?> convertedType = ReflectTools.convertPrimitiveType(type); if (instance != null) { Optional<UI> ui = instance.getUI(); if (!ui.isPresent()) { throw new IllegalStateException( "Rpc handler may not be called for a detached component"); } VaadinContext context = ui.get().getSession().getService() .getContext(); DeprecatedPolymerPublishedEventHandler handler = context .getAttribute(Lookup.class) .lookup(DeprecatedPolymerPublishedEventHandler.class); if (handler != null && handler.isTemplateModelValue(instance, argValue, convertedType)) { return handler.getTemplateItem(instance, (JsonObject) argValue, method.getGenericParameterTypes()[index]); } } Optional<RpcDecoder> decoder = getDecoder(argValue, convertedType); if (decoder.isPresent()) { try { return decoder.get().decode(argValue, convertedType); } catch (RpcDecodeException exception) { throw new IllegalArgumentException(exception); } } String msg = String.format("Class '%s' has the method '%s' " + "whose parameter %d refers to unsupported type '%s'", method.getDeclaringClass().getName(), method.getName(), index, type.getName()); throw new IllegalArgumentException(msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeArg File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
decodeArg
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
public Field<?> getEditorField() { return grid.getEditorField(getPropertyId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEditorField 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
getEditorField
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public boolean setAutoRevokeExempted( @NonNull String packageName, boolean exempted, int userId) { Objects.requireNonNull(packageName); final AndroidPackage pkg = mPackageManagerInt.getPackage(packageName); final int callingUid = Binder.getCallingUid(); if (!checkAutoRevokeAccess(pkg, callingUid)) { return false; } return setAutoRevokeExemptedInternal(pkg, exempted, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoRevokeExempted 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
setAutoRevokeExempted
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
protected void populateExtraHelperUtilities(Map<String, Object> variables) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateExtraHelperUtilities File: portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java Repository: samuelkong/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2963
MEDIUM
4.3
samuelkong/liferay-portal
populateExtraHelperUtilities
portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java
5db1f7622e8e2c9a559ef0145a0f04c5854a1e8b
0
Analyze the following code function for security vulnerabilities
public String selectBackupTransport(String transport) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "selectBackupTransport"); synchronized (mTransports) { final long oldId = Binder.clearCallingIdentity(); try { String prevTransport = mCurrentTransport; mCurrentTransport = transport; Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.BACKUP_TRANSPORT, transport); Slog.v(TAG, "selectBackupTransport() set " + mCurrentTransport + " returning " + prevTransport); return prevTransport; } finally { Binder.restoreCallingIdentity(oldId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectBackupTransport File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
selectBackupTransport
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public Builder address(ClickHouseProtocol protocol, InetSocketAddress address) { if (address != null) { host(address.getHostName()); port(protocol, address.getPort()); } else { host(null); port(protocol, null); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: address File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
address
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
public String getResponseString(CloseableHttpResponse response) throws IOException { HttpEntity entity = response.getEntity(); if (entity == null) return "{}"; String responseString = EntityUtils.toString(entity); logger.debug("Http response: " + responseString); return responseString; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponseString File: notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java Repository: opendistro-for-elasticsearch/alerting The code follows secure coding practices.
[ "CWE-918" ]
CVE-2021-31828
MEDIUM
5.5
opendistro-for-elasticsearch/alerting
getResponseString
notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
49cc584dd6bd38ca26129eeaca5cd04e40a27f25
0
Analyze the following code function for security vulnerabilities
@Override public void emailSuccessMessage(Context context, EPerson eperson, String fileName) throws MessagingException { try { Locale supportedLocale = I18nUtil.getEPersonLocale(eperson); Email email = Email.getEmail(I18nUtil.getEmailFilename(supportedLocale, "bte_batch_import_success")); email.addRecipient(eperson.getEmail()); email.addArgument(fileName); email.send(); } catch (Exception e) { log.warn(LogManager.getHeader(context, "emailSuccessMessage", "cannot notify user of import"), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: emailSuccessMessage File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
emailSuccessMessage
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
@Override public void sendIdleJobTrigger() { if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.SET_ACTIVITY_WATCHER); } final long ident = Binder.clearCallingIdentity(); try { Intent intent = new Intent(ACTION_TRIGGER_IDLE) .setPackage("android") .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); broadcastIntent(null, intent, null, null, 0, null, null, null, OP_NONE, null, false, false, UserHandle.USER_ALL); } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendIdleJobTrigger File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
sendIdleJobTrigger
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void setRealm(String realm) { if (realm != null) { attributes.put(REALM, realm); } else { attributes.remove(REALM); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRealm File: base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setRealm
base/common/src/main/java/com/netscape/certsrv/key/KeyArchivalRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public String[] listStorageEntries() { return getContext().fileList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listStorageEntries 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
listStorageEntries
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Subscribe(threadMode = ThreadMode.MAIN) public void onEventMainThread(SyncStartedEvent event) { Log.d(TAG, "onEventMainThread - SyncStartedEvent"); updateButtonLayout(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onEventMainThread 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
onEventMainThread
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
private void saveRunningDevServerPort() { try { FileUtils.writeStringToFile(devServerPortFile, String.valueOf(port), StandardCharsets.UTF_8); } catch (IOException e) { throw new UncheckedIOException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveRunningDevServerPort File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-172" ]
CVE-2021-33604
LOW
1.2
vaadin/flow
saveRunningDevServerPort
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
0
Analyze the following code function for security vulnerabilities
public String getFirstImgUrl(String htmlContent, AdminTokenVO adminTokenVO) { if (StringUtils.isEmpty(htmlContent)) { return ""; } Elements elements = Jsoup.parse(htmlContent).select("img"); if (!elements.isEmpty()) { String url = elements.first().attr("src"); try { //检查默认目录是否存在 new File(JFinal.me().getConstants().getBaseUploadPath()).mkdirs(); String path = url; File thumbnailFile; byte[] bytes; if (url.startsWith("https://") || url.startsWith("http://")) { path = new URL(url).getPath(); if (!path.startsWith(Constants.ATTACHED_FOLDER)) { path = (Constants.ATTACHED_FOLDER + path).replace("//", "/"); } else { path = path.replace("//", "/"); } bytes = getRequestBodyBytes(url); path = path.substring(0, path.indexOf('.')) + "_thumbnail" + path.substring(path.indexOf('.')); thumbnailFile = new File(PathKit.getWebRootPath() + path); } else { bytes = IOUtil.getByteByInputStream(new FileInputStream(PathKit.getWebRootPath() + url.replace(JFinal.me().getContextPath(), ""))); path = url.substring(0, url.indexOf('.')) + "_thumbnail" + url.substring(path.indexOf('.')); thumbnailFile = new File(PathKit.getWebRootPath() + path); } int height = -1; int width = -1; if (bytes.length > 0) { try { String extName = thumbnailFile.getName().substring(thumbnailFile.getName().lastIndexOf('.')); //创建文件夹,避免保存失败 thumbnailFile.getParentFile().mkdirs(); if (!".gif".equalsIgnoreCase(extName)) { IOUtil.writeBytesToFile(ThumbnailUtil.jpeg(bytes, 1f), thumbnailFile); BufferedImage bimg = ImageIO.read(thumbnailFile); height = bimg.getHeight(); width = bimg.getWidth(); } else { IOUtil.writeBytesToFile(bytes, thumbnailFile); } } catch (IOException e) { LOGGER.error("generation jpeg thumbnail error ", e); return url; } return new UploadService().getCloudUrl(JFinal.me().getContextPath(), path, thumbnailFile.getPath(), null, adminTokenVO).getUrl() + "?h=" + height + "&w=" + width; } } catch (Exception e) { LOGGER.error("", e); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstImgUrl File: service/src/main/java/com/zrlog/service/ArticleService.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
getFirstImgUrl
service/src/main/java/com/zrlog/service/ArticleService.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
public String render(String path, XWikiContext context) throws XWikiException, IOException { // This Action expects an incoming Entity URL of the type: // http://localhost:8080/xwiki/bin/skin/<path to resource on the filesystem, relative to the xwiki webapp> // Example 1 (fs skin file): .../bin/skin/skins/flamingo/style.css?... // Example 2 (fs resource file): .../bin/skin/resources/uicomponents/search/searchSuggest.css // Example 3 (wiki skin attachment or xproperty): .../bin/skin/XWiki/DefaultSkin/somefile.css // // TODO: The mapping to an Entity URL is hackish and needs to be fixed, // see https://jira.xwiki.org/browse/XWIKI-12449 // Since we support Nested Spaces, these two examples will be mapped as the following Attachment References: // Example 1: skins.flamingo@style\.css // Example 2: resources.uicomponents.search@searchSuggest\.css // Example 3: XWiki.DefaultSkin@somefile\.css XWiki xwiki = context.getWiki(); // Since skin paths usually contain the name of skin document, it is likely that the context document belongs to // the current skin. XWikiDocument doc = context.getDoc(); // The base skin could be either a filesystem directory, or an xdocument. String baseskin = xwiki.getBaseSkin(context, true); XWikiDocument baseskindoc = xwiki.getDocument(baseskin, context); // The default base skin is always a filesystem directory. String defaultbaseskin = xwiki.getDefaultBaseSkin(context); LOGGER.debug("document: [{}] ; baseskin: [{}] ; defaultbaseskin: [{}]", new Object[] { doc.getDocumentReference(), baseskin, defaultbaseskin }); // Since we don't know exactly what does the URL point at, meaning that we don't know where the skin identifier // ends and where the path to the file starts, we must try to split at every '/' character. int idx = path.lastIndexOf(DELIMITER); boolean found = false; while (idx > 0) { try { String filename = Util.decodeURI(path.substring(idx + 1), context); LOGGER.debug("Trying [{}]", filename); // Try on the current skin document. if (renderSkin(filename, doc, context)) { found = true; break; } // Try on the base skin document, if it is not the same as above. if (StringUtils.isNotEmpty(baseskin) && !doc.getName().equals(baseskin)) { if (renderSkin(filename, baseskindoc, context)) { found = true; break; } } // Try on the default base skin, if it wasn't already tested above. if (StringUtils.isNotEmpty(baseskin) && !(doc.getName().equals(defaultbaseskin) || baseskin.equals(defaultbaseskin))) { // defaultbaseskin can only be on the filesystem, so don't try to use it as a // skin document. if (renderFileFromFilesystem(getSkinFilePath(filename, defaultbaseskin), context)) { found = true; break; } } // Try in the resources directory. if (renderFileFromFilesystem(getResourceFilePath(filename), context)) { found = true; break; } } catch (XWikiException ex) { if (ex.getCode() == XWikiException.ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION) { // This means that the response couldn't be sent, although the file was // successfully found. Signal this further, and stop trying to render. throw ex; } LOGGER.debug(String.valueOf(idx), ex); } idx = path.lastIndexOf(DELIMITER, idx - 1); } if (!found) { context.getResponse().setStatus(404); return "docdoesnotexist"; } return null; }
Vulnerability Classification: - CWE: CWE-287 - CVE: CVE-2022-36092 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-19549: Disallow template override for login, register and skin * Also do not put a document without view rights into the context. Function: render File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java Repository: xwiki/xwiki-platform Fixed Code: public String render(String path, XWikiContext context) throws XWikiException, IOException { // This Action expects an incoming Entity URL of the type: // http://localhost:8080/xwiki/bin/skin/<path to resource on the filesystem, relative to the xwiki webapp> // Example 1 (fs skin file): .../bin/skin/skins/flamingo/style.css?... // Example 2 (fs resource file): .../bin/skin/resources/uicomponents/search/searchSuggest.css // Example 3 (wiki skin attachment or xproperty): .../bin/skin/XWiki/DefaultSkin/somefile.css // // TODO: The mapping to an Entity URL is hackish and needs to be fixed, // see https://jira.xwiki.org/browse/XWIKI-12449 // Since we support Nested Spaces, these two examples will be mapped as the following Attachment References: // Example 1: skins.flamingo@style\.css // Example 2: resources.uicomponents.search@searchSuggest\.css // Example 3: XWiki.DefaultSkin@somefile\.css XWiki xwiki = context.getWiki(); // Since skin paths usually contain the name of skin document, it is likely that the context document belongs to // the current skin. XWikiDocument doc = context.getDoc(); // The base skin could be either a filesystem directory, or an xdocument. String baseskin = xwiki.getBaseSkin(context, true); XWikiDocument baseskindoc = xwiki.getDocument(baseskin, context); // The default base skin is always a filesystem directory. String defaultbaseskin = xwiki.getDefaultBaseSkin(context); LOGGER.debug("document: [{}] ; baseskin: [{}] ; defaultbaseskin: [{}]", new Object[] { doc.getDocumentReference(), baseskin, defaultbaseskin }); // Since we don't know exactly what does the URL point at, meaning that we don't know where the skin identifier // ends and where the path to the file starts, we must try to split at every '/' character. int idx = path.lastIndexOf(DELIMITER); boolean found = false; while (idx > 0) { try { String filename = Util.decodeURI(path.substring(idx + 1), context); LOGGER.debug("Trying [{}]", filename); // Try on the current skin document. if (renderSkin(filename, doc, context)) { found = true; break; } // Try on the base skin document, if it is not the same as above. if (StringUtils.isNotEmpty(baseskin) && !doc.getName().equals(baseskin)) { if (renderSkin(filename, baseskindoc, context)) { found = true; break; } } // Try on the default base skin, if it wasn't already tested above. if (StringUtils.isNotEmpty(baseskin) && !(doc.getName().equals(defaultbaseskin) || baseskin.equals(defaultbaseskin))) { // defaultbaseskin can only be on the filesystem, so don't try to use it as a // skin document. if (renderFileFromFilesystem(getSkinFilePath(filename, defaultbaseskin), context)) { found = true; break; } } // Try in the resources directory. if (renderFileFromFilesystem(getResourceFilePath(filename), context)) { found = true; break; } } catch (XWikiException ex) { if (ex.getCode() == XWikiException.ERROR_XWIKI_APP_SEND_RESPONSE_EXCEPTION) { // This means that the response couldn't be sent, although the file was // successfully found. Signal this further, and stop trying to render. throw ex; } LOGGER.debug(String.valueOf(idx), ex); } idx = path.lastIndexOf(DELIMITER, idx - 1); } if (!found) { context.getResponse().setStatus(404); return DOCDOESNOTEXIST; } return null; }
[ "CWE-287" ]
CVE-2022-36092
HIGH
7.5
xwiki/xwiki-platform
render
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
1
Analyze the following code function for security vulnerabilities
@Override public boolean isUsingCompression() { return compressionHandler != null && compressSyncPoint.wasSuccessful(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUsingCompression File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
isUsingCompression
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
public JSONObject put(String key, int value) throws JSONException { return this.put(key, Integer.valueOf(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
put
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public void onAuthenticationError(int errorCode, CharSequence errString) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAuthenticationError File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onAuthenticationError
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveActivityTaskToBack File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
moveActivityTaskToBack
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public long insertStartSyncEvent(SyncOperation op, long now) { long id; synchronized (mAuthorities) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "insertStartSyncEvent: " + op); } AuthorityInfo authority = getAuthorityLocked(op.target, "insertStartSyncEvent"); if (authority == null) { return -1; } SyncHistoryItem item = new SyncHistoryItem(); item.initialization = op.isInitialization(); item.authorityId = authority.ident; item.historyId = mNextHistoryId++; if (mNextHistoryId < 0) mNextHistoryId = 0; item.eventTime = now; item.source = op.syncSource; item.reason = op.reason; item.extras = op.extras; item.event = EVENT_START; mSyncHistory.add(0, item); while (mSyncHistory.size() > MAX_HISTORY) { mSyncHistory.remove(mSyncHistory.size()-1); } id = item.historyId; if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "returning historyId " + id); } reportChange(ContentResolver.SYNC_OBSERVER_TYPE_STATUS); return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertStartSyncEvent File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
insertStartSyncEvent
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public static boolean fresh(RoutingContext ctx, long lastModified) { final HttpServerRequest req = ctx.request(); final HttpServerResponse res = ctx.response(); // fields final String modifiedSince = req.getHeader(HttpHeaders.IF_MODIFIED_SINCE); final String noneMatch = req.getHeader(HttpHeaders.IF_NONE_MATCH); // unconditional request if (modifiedSince == null && noneMatch == null) { return false; } // Always return stale when Cache-Control: no-cache // to support end-to-end reload requests // https://tools.ietf.org/html/rfc2616#section-14.9.4 final String cacheControl = req.getHeader(HttpHeaders.CACHE_CONTROL); if (cacheControl != null && CACHE_CONTROL_NO_CACHE_REGEXP.matcher(cacheControl).find()) { return false; } // if-none-match if (noneMatch != null && !"*".equals(noneMatch)) { final String etag = res.headers().get(HttpHeaders.ETAG); if (etag == null) { return false; } boolean etagStale = true; // lookup etags int end = 0; int start = 0; loop: for (int i = 0; i < noneMatch.length(); i++) { switch (noneMatch.charAt(i)) { case ' ': if (start == end) { start = end = i + 1; } break; case ',': String match = noneMatch.substring(start, end); if (match.equals(etag) || match.equals("W/" + etag) || ("W/" + match).equals(etag)) { etagStale = false; break loop; } start = end = i + 1; break; default: end = i + 1; break; } } if (etagStale) { // the parser run out of bytes, need to check if the match is valid String match = noneMatch.substring(start, end); if (!match.equals(etag) && !match.equals("W/" + etag) && !("W/" + match).equals(etag)) { return false; } } } // if-modified-since if (modifiedSince != null) { if (lastModified == -1) { // no custom last modified provided, will use the response headers if any lastModified = parseRFC1123DateTime(res.headers().get(HttpHeaders.LAST_MODIFIED)); } boolean modifiedStale = lastModified == -1 || !(lastModified <= parseRFC1123DateTime(modifiedSince)); return !modifiedStale; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fresh File: vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-24815
MEDIUM
5.3
vert-x3/vertx-web
fresh
vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java
9e3a783b1d1a731055e9049078b1b1494ece9c15
0
Analyze the following code function for security vulnerabilities
public void registerProcessObserver(IProcessObserver observer) { enforceCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER, "registerProcessObserver()"); synchronized (this) { mProcessObservers.register(observer); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerProcessObserver File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
registerProcessObserver
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static <T> T unmarshal(final Class<T> clazz, final InputSource inputSource, final JAXBContext jaxbContext, final boolean validate, final boolean disableDOCTYPE) { final Unmarshaller um = getUnmarshallerFor(clazz, jaxbContext, validate); LOG.trace("unmarshalling class {} from input source {} with unmarshaller {}", clazz.getSimpleName(), inputSource, um); try { final XMLFilter filter = getXMLFilterForClass(clazz, disableDOCTYPE); final SAXSource source = new SAXSource(filter, inputSource); um.setEventHandler(new LoggingValidationEventHandler()); final JAXBElement<T> element = um.unmarshal(source, clazz); return element.getValue(); } catch (final SAXException e) { throw EXCEPTION_TRANSLATOR.translate("creating an XML reader object", e); } catch (final JAXBException e) { throw EXCEPTION_TRANSLATOR.translate("unmarshalling an object (" + clazz.getSimpleName() + ")", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unmarshal File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-0871
MEDIUM
6.1
OpenNMS/opennms
unmarshal
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
3c17231714e3d55809efc580a05734ed530f9ad4
0
Analyze the following code function for security vulnerabilities
protected static RootSearcher searchRootDirectory(Path fPath) throws IOException { RootSearcher rootSearcher = new RootSearcher(); Files.walkFileTree(fPath, rootSearcher); return rootSearcher; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-39180 - Severity: HIGH - CVSS Score: 9.0 Description: OO-5549: fix the wiki import and add some unit tests Function: searchRootDirectory File: src/main/java/org/olat/fileresource/types/FileResource.java Repository: OpenOLAT Fixed Code: protected static RootSearcher searchRootDirectory(Path fPath) throws IOException { RootSearcher rootSearcher = new RootSearcher(); Files.walkFileTree(fPath, EnumSet.noneOf(FileVisitOption.class), 16, rootSearcher); return rootSearcher; }
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
searchRootDirectory
src/main/java/org/olat/fileresource/types/FileResource.java
699490be8e931af0ef1f135c55384db1f4232637
1
Analyze the following code function for security vulnerabilities
public static DependencyMaterial dependencyMaterial() { return new DependencyMaterial(new CaseInsensitiveString("pipeline-name"), new CaseInsensitiveString("stage-name")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dependencyMaterial File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
dependencyMaterial
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
public String displayDocument(Syntax targetSyntax, boolean restricted, XWikiContext context) throws XWikiException { return getRenderedContent(targetSyntax, true, restricted, context, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayDocument 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
displayDocument
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 getRenderedContent(boolean transformationContextIsolated) throws XWikiException { return this.doc.getRenderedContent(transformationContextIsolated, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderedContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getRenderedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public static String toValidFilename(String filename) { return filename.replaceAll("[\\\\/:\"*?<>|]+", ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toValidFilename File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
toValidFilename
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
void notifyInsetsChanged() { ProtoLog.d(WM_DEBUG_WINDOW_INSETS, "notifyInsetsChanged for %s ", this); mWindowFrames.setInsetsChanged(true); // If the new InsetsState won't be dispatched before releasing WM lock, the following // message will be executed. mWmService.mWindowsInsetsChanged++; mWmService.mH.removeMessages(WindowManagerService.H.INSETS_CHANGED); mWmService.mH.sendEmptyMessage(WindowManagerService.H.INSETS_CHANGED); final WindowContainer p = getParent(); if (p != null) { p.updateOverlayInsetsState(this); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyInsetsChanged File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
notifyInsetsChanged
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public T add(K name, Iterable<? extends V> values) { validateName(nameValidator, true, name); int h = hashingStrategy.hashCode(name); int i = index(h); for (V v: values) { validateValue(valueValidator, name, v); add0(h, i, name, v); } return thisT(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
add
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public int getCustomBackgroundColor() { return mCustomBackgroundColor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomBackgroundColor File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getCustomBackgroundColor
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public ResultSet getResponsaveis() throws Exception{ ResultSet result = this.bancoConec.execConsulta("Select * from ACI_Responsavel"); if(result.first()){ result.beforeFirst(); return result; }else{ return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponsaveis File: Escola Eclipse/Escola/src/banco_de_dados/dao/Responsaveis.java Repository: marinaguimaraes/ACI_Escola The code follows secure coding practices.
[ "CWE-89" ]
CVE-2015-10037
MEDIUM
5.2
marinaguimaraes/ACI_Escola
getResponsaveis
Escola Eclipse/Escola/src/banco_de_dados/dao/Responsaveis.java
34eed1f7b9295d1424912f79989d8aba5de41e9f
0
Analyze the following code function for security vulnerabilities
protected ID checkoutReferenceValue(Field field, Cell cell) { final String val = cell.asString(); final Entity refEntity = field.getReferenceEntity(); // 支持ID ID vla2id = MetadataHelper.checkSpecEntityId(val, refEntity.getEntityCode()); if (vla2id != null) { if (QueryHelper.exists(vla2id)) return vla2id; log.warn("Reference ID `{}` not exists", vla2id); return null; } Object val2Text = checkoutFieldValue(refEntity.getNameField(), cell, false); if (val2Text == null) return null; Query query; // 用户特殊处理 if (refEntity.getEntityCode() == EntityHelper.User) { String sql = MessageFormat.format( "select userId from User where loginName = ''{0}'' or email = ''{0}'' or fullName = ''{0}''", StringEscapeUtils.escapeSql(val2Text.toString())); query = Application.createQueryNoFilter(sql); } else { // 查找引用实体的名称字段和自动编号字段 Set<String> queryFields = new HashSet<>(); queryFields.add(refEntity.getNameField().getName()); // 名称字段又是引用字段 if (!(val2Text instanceof ID)) { for (Field s : MetadataSorter.sortFields(refEntity, DisplayType.SERIES)) { queryFields.add(s.getName()); } } StringBuilder sql = new StringBuilder( String.format("select %s from %s where ", refEntity.getPrimaryField().getName(), refEntity.getName())); for (String qf : queryFields) { sql.append( String.format("%s = '%s' or ", qf, StringEscapeUtils.escapeSql(val2Text.toString()))); } sql = new StringBuilder(sql.substring(0, sql.length() - 4)); query = Application.createQueryNoFilter(sql.toString()); } Object[] found = query.unique(); return found != null ? (ID) found[0] : null; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2023-1495 - Severity: MEDIUM - CVSS Score: 6.5 Description: H5 sync2 (#595) * style: 目录样式gh * style: J_new * feat: advListFilterTabs * feat: nav-copyto * enh: 助记码全拼 * enh: 地图搜索选点 * enh: topnav * list pn * .form-line.v33 * open TAG * KVS addShutdownHook * fix: #594 --------- Co-authored-by: devezhao <zhaofang123@gmail.com> Function: checkoutReferenceValue File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild Fixed Code: protected ID checkoutReferenceValue(Field field, Cell cell) { final String val = cell.asString(); final Entity refEntity = field.getReferenceEntity(); // 支持ID ID vla2id = MetadataHelper.checkSpecEntityId(val, refEntity.getEntityCode()); if (vla2id != null) { if (QueryHelper.exists(vla2id)) return vla2id; log.warn("Reference ID `{}` not exists", vla2id); return null; } Object val2Text = checkoutFieldValue(refEntity.getNameField(), cell, false); if (val2Text == null) return null; Query query; // 用户特殊处理 if (refEntity.getEntityCode() == EntityHelper.User) { String sql = MessageFormat.format( "select userId from User where loginName = ''{0}'' or email = ''{0}'' or fullName = ''{0}''", CommonsUtils.escapeSql(val2Text.toString())); query = Application.createQueryNoFilter(sql); } else { // 查找引用实体的名称字段和自动编号字段 Set<String> queryFields = new HashSet<>(); queryFields.add(refEntity.getNameField().getName()); // 名称字段又是引用字段 if (!(val2Text instanceof ID)) { for (Field s : MetadataSorter.sortFields(refEntity, DisplayType.SERIES)) { queryFields.add(s.getName()); } } StringBuilder sql = new StringBuilder( String.format("select %s from %s where ", refEntity.getPrimaryField().getName(), refEntity.getName())); for (String qf : queryFields) { sql.append( String.format("%s = '%s' or ", qf, CommonsUtils.escapeSql(val2Text.toString()))); } sql = new StringBuilder(sql.substring(0, sql.length() - 4)); query = Application.createQueryNoFilter(sql.toString()); } Object[] found = query.unique(); return found != null ? (ID) found[0] : null; }
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
checkoutReferenceValue
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
1
Analyze the following code function for security vulnerabilities
@VisibleForTesting public PackageManagerInternal getPackageManagerInternal() { // Intentionally hold no locks: in case of race conditions, the mPackageManagerInt will // be set to the same value anyway. if (mPackageManagerInt == null) { mPackageManagerInt = LocalServices.getService(PackageManagerInternal.class); } return mPackageManagerInt; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageManagerInternal 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
getPackageManagerInternal
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public int getTaskToShowPermissionDialogOn(String pkgName, int uid) { synchronized (ActivityTaskManagerService.this.mGlobalLock) { return ActivityTaskManagerService.this.mRootWindowContainer .getTaskToShowPermissionDialogOn(pkgName, uid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskToShowPermissionDialogOn 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
getTaskToShowPermissionDialogOn
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private static void writeBaloFile(HttpURLConnection conn, Path baloPath, String fullModuleName, long resContentLength) { try (InputStream inputStream = conn.getInputStream(); FileOutputStream outputStream = new FileOutputStream(baloPath.toString())) { writeAndHandleProgress(inputStream, outputStream, resContentLength / 1024, fullModuleName); } catch (IOException e) { createError("error occurred copying the balo file: " + e.getMessage()); } }
Vulnerability Classification: - CWE: CWE-306 - CVE: CVE-2021-32700 - Severity: MEDIUM - CVSS Score: 5.8 Description: Fix central connection Function: writeBaloFile File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java Repository: ballerina-platform/ballerina-lang Fixed Code: private static void writeBaloFile(HttpsURLConnection conn, Path baloPath, String fullModuleName, long resContentLength) { try (InputStream inputStream = conn.getInputStream(); FileOutputStream outputStream = new FileOutputStream(baloPath.toString())) { writeAndHandleProgress(inputStream, outputStream, resContentLength / 1024, fullModuleName); } catch (IOException e) { createError("error occurred copying the balo file: " + e.getMessage()); } }
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
writeBaloFile
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java
4609ffee1744ecd16aac09303b1783bf0a525816
1