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 Set<String> getSpaces() { if (ScooldUtils.getInstance().isMod(this)) { spaces = ScooldUtils.getInstance().getAllSpaces().stream(). map(s -> s.getId() + Para.getConfig().separator() + s.getName()).collect(Collectors.toSet()); } if (spaces == null) { spaces = new LinkedHashSet<String>(); } if (spaces.isEmpty()) { spaces.add(Post.DEFAULT_SPACE); } // this is confusing - let admins control who is in the default space //if (spaces.size() > 1 && spaces.contains(Post.DEFAULT_SPACE)) { // spaces.remove(Post.DEFAULT_SPACE); //} return spaces; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpaces File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getSpaces
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private void incLine() { lineNumber_++; columnNumber_ = 1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incLine File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
incLine
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public void editorOpened(EditorOpenEvent e);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editorOpened 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
editorOpened
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public MapSession createSession() { MapSession result = new MapSession(); result.setCreationTime(Instant.now()); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createSession File: spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java Repository: infinispan The code follows secure coding practices.
[ "CWE-384" ]
CVE-2019-10158
HIGH
7.5
infinispan
createSession
spring/spring5/spring5-common/src/main/java/org/infinispan/spring/common/session/AbstractInfinispanSessionRepository.java
f3efef8de7fec4108dd5ab725cea6ae09f14815d
0
Analyze the following code function for security vulnerabilities
public void cancelKeyguardExitAnimation() { Trace.beginSection("KeyguardViewMediator#cancelKeyguardExitAnimation"); Message msg = mHandler.obtainMessage(CANCEL_KEYGUARD_EXIT_ANIM); mHandler.sendMessage(msg); Trace.endSection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelKeyguardExitAnimation File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
cancelKeyguardExitAnimation
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
int settingsSecureGetIntForUser(String name, int def, int userHandle) { return Settings.Secure.getIntForUser(mContext.getContentResolver(), name, def, userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: settingsSecureGetIntForUser 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
settingsSecureGetIntForUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void cleanup() { if(mAdapterProperties != null) mAdapterProperties = null; if(mAdapterService != null) mAdapterService = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanup File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
cleanup
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; // Rebuild HTTP Client according to the new "debugging" value. this.httpClient = buildHttpClient(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDebugging File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setDebugging
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void addItemsAtomic(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template) throws Exception { try { addItems(c, mycollections, sourceDir, mapFile, template); } catch (Exception addException) { log.error("AddItems encountered an error, will try to revert. Error: " + addException.getMessage()); deleteItems(c, mapFile); c.commit(); log.info("Attempted to delete partial (errored) import"); throw addException; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItemsAtomic File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
addItemsAtomic
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
protected byte[] engineGetEncoded() throws IOException { return ccmParams.getEncoded(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetEncoded File: prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
engineGetEncoded
prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
protected Map<String, Serializable> getPrincipal(Jwt jwt) { Map<String, Serializable> principal = new HashMap<>(); principal.put("jwt", (Serializable) jwt.getBody()); return principal; }
Vulnerability Classification: - CWE: CWE-347 - CVE: CVE-2021-29451 - Severity: MEDIUM - CVSS Score: 6.4 Description: Fix security vulnerability Function: getPrincipal File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java Repository: ManyDesigns/Portofino Fixed Code: protected Map<String, Serializable> getPrincipal(Jws<Claims> jwt) { Map<String, Serializable> principal = new HashMap<>(); principal.put("jwt", (Serializable) jwt.getBody()); return principal; }
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getPrincipal
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
1
Analyze the following code function for security vulnerabilities
@Override public boolean endCall() { synchronized (mLock) { enforceModifyPermission(); long token = Binder.clearCallingIdentity(); try { return endCallInternal(); } finally { Binder.restoreCallingIdentity(token); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endCall File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
endCall
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
public void startLoginActivity() { Intent loginIntent = new Intent(this, LoginDialogActivity.class); startActivityForResult(loginIntent, RESULT_LOGIN); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startLoginActivity 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
startLoginActivity
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
@Override public Object getInputSource() { return _inputStream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputSource File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
getInputSource
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
Intent getSecondaryHomeIntent(String preferredPackage) { final Intent intent = new Intent(mTopAction, mTopData != null ? Uri.parse(mTopData) : null); final boolean useSystemProvidedLauncher = mContext.getResources().getBoolean( com.android.internal.R.bool.config_useSystemProvidedLauncherForSecondary); if (preferredPackage == null || useSystemProvidedLauncher) { // Using the package name stored in config if no preferred package name or forced. final String secondaryHomePackage = mContext.getResources().getString( com.android.internal.R.string.config_secondaryHomePackage); intent.setPackage(secondaryHomePackage); } else { intent.setPackage(preferredPackage); } intent.addFlags(Intent.FLAG_DEBUG_TRIAGED_MISSING); if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL) { intent.addCategory(Intent.CATEGORY_SECONDARY_HOME); } return intent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecondaryHomeIntent 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
getSecondaryHomeIntent
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getPermittedAccessibilityServices(ComponentName who) { if (!mHasFeature) { return null; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); return admin.permittedAccessiblityServices; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedAccessibilityServices 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
getPermittedAccessibilityServices
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public synchronized int getStatus() { return this.status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getStatus
Testing/src/main/java/org/loboevolution/html/test/SimpleHttpRequest.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override public void onResume() { super.onResume(); mServiceListing.reload(); mServiceListing.setListening(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/com/android/settings/notification/NotificationAccessSettings.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35667
HIGH
7.8
android
onResume
src/com/android/settings/notification/NotificationAccessSettings.java
d8355ac47e068ad20c6a7b1602e72f0585ec0085
0
Analyze the following code function for security vulnerabilities
private void highlightList(Map<String, Object> options, List<Object> collection, int width, int depth) { int row = 0; int maxrows = (int) options.get(Printer.MAXROWS); int indent = (int) options.get(Printer.INDENTION); List<Integer> tabs = new ArrayList<>(); SyntaxHighlighter highlighter = depth == 0 ? (SyntaxHighlighter) options.get(Printer.STYLE) : null; if (!(boolean) options.getOrDefault(Printer.MULTI_COLUMNS, false)) { tabs.add(indent * depth); if (options.containsKey(Printer.ROWNUM)) { tabs.add(indent * depth + digits(collection.size()) + 2); } options.remove(Printer.MAX_COLUMN_WIDTH); for (Object o : collection) { AttributedStringBuilder asb = new AttributedStringBuilder().tabs(tabs); if (depth > 0) { asb.append("\t"); } if (options.containsKey(Printer.ROWNUM)) { asb.styled(prntStyle.resolve(".rn"), Integer.toString(row)).append(":"); asb.append("\t"); row++; } if (highlighter != null && o instanceof String) { asb.append(highlighter.highlight((String) o)); } else { asb.append(highlightValue(options, null, o)); } println(asb.columnSubSequence(0, width), maxrows); } } else { int maxWidth = 0; for (Object o : collection) { AttributedString as; if (highlighter != null && o instanceof String) { as = highlighter.highlight((String) o); } else { as = highlightValue(options, null, o); } if (as.length() > maxWidth) { maxWidth = as.length(); } } int mcw = (int) options.getOrDefault(Printer.MAX_COLUMN_WIDTH, Integer.MAX_VALUE); maxWidth = mcw < maxWidth ? mcw : maxWidth; tabs.add(maxWidth + 1); AttributedStringBuilder asb = new AttributedStringBuilder().tabs(tabs); for (Object o : collection) { if (asb.length() + maxWidth > width) { println(asb.columnSubSequence(0, width), maxrows); asb = new AttributedStringBuilder().tabs(tabs); } if (highlighter != null && o instanceof String) { asb.append(highlighter.highlight((String) o)); } else { asb.append(highlightValue(options, null, o)); } asb.append("\t"); } println(asb.columnSubSequence(0, width), maxrows); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: highlightList File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java Repository: jline/jline3 The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-50572
MEDIUM
5.5
jline/jline3
highlightList
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public void onUserSetupChanged() { final boolean userSetup = mDeviceProvisionedController.isUserSetup( mDeviceProvisionedController.getCurrentUser()); if (MULTIUSER_DEBUG) Log.d(TAG, String.format("User setup changed: " + "userSetup=%s mUserSetup=%s", userSetup, mUserSetup)); if (userSetup != mUserSetup) { mUserSetup = userSetup; if (!mUserSetup && mStatusBarView != null) animateCollapseQuickSettings(); if (mKeyguardBottomArea != null) { mKeyguardBottomArea.setUserSetupComplete(mUserSetup); } updateQsExpansionEnabled(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserSetupChanged 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
onUserSetupChanged
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public boolean isDebugging() { return debugging; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDebugging File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
isDebugging
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void updateReceiveFlowControlWindow(int read) throws IOException { if (read <= 0) { return; } int delta = -1; synchronized (flowControlLock) { receiveWindowSize -= read; //TODO: make this configurable, we should be able to set the policy that is used to determine when to update the window size int initialWindowSize = this.initialReceiveWindowSize; if (receiveWindowSize < (initialWindowSize / 2)) { delta = initialWindowSize - receiveWindowSize; receiveWindowSize += delta; } } if(delta > 0) { sendUpdateWindowSize(0, delta); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateReceiveFlowControlWindow File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
updateReceiveFlowControlWindow
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") @Override public boolean setBiome(BlockVector3 position, BiomeType biome) { if (HAS_3D_BIOMES) { getWorld().setBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ(), BukkitAdapter.adapt(biome)); } else { getWorld().setBiome(position.getBlockX(), position.getBlockZ(), BukkitAdapter.adapt(biome)); } return true; }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2023-35925 - Severity: MEDIUM - CVSS Score: 5.5 Description: feat: prevent edits outside +/- 30,000,000 blocks Function: setBiome File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit Fixed Code: @SuppressWarnings("deprecation") @Override public boolean setBiome(BlockVector3 position, BiomeType biome) { //FAWE start - safe edit region testCoords(position); //FAWE end if (HAS_3D_BIOMES) { getWorld().setBiome(position.getBlockX(), position.getBlockY(), position.getBlockZ(), BukkitAdapter.adapt(biome)); } else { getWorld().setBiome(position.getBlockX(), position.getBlockZ(), BukkitAdapter.adapt(biome)); } return true; }
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
setBiome
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
1
Analyze the following code function for security vulnerabilities
public String next(int n) throws JSONException { if (n == 0) { return ""; } char[] chars = new char[n]; int pos = 0; while (pos < n) { chars[pos] = this.next(); if (this.end()) { throw this.syntaxError("Substring bounds error"); } pos += 1; } return new String(chars); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next File: src/main/java/org/json/JSONTokener.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2022-45690
HIGH
7.5
stleary/JSON-java
next
src/main/java/org/json/JSONTokener.java
7a124d857dc8da1165c87fa788e53359a317d0f7
0
Analyze the following code function for security vulnerabilities
protected static Element getTopLevelElement(URL baseUrl) throws PolicyException { try { InputSource source = resolveEntity(baseUrl.toExternalForm(), baseUrl); if (source == null) { source = new InputSource(baseUrl.toExternalForm()); source.setByteStream(baseUrl.openStream()); } else { source.setSystemId(baseUrl.toExternalForm()); } return getTopLevelElement( source); } catch (SAXException e) { throw new PolicyException(e); } catch (IOException e) { throw new PolicyException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTopLevelElement File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
getTopLevelElement
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
private static void autoDetectionConfigXmlGenerator(XmlGenerator gen, JoinConfig join) { gen.open("auto-detection", "enabled", join.getAutoDetectionConfig().isEnabled()).close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: autoDetectionConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-522" ]
CVE-2023-33264
MEDIUM
4.3
hazelcast
autoDetectionConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
80a502d53cc48bf895711ab55f95e3a51e344ac1
0
Analyze the following code function for security vulnerabilities
private static File getDevServerPortFile(File npmFolder) { // UUID changes between JVM restarts String jvmUuid = System.getProperty(WEBPACK_PORTFILE_UUID_PROPERTY); if (jvmUuid == null) { jvmUuid = UUID.randomUUID().toString(); System.setProperty(WEBPACK_PORTFILE_UUID_PROPERTY, jvmUuid); } // Frontend path ensures uniqueness for multiple devmode apps running // simultaneously String frontendBuildPath = npmFolder.getAbsolutePath(); String uniqueUid = UUID.nameUUIDFromBytes( (jvmUuid + frontendBuildPath).getBytes(StandardCharsets.UTF_8)) .toString(); return new File(System.getProperty("java.io.tmpdir"), uniqueUid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDevServerPortFile 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
getDevServerPortFile
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
0
Analyze the following code function for security vulnerabilities
public BaseClass getExtensionClass(XWikiContext context) { try { XWikiDocument doc = context.getWiki().getDocument(getExtensionClassName(), context); return doc.getXClass(); } catch (Exception ex) { LOGGER.error("Cannot get skin extension class [{}]", getExtensionClassName(), ex); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExtensionClass File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getExtensionClass
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
public ModuleLocation[] getProjectLocations(AbstractProject project) throws IOException { List<External> projectExternals = getExternals(project); ModuleLocation[] configuredLocations = getLocations(); if (projectExternals.isEmpty()) { return configuredLocations; } List<ModuleLocation> allLocations = new ArrayList<ModuleLocation>(configuredLocations.length + projectExternals.size()); allLocations.addAll(Arrays.asList(configuredLocations)); for (External external : projectExternals) { allLocations.add(new ModuleLocation(external.url, external.path)); } return allLocations.toArray(new ModuleLocation[allLocations.size()]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProjectLocations File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getProjectLocations
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override public int getUidProcessState(int uid) { return getUidState(uid); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidProcessState 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
getUidProcessState
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void registerObjectRead(Object obj, int handle, boolean unshared) throws IOException { if (unshared) { obj = UNSHARED_OBJ; } int index = handle - ObjectStreamConstants.baseWireHandle; int size = objectsRead.size(); // ObjectOutputStream sometimes wastes a handle. I've compared hex dumps of the RI // and it seems like that's a 'feature'. Look for calls to objectsWritten.put that // are guarded by !unshared tests. while (index > size) { objectsRead.add(null); ++size; } if (index == size) { objectsRead.add(obj); } else { objectsRead.set(index, obj); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerObjectRead 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
registerObjectRead
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public void removeConnectionServiceAdapter(IConnectionServiceAdapter adapter, Session.Info info) throws RemoteException { if (!mConnectionServiceAdapters.remove(adapter)) { throw new RuntimeException("Adapter never added: " + adapter); } mConnectionServiceDelegateAdapter.removeConnectionServiceAdapter(adapter, null /*Session.Info*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeConnectionServiceAdapter File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
removeConnectionServiceAdapter
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private void notifyFailedSynchronization() { NotificationCompat.Builder notificationBuilder = createNotificationBuilder(); boolean needsToUpdateCredentials = mLastFailedResult != null && ResultCode.UNAUTHORIZED.equals(mLastFailedResult.getCode()); if (needsToUpdateCredentials) { // let the user update credentials with one click Intent updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class); updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, getAccount()); updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND); notificationBuilder .setTicker(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentTitle(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentIntent(PendingIntent.getActivity( getContext(), (int)System.currentTimeMillis(), updateAccountCredentials, PendingIntent.FLAG_ONE_SHOT )) .setContentText(i18n(R.string.sync_fail_content_unauthorized, getAccount().name)); } else { notificationBuilder .setTicker(i18n(R.string.sync_fail_ticker)) .setContentTitle(i18n(R.string.sync_fail_ticker)) .setContentText(i18n(R.string.sync_fail_content, getAccount().name)); } showNotification(R.string.sync_fail_ticker, notificationBuilder); }
Vulnerability Classification: - CWE: CWE-732 - CVE: CVE-2022-24886 - Severity: LOW - CVSS Score: 2.1 Description: Make more PendingIntents immutable This should be all of them. Picked up by lint. Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com> Function: notifyFailedSynchronization File: src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java Repository: nextcloud/android Fixed Code: private void notifyFailedSynchronization() { NotificationCompat.Builder notificationBuilder = createNotificationBuilder(); boolean needsToUpdateCredentials = mLastFailedResult != null && ResultCode.UNAUTHORIZED.equals(mLastFailedResult.getCode()); if (needsToUpdateCredentials) { // let the user update credentials with one click Intent updateAccountCredentials = new Intent(getContext(), AuthenticatorActivity.class); updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, getAccount()); updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); updateAccountCredentials.addFlags(Intent.FLAG_FROM_BACKGROUND); notificationBuilder .setTicker(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentTitle(i18n(R.string.sync_fail_ticker_unauthorized)) .setContentIntent(PendingIntent.getActivity( getContext(), (int)System.currentTimeMillis(), updateAccountCredentials, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE )) .setContentText(i18n(R.string.sync_fail_content_unauthorized, getAccount().name)); } else { notificationBuilder .setTicker(i18n(R.string.sync_fail_ticker)) .setContentTitle(i18n(R.string.sync_fail_ticker)) .setContentText(i18n(R.string.sync_fail_content, getAccount().name)); } showNotification(R.string.sync_fail_ticker, notificationBuilder); }
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
notifyFailedSynchronization
src/main/java/com/owncloud/android/syncadapter/FileSyncAdapter.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
1
Analyze the following code function for security vulnerabilities
@Transactional public UploadPackageResultDto parsePackageFile(File dest, File localFilePath) throws IOException, SAXException { // 2. unzip local package file unzipLocalFile(dest.getCanonicalPath(), localFilePath.getCanonicalPath() + "/"); // 3. read xml file in plugin package File registerXmlFile = new File(localFilePath.getCanonicalPath() + "/" + pluginProperties.getRegisterFile()); if (!registerXmlFile.exists()) { String errMsg = String.format("Plugin package definition file: [%s] does not exist.", pluginProperties.getRegisterFile()); throw new WecubeCoreException("3114", errMsg, pluginProperties.getRegisterFile()); } FileInputStream registerXmlFileFis = null; try { registerXmlFileFis = new FileInputStream(registerXmlFile); new PluginConfigXmlValidator().validate(registerXmlFileFis); } finally { closeSilently(registerXmlFileFis); } String registerXmlDataAsStr = null; try { registerXmlFileFis = new FileInputStream(registerXmlFile); registerXmlDataAsStr = IOUtils.toString(registerXmlFileFis, Charset.forName("utf-8")); } finally { closeSilently(registerXmlFileFis); } if (log.isInfoEnabled()) { log.info("parsing register xml:{}", registerXmlDataAsStr); } PackageType xmlPackage = JaxbUtils.convertToObject(registerXmlDataAsStr, PackageType.class); String edition = xmlPackage.getEdition(); if(StringUtils.isBlank(edition)) { edition = Constants.EDITION_COMMUNITY; } pluginPackageValidator.validatePackage(xmlPackage); dataModelValidator.validateDataModel(xmlPackage.getDataModel()); if (isPluginPackageExists(xmlPackage.getName(), xmlPackage.getVersion(), edition)) { String errMsg = String.format("Plugin package [name=%s, version=%s, edition=%s] exists.", xmlPackage.getName(), xmlPackage.getVersion(), edition); throw new WecubeCoreException("3115", errMsg, xmlPackage.getName(), xmlPackage.getVersion()); } processPluginDockerImageFile(localFilePath, xmlPackage); PluginPackages pluginPackageEntity = new PluginPackages(); pluginPackageEntity.setId(LocalIdGenerator.generateId()); pluginPackageEntity.setName(xmlPackage.getName()); pluginPackageEntity.setVersion(xmlPackage.getVersion()); pluginPackageEntity.setStatus(PluginPackages.UNREGISTERED); pluginPackageEntity.setUploadTimestamp(new Date()); pluginPackageEntity.setEdition(edition); pluginPackagesMapper.insert(pluginPackageEntity); processPluginUiPackageFile(localFilePath, xmlPackage, pluginPackageEntity); processS3BucketFiles(localFilePath, xmlPackage, pluginPackageEntity); // trySavePluginPackageResourceFiles(pluginPackageResourceFilesEntities); processPluginInitSqlFile(localFilePath, xmlPackage); processPluginUpgradeSqlFile(localFilePath, xmlPackage); pluginPackagesMapper.updateByPrimaryKeySelective(pluginPackageEntity); processPluginConfigs(xmlPackage.getPlugins(), xmlPackage, pluginPackageEntity); processSystemVaraibles(xmlPackage.getSystemParameters(), xmlPackage, pluginPackageEntity); processPackageDependencies(xmlPackage.getPackageDependencies(), xmlPackage, pluginPackageEntity); processMenus(xmlPackage.getMenus(), xmlPackage, pluginPackageEntity); processAuthorities(xmlPackage.getAuthorities(), xmlPackage, pluginPackageEntity); processResourceDependencies(xmlPackage.getResourceDependencies(), xmlPackage, pluginPackageEntity); processDataModels(xmlPackage.getDataModel(), xmlPackage, pluginPackageEntity); // processParamObjects(xmlPackage.getParamObjects(), xmlPackage.getName(), xmlPackage.getVersion()); return buildUploadPackageResultDto(pluginPackageEntity); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parsePackageFile File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
parsePackageFile
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
public @Nullable WifiConfiguration getConfiguredNetwork(String configKey) { WifiConfiguration config = getInternalConfiguredNetwork(configKey); if (config == null) { return null; } // Create a new configuration object with the passwords masked to send out to the external // world. return createExternalWifiConfiguration(config, true, Process.WIFI_UID); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getConfiguredNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void handle(RoutingContext context) { HttpServerRequest request = context.request(); if (request.method() != HttpMethod.GET && request.method() != HttpMethod.HEAD) { if (log.isTraceEnabled()) log.trace("Not GET or HEAD so ignoring request"); context.next(); } else { String path = Utils.removeDots(Utils.urlDecode(context.normalisedPath(), false)); // if the normalized path is null it cannot be resolved if (path == null) { log.warn("Invalid path: " + context.request().path()); context.next(); return; } // only root is known for sure to be a directory. all other directories must be identified as such. if (!directoryListing && "/".equals(path)) { path = indexPage; } // can be called recursive for index pages sendStatic(context, path); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2018-12542 - Severity: HIGH - CVSS Score: 7.5 Description: CVE-2018-12542: The StaticHandler uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\' (forward slashes) sequences that can resolve to a location that is outside of that directory when running on Windows Operating Systems. - fixes #1025 Function: handle File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web Fixed Code: @Override public void handle(RoutingContext context) { HttpServerRequest request = context.request(); if (request.method() != HttpMethod.GET && request.method() != HttpMethod.HEAD) { if (log.isTraceEnabled()) log.trace("Not GET or HEAD so ignoring request"); context.next(); } else { // we are trying to match a URL path to a Filesystem path, so the first step // is to url decode the normalized path so avoid misinterpretations String path = Utils.urlDecode(context.normalisedPath(), false); if (path == null) { // if the normalized path is null it cannot be resolved log.warn("Invalid path: " + context.request().path()); context.next(); return; } if (File.separatorChar != '/') { // although forward slashes are not path separators according to the rfc3986 if // used directly to access the filesystem on Windows, they would be treated as such // Instead of relying on the usual normalized method, all forward slashes must be // replaced by backslashes in this handler. path = path.replace(File.separatorChar, '/'); } // clean the .. sequences according to rfc3986 path = Utils.removeDots(path); // only root is known for sure to be a directory. all other directories must be identified as such. if (!directoryListing && "/".equals(path)) { path = indexPage; } // can be called recursive for index pages sendStatic(context, path); } }
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
handle
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
1
Analyze the following code function for security vulnerabilities
@Override public void setScreenCaptureDisabled(int userId, boolean disabled) { int callingUid = Binder.getCallingUid(); if (callingUid != Process.SYSTEM_UID) { throw new SecurityException("Only system can call setScreenCaptureDisabled."); } synchronized(mWindowMap) { mScreenCaptureDisabled.put(userId, disabled); // Update secure surface for all windows belonging to this user. for (int displayNdx = mDisplayContents.size() - 1; displayNdx >= 0; --displayNdx) { WindowList windows = mDisplayContents.valueAt(displayNdx).getWindowList(); for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) { final WindowState win = windows.get(winNdx); if (win.mHasSurface && userId == UserHandle.getUserId(win.mOwnerUid)) { win.mWinAnimator.setSecureLocked(disabled); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setScreenCaptureDisabled 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
setScreenCaptureDisabled
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private boolean inSamePackage(Class<?> c1, Class<?> c2) { String nameC1 = c1.getName(); String nameC2 = c2.getName(); int indexDotC1 = nameC1.lastIndexOf('.'); int indexDotC2 = nameC2.lastIndexOf('.'); if (indexDotC1 != indexDotC2) { return false; // cannot be in the same package if indices are not the same } if (indexDotC1 == -1) { return true; // both of them are in default package } return nameC1.regionMatches(0, nameC2, 0, indexDotC1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inSamePackage File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
inSamePackage
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public <T> Jooby bind(final Class<T> type, final Function<Config, ? extends T> provider) { use((env, conf, binder) -> { T service = provider.apply(conf); binder.bind(type).toInstance(service); }); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind 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
bind
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public void switchToConversation(Conversation conversation, String text) { switchToConversation(conversation, text, false, null, false); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2018-18467 - Severity: MEDIUM - CVSS Score: 5.0 Description: Do not insert text shared over XMPP uri when already drafting message XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to directly share a message with a specific contact. Previously the text was always appended to the message currently in draft. The message was never send automatically. Essentially those links where treated like normal text share intents (for example when sharing a URL from the browser) but without the contact selection. There is a concern (CVE-2018-18467) that when this URI is invoked automatically and the user is currently drafting a long message to that particular contact the text could be inserted in the draft field (input box) without the user noticing. To circumvent that the text shared over XMPP uris that contain a particular contact is now appended only if the draft box is currently empty. Sharing text normally (**with** manual contact selection) is still treated the same; meaning the shared text will be appended to the current draft. This is intended behaviour to make the 'Hey I have this cool link here;' *open browser*, *share link* - secenario work. Function: switchToConversation File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations Fixed Code: public void switchToConversation(Conversation conversation, String text) { switchToConversation(conversation, text, false, null, false, false); }
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
switchToConversation
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
1
Analyze the following code function for security vulnerabilities
private void dumpCurrentTime(PrintWriter pw) { pw.print(formatTime(injectCurrentTimeMillis())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpCurrentTime File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
dumpCurrentTime
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void setQsExpansionEnabled(boolean qsExpansionEnabled) { mQsExpansionEnabled = qsExpansionEnabled; if (mQs == null) return; mQs.setHeaderClickable(qsExpansionEnabled); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setQsExpansionEnabled 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
setQsExpansionEnabled
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") private void saveUserInternalLocked(@UserIdInt int userId, OutputStream os, boolean forBackup) throws IOException, XmlPullParserException { // Write to XML final TypedXmlSerializer out; if (forBackup) { out = Xml.newFastSerializer(); out.setOutput(os, StandardCharsets.UTF_8.name()); } else { out = Xml.resolveSerializer(os); } out.startDocument(null, true); getUserShortcutsLocked(userId).saveToXml(out, forBackup); out.endDocument(); os.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveUserInternalLocked File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
saveUserInternalLocked
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public ComponentName startService(IApplicationThread caller, Intent service, String resolvedType, String callingPackage, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); service.writeToParcel(data, 0); data.writeString(resolvedType); data.writeString(callingPackage); data.writeInt(userId); mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); reply.readException(); ComponentName res = ComponentName.readFromParcel(reply); data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startService File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startService
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void registerUidObserver(IUidObserver observer, int which, int cutpoint, String callingPackage) { if (!hasUsageStatsPermission(callingPackage)) { enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS, "registerUidObserver"); } mUidObserverController.register(observer, which, cutpoint, callingPackage, Binder.getCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerUidObserver 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
registerUidObserver
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerIndex File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setServerIndex
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void enablePackage(String packageName, @UserIdInt int userId) { try { final int enabledSetting = mIPackageManager.getApplicationEnabledSetting( packageName, userId); if (enabledSetting != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT && enabledSetting != PackageManager.COMPONENT_ENABLED_STATE_ENABLED) { mIPackageManager.setApplicationEnabledSetting( packageName, PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, // Device policy app may have launched ManagedProvisioning, play nice and // don't kill it as a side-effect of this call. PackageManager.DONT_KILL_APP, userId, mContext.getOpPackageName()); } } catch (RemoteException e) { // Shouldn't happen. Slogf.wtf(LOG_TAG, "Error setting application enabled", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enablePackage File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
enablePackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean updateConfiguration(Configuration values) { return mActivityTaskManager.updateConfiguration(values); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateConfiguration 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
updateConfiguration
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN) @RequiresPermission(value = MANAGE_DEVICE_POLICY_RESET_PASSWORD, conditional = true) public boolean clearResetPasswordToken(@Nullable ComponentName admin) { throwIfParentInstance("clearResetPasswordToken"); if (mService != null) { try { return mService.clearResetPasswordToken(admin, mContext.getPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearResetPasswordToken File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
clearResetPasswordToken
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void checkRights(SpaceReference spaceReference, XWikiContext context) throws XWikiException { ContextualAuthorizationManager authManager = Utils.getComponent(ContextualAuthorizationManager.class); if (!authManager.hasAccess(Right.EDIT, spaceReference)) { Object[] args = { spaceReference.toString(), context.getUser() }; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "The creation of a document into the space {0} has been denied to user {1}", null, args); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkRights File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
checkRights
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/CreateAction.java
30c52b01559b8ef5ed1035dac7c34aaf805764d5
0
Analyze the following code function for security vulnerabilities
private PropPatchParseResult parseContent( byte[] arr ) throws IOException, SAXException { if( arr.length > 0 ) { log.debug( "processing content" ); ByteArrayInputStream bin = new ByteArrayInputStream( arr ); XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); PropPatchSaxHandler handler = new PropPatchSaxHandler(); reader.setContentHandler( handler ); reader.parse( new InputSource( bin ) ); log.debug( "toset: " + handler.getAttributesToSet().size()); return new PropPatchParseResult( handler.getAttributesToSet(), handler.getAttributesToRemove().keySet() ); } else { log.debug( "empty content" ); return new PropPatchParseResult( new HashMap<QName, String>(), new HashSet<QName>() ); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2015-7326 - Severity: HIGH - CVSS Score: 7.5 Description: patch XXE vulnerability Function: parseContent File: milton-server-ce/src/main/java/io/milton/http/webdav/DefaultPropPatchParser.java Repository: miltonio/milton2 Fixed Code: private PropPatchParseResult parseContent( byte[] arr ) throws IOException, SAXException { if( arr.length > 0 ) { log.debug( "processing content" ); ByteArrayInputStream bin = new ByteArrayInputStream( arr ); XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); // https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); reader.setFeature("http://xml.org/sax/features/external-general-entities", false); PropPatchSaxHandler handler = new PropPatchSaxHandler(); reader.setContentHandler( handler ); reader.parse( new InputSource( bin ) ); log.debug( "toset: " + handler.getAttributesToSet().size()); return new PropPatchParseResult( handler.getAttributesToSet(), handler.getAttributesToRemove().keySet() ); } else { log.debug( "empty content" ); return new PropPatchParseResult( new HashMap<QName, String>(), new HashSet<QName>() ); } }
[ "CWE-611" ]
CVE-2015-7326
HIGH
7.5
miltonio/milton2
parseContent
milton-server-ce/src/main/java/io/milton/http/webdav/DefaultPropPatchParser.java
5f81b0c48a817d4337d8b0e99ea0b4744ecd720b
1
Analyze the following code function for security vulnerabilities
@Deprecated public String parseTemplate(String template, String skinId, XWikiContext context) { MutableRenderingContext mutableRenderingContext = getMutableRenderingContext(); Syntax currentTargetSyntax = mutableRenderingContext.getTargetSyntax(); try { // Force rendering with XHTML 1.0 syntax for retro-compatibility mutableRenderingContext.setTargetSyntax(Syntax.XHTML_1_0); Skin skin = getInternalSkinManager().getSkin(skinId); return getTemplateManager().renderFromSkin(template, skin); } catch (Exception e) { LOGGER.error("Error while evaluating velocity template [{}] skin [{}]", template, skinId, e); Object[] args = { template, skinId }; XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_RENDERING, XWikiException.ERROR_XWIKI_RENDERING_VELOCITY_EXCEPTION, "Error while evaluating velocity template [{0}] from skin [{1}]", e, args); return Util.getHTMLExceptionMessage(xe, context); } finally { mutableRenderingContext.setTargetSyntax(currentTargetSyntax); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTemplate File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
parseTemplate
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public boolean isTopOfTask(IBinder token) { synchronized (this) { ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { throw new IllegalArgumentException(); } return r.task.getTopActivity() == r; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTopOfTask File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
isTopOfTask
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private int getDefaultAction(LocalDocumentReference reference) { int defaultAction = XarModel.ACTION_SKIP; XarEntry packageFile = this.packageFiles.get(reference); if (packageFile != null) { defaultAction = packageFile.getDefaultAction(); } return defaultAction; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultAction File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-27480
HIGH
7.7
xwiki/xwiki-platform
getDefaultAction
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
e3527b98fdd8dc8179c24dc55e662b2c55199434
0
Analyze the following code function for security vulnerabilities
private boolean setKeyChainGrantInternal(String alias, boolean hasGrant, int granteeUid, UserHandle userHandle) { final long id = mInjector.binderClearCallingIdentity(); try { try (KeyChainConnection keyChainConnection = KeyChain.bindAsUser(mContext, userHandle)) { IKeyChainService keyChain = keyChainConnection.getService(); return keyChain.setGrant(granteeUid, alias, hasGrant); } catch (RemoteException e) { Slogf.e(LOG_TAG, "Setting grant for package.", e); return false; } } catch (InterruptedException e) { Slogf.w(LOG_TAG, "Interrupted while setting key grant", e); Thread.currentThread().interrupt(); } finally { mInjector.binderRestoreCallingIdentity(id); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeyChainGrantInternal 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
setKeyChainGrantInternal
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private ByteBuffer loadFile(final File file) { try { return ByteBuffer.wrap(Files.readAllBytes(file.toPath())); } catch(IOException ex) { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadFile File: src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java Repository: jlangch/venice The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-36007
LOW
3.3
jlangch/venice
loadFile
src/main/java/com/github/jlangch/venice/impl/util/io/LoadPaths.java
c942c73136333bc493050910f171a48e6f575b23
0
Analyze the following code function for security vulnerabilities
private String getRenderedContent(String text, String syntaxId, boolean restricted) throws XWikiException { // Make sure we keep using current author as passed content author return this.doc.getRenderedContent(text, syntaxId, restricted, getCallerDocument(getXWikiContext()), 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
static void throwIllegalArgumentExceptionIfNull(final Object toCheck, final String errorMessage) { if (toCheck == null) { throw new IllegalArgumentException(errorMessage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: throwIllegalArgumentExceptionIfNull File: core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java Repository: eclipse-ee4j/jersey The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-28168
LOW
2.1
eclipse-ee4j/jersey
throwIllegalArgumentExceptionIfNull
core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
5794b7a2da9bfc3404cc662b988fbee55f74059d
0
Analyze the following code function for security vulnerabilities
public boolean checkWhetherChangePasswordOrNot(LoginRequest request) { // 升级之后 admin 还使用弱密码也提示修改 if (StringUtils.equals("admin", request.getUsername())) { UserExample example = new UserExample(); example.createCriteria().andIdEqualTo("admin") .andPasswordEqualTo(CodingUtil.md5("metersphere")); return userMapper.countByExample(example) > 0; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkWhetherChangePasswordOrNot File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
checkWhetherChangePasswordOrNot
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
private void updateAppWidgetIds(String callingPackage, int[] appWidgetIds, RemoteViews views, boolean partially) { final int userId = UserHandle.getCallingUserId(); if (appWidgetIds == null || appWidgetIds.length == 0) { return; } // Make sure the package runs under the caller uid. mSecurityPolicy.enforceCallFromPackage(callingPackage); final int bitmapMemoryUsage = (views != null) ? views.estimateMemoryUsage() : 0; if (bitmapMemoryUsage > mMaxWidgetBitmapMemory) { throw new IllegalArgumentException("RemoteViews for widget update exceeds" + " maximum bitmap memory usage (used: " + bitmapMemoryUsage + ", max: " + mMaxWidgetBitmapMemory + ")"); } synchronized (mLock) { ensureGroupStateLoadedLocked(userId); final int N = appWidgetIds.length; for (int i = 0; i < N; i++) { final int appWidgetId = appWidgetIds[i]; // NOTE: The lookup is enforcing security across users by making // sure the caller can only access widgets it hosts or provides. Widget widget = lookupWidgetLocked(appWidgetId, Binder.getCallingUid(), callingPackage); if (widget != null) { updateAppWidgetInstanceLocked(widget, views, partially); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAppWidgetIds File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
updateAppWidgetIds
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public int getAvailabilityStatus() { return mContext.getResources().getBoolean(R.bool.config_show_location_scanning) ? AVAILABLE : UNSUPPORTED_ON_DEVICE; }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2023-21247 - Severity: HIGH - CVSS Score: 7.8 Description: Fix: Bluetooth and Wifi scanning location MainSwitch page policy transparency. When DISALLOW_CONFIG_LOCATION is set, make location service's MainSwitchPreference pages for wifi scanning and bluetooth scanning unavailable too, so that intent direct access is disabled. screenshot: http://shortn/_kkK3BMTSh1 Bug: 277333746 Bug: 277333781 Test: atest SettingsRoboTests, on device (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7591fff234886e79c5d0210a2cf3282a69de9be9) Merged-In: I52f9a11b1dd78a5e5dbb1bbde3cda7381c87ae39 Change-Id: I52f9a11b1dd78a5e5dbb1bbde3cda7381c87ae39 Function: getAvailabilityStatus File: src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java Repository: android Fixed Code: @Override public int getAvailabilityStatus() { return mContext.getResources().getBoolean(R.bool.config_show_location_scanning) ? (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_LOCATION) ? DISABLED_DEPENDENT_SETTING : AVAILABLE) : UNSUPPORTED_ON_DEVICE; }
[ "CWE-862" ]
CVE-2023-21247
HIGH
7.8
android
getAvailabilityStatus
src/com/android/settings/location/BluetoothScanningMainSwitchPreferenceController.java
edd4023805bc7fa54ae31de222cde02b9012bbc4
1
Analyze the following code function for security vulnerabilities
public AutoCloseTagResponse doTagComplete(DOMDocument xmlDocument, Position position, CancelChecker cancelChecker) { return completions.doTagComplete(xmlDocument, position, cancelChecker); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doTagComplete File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
doTagComplete
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
public void setAutoCreatePlaceholderReferenceTargets(boolean theAutoCreatePlaceholderReferenceTargets) { myAutoCreatePlaceholderReferenceTargets = theAutoCreatePlaceholderReferenceTargets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoCreatePlaceholderReferenceTargets 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
setAutoCreatePlaceholderReferenceTargets
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
private Bundle parseWidgetIdOptions(XmlPullParser parser) { Bundle options = new Bundle(); String minWidthString = parser.getAttributeValue(null, "min_width"); if (minWidthString != null) { options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, Integer.parseInt(minWidthString, 16)); } String minHeightString = parser.getAttributeValue(null, "min_height"); if (minHeightString != null) { options.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT, Integer.parseInt(minHeightString, 16)); } String maxWidthString = parser.getAttributeValue(null, "max_width"); if (maxWidthString != null) { options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, Integer.parseInt(maxWidthString, 16)); } String maxHeightString = parser.getAttributeValue(null, "max_height"); if (maxHeightString != null) { options.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_HEIGHT, Integer.parseInt(maxHeightString, 16)); } String categoryString = parser.getAttributeValue(null, "host_category"); if (categoryString != null) { options.putInt(AppWidgetManager.OPTION_APPWIDGET_HOST_CATEGORY, Integer.parseInt(categoryString, 16)); } return options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseWidgetIdOptions File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
parseWidgetIdOptions
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void checkTrustWithUser() throws LaunchException { if (securityDelegate.getRunInSandbox()) { return; } if (getSigningState() == SigningState.FULL && jcv.isFullySigned() && !jcv.getAlreadyTrustPublisher()) { jcv.checkTrustWithUser(securityDelegate, file); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkTrustWithUser 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
checkTrustWithUser
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public boolean hasManagedProfileContactsAccess(@NonNull UserHandle userHandle, @NonNull String packageName) { if (mService != null) { try { return mService.hasManagedProfileContactsAccess(userHandle.getIdentifier(), packageName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasManagedProfileContactsAccess File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
hasManagedProfileContactsAccess
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public ClickHouseCredentials getCredentials(ClickHouseConfig config) { return credentials != null ? credentials : ClickHouseChecker.nonNull(config, ClickHouseConfig.TYPE_NAME).getDefaultCredentials(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCredentials 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
getCredentials
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
public String getPropertyOptions() { return AppUtil.readPluginResource(getClass().getName(), "/properties/userview/userProfileMenu.json", null, true, "message/userview/userProfileMenu"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPropertyOptions File: wflow-core/src/main/java/org/joget/plugin/enterprise/UserProfileMenu.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4859
MEDIUM
4
jogetworkflow/jw-community
getPropertyOptions
wflow-core/src/main/java/org/joget/plugin/enterprise/UserProfileMenu.java
9a77f508a2bf8cf661d588f37a4cc29ecaea4fc8
0
Analyze the following code function for security vulnerabilities
void notifyUnknownVisibilityLaunchedForKeyguardTransition() { // No display activities never add a window, so there is no point in waiting them for // relayout. if (noDisplay || !isKeyguardLocked()) { return; } mDisplayContent.mUnknownAppVisibilityController.notifyLaunched(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyUnknownVisibilityLaunchedForKeyguardTransition 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
notifyUnknownVisibilityLaunchedForKeyguardTransition
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
void handoverComplete(final Call call) { Log.d(this, "handoverComplete(%s) via %s.", call, getComponentName()); BindCallback callback = new BindCallback() { @Override public void onSuccess() { final String callId = mCallIdMapper.getCallId(call); // If still bound, tell the connection service create connection has failed. if (callId != null && isServiceValid("handoverComplete")) { try { mServiceInterface.handoverComplete( callId, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { } } } @Override public void onFailure() { // Binding failed. Log.w(this, "onFailure - could not bind to CS for call %s", call.getId()); } }; mBinder.bind(callback, call); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handoverComplete File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
handoverComplete
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
protected String[] getEnabledCipherSuites() { return enabledCipherSuites.clone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnabledCipherSuites File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
getEnabledCipherSuites
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
public ArraySet<String> getGrantedPackages() { final ArraySet<String> pkgs = new ArraySet<>(); long identity = Binder.clearCallingIdentity(); try { final String setting = Settings.Secure.getStringForUser( getContext().getContentResolver(), Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES, ActivityManager.getCurrentUser()); if (setting != null) { final String[] tokens = setting.split(SEPARATOR); for (int i = 0; i < tokens.length; i++) { String token = tokens[i]; if (token != null) { token = token.trim(); } if (TextUtils.isEmpty(token)) { continue; } pkgs.add(token); } } } finally { Binder.restoreCallingIdentity(identity); } return pkgs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGrantedPackages File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
getGrantedPackages
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public DomainInfo getDomainInfo() throws EBaseException { CMSEngine engine = CMS.getCMSEngine(); EngineConfig cs = engine.getConfig(); PKISocketConfig socketConfig = cs.getSocketConfig(); LdapBoundConnFactory connFactory = null; LDAPConnection conn = null; try { LDAPSearchConstraints cons = null; String[] attrs = null; LDAPConfig ldapConfig = cs.getInternalDBConfig(); String basedn = ldapConfig.getBaseDN(); String dn = "ou=Security Domain," + basedn; String filter = "objectclass=pkiSecurityGroup"; connFactory = new LdapBoundConnFactory("SecurityDomainProcessor"); connFactory.init(socketConfig, ldapConfig, engine.getPasswordStore()); conn = connFactory.getConn(); // get the security domain name String name = conn.read(dn).getAttribute("name").getStringValues().nextElement(); logger.debug("SecurityDomainProcessor: name: " + name); DomainInfo domain = new DomainInfo(); domain.setName(name); // this should return CAList, KRAList etc. LDAPSearchResults res = conn.search(dn, LDAPConnection.SCOPE_ONE, filter, attrs, true, cons); while (res.hasMoreElements()) { dn = res.next().getDN(); String listName = dn.substring(3, dn.indexOf(",")); String subType = listName.substring(0, listName.indexOf("List")); logger.debug("SecurityDomainProcessor: subtype: " + subType); filter = "objectclass=pkiSubsystem"; LDAPSearchResults res2 = conn.search(dn, LDAPConnection.SCOPE_ONE, filter, attrs, false, cons); while (res2.hasMoreElements()) { LDAPEntry entry = res2.next(); logger.debug("SecurityDomainProcessor: - " + entry.getDN()); SecurityDomainHost host = new SecurityDomainHost(); LDAPAttributeSet entryAttrs = entry.getAttributeSet(); Enumeration<LDAPAttribute> attrsInSet = entryAttrs.getAttributes(); while (attrsInSet.hasMoreElements()) { LDAPAttribute nextAttr = attrsInSet.nextElement(); String attrName = nextAttr.getName(); String attrValue = nextAttr.getStringValues().nextElement(); logger.debug("SecurityDomainProcessor: - " + attrName+": " + attrValue); if ("Host".equalsIgnoreCase(attrName)) { host.setHostname(attrValue); } else if ("UnSecurePort".equalsIgnoreCase(attrName)) { host.setPort(attrValue); } else if ("SecurePort".equalsIgnoreCase(attrName)) { host.setSecurePort(attrValue); } else if ("SecureEEClientAuthPort".equalsIgnoreCase(attrName)) { host.setSecureEEClientAuthPort(attrValue); } else if ("SecureAgentPort".equalsIgnoreCase(attrName)) { host.setSecureAgentPort(attrValue); } else if ("SecureAdminPort".equalsIgnoreCase(attrName)) { host.setSecureAdminPort(attrValue); } else if ("Clone".equalsIgnoreCase(attrName)) { host.setClone(attrValue); } else if ("SubsystemName".equalsIgnoreCase(attrName)) { host.setSubsystemName(attrValue); } else if ("DomainManager".equalsIgnoreCase(attrName)) { host.setDomainManager(attrValue); } } String port = host.getSecurePort(); if (port == null) port = host.getSecureEEClientAuthPort(); host.setId(subType+" "+host.getHostname()+" "+port); domain.addHost(subType, host); } } return domain; } catch (Exception e) { logger.error("SecurityDomainProcessor: Failed to read domain info from ldap " + e.getMessage(), e); throw new EBaseException(e.getMessage(), e); } finally { if (conn != null && connFactory != null) { logger.debug("Releasing ldap connection"); connFactory.returnConn(conn); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDomainInfo File: base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getDomainInfo
base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public Integer getPriority() { return 100; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPriority File: kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
getPriority
kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
private static String getUsernameFromObject(Scriptable obj) { return ((APIStoreHostObject) obj).getUsername(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUsernameFromObject File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
getUsernameFromObject
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public List<String> getJobGroupsToNeverDelete() { return Collections.unmodifiableList(jobGroupsToDelete); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJobGroupsToNeverDelete File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java Repository: quartz-scheduler/quartz The code follows secure coding practices.
[ "CWE-611" ]
CVE-2019-13990
HIGH
7.5
quartz-scheduler/quartz
getJobGroupsToNeverDelete
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
a1395ba118df306c7fe67c24fb0c9a95a4473140
0
Analyze the following code function for security vulnerabilities
private void emitDefaultNotFoundResponse(ChannelHandlerContext ctx, io.micronaut.http.HttpRequest<?> request) { MutableHttpResponse<Object> res = newNotFoundError(request); AtomicReference<HttpRequest<?>> requestReference = new AtomicReference<>(request); Flowable<? extends MutableHttpResponse<?>> responsePublisher = filterPublisher( requestReference, Flowable.just(res), ctx.channel().eventLoop(), false ); subscribeToResponsePublisher( ctx, MediaType.APPLICATION_JSON_TYPE, requestReference, responsePublisher ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: emitDefaultNotFoundResponse File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
emitDefaultNotFoundResponse
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public void onPictureInPictureStateChanged(PictureInPictureUiState pipState) { enforceTaskPermission("onPictureInPictureStateChanged"); final Task rootPinnedTask = mRootWindowContainer.getDefaultTaskDisplayArea() .getRootPinnedTask(); if (rootPinnedTask != null && rootPinnedTask.getTopMostActivity() != null) { mWindowManager.mAtmService.mActivityClientController.onPictureInPictureStateChanged( rootPinnedTask.getTopMostActivity(), pipState); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onPictureInPictureStateChanged 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
onPictureInPictureStateChanged
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@MediumTest @Test public void testNoAutoSpeakerphoneOnOutgoing() throws Exception { // Start an incoming video call. IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, VideoProfile.STATE_AUDIO_ONLY); verifyAudioRoute(CallAudioState.ROUTE_EARPIECE); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: testNoAutoSpeakerphoneOnOutgoing File: tests/src/com/android/server/telecom/tests/VideoCallTests.java Repository: android Fixed Code: @MediumTest @Test public void testNoAutoSpeakerphoneOnOutgoing() throws Exception { // Start an incoming video call. IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA, VideoProfile.STATE_AUDIO_ONLY, null); verifyAudioRoute(CallAudioState.ROUTE_EARPIECE); }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testNoAutoSpeakerphoneOnOutgoing
tests/src/com/android/server/telecom/tests/VideoCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") @VisibleForTesting void cleanUpPackageLocked(String packageName, int owningUserId, int packageUserId, boolean appStillExists) { final boolean wasUserLoaded = isUserLoadedLocked(owningUserId); final ShortcutUser user = getUserShortcutsLocked(owningUserId); boolean doNotify = false; // First, remove the package from the package list (if the package is a publisher). final ShortcutPackage sp = (packageUserId == owningUserId) ? user.removePackage(packageName) : null; if (sp != null) { doNotify = true; } // Also remove from the launcher list (if the package is a launcher). user.removeLauncher(packageUserId, packageName); // Then remove pinned shortcuts from all launchers. user.forAllLaunchers(l -> l.cleanUpPackage(packageName, packageUserId)); // Now there may be orphan shortcuts because we removed pinned shortcuts at the previous // step. Remove them too. user.forAllPackages(p -> p.refreshPinnedFlags()); if (doNotify) { notifyListeners(packageName, owningUserId); } // If the app still exists (i.e. data cleared), we need to re-publish manifest shortcuts. if (appStillExists && (packageUserId == owningUserId)) { // This will do the notification and save when needed, so do it after the above // notifyListeners. user.rescanPackageIfNeeded(packageName, /* forceRescan=*/ true); } if (!appStillExists && (packageUserId == owningUserId) && sp != null) { // If the app is removed altogether, we can get rid of the xml as well injectPostToHandler(() -> sp.removeShortcutPackageItem()); } if (!wasUserLoaded) { // Note this will execute the scheduled save. unloadUserLocked(owningUserId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanUpPackageLocked File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
cleanUpPackageLocked
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
protected void internalTriggerCompactionNonPartitionedTopic(boolean authoritative) { validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.COMPACT); PersistentTopic topic = (PersistentTopic) getTopicReference(topicName); try { topic.triggerCompaction(); } catch (AlreadyRunningException e) { throw new RestException(Status.CONFLICT, e.getMessage()); } catch (Exception e) { log.error("[{}] Failed to trigger compaction on topic {}", clientAppId(), topicName, e); throw new RestException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalTriggerCompactionNonPartitionedTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalTriggerCompactionNonPartitionedTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public void changeModel(Serializable id, String modelId) { CmsContent entity = getEntity(id); if (null != entity) { entity.setModelId(modelId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: changeModel File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
changeModel
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
private EnforcingAdmin getEnforcingAdminForPackage(@Nullable ComponentName who, String packageName, int userId) { ActiveAdmin admin; if (who != null) { if (isDeviceOwner(who, userId) || isProfileOwner(who, userId)) { synchronized (getLockObject()) { admin = getActiveAdminUncheckedLocked(who, userId); } if (admin != null) { return EnforcingAdmin.createEnterpriseEnforcingAdmin(who, userId, admin); } } else { // Check for non-DPC active admins. admin = getActiveAdminUncheckedLocked(who, userId); if (admin != null) { return EnforcingAdmin.createDeviceAdminEnforcingAdmin(who, userId, admin); } } } admin = getUserData(userId).createOrGetPermissionBasedAdmin(userId); return EnforcingAdmin.createEnforcingAdmin(packageName, userId, admin); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnforcingAdminForPackage File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getEnforcingAdminForPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean processBatch(IndexQueueEntry queueEntry) { int length = 0; for (IndexQueueEntry batchEntry = queueEntry; batchEntry != null; batchEntry = this.indexQueue.poll()) { if (batchEntry == INDEX_QUEUE_ENTRY_STOP) { // Discard the current batch and stop the indexing thread. return false; } IndexOperation operation = batchEntry.operation; // For the current contiguous operations queue, group the changes try { ExecutionContext executionContext = new ExecutionContext(); this.ecim.initialize(executionContext); XWikiContext xcontext = (XWikiContext) executionContext.getProperty(XWikiContext.EXECUTIONCONTEXT_KEY); xcontext.setUserReference(indexingUserConfig.getIndexingUserReference()); if (IndexOperation.INDEX.equals(operation)) { LengthSolrInputDocument solrDocument = getSolrDocument(batchEntry.reference); if (solrDocument != null) { solrInstance.add(solrDocument); length += solrDocument.getLength(); ++this.batchSize; } } else if (IndexOperation.DELETE.equals(operation)) { if (batchEntry.reference == null) { solrInstance.deleteByQuery(batchEntry.deleteQuery); } else { solrInstance.delete(this.solrRefereceResolver.getId(batchEntry.reference)); } ++this.batchSize; } } catch (Throwable e) { this.logger.error("Failed to process entry [{}]", batchEntry, e); } finally { this.execution.removeContext(); } // Commit the index changes so that they become available to queries. This is a costly operation and that is // the reason why we perform it at the end of the batch. if (shouldCommit(length, this.batchSize)) { commit(); length = 0; } } // Commit what's left if (this.batchSize > 0) { commit(); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processBatch File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
processBatch
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
public void clearAllImplicitRanks() { forEachShortcutMutate(ShortcutInfo::clearImplicitRankAndRankChangedFlag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearAllImplicitRanks File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
clearAllImplicitRanks
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
@Override public void forceStopPackage(final String packageName, int userId) { if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: forceStopPackage() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES; Slog.w(TAG, msg); throw new SecurityException(msg); } final int callingPid = Binder.getCallingPid(); userId = handleIncomingUser(callingPid, Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, "forceStopPackage", null); long callingId = Binder.clearCallingIdentity(); try { IPackageManager pm = AppGlobals.getPackageManager(); synchronized(this) { int[] users = userId == UserHandle.USER_ALL ? getUsersLocked() : new int[] { userId }; for (int user : users) { int pkgUid = -1; try { pkgUid = pm.getPackageUid(packageName, user); } catch (RemoteException e) { } if (pkgUid == -1) { Slog.w(TAG, "Invalid packageName: " + packageName); continue; } try { pm.setPackageStoppedState(packageName, true, user); } catch (RemoteException e) { } catch (IllegalArgumentException e) { Slog.w(TAG, "Failed trying to unstop package " + packageName + ": " + e); } if (isUserRunningLocked(user, false)) { forceStopPackageLocked(packageName, pkgUid, "from pid " + callingPid); } } } } finally { Binder.restoreCallingIdentity(callingId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceStopPackage File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
forceStopPackage
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public String getCallingPackage(IBinder token) { synchronized (this) { ActivityRecord r = getCallingRecordLocked(token); return r != null ? r.info.packageName : null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallingPackage 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
getCallingPackage
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path relativeDir = source.relativize(dir); final Path dirToCreate = Paths.get(destDir.toString(), relativeDir.toString()); if(!dirToCreate.toFile().exists()) { Files.createDirectory(dirToCreate); } return FileVisitResult.CONTINUE; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-39180 - Severity: HIGH - CVSS Score: 9.0 Description: OO-5549: check parent by unzip Function: preVisitDirectory File: src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java Repository: OpenOLAT Fixed Code: @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { Path relativeDir = source.relativize(dir); final Path dirToCreate = Paths.get(destDir.toString(), relativeDir.toString()); checkPath(dirToCreate); if(!dirToCreate.toFile().exists()) { Files.createDirectory(dirToCreate); } return FileVisitResult.CONTINUE; }
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
preVisitDirectory
src/main/java/org/olat/ims/qti21/repository/handlers/CopyAndConvertVisitor.java
5668a41ab3f1753102a89757be013487544279d5
1
Analyze the following code function for security vulnerabilities
public void setJacksonCompatible(boolean jacksonCompatible) { this.jacksonCompatible = jacksonCompatible; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setJacksonCompatible File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
setJacksonCompatible
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
@Override public InputStream getInputStream() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInputStream File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getInputStream
src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
protected void encryptOutgoingBuffer(Buffer buf, int offset, int len) throws Exception { if (outCipher == null) { return; } outCipher.update(buf.array(), offset, len); int blocksCount = len / outCipherSize; outBlocksCount.addAndGet(Math.max(1, blocksCount)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encryptOutgoingBuffer File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
encryptOutgoingBuffer
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public void start() { serverSocket = NetUtils.createServerSocket(port, ssl); port = serverSocket.getLocalPort(); updateURL(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: h2/src/main/org/h2/server/web/WebServer.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
start
h2/src/main/org/h2/server/web/WebServer.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = REPORT_URL + "/{referenceId:\\S+}", method = RequestMethod.GET) public final void getReport( @PathVariable final String referenceId, @RequestParam(value = "inline", defaultValue = "false") final boolean inline, final HttpServletResponse getReportResponse) throws IOException, ServletException { MDC.put(Processor.MDC_JOB_ID_KEY, referenceId); setNoCache(getReportResponse); loadReport(referenceId, getReportResponse, new HandleReportLoadResult<Void>() { @Override public Void unknownReference( final HttpServletResponse httpServletResponse, final String referenceId) { error(httpServletResponse, "Error getting print with ref=" + referenceId + ": unknown reference", HttpStatus.NOT_FOUND); return null; } @Override public Void unsupportedLoader( final HttpServletResponse httpServletResponse, final String referenceId) { error(httpServletResponse, "Error getting print with ref=" + referenceId + " can not be loaded", HttpStatus.NOT_FOUND); return null; } @Override public Void successfulPrint( final PrintJobStatus successfulPrintResult, final HttpServletResponse httpServletResponse, final URI reportURI, final ReportLoader loader) throws IOException { sendReportFile(successfulPrintResult, httpServletResponse, loader, reportURI, inline); return null; } @Override public Void failedPrint( final PrintJobStatus failedPrintJob, final HttpServletResponse httpServletResponse) { error(httpServletResponse, failedPrintJob.getError(), HttpStatus.INTERNAL_SERVER_ERROR); return null; } @Override public Void printJobPending( final HttpServletResponse httpServletResponse, final String referenceId) { error(httpServletResponse, "Report has not yet completed processing", HttpStatus.ACCEPTED); return null; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReport File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java Repository: mapfish/mapfish-print The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-15231
MEDIUM
4.3
mapfish/mapfish-print
getReport
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
89155f2506b9cee822e15ce60ccae390a1419d5e
0
Analyze the following code function for security vulnerabilities
public void cmsEvent(CmsEvent event) { CmsResource resource; switch (event.getType()) { case I_CmsEventListener.EVENT_PUBLISH_PROJECT: // only flush cache if a schema definition where published CmsUUID publishHistoryId = new CmsUUID((String)event.getData().get(I_CmsEventListener.KEY_PUBLISHID)); if (isSchemaDefinitionInPublishList(publishHistoryId)) { m_cacheTemporary.clear(); m_cacheContentDefinitions.clear(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_ERR_FLUSHED_CACHES_0)); } } break; case I_CmsEventListener.EVENT_CLEAR_CACHES: // flush cache m_cacheTemporary.clear(); m_cacheContentDefinitions.clear(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_ERR_FLUSHED_CACHES_0)); } break; case I_CmsEventListener.EVENT_RESOURCE_MODIFIED: Object change = event.getData().get(I_CmsEventListener.KEY_CHANGE); if ((change != null) && change.equals(new Integer(CmsDriverManager.NOTHING_CHANGED))) { // skip lock & unlock return; } resource = (CmsResource)event.getData().get(I_CmsEventListener.KEY_RESOURCE); uncacheSystemId(resource.getRootPath()); break; case I_CmsEventListener.EVENT_RESOURCE_DELETED: case I_CmsEventListener.EVENT_RESOURCE_MOVED: List<CmsResource> resources = CmsCollectionsGenericWrapper.list( event.getData().get(I_CmsEventListener.KEY_RESOURCES)); for (int i = 0; i < resources.size(); i++) { resource = resources.get(i); uncacheSystemId(resource.getRootPath()); } break; default: // no operation } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cmsEvent File: src/org/opencms/xml/CmsXmlEntityResolver.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3312
MEDIUM
4
alkacon/opencms-core
cmsEvent
src/org/opencms/xml/CmsXmlEntityResolver.java
92e035423aa6967822d343e54392d4291648c0ee
0
Analyze the following code function for security vulnerabilities
public void updateOrAddPeriodicSync(EndPoint info, long period, long flextime, Bundle extras) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "addPeriodicSync: " + info + " -> period " + period + ", flex " + flextime + ", extras " + extras.toString()); } synchronized (mAuthorities) { if (period <= 0) { Log.e(TAG, "period < 0, should never happen in updateOrAddPeriodicSync"); } if (extras == null) { Log.e(TAG, "null extras, should never happen in updateOrAddPeriodicSync:"); } try { PeriodicSync toUpdate; if (info.target_provider) { toUpdate = new PeriodicSync(info.account, info.provider, extras, period, flextime); } else { return; } AuthorityInfo authority = getOrCreateAuthorityLocked(info, -1, false); // add this periodic sync if an equivalent periodic doesn't already exist. boolean alreadyPresent = false; for (int i = 0, N = authority.periodicSyncs.size(); i < N; i++) { PeriodicSync syncInfo = authority.periodicSyncs.get(i); if (SyncManager.syncExtrasEquals(syncInfo.extras, extras, true /* includeSyncSettings*/)) { if (period == syncInfo.period && flextime == syncInfo.flexTime) { // Absolutely the same. return; } authority.periodicSyncs.set(i, toUpdate); alreadyPresent = true; break; } } // If we added an entry to the periodicSyncs array also add an entry to // the periodic syncs status to correspond to it. if (!alreadyPresent) { authority.periodicSyncs.add(toUpdate); SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident); // A new periodic sync is initialised as already having been run. status.setPeriodicSyncTime( authority.periodicSyncs.size() - 1, System.currentTimeMillis()); } } finally { writeAccountInfoLocked(); writeStatusLocked(); } } reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOrAddPeriodicSync 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
updateOrAddPeriodicSync
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public synchronized void setService(Service service) { if (service == null) { service = nullService; } log.debug("Setting active service to {}", service.getName()); this.service = service; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setService File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
setService
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@Override public void registerTaskStackListener(ITaskStackListener listener) { enforceTaskPermission("registerTaskStackListener()"); mTaskChangeNotificationController.registerTaskStackListener(listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerTaskStackListener 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
registerTaskStackListener
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public static List<Node> getNodes(Node node, Pattern... nodePath) { List<Node> res = new ArrayList<>(); getMatchingNodes(node, nodePath, 0, res); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodes File: src/edu/stanford/nlp/time/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
getNodes
src/edu/stanford/nlp/time/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
@Override public String etagFor(BackupConfig entityFromServer) { throw new UnsupportedOperationException(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: etagFor File: api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java Repository: gocd The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25924
HIGH
9.3
gocd
etagFor
api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java
7d0baab0d361c377af84994f95ba76c280048548
0
Analyze the following code function for security vulnerabilities
@Override public ServerHttpResponse pauseRequestInput() { request.pause(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pauseRequestInput File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
pauseRequestInput
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0