instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
private boolean updatePersonalAppsSuspension(int profileUserId) { final boolean shouldSuspend; synchronized (getLockObject()) { final ActiveAdmin profileOwner = getProfileOwnerAdminLocked(profileUserId); if (profileOwner != null) { // Profile is considered "off" when it is either not running or is running locked // or is in quiet mode, i.e. when the admin cannot sync policies or show UI. boolean profileUserOff = !mUserManagerInternal.isUserUnlockingOrUnlocked(profileUserId) || mUserManager.isQuietModeEnabled(UserHandle.of(profileUserId)); final int notificationState = updateProfileOffDeadlineLocked( profileUserId, profileOwner, profileUserOff); final boolean suspendedExplicitly = profileOwner.mSuspendPersonalApps; final boolean suspendedByTimeout = profileOwner.mProfileOffDeadline == -1; Slogf.d(LOG_TAG, "Personal apps suspended explicitly: %b, by timeout: %b, notification: %d", suspendedExplicitly, suspendedByTimeout, notificationState); updateProfileOffDeadlineNotificationLocked( profileUserId, profileOwner, notificationState); shouldSuspend = suspendedExplicitly || suspendedByTimeout; } else { shouldSuspend = false; } } final int parentUserId = getProfileParentId(profileUserId); suspendPersonalAppsInternal(parentUserId, profileUserId, shouldSuspend); return shouldSuspend; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePersonalAppsSuspension 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
updatePersonalAppsSuspension
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void setXmlVersion(String xmlVersion) throws DOMException { doc.setXmlVersion(xmlVersion); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setXmlVersion File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
setXmlVersion
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
final List<String> getAllAndRemove(CharSequence name) { final List<String> all = getAll(name); if (!all.isEmpty()) { remove(name); } return all; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllAndRemove File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
getAllAndRemove
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
public void handleApplicationStrictModeViolation( IBinder app, int violationMask, StrictMode.ViolationInfo info) { // We're okay if the ProcessRecord is missing; it probably means that // we're reporting a violation from the system process itself. final ProcessRecord r = findAppProcess(app, "StrictMode"); if ((violationMask & StrictMode.PENALTY_DROPBOX) != 0) { Integer stackFingerprint = info.hashCode(); boolean logIt = true; synchronized (mAlreadyLoggedViolatedStacks) { if (mAlreadyLoggedViolatedStacks.contains(stackFingerprint)) { logIt = false; // TODO: sub-sample into EventLog for these, with // the info.durationMillis? Then we'd get // the relative pain numbers, without logging all // the stack traces repeatedly. We'd want to do // likewise in the client code, which also does // dup suppression, before the Binder call. } else { if (mAlreadyLoggedViolatedStacks.size() >= MAX_DUP_SUPPRESSED_STACKS) { mAlreadyLoggedViolatedStacks.clear(); } mAlreadyLoggedViolatedStacks.add(stackFingerprint); } } if (logIt) { logStrictModeViolationToDropBox(r, info); } } if ((violationMask & StrictMode.PENALTY_DIALOG) != 0) { AppErrorResult result = new AppErrorResult(); synchronized (this) { final long origId = Binder.clearCallingIdentity(); Message msg = Message.obtain(); msg.what = SHOW_STRICT_MODE_VIOLATION_UI_MSG; HashMap<String, Object> data = new HashMap<String, Object>(); data.put("result", result); data.put("app", r); data.put("violationMask", violationMask); data.put("info", info); msg.obj = data; mUiHandler.sendMessage(msg); Binder.restoreCallingIdentity(origId); } int res = result.get(); Slog.w(TAG, "handleApplicationStrictModeViolation; res=" + res); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleApplicationStrictModeViolation 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
handleApplicationStrictModeViolation
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private SyntaxHighlighter valueHighlighter(String style) { SyntaxHighlighter out; if (style == null || style.isEmpty()) { out = null; } else if (highlighters.containsKey(style)) { out = highlighters.get(style); } else if (style.matches("[a-z]+:.*")) { out = SyntaxHighlighter.build(style); highlighters.put(style, out); } else { Path nanorc = configPath != null ? configPath.getConfig(DEFAULT_NANORC_FILE) : null; if (engine != null && engine.hasVariable(VAR_NANORC)) { nanorc = Paths.get((String) engine.get(VAR_NANORC)); } if (nanorc == null) { nanorc = Paths.get("/etc/nanorc"); } out = SyntaxHighlighter.build(nanorc, style); highlighters.put(style, out); } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: valueHighlighter 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
valueHighlighter
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
0
Analyze the following code function for security vulnerabilities
@Override public PendingIntent getLaunchPendingIntent() { return mLaunchIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLaunchPendingIntent File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
getLaunchPendingIntent
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
public void sendSetIsConferenced(String id) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.setIsConferenced(id, mConnectionById.get(id).conferenceId, null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendSetIsConferenced 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
sendSetIsConferenced
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static ParcelFileDescriptor blobFileDescriptorForQuery(SQLiteDatabase db, String query, String[] selectionArgs) { SQLiteStatement prog = db.compileStatement(query); try { return blobFileDescriptorForQuery(prog, selectionArgs); } finally { prog.close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: blobFileDescriptorForQuery File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
blobFileDescriptorForQuery
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "3.0M2") public String getCreator() { return userReferenceToString(getCreatorReference()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCreator File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
getCreator
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@RequestMapping({"/ulogin/(*:appId)/(*:userviewId)/(~:key)","/ulogin/(*:appId)/(*:userviewId)","/ulogin/(*:appId)/(*:userviewId)/(*:key)/(*:menuId)"}) public String login(ModelMap map, HttpServletRequest request, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam("userviewId") String userviewId, @RequestParam(value = "menuId", required = false) String menuId, @RequestParam(value = "key", required = false) String key, @RequestParam(value = "embed", required = false) Boolean embed) throws Exception { if (embed == null) { embed = false; } return embedLogin(map, request, response, appId, userviewId, menuId, key, embed); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: login File: wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
login
wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
void set(@NonNull Request request) { caller = request.caller; intent = request.intent; intentGrants = request.intentGrants; ephemeralIntent = request.ephemeralIntent; resolvedType = request.resolvedType; activityInfo = request.activityInfo; resolveInfo = request.resolveInfo; voiceSession = request.voiceSession; voiceInteractor = request.voiceInteractor; resultTo = request.resultTo; resultWho = request.resultWho; requestCode = request.requestCode; callingPid = request.callingPid; callingUid = request.callingUid; callingPackage = request.callingPackage; callingFeatureId = request.callingFeatureId; realCallingPid = request.realCallingPid; realCallingUid = request.realCallingUid; startFlags = request.startFlags; activityOptions = request.activityOptions; ignoreTargetSecurity = request.ignoreTargetSecurity; componentSpecified = request.componentSpecified; outActivity = request.outActivity; inTask = request.inTask; inTaskFragment = request.inTaskFragment; reason = request.reason; profilerInfo = request.profilerInfo; globalConfig = request.globalConfig; userId = request.userId; waitResult = request.waitResult; avoidMoveToFront = request.avoidMoveToFront; allowPendingRemoteAnimationRegistryLookup = request.allowPendingRemoteAnimationRegistryLookup; filterCallingUid = request.filterCallingUid; originatingPendingIntent = request.originatingPendingIntent; allowBackgroundActivityStart = request.allowBackgroundActivityStart; errorCallbackToken = request.errorCallbackToken; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: set File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
set
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
public String getStringUnchecked(String key, String defaultValue, int userId) { if (Settings.Secure.LOCK_PATTERN_ENABLED.equals(key)) { long ident = Binder.clearCallingIdentity(); try { return mLockPatternUtils.isLockPatternEnabled(userId) ? "1" : "0"; } finally { Binder.restoreCallingIdentity(ident); } } return mStorage.readKeyValue(key, defaultValue, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStringUnchecked File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
getStringUnchecked
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
0
Analyze the following code function for security vulnerabilities
@Override public void setRecommendedGlobalProxy(ComponentName who, ProxyInfo proxyInfo) { Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkAllUsersAreAffiliatedWithDevice(); mInjector.binderWithCleanCallingIdentity( () -> mInjector.getConnectivityManager().setGlobalProxy(proxyInfo)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRecommendedGlobalProxy 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
setRecommendedGlobalProxy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private EnforcingAdmin enforcePermissionsAndGetEnforcingAdmin(@Nullable ComponentName admin, String[] permissions, int deviceAdminPolicy, String callerPackageName, int targetUserId) { enforcePermissions(permissions, deviceAdminPolicy, callerPackageName, targetUserId); return getEnforcingAdminForCaller(admin, callerPackageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforcePermissionsAndGetEnforcingAdmin 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
enforcePermissionsAndGetEnforcingAdmin
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static DomainSocketAddress newSocketAddress() { try { File file; do { file = File.createTempFile("NETTY", "UDS"); if (!file.delete()) { throw new IOException("failed to delete: " + file); } } while (file.getAbsolutePath().length() > 128); return new DomainSocketAddress(file); } catch (IOException e) { throw new IllegalStateException(e); } }
Vulnerability Classification: - CWE: CWE-378, CWE-379 - CVE: CVE-2021-21290 - Severity: LOW - CVSS Score: 1.9 Description: Use Files.createTempFile(...) to ensure the file is created with proper permissions Motivation: File.createTempFile(String, String)` will create a temporary file in the system temporary directory if the 'java.io.tmpdir'. The permissions on that file utilize the umask. In a majority of cases, this means that the file that java creates has the permissions: `-rw-r--r--`, thus, any other local user on that system can read the contents of that file. This can be a security concern if any sensitive data is stored in this file. This was reported by Jonathan Leitschuh <jonathan.leitschuh@gmail.com> as a security problem. Modifications: Use Files.createTempFile(...) which will use safe-defaults when running on java 7 and later. If running on java 6 there isnt much we can do, which is fair enough as java 6 shouldnt be considered "safe" anyway. Result: Create temporary files with sane permissions by default. Function: newSocketAddress File: transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/UnixTestUtils.java Repository: netty Fixed Code: public static DomainSocketAddress newSocketAddress() { try { File file; do { file = PlatformDependent.createTempFile("NETTY", "UDS", null); if (!file.delete()) { throw new IOException("failed to delete: " + file); } } while (file.getAbsolutePath().length() > 128); return new DomainSocketAddress(file); } catch (IOException e) { throw new IllegalStateException(e); } }
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
newSocketAddress
transport-native-unix-common-tests/src/main/java/io/netty/channel/unix/tests/UnixTestUtils.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
1
Analyze the following code function for security vulnerabilities
@Deprecated public void rename(DocumentReference newDocumentReference, List<DocumentReference> backlinkDocumentReferences, List<DocumentReference> childDocumentReferences, XWikiContext context) throws XWikiException { // TODO: Do all this in a single DB transaction as otherwise the state will be unknown if // something fails in the middle... // TODO: Why do we verify if the document has just been created and not been saved. // If the user is trying to rename to the same name... In that case, simply exits for efficiency. if (isNew() || getDocumentReference().equals(newDocumentReference)) { return; } context.getWiki().renameByCopyAndDelete(this, newDocumentReference, backlinkDocumentReferences, childDocumentReferences, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rename File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
rename
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public Object readUnshared() throws IOException, ClassNotFoundException { return readObject(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readUnshared 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
readUnshared
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-2414 - Severity: HIGH - CVSS Score: 7.5 Description: Disable access to external entities when parsing XML This reduces the vulnerability of XML parsers to XXE (XML external entity) injection. The best way to prevent XXE is to stop using XML altogether, which we do plan to do. Until that happens I consider it worthwhile to tighten the security here though. Function: toXML File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java Repository: dogtagpki/pki Fixed Code: public String toXML() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element element = toDOM(document); document.appendChild(element); TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); transformerFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); DOMSource domSource = new DOMSource(document); StringWriter sw = new StringWriter(); StreamResult streamResult = new StreamResult(sw); transformer.transform(domSource, streamResult); return sw.toString(); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
toXML
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfos.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
private static void scheduledExecutorXmlGenerator(XmlGenerator gen, Config config) { for (ScheduledExecutorConfig ex : config.getScheduledExecutorConfigs().values()) { MergePolicyConfig mergePolicyConfig = ex.getMergePolicyConfig(); gen.open("scheduled-executor-service", "name", ex.getName()) .node("pool-size", ex.getPoolSize()) .node("durability", ex.getDurability()) .node("capacity", ex.getCapacity()) .node("quorum-ref", ex.getQuorumName()) .node("merge-policy", mergePolicyConfig.getPolicy(), "batch-size", mergePolicyConfig.getBatchSize()) .close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduledExecutorXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
scheduledExecutorXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public void addItemClickListener(ItemClickListener listener) { addListener(GridConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener, ItemClickEvent.ITEM_CLICK_METHOD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItemClickListener 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
addItemClickListener
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public Param[] getParametersInfo() { return PARAMS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParametersInfo File: modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
getParametersInfo
modules/library/jdbc/src/main/java/org/geotools/data/jdbc/datasource/JNDIDataSourceFactory.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
private boolean hasPrivilegedAccess(int callingUid, ActivityInfo activityInfo) { if (TextUtils.equals(PasswordUtils.getCallingAppPackageName(getActivityToken()), getPackageName())) { return true; } int targetUid = -1; try { targetUid = getPackageManager().getApplicationInfo(activityInfo.packageName, /* flags= */ 0).uid; } catch (PackageManager.NameNotFoundException nnfe) { Log.e(TAG, "Not able to get targetUid: " + nnfe); return false; } // When activityInfo.exported is false, Activity still can be launched if applications have // the same user ID. if (UserHandle.isSameApp(callingUid, targetUid)) { return true; } // When activityInfo.exported is false, Activity still can be launched if calling app has // root or system privilege. int callingAppId = UserHandle.getAppId(callingUid); if (callingAppId == Process.ROOT_UID || callingAppId == Process.SYSTEM_UID) { return true; } return false; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21256 - Severity: HIGH - CVSS Score: 7.8 Description: Refine permission check process of 2-pane deep link - Check the deep link activity instance before redirecting to the internal activity for the managed profile invocation, so the caller can't bypass the permission check. - Get the referrer as the caller so that onNewIntent can recognize the new caller and check if it has a permission to open the target page. Test: robotest & manual Bug: 268193384 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0f13f70655099543ba34eb8aeaa74b34a3993a3b) Merged-In: Ie69742983fb74ee2316b7aad16461db95ed927c2 Change-Id: Ie69742983fb74ee2316b7aad16461db95ed927c2 Function: hasPrivilegedAccess File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android Fixed Code: private boolean hasPrivilegedAccess(String callerPkg, int callerUid, String targetPackage) { if (TextUtils.equals(callerPkg, getPackageName())) { return true; } int targetUid = -1; try { targetUid = getPackageManager().getApplicationInfo(targetPackage, ApplicationInfoFlags.of(/* flags= */ 0)).uid; } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "Not able to get targetUid: " + e); return false; } // When activityInfo.exported is false, Activity still can be launched if applications have // the same user ID. if (UserHandle.isSameApp(callerUid, targetUid)) { return true; } // When activityInfo.exported is false, Activity still can be launched if calling app has // root or system privilege. int callingAppId = UserHandle.getAppId(callerUid); if (callingAppId == Process.ROOT_UID || callingAppId == Process.SYSTEM_UID) { return true; } return false; }
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
hasPrivilegedAccess
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
1
Analyze the following code function for security vulnerabilities
private int getNextAvailableIdLocked() { synchronized (mPackagesLock) { int i = MIN_USER_ID; while (i < Integer.MAX_VALUE) { if (mUsers.indexOfKey(i) < 0 && !mRemovingUserIds.get(i)) { break; } i++; } return i; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextAvailableIdLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
getNextAvailableIdLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public long getSerialVersionUID() { return svUID; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSerialVersionUID 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
getSerialVersionUID
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
protected B promisedRequestVerifier(Http2PromisedRequestVerifier promisedRequestVerifier) { enforceNonCodecConstraints("promisedRequestVerifier"); this.promisedRequestVerifier = checkNotNull(promisedRequestVerifier, "promisedRequestVerifier"); return self(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: promisedRequestVerifier File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
promisedRequestVerifier
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setDescriptionGenerator( DescriptionGenerator<T> cellDescriptionGenerator) { return setDescriptionGenerator(cellDescriptionGenerator, ContentMode.PREFORMATTED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescriptionGenerator 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
setDescriptionGenerator
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public boolean suppressAlertingDueToGrouping() { if (isGroupSummary() && getGroupAlertBehavior() == Notification.GROUP_ALERT_CHILDREN) { return true; } else if (isGroupChild() && getGroupAlertBehavior() == Notification.GROUP_ALERT_SUMMARY) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: suppressAlertingDueToGrouping File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
suppressAlertingDueToGrouping
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public static short[] uncompressShortArray(byte[] input, int offset, int length) throws IOException { int uncompressedLength = Snappy.uncompressedLength(input, offset, length); short[] result = new short[uncompressedLength / 2]; impl.rawUncompress(input, offset, length, result, 0); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: uncompressShortArray File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
uncompressShortArray
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
public static Object readAttributeValue(ObjectDataInput in) throws IOException { byte type = in.readByte(); switch (type) { case PRIMITIVE_TYPE_BOOLEAN: return in.readBoolean(); case PRIMITIVE_TYPE_BYTE: return in.readByte(); case PRIMITIVE_TYPE_SHORT: return in.readShort(); case PRIMITIVE_TYPE_INTEGER: return in.readInt(); case PRIMITIVE_TYPE_LONG: return in.readLong(); case PRIMITIVE_TYPE_FLOAT: return in.readFloat(); case PRIMITIVE_TYPE_DOUBLE: return in.readDouble(); case PRIMITIVE_TYPE_UTF: return in.readUTF(); default: throw new IllegalStateException("Illegal attribute type ID found"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readAttributeValue File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
readAttributeValue
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public static SQLiteDatabase openOrCreateDatabase(@NonNull String path, @Nullable CursorFactory factory) { return openDatabase(path, factory, CREATE_IF_NECESSARY, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openOrCreateDatabase File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
openOrCreateDatabase
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private boolean isSessionActive(VaadinSession session) { if (session.getState() != State.OPEN || session.getSession() == null) { return false; } else { long now = System.currentTimeMillis(); int timeout = 1000 * getUidlRequestTimeout(session); return timeout < 0 || now - session.getLastRequestTimestamp() < timeout; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSessionActive File: server/src/main/java/com/vaadin/server/VaadinService.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31403
LOW
1.9
vaadin/framework
isSessionActive
server/src/main/java/com/vaadin/server/VaadinService.java
d852126ab6f0c43f937239305bd0e9594834fe34
0
Analyze the following code function for security vulnerabilities
private int getCallingUserId() { return UserHandle.getUserId(injectBinderCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallingUserId 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
getCallingUserId
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString 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
parameterToString
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@HotPath(caller = HotPath.PROCESS_CHANGE) @Override public void onProcessAdded(WindowProcessController proc) { synchronized (mGlobalLockWithoutBoost) { mProcessNames.put(proc.mName, proc.mUid, proc); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onProcessAdded 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
onProcessAdded
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
protected MetaDataStateChainingListener getMetaDataState() { return (MetaDataStateChainingListener) getListenerChain().getListener(MetaDataStateChainingListener.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaDataState File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
getMetaDataState
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
public EntityReference resolveSpaceReference(String referenceAsString) { return referenceResolver.resolve(referenceAsString, EntityType.SPACE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveSpaceReference File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
resolveSpaceReference
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void onError(@Nullable String ssid) {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onError File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onError
service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private void createSession( final AuthenticationInfo authInfo ) { final Session session = this.context.get().getLocalScope().getSession(); if ( session != null ) { session.setAttribute( authInfo ); } if ( this.sessionTimeout != null ) { setSessionTimeout(); } }
Vulnerability Classification: - CWE: CWE-384 - CVE: CVE-2024-23679 - Severity: CRITICAL - CVSS Score: 9.8 Description: Invalidate old session after login #9253 Function: createSession File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp Fixed Code: private void createSession( final AuthenticationInfo authInfo ) { final LocalScope localScope = this.context.get().getLocalScope(); final Session session = localScope.getSession(); if ( session != null ) { final var attributes = session.getAttributes(); session.invalidate(); final Session newSession = localScope.getSession(); if ( newSession != null ) { attributes.forEach( newSession::setAttribute ); session.setAttribute( authInfo ); if ( this.sessionTimeout != null ) { setSessionTimeout(); } } } }
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
createSession
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
0189975691e9e6407a9fee87006f730e84f734ff
1
Analyze the following code function for security vulnerabilities
protected String getBreadcrumb(Map<String, Object> data) { String breadcrumb = "<ul class=\"breadcrumb\"><li><i class=\"fa fa-home\"></i> <a href=\"" + data.get("home_page_link") + "\">" + ResourceBundleUtil.getMessage("theme.universal.home") + "</a> <i class=\"fa fa-angle-right\"></i></li>"; if ((Boolean) data.get("is_login_page") || (Boolean) data.get("embed")) { return ""; } else if (userview.getCurrent() != null) { UserviewCategory category = userview.getCurrentCategory(); if (!(category.getMenus().size() <= 1 && ((Boolean) data.get("combine_single_menu_category"))) && !"yes".equals(category.getPropertyString("hide"))) { breadcrumb += "<li><a href=\"" + getCategoryLink(category, data) + "\">" + StringUtil.stripAllHtmlTag(category.getPropertyString("label")) + "</a> <i class=\"fa fa-angle-right\"></i></li>"; } breadcrumb += "<li><a>" + StringUtil.stripAllHtmlTag(userview.getCurrent().getPropertyString("label")) + "</a></li>"; } else if (PROFILE.equals(userview.getParamString("menuId"))) { breadcrumb += "<li><a>" + ResourceBundleUtil.getMessage("theme.universal.profile") + "</a></li>"; } else if (INBOX.equals(userview.getParamString("menuId"))) { breadcrumb += "<li><a>" + ResourceBundleUtil.getMessage("theme.universal.inbox") + "</a></li>"; } else if (UserviewPwaTheme.PWA_OFFLINE_MENU_ID.equals(userview.getParamString("menuId")) || UserviewPwaTheme.PAGE_UNAVAILABLE_MENU_ID.equals(userview.getParamString("menuId"))) { breadcrumb += "<li><a>" + ResourceBundleUtil.getMessage("pwa.offline.breadcrumbTitle") + "</a></li>"; } else { breadcrumb += "<li><a>" + ResourceBundleUtil.getMessage("ubuilder.pageNotFound") + "</a></li>"; } breadcrumb += "</ul>"; return breadcrumb; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBreadcrumb File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
getBreadcrumb
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
@Override public JavaType mapAbstractType(DeserializationConfig config, JavaType type) throws JsonMappingException { // first, general mappings while (true) { JavaType next = _mapAbstractType2(config, type); if (next == null) { return type; } // Should not have to worry about cycles; but better verify since they will invariably occur... :-) // (also: guard against invalid resolution to a non-related type) Class<?> prevCls = type.getRawClass(); Class<?> nextCls = next.getRawClass(); if ((prevCls == nextCls) || !prevCls.isAssignableFrom(nextCls)) { throw new IllegalArgumentException("Invalid abstract type resolution from "+type+" to "+next+": latter is not a subtype of former"); } type = next; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mapAbstractType File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
mapAbstractType
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
void grantUriPermissionUncheckedLocked(int targetUid, String targetPkg, GrantUri grantUri, final int modeFlags, UriPermissionOwner owner) { if (!Intent.isAccessUriMode(modeFlags)) { return; } // So here we are: the caller has the assumed permission // to the uri, and the target doesn't. Let's now give this to // the target. if (DEBUG_URI_PERMISSION) Slog.v(TAG, "Granting " + targetPkg + "/" + targetUid + " permission to " + grantUri); final String authority = grantUri.uri.getAuthority(); final ProviderInfo pi = getProviderInfoLocked(authority, grantUri.sourceUserId); if (pi == null) { Slog.w(TAG, "No content provider found for grant: " + grantUri.toSafeString()); return; } if ((modeFlags & Intent.FLAG_GRANT_PREFIX_URI_PERMISSION) != 0) { grantUri.prefix = true; } final UriPermission perm = findOrCreateUriPermissionLocked( pi.packageName, targetPkg, targetUid, grantUri); perm.grantModes(modeFlags, owner); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantUriPermissionUncheckedLocked 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
grantUriPermissionUncheckedLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private List<String> getAllCodePaths() { final File codeFile = new File(getCodePath()); if (codeFile != null && codeFile.exists()) { try { final PackageLite pkg = PackageParser.parsePackageLite(codeFile, 0); return pkg.getAllCodePaths(); } catch (PackageParserException e) { // Ignored; we tried our best } } return Collections.EMPTY_LIST; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllCodePaths File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getAllCodePaths
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public int getFontDescent(Object nativeFont) { Paint font = (nativeFont == null ? this.defaultFont : (Paint) ((NativeFont) nativeFont).font); return Math.abs(Math.round(font.getFontMetrics().descent)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFontDescent File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getFontDescent
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String readXmlFile(String filename, boolean xmlContent) throws IOException { String result = readFile(filename); if (xmlContent) { result = result.replaceAll("'", "\\\\'").replaceAll("\t", "") .replaceAll("\n", ""); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readXmlFile File: src/main/java/com/mxgraph/online/EmbedServlet2.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-1723
MEDIUM
5
jgraph/drawio
readXmlFile
src/main/java/com/mxgraph/online/EmbedServlet2.java
7a68ebe22a64fe722704e9c4527791209fee2034
0
Analyze the following code function for security vulnerabilities
public String fileName() { return fileName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fileName File: src/main/java/org/candlepin/sync/Importer.java Repository: candlepin The code follows secure coding practices.
[ "CWE-264" ]
CVE-2012-6119
LOW
2.1
candlepin
fileName
src/main/java/org/candlepin/sync/Importer.java
f4d93230e58b969c506b4c9778e04482a059b08c
0
Analyze the following code function for security vulnerabilities
@Override public void setDefaultSmsApplication(ComponentName admin, String callerPackageName, String packageName, boolean parent) { CallerIdentity caller; if (isPermissionCheckFlagEnabled()) { caller = getCallerIdentity(admin, callerPackageName); } else { caller = getCallerIdentity(admin); } final int userId; if (isPermissionCheckFlagEnabled()) { enforcePermission( MANAGE_DEVICE_POLICY_DEFAULT_SMS, caller.getPackageName(), getAffectedUser(parent)); } else { Objects.requireNonNull(admin, "ComponentName is null"); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller)); } if (!parent && isManagedProfile(caller.getUserId()) && getManagedSubscriptionsPolicy().getPolicyType() != ManagedSubscriptionsPolicy.TYPE_ALL_MANAGED_SUBSCRIPTIONS) { throw new IllegalStateException( "Default sms application can only be set on the profile, when " + "ManagedSubscriptions policy is set"); } if (parent) { userId = getProfileParentId(mInjector.userHandleGetCallingUserId()); mInjector.binderWithCleanCallingIdentity(() -> enforcePackageIsSystemPackage( packageName, userId)); } else { userId = mInjector.userHandleGetCallingUserId(); } mInjector.binderWithCleanCallingIdentity(() -> SmsApplication.setDefaultApplicationAsUser(packageName, mContext, userId)); synchronized (getLockObject()) { final ActiveAdmin activeAdmin = getParentOfAdminIfRequired( getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()), parent); if (isManagedProfile(userId)) { mInjector.binderWithCleanCallingIdentity( () -> updateDialerAndSmsManagedShortcutsOverrideCache()); } if (!Objects.equals(activeAdmin.mSmsPackage, packageName)) { activeAdmin.mSmsPackage = packageName; saveSettingsLocked(caller.getUserId()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultSmsApplication 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
setDefaultSmsApplication
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void setAnimateWakeup(boolean animateWakeup) { mAnimateWakeup = animateWakeup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAnimateWakeup 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
setAnimateWakeup
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean removeObject(BaseObject object) { return removeXObject(object); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeObject File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
removeObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public BaseStatement getPGStatement() { return statement; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPGStatement File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getPGStatement
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public int releaseBuffered(OutputStream out) throws IOException { int count = _inputEnd - _inputPtr; if (count < 1) { return 0; } // let's just advance ptr to end int origPtr = _inputPtr; out.write(_inputBuffer, origPtr, count); return count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: releaseBuffered 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
releaseBuffered
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting ShortcutInfo getPackageShortcutForTest(String packageName, String shortcutId, int userId) { synchronized (mLock) { final ShortcutPackage pkg = getPackageShortcutForTest(packageName, userId); if (pkg == null) return null; return pkg.findShortcutById(shortcutId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageShortcutForTest 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
getPackageShortcutForTest
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
final void updateProcessForegroundLocked(ProcessRecord proc, boolean isForeground, boolean oomAdj) { if (isForeground != proc.foregroundServices) { proc.foregroundServices = isForeground; ArrayList<ProcessRecord> curProcs = mForegroundPackages.get(proc.info.packageName, proc.info.uid); if (isForeground) { if (curProcs == null) { curProcs = new ArrayList<ProcessRecord>(); mForegroundPackages.put(proc.info.packageName, proc.info.uid, curProcs); } if (!curProcs.contains(proc)) { curProcs.add(proc); mBatteryStatsService.noteEvent(BatteryStats.HistoryItem.EVENT_FOREGROUND_START, proc.info.packageName, proc.info.uid); } } else { if (curProcs != null) { if (curProcs.remove(proc)) { mBatteryStatsService.noteEvent( BatteryStats.HistoryItem.EVENT_FOREGROUND_FINISH, proc.info.packageName, proc.info.uid); if (curProcs.size() <= 0) { mForegroundPackages.remove(proc.info.packageName, proc.info.uid); } } } } if (oomAdj) { updateOomAdjLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateProcessForegroundLocked 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
updateProcessForegroundLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { parent.fireWebEvent("onError", new ActionEvent(description, errorCode)); super.onReceivedError(view, errorCode, description, failingUrl); super.shouldOverrideKeyEvent(view, null); dismissProgress(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onReceivedError File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onReceivedError
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean isDragResizingChangeReported() { return mDragResizingChangeReported; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDragResizingChangeReported File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isDragResizingChangeReported
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private String calculatePluginPackageFileName(PluginArtifactPullContext ctx) { String keyName = ctx.getKeyName(); int index = keyName.lastIndexOf("/"); if (index >= 0) { return keyName.substring(index); } else { return keyName; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculatePluginPackageFileName 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
calculatePluginPackageFileName
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
@Override public void onSwipingAborted() { mFalsingManager.onAffordanceSwipingAborted(); mKeyguardBottomArea.unbindCameraPrewarmService(false /* launched */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSwipingAborted 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
onSwipingAborted
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public String getURL() { return service.getURL(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL File: h2/src/main/org/h2/tools/Server.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getURL
h2/src/main/org/h2/tools/Server.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outState) { if (outState == null) { throw new IllegalArgumentException("outState is null"); } enforceNotIsolatedCaller("getMyMemoryState"); final int callingUid = Binder.getCallingUid(); final int clientTargetSdk = mPackageManagerInt.getUidTargetSdkVersion(callingUid); synchronized (mProcLock) { ProcessRecord proc; synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(Binder.getCallingPid()); } if (proc != null) { mProcessList.fillInProcMemInfoLOSP(proc, outState, clientTargetSdk); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMyMemoryState 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
getMyMemoryState
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public static XMLBuilder2 parse(File xmlFile) { try { return XMLBuilder2.parse(new InputSource(new FileReader(xmlFile))); } catch (FileNotFoundException e) { throw wrapExceptionAsRuntimeException(e); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2014-125087 - Severity: MEDIUM - CVSS Score: 5.2 Description: Disable external entities by default to prevent XXE injection attacks, re #6 XML Builder classes now explicitly enable or disable 'external-general-entities' and 'external-parameter-entities' features of the DocumentBuilderFactory when #create or #parse methods are used. To prevent XML External Entity (XXE) injection attacks, these features are disabled by default. They can only be enabled by passing a true boolean value to new versions of the #create and #parse methods that accept a flag for this feature. Function: parse File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder Fixed Code: public static XMLBuilder2 parse(File xmlFile) { return XMLBuilder2.parse(xmlFile, false); }
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
parse
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
1
Analyze the following code function for security vulnerabilities
private static byte[] getBytesFromBlob( java.sql.Blob blob ) throws IOException, SQLException { InputStream is = blob.getBinaryStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int b; while ((b = is.read()) != -1) { os.write(b); } os.close(); return os.toByteArray(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBytesFromBlob File: core/src/main/java/org/opencrx/kernel/tools/CopyDb.java Repository: opencrx The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-25959
MEDIUM
4.3
opencrx
getBytesFromBlob
core/src/main/java/org/opencrx/kernel/tools/CopyDb.java
14e75f95e5f56fbe7ee897bdf5d858788072e818
0
Analyze the following code function for security vulnerabilities
public List<ResponseFilter> getResponseFilters() { return Collections.unmodifiableList(responseFilters); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResponseFilters File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getResponseFilters
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public void onFocusChanged(boolean gainFocus) { if (gainFocus) { restoreSelectionPopupsIfNecessary(); } else { hideImeIfNeeded(); cancelRequestToScrollFocusedEditableNodeIntoView(); if (mPreserveSelectionOnNextLossOfFocus) { mPreserveSelectionOnNextLossOfFocus = false; hidePopupsAndPreserveSelection(); } else { hidePopupsAndClearSelection(); } } if (mNativeContentViewCore != 0) nativeSetFocus(mNativeContentViewCore, gainFocus); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFocusChanged File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-1021" ]
CVE-2015-1241
MEDIUM
4.3
chromium
onFocusChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
public synchronized void login(CharSequence username, String password) throws XMPPException, SmackException, IOException, InterruptedException { login(username, password, config.getResource()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: login File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
login
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected void parseModuleConfigFile(Digester digester, String path) throws UnavailableException { InputStream input = null; try { URL url = getServletContext().getResource(path); // If the config isn't in the servlet context, try the class loader // which allows the config files to be stored in a jar if (url == null) { url = getClass().getResource(path); } if (url == null) { String msg = internal.getMessage("configMissing", path); log.error(msg); throw new UnavailableException(msg); } InputSource is = new InputSource(url.toExternalForm()); input = url.openStream(); is.setByteStream(input); digester.parse(is); } catch (MalformedURLException e) { handleConfigException(path, e); } catch (IOException e) { handleConfigException(path, e); } catch (SAXException e) { handleConfigException(path, e); } finally { if (input != null) { try { input.close(); } catch (IOException e) { throw new UnavailableException(e.getMessage()); } } } }
Vulnerability Classification: - CWE: CWE-Other, CWE-20 - CVE: CVE-2016-1181 - Severity: MEDIUM - CVSS Score: 6.8 Description: Fixed CVE-2016-1181 and CVE-2016-1182 Function: parseModuleConfigFile File: src/share/org/apache/struts/action/ActionServlet.java Repository: kawasima/struts1-forever Fixed Code: protected void parseModuleConfigFile(Digester digester, String path) throws UnavailableException { InputStream input = null; try { URL url = getServletContext().getResource(path); // If the config isn't in the servlet context, try the class loader // which allows the config files to be stored in a jar if (url == null) { url = getClass().getResource(path); } if (url == null) { String msg = internal.getMessage("configMissing", path); log.error(msg); throw new UnavailableException(msg); } InputSource is = new InputSource(url.toExternalForm()); input = url.openStream(); is.setByteStream(input); digester.parse(is); } catch (MalformedURLException e) { handleConfigException(path, e); } catch (IOException e) { handleConfigException(path, e); } catch (SAXException e) { handleConfigException(path, e); } finally { if (input != null) { try { input.close(); } catch (IOException e) { throw new UnavailableException(e.getMessage()); } } } }
[ "CWE-Other", "CWE-20" ]
CVE-2016-1181
MEDIUM
6.8
kawasima/struts1-forever
parseModuleConfigFile
src/share/org/apache/struts/action/ActionServlet.java
eda3a79907ed8fcb0387a0496d0cb14332f250e8
1
Analyze the following code function for security vulnerabilities
boolean isInTransition() { return mTransitionController.inTransition() // Shell transitions. || isAnimating(PARENTS | TRANSITION); // Legacy transitions. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInTransition 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
isInTransition
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public Field sub(String key) { return sub(key, form.lang); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sub File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
sub
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private boolean isDialerOrPrivileged(String callingPackage, String message) { // The system/default dialer can always read phone state - so that emergency calls will // still work. if (isPrivilegedDialerCalling(callingPackage)) { return true; } mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE, message); // SKIP checking run-time OP_READ_PHONE_STATE since caller or self has PRIVILEGED // permission return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDialerOrPrivileged File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
isDialerOrPrivileged
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public void setUsageLimitTimeLimitInMinutes(long usageLimitTimeLimitInMinutes) { mUsageLimitTimeLimitInMinutes = usageLimitTimeLimitInMinutes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsageLimitTimeLimitInMinutes File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
setUsageLimitTimeLimitInMinutes
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public static void writeServiceProperties(Context a) { if (servicePropertiesDirty()) { Map<String,String> out = getServiceProperties(a); for (String key : servicePropertyKeys) { String val = Display.getInstance().getProperty(key, null); if (val != null) { out.put(key, val); } if ("true".equals(Display.getInstance().getProperty(key+"#delete", null))) { out.remove(key); } } OutputStream os = null; try { os = a.openFileOutput("CN1$AndroidServiceProperties", 0); if (os == null) { System.out.println("Failed to save service properties null output stream"); return; } DataOutputStream dos = new DataOutputStream(os); dos.writeInt(out.size()); for (String key : out.keySet()) { dos.writeUTF(key); dos.writeUTF((String)out.get(key)); } serviceProperties = null; } catch (FileNotFoundException ex) { System.out.println("Service properties file not found. This is normal for the first run. On subsequent runs, the file should exist."); } catch (IOException ex) { Logger.getLogger(AndroidImplementation.class.getName()).log(Level.SEVERE, null, ex); } finally { try { if (os != null) os.close(); } catch (Throwable ex) { Logger.getLogger(AndroidImplementation.class.getName()).log(Level.SEVERE, null, ex); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeServiceProperties File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
writeServiceProperties
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected Locale getLocale(DocumentReference documentReference) throws SolrIndexerException { Locale locale = null; try { if (documentReference.getLocale() != null && !documentReference.getLocale().equals(Locale.ROOT)) { locale = documentReference.getLocale(); } else { XWikiContext xcontext = this.xcontextProvider.get(); locale = xcontext.getWiki().getDocument(documentReference, xcontext).getRealLocale(); } } catch (Exception e) { throw new SolrIndexerException( String.format("Exception while fetching the locale of the document '%s'", documentReference), e); } return locale; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocale File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
getLocale
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
@Override public void saveNamedQuery(String projectName, NamedQuery namedQuery, AsyncMethodCallback resultHandler) { unimplemented(resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveNamedQuery File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
saveNamedQuery
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
@Override public void clearBodyInternal() throws JMSException { this.bout = new ByteArrayOutputStream(RMQMessage.DEFAULT_MESSAGE_BODY_SIZE); try { this.out = new ObjectOutputStream(this.bout); } catch (IOException x) { throw new RMQJMSException(x); } this.bin = null; this.in = null; this.buf = null; this.readbuf = null; this.reading = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearBodyInternal File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
clearBodyInternal
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
private static final native long nativeCreate(byte[] data, int offset, int size);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeCreate File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeCreate
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public void fling(float vel, boolean expand) { GestureRecorder gr = ((PhoneStatusBarView) mBar).mBar.getGestureRecorder(); if (gr != null) { gr.tag("fling " + ((vel > 0) ? "open" : "closed"), "notifications,v=" + vel); } super.fling(vel, expand); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fling 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
fling
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteAlarmFinish File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
noteAlarmFinish
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
protected boolean isAtmosphereAvailable() { return atmosphereAvailable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAtmosphereAvailable File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
isAtmosphereAvailable
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
public void deleteVersions(String space, String page, String v1, String v2) { gotoPage(space, page, "deleteversions", "rev1", v1, "rev2", v2, "confirm", "1"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteVersions File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
deleteVersions
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public FieldDeserializer createFieldDeserializer(ParserConfig mapping, // JavaBeanInfo beanInfo, // FieldInfo fieldInfo) { Class<?> clazz = beanInfo.clazz; Class<?> fieldClass = fieldInfo.fieldClass; Class<?> deserializeUsing = null; JSONField annotation = fieldInfo.getAnnotation(); if (annotation != null) { deserializeUsing = annotation.deserializeUsing(); if (deserializeUsing == Void.class) { deserializeUsing = null; } } if (deserializeUsing == null && (fieldClass == List.class || fieldClass == ArrayList.class)) { return new ArrayListTypeFieldDeserializer(mapping, clazz, fieldInfo); } return new DefaultFieldDeserializer(mapping, clazz, fieldInfo); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFieldDeserializer 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
createFieldDeserializer
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
void columnVisibilityChanged(ColumnVisibilityChangeEvent event);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: columnVisibilityChanged 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
columnVisibilityChanged
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public void visit(ModifiedFile file) { if (!includeModifiedFiles) { return; } Map<String, Object> jsonMap = new LinkedHashMap<>(); jsonMap.put("action", file.getAction().toString()); jsonMap.put("fileName", file.getFileName()); modifiedFilesJson.add(jsonMap); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: visit File: server/src/main/java/com/thoughtworks/go/server/presentation/models/MaterialRevisionsJsonBuilder.java Repository: gocd The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-28629
MEDIUM
5.4
gocd
visit
server/src/main/java/com/thoughtworks/go/server/presentation/models/MaterialRevisionsJsonBuilder.java
95f758229d419411a38577608709d8552cccf193
0
Analyze the following code function for security vulnerabilities
public com.xpn.xwiki.api.Document newDocument(Class<?> customClass, XWikiContext context) { if (customClass != null) { try { Class<?>[] classes = new Class[] { XWikiDocument.class, XWikiContext.class }; Object[] args = new Object[] { this, context }; return (com.xpn.xwiki.api.Document) customClass.getConstructor(classes).newInstance(args); } catch (Exception e) { LOGGER.error("Failed to create a custom Document object", e); } } return new com.xpn.xwiki.api.Document(this, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
newDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public static boolean isBreaking(XMLTag tag) { return breakingTags.contains(tag.name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBreaking File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
isBreaking
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
public String getOAuth2ThirdLoginURL() { return CONF.oauthAuthorizationUrl("third") + "?" + "response_type=code&client_id=" + CONF.oauthAppId("third") + "&scope=" + CONF.oauthScope("third") + "&state=" + getParaAppId() + "&redirect_uri=" + getParaEndpoint() + "/oauth2_auth"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOAuth2ThirdLoginURL File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getOAuth2ThirdLoginURL
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static boolean isRestricted(Context context, DSpaceObject o) throws SQLException { List<ResourcePolicy> policies = AuthorizeManager .getPoliciesActionFilter(context, o, Constants.READ); for (ResourcePolicy rp : policies) { if (rp.isDateValid()) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRestricted File: dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java Repository: DSpace The code follows secure coding practices.
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
isRestricted
dspace-jspui/src/main/java/org/dspace/app/webui/util/RequestItemManager.java
28eb8158210d41168a62ed5f9e044f754513bc37
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting protected Collection<String> initToRecipients(final String fullSenderAddress, final String[] replyToAddresses, final String[] inToAddresses) { // The To recipient is the reply-to address specified in the original // message, unless it is: // the current user OR a custom from of the current user, in which case // it's the To recipient list of the original message. // OR missing, in which case use the sender of the original message Set<String> toAddresses = Sets.newHashSet(); for (final String replyToAddress : replyToAddresses) { if (!TextUtils.isEmpty(replyToAddress) && !recipientMatchesThisAccount(replyToAddress)) { toAddresses.add(replyToAddress); } } if (toAddresses.size() == 0) { // In this case, the user is replying to a message in which their // current account or some of their custom from addresses are the only // recipients and they sent the original message. if (inToAddresses.length == 1 && recipientMatchesThisAccount(fullSenderAddress) && recipientMatchesThisAccount(inToAddresses[0])) { toAddresses.add(inToAddresses[0]); return toAddresses; } // This happens if the user replies to a message they originally // wrote. In this case, "reply" really means "re-send," so we // target the original recipients. This works as expected even // if the user sent the original message to themselves. for (String address : inToAddresses) { if (!recipientMatchesThisAccount(address)) { toAddresses.add(address); } } } return toAddresses; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initToRecipients File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
initToRecipients
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public void show(FragmentManager manager, String tag) { if (manager.findFragmentByTag(tag) == null) { // Prevent opening multiple dialogs if tapped on button quickly super.show(manager, tag); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: show File: src/com/android/settings/password/ChooseLockGeneric.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
show
src/com/android/settings/password/ChooseLockGeneric.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
@CalledByNative public int getPhysicalBackingWidthPix() { return mPhysicalBackingWidthPix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPhysicalBackingWidthPix File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getPhysicalBackingWidthPix
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@CriticalNative private static final native int nativeGetAttributeDataType(long state, int idx);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetAttributeDataType File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeGetAttributeDataType
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
boolean doRemoveIfNoThreadInternal(int pid, ProcessRecord app) { if (app == null || app.getThread() != null) { return false; } return doRemoveInternal(pid, app); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doRemoveIfNoThreadInternal 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
doRemoveIfNoThreadInternal
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public boolean isUniqueIndexesEnabled() { return myUniqueIndexesEnabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUniqueIndexesEnabled 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
isUniqueIndexesEnabled
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public static boolean contains(Collection<File> dirs, File file) { for (File dir : dirs) { if (contains(dir, file)) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: contains File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
contains
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
@Override public UserSessionModel loadUserSession(RealmModel realm, String userSessionId, boolean offline) { String offlineStr = offlineToString(offline); TypedQuery<PersistentUserSessionEntity> userSessionQuery = em.createNamedQuery("findUserSession", PersistentUserSessionEntity.class); userSessionQuery.setParameter("realmId", realm.getId()); userSessionQuery.setParameter("offline", offlineStr); userSessionQuery.setParameter("userSessionId", userSessionId); userSessionQuery.setMaxResults(1); Stream<PersistentUserSessionAdapter> persistentUserSessions = closing(userSessionQuery.getResultStream().map(this::toAdapter)); return persistentUserSessions.findAny().map(userSession -> { TypedQuery<PersistentClientSessionEntity> clientSessionQuery = em.createNamedQuery("findClientSessionsByUserSession", PersistentClientSessionEntity.class); clientSessionQuery.setParameter("userSessionId", Collections.singleton(userSessionId)); clientSessionQuery.setParameter("offline", offlineStr); Set<String> removedClientUUIDs = new HashSet<>(); closing(clientSessionQuery.getResultStream()).forEach(clientSession -> { boolean added = addClientSessionToAuthenticatedClientSessionsIfPresent(userSession, clientSession); if (!added) { // client was removed in the meantime removedClientUUIDs.add(clientSession.getClientId()); } } ); removedClientUUIDs.forEach(this::onClientRemoved); return userSession; }).orElse(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadUserSession File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
loadUserSession
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
0
Analyze the following code function for security vulnerabilities
void startSetupActivityLocked() { // Only do this once per boot. if (mCheckedForSetup) { return; } // We will show this screen if the current one is a different // version than the last one shown, and we are not running in // low-level factory test mode. final ContentResolver resolver = mContext.getContentResolver(); if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL && Settings.Global.getInt(resolver, Settings.Global.DEVICE_PROVISIONED, 0) != 0) { mCheckedForSetup = true; // See if we should be showing the platform update setup UI. Intent intent = new Intent(Intent.ACTION_UPGRADE_SETUP); List<ResolveInfo> ris = mContext.getPackageManager() .queryIntentActivities(intent, PackageManager.GET_META_DATA); // We don't allow third party apps to replace this. ResolveInfo ri = null; for (int i=0; ris != null && i<ris.size(); i++) { if ((ris.get(i).activityInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { ri = ris.get(i); break; } } if (ri != null) { String vers = ri.activityInfo.metaData != null ? ri.activityInfo.metaData.getString(Intent.METADATA_SETUP_VERSION) : null; if (vers == null && ri.activityInfo.applicationInfo.metaData != null) { vers = ri.activityInfo.applicationInfo.metaData.getString( Intent.METADATA_SETUP_VERSION); } String lastVers = Settings.Secure.getString( resolver, Settings.Secure.LAST_SETUP_SHOWN); if (vers != null && !vers.equals(lastVers)) { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setComponent(new ComponentName( ri.activityInfo.packageName, ri.activityInfo.name)); mStackSupervisor.startActivityLocked(null, intent, null, ri.activityInfo, null, null, null, null, 0, 0, 0, null, 0, 0, 0, null, false, null, null, null); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startSetupActivityLocked 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
startSetupActivityLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void deleteAsAuthor() throws XWikiException { XWikiContext xcontext = getXWikiContext(); DocumentReference author = getEffectiveAuthorReference(); if (hasAccess(Right.DELETE, author)) { DocumentReference currentUser = xcontext.getUserReference(); try { xcontext.setUserReference(author); deleteDocument(); } finally { xcontext.setUserReference(currentUser); } } else { java.lang.Object[] args = { author, xcontext.getDoc(), this.getFullName() }; throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_DENIED, "Access denied; user {0}, acting through script in document {1} cannot delete document {2}", null, args); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteAsAuthor 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
deleteAsAuthor
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
private List<LogFile> getMemLogFiles(MemoryAppender memAppender) { try { final long logsSize = memAppender.getLogsSize(); if (logsSize == 0) { return List.of(); } return List.of(new LogFile(IN_MEMORY_LOGFILE_ID, "server.mem.log", logsSize, Instant.now())); } catch (Exception e) { LOG.warn("Failed to get logs from MemoryAppender <{}>", memAppender.getName(), e); return List.of(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMemLogFiles File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
getMemLogFiles
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
private GeneratedTemplate generateAmwTemplateModel(Configuration cfg, TemplateDescriptorEntity template, AmwTemplateModel model) throws TemplateException, IOException { // If the template has a target path and is // therefore not only a // nested template pattern, generate it! String targetPath = ""; String fileContent = ""; logStartTemplateGeneration(template); if (template.getName() != null) { if (template.getTargetPath() != null && !template.getTargetPath().isEmpty()) { // Process targetPath the name can contain properties as well Writer targetPathWriter = new StringWriter(); freemarker.template.Template targetPathTemplate = cfg.getTemplate(template.getName() + FILEPATH_PLACEHOLDER); targetPathTemplate.process(model, targetPathWriter); targetPathWriter.flush(); targetPath = targetPathWriter.toString(); cfg.clearTemplateCache(); ((StringTemplateLoader) cfg.getTemplateLoader()).putTemplate(template.getName() + FILEPATH_PLACEHOLDER, targetPath); } // Process file content Writer fileContentWriter = new StringWriter(); freemarker.template.Template fileContentTemplate = cfg.getTemplate(template.getName()); fileContentTemplate.process(model, fileContentWriter); fileContentWriter.flush(); fileContent = fileContentWriter.toString(); cfg.clearTemplateCache(); ((StringTemplateLoader) cfg.getTemplateLoader()).putTemplate(template.getName(), fileContent); } // replace "escaping annotations" with value fileContent = fileContent.replace("@@{", "${"); logFinishedTemplateGeneration(template); GeneratedTemplate generatedTemplate = new GeneratedTemplate(template.getName(), targetPath, fileContent); generatedTemplate.setTemplateEntity(template); return generatedTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateAmwTemplateModel File: AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java Repository: liimaorg/liima The code follows secure coding practices.
[ "CWE-917" ]
CVE-2023-26092
CRITICAL
9.8
liimaorg/liima
generateAmwTemplateModel
AMW_business/src/main/java/ch/puzzle/itc/mobiliar/business/generator/control/extracted/templates/BaseTemplateProcessor.java
78ba2e198c615dc8858e56eee3290989f0362686
0
Analyze the following code function for security vulnerabilities
private String getFinancedDeviceKioskRoleHolderOnAnyUser() { return getRoleHolderPackageNameOnUser( RoleManager.ROLE_FINANCED_DEVICE_KIOSK, UserHandle.USER_ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFinancedDeviceKioskRoleHolderOnAnyUser 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
getFinancedDeviceKioskRoleHolderOnAnyUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public DomNode cloneNode(final boolean deep) { final DomNode newnode; try { newnode = (DomNode) clone(); } catch (final CloneNotSupportedException e) { throw new IllegalStateException("Clone not supported for node [" + this + "]", e); } newnode.parent_ = null; newnode.nextSibling_ = null; newnode.previousSibling_ = null; newnode.scriptObject_ = null; newnode.firstChild_ = null; newnode.attachedToPage_ = false; // if deep, clone the children too. if (deep) { for (DomNode child = firstChild_; child != null; child = child.nextSibling_) { newnode.appendChild(child.cloneNode(true)); } } return newnode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cloneNode File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
cloneNode
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
void enforceShellRestriction(String restriction, int callingUid, int userHandle) { if (callingUid == Process.SHELL_UID) { if (userHandle >= 0 && sUserManager.hasUserRestriction(restriction, userHandle)) { throw new SecurityException("Shell does not have permission to access user " + userHandle); } else if (userHandle < 0) { Slog.e(TAG, "Unable to check shell permission for user " + userHandle + "\n\t" + Debug.getCallers(3)); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceShellRestriction File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
enforceShellRestriction
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@TestOnly public List<String> submoduleFolders() { CommandLine gitCmd = gitWd().withArgs("submodule", "status"); ConsoleResult result = runOrBomb(gitCmd); return submoduleFolders(result.output()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: submoduleFolders File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
submoduleFolders
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0