instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static byte[] cloneArray(byte[] in) { if (in == null) { throw new NullPointerException("in == null"); } byte[] out = new byte[in.length]; for (int i = 0; i < in.length; i++) { out[i] = in[i]; } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cloneArray File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
cloneArray
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
@Override @Transactional( readOnly = true ) public Program getProgram( long id ) { return programStore.get( id ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProgram File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getProgram
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0
Analyze the following code function for security vulnerabilities
private boolean isCallerDevicePolicyManagementRoleHolder(CallerIdentity caller) { return doesCallerHoldRole(caller, RoleManager.ROLE_DEVICE_POLICY_MANAGEMENT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCallerDevicePolicyManagementRoleHolder 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
isCallerDevicePolicyManagementRoleHolder
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setDockerImage(String dockerImage) { this.dockerImage = dockerImage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDockerImage File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
setDockerImage
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
protected boolean select(final Object itemId, boolean refresh) { if (itemId == null) { return deselect(getSelectedRow()); } checkItemIdExists(itemId); final Object selectedRow = getSelectedRow(); final boolean modified = selection.add(itemId); if (modified) { final Collection<Object> deselected; if (selectedRow != null) { deselectInternal(selectedRow, false, true); deselected = Collections.singleton(selectedRow); } else { deselected = Collections.emptySet(); } fireSelectionEvent(deselected, selection); } if (refresh) { refreshRow(itemId); } return modified; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: select 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
select
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public void reportFailedPasswordAttempt(int userHandle) { Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization(hasCallingOrSelfPermission(BIND_DEVICE_ADMIN)); if (!isSeparateProfileChallengeEnabled(userHandle)) { Preconditions.checkCallAuthorization(!isManagedProfile(userHandle), "You can not report failed password attempt if separate profile challenge is " + "not in place for a managed profile, userId = %d", userHandle); } boolean wipeData = false; ActiveAdmin strictestAdmin = null; final long ident = mInjector.binderClearCallingIdentity(); try { synchronized (getLockObject()) { DevicePolicyData policy = getUserData(userHandle); policy.mFailedPasswordAttempts++; saveSettingsLocked(userHandle); if (mHasFeature) { strictestAdmin = getAdminWithMinimumFailedPasswordsForWipeLocked( userHandle, /* parent */ false); int max = strictestAdmin != null ? strictestAdmin.maximumFailedPasswordsForWipe : 0; if (max > 0 && policy.mFailedPasswordAttempts >= max) { wipeData = true; } sendAdminCommandForLockscreenPoliciesLocked( DeviceAdminReceiver.ACTION_PASSWORD_FAILED, DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, userHandle); } } } finally { mInjector.binderRestoreCallingIdentity(ident); } if (wipeData && strictestAdmin != null) { final int userId = getUserIdToWipeForFailedPasswords(strictestAdmin); Slogf.i(LOG_TAG, "Max failed password attempts policy reached for admin: " + strictestAdmin.info.getComponent().flattenToShortString() + ". Calling wipeData for user " + userId); // Attempt to wipe the device/user/profile associated with the admin, as if the // admin had called wipeData(). That way we can check whether the admin is actually // allowed to wipe the device (e.g. a regular device admin shouldn't be able to wipe the // device if the device owner has set DISALLOW_FACTORY_RESET, but the DO should be // able to do so). // IMPORTANT: Call without holding the lock to prevent deadlock. try { wipeDataNoLock(strictestAdmin.info.getComponent(), /*flags=*/ 0, /*reason=*/ "reportFailedPasswordAttempt()", getFailedPasswordAttemptWipeMessage(), userId); } catch (SecurityException e) { Slogf.w(LOG_TAG, "Failed to wipe user " + userId + " after max failed password attempts reached.", e); } } if (mInjector.securityLogIsLoggingEnabled()) { SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT, /*result*/ 0, /*method strength*/ 1); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportFailedPasswordAttempt 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
reportFailedPasswordAttempt
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean hasDoc() { return !Strings.isNullOrEmpty(getDoc()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasDoc File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
hasDoc
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
private final void _finishChunkedText() throws IOException { char[] outBuf = _textBuffer.emptyAndGetCurrentSegment(); int outPtr = 0; final int[] codes = UTF8_UNIT_CODES; int outEnd = outBuf.length; final byte[] input = _inputBuffer; _chunkEnd = _inputPtr; _chunkLeft = 0; while (true) { // at byte boundary fine to get break marker, hence different: if (_inputPtr >= _chunkEnd) { // end of chunk? get a new one, if there is one; if not, we are done if (_chunkLeft == 0) { int len = _decodeChunkLength(CBORConstants.MAJOR_TYPE_TEXT); if (len < 0) { // fine at this point (but not later) break; } _chunkLeft = len; int end = _inputPtr + len; if (end <= _inputEnd) { // all within buffer _chunkLeft = 0; _chunkEnd = end; } else { // stretches beyond _chunkLeft = (end - _inputEnd); _chunkEnd = _inputEnd; } } // besides of which just need to ensure there's content if (_inputPtr >= _inputEnd) { // end of buffer, but not necessarily chunk loadMoreGuaranteed(); int end = _inputPtr + _chunkLeft; if (end <= _inputEnd) { // all within buffer _chunkLeft = 0; _chunkEnd = end; } else { // stretches beyond _chunkLeft = (end - _inputEnd); _chunkEnd = _inputEnd; } } } int c = input[_inputPtr++] & 0xFF; int code = codes[c]; if (code == 0 && outPtr < outEnd) { outBuf[outPtr++] = (char) c; continue; } switch (code) { case 0: break; case 1: // 2-byte UTF { int d = _nextChunkedByte(); if ((d & 0xC0) != 0x080) { _reportInvalidOther(d & 0xFF, _inputPtr); } c = ((c & 0x1F) << 6) | (d & 0x3F); } break; case 2: // 3-byte UTF c = _decodeChunkedUTF8_3(c); break; case 3: // 4-byte UTF c = _decodeChunkedUTF8_4(c); // Let's add first part right away: if (outPtr >= outBuf.length) { outBuf = _textBuffer.finishCurrentSegment(); outPtr = 0; outEnd = outBuf.length; } outBuf[outPtr++] = (char) (0xD800 | (c >> 10)); c = 0xDC00 | (c & 0x3FF); // And let the other char output down below break; default: // Is this good enough error message? _reportInvalidChar(c); } // Need more room? if (outPtr >= outEnd) { outBuf = _textBuffer.finishCurrentSegment(); outPtr = 0; outEnd = outBuf.length; } // Ok, let's add char to output: outBuf[outPtr++] = (char) c; } _textBuffer.setCurrentLength(outPtr); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _finishChunkedText 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
_finishChunkedText
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
private CallerIdentity getCallerIdentity() { return getCallerIdentity(null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallerIdentity 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
getCallerIdentity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private static boolean validateBssidPattern( Pair<MacAddress, MacAddress> bssidPatternMatcher) { if (bssidPatternMatcher == null) return true; MacAddress baseAddress = bssidPatternMatcher.first; MacAddress mask = bssidPatternMatcher.second; if (baseAddress.getAddressType() != MacAddress.TYPE_UNICAST) { Log.e(TAG, "validateBssidPatternMatcher failed : invalid base address: " + baseAddress); return false; } if (mask.equals(ALL_ZEROS_MAC_ADDRESS) && !baseAddress.equals(ALL_ZEROS_MAC_ADDRESS)) { Log.e(TAG, "validateBssidPatternMatcher failed : invalid mask/base: " + mask + "/" + baseAddress); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateBssidPattern File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validateBssidPattern
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
Rect getFrame() { return mWindowFrames.mFrame; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFrame 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
getFrame
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public Builder setTokenServerUrl(GenericUrl tokenServerUrl) { this.tokenServerUrl = Preconditions.checkNotNull(tokenServerUrl); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTokenServerUrl File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
setTokenServerUrl
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
public @Nullable Blob getBlob(String columnName) throws SQLException { return getBlob(findColumn(columnName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBlob 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
getBlob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public long getYoungestFileModificationTime() { return youngestFileModificationTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getYoungestFileModificationTime File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
getYoungestFileModificationTime
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
public void setSystemMessage(String message) throws IOException { this.systemMessage = message; save(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSystemMessage File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
setSystemMessage
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalSetOffloadPolicies(OffloadPoliciesImpl offloadPolicies) { return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new); topicPolicies.setOffloadPolicies(offloadPolicies); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies); }).thenCompose(__ -> { //The policy update is asynchronous. Cache at this step may not be updated yet. //So we need to set the loader by the incoming offloadPolicies instead of topic policies cache. PartitionedTopicMetadata metadata = fetchPartitionedTopicMetadata(pulsar(), topicName); if (metadata.partitions > 0) { List<CompletableFuture<Void>> futures = new ArrayList<>(metadata.partitions); for (int i = 0; i < metadata.partitions; i++) { futures.add(internalUpdateOffloadPolicies(offloadPolicies, topicName.getPartition(i))); } return FutureUtil.waitForAll(futures); } else { return internalUpdateOffloadPolicies(offloadPolicies, topicName); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetOffloadPolicies File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetOffloadPolicies
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Override public void onServiceConnected(ComponentName className, IBinder service) { XmppConnectionBinder binder = (XmppConnectionBinder) service; xmppConnectionService = binder.getService(); xmppConnectionServiceBound = true; registerListeners(); onBackendConnected(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onServiceConnected File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onServiceConnected
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private String getDebugVersionOfString(String mess) { // If we have put the Service into debug mode we // will wrap all the messages in a marker. boolean debugMode = Config.get().getBoolean("java.l10n_debug"); if (debugMode) { StringBuilder debug = new StringBuilder(); String marker = Config.get().getString("java.l10n_debug_marker", "$$$"); debug.append(marker); debug.append(mess); debug.append(marker); mess = debug.toString(); } return mess; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDebugVersionOfString File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
getDebugVersionOfString
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
@Override public String getShortDescription() { if(note != null) { return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, note); } else { return Messages.Cause_RemoteCause_ShortDescription(addr); } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2014-2067 - Severity: LOW - CVSS Score: 3.5 Description: [FIXED SECURITY-74] Apply markup formatter to remote cause note. Function: getShortDescription File: core/src/main/java/hudson/model/Cause.java Repository: jenkinsci/jenkins Fixed Code: @Override public String getShortDescription() { if(note != null) { try { return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, Jenkins.getInstance().getMarkupFormatter().translate(note)); } catch (IOException x) { // ignore } } return Messages.Cause_RemoteCause_ShortDescription(addr); }
[ "CWE-79" ]
CVE-2014-2067
LOW
3.5
jenkinsci/jenkins
getShortDescription
core/src/main/java/hudson/model/Cause.java
5d57c855f3147bfc5e7fda9252317b428a700014
1
Analyze the following code function for security vulnerabilities
@Override public void browserExecute(final PeerComponent browserPeer, final String javaScript) { final AndroidImplementation.AndroidBrowserComponent bc = (AndroidImplementation.AndroidBrowserComponent) browserPeer; execJSSafe(bc.web, javaScript); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: browserExecute 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
browserExecute
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private ModelAndView editGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String groupName = request.getParameter("groupName"); WebGroup group = m_groupRepository.getGroup(groupName); return editGroup(request, group); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editGroup File: opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352", "CWE-79" ]
CVE-2021-25929
LOW
3.5
OpenNMS/opennms
editGroup
opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java
eb08b5ed4c5548f3e941a1f0d0363ae4439fa98c
0
Analyze the following code function for security vulnerabilities
private FlippingStrategy parseFlipStrategy(Element flipStrategyTag, String uid) { NamedNodeMap nnm = flipStrategyTag.getAttributes(); FlippingStrategy flipStrategy; if (nnm.getNamedItem(FLIPSTRATEGY_ATTCLASS) == null) { throw new IllegalArgumentException("Error syntax in configuration file : '" + FLIPSTRATEGY_ATTCLASS + "' is required for each flipstrategy (feature=" + uid + ")"); } try { // Attribute CLASS String clazzName = nnm.getNamedItem(FLIPSTRATEGY_ATTCLASS).getNodeValue(); flipStrategy = (FlippingStrategy) Class.forName(clazzName).newInstance(); // LIST OF PARAMS Map<String, String> parameters = new LinkedHashMap<String, String>(); NodeList initparamsNodes = flipStrategyTag.getElementsByTagName(FLIPSTRATEGY_PARAMTAG); for (int k = 0; k < initparamsNodes.getLength(); k++) { Element param = (Element) initparamsNodes.item(k); NamedNodeMap nnmap = param.getAttributes(); // Check for required attribute name String currentParamName; if (nnmap.getNamedItem(FLIPSTRATEGY_PARAMNAME) == null) { throw new IllegalArgumentException(ERROR_SYNTAX_IN_CONFIGURATION_FILE + "'name' is required for each param in flipstrategy(check " + uid + ")"); } currentParamName = nnmap.getNamedItem(FLIPSTRATEGY_PARAMNAME).getNodeValue(); // Check for value attribute if (nnmap.getNamedItem(FLIPSTRATEGY_PARAMVALUE) != null) { parameters.put(currentParamName, unEscapeXML( nnmap.getNamedItem(FLIPSTRATEGY_PARAMVALUE) .getNodeValue())); } else if (param.getFirstChild() != null) { parameters.put(currentParamName, unEscapeXML( param.getFirstChild().getNodeValue())); } else { throw new IllegalArgumentException("Parameter '" + currentParamName + "' in feature '" + uid + "' has no value, please check XML"); } } flipStrategy.init(uid, parameters); } catch (Exception e) { throw new IllegalArgumentException("An error occurs during flipstrategy parsing TAG" + uid, e); } return flipStrategy; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2022-44262 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix: Validate FlippingStrategy in various parsers (#624) Function: parseFlipStrategy File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java Repository: ff4j Fixed Code: private FlippingStrategy parseFlipStrategy(Element flipStrategyTag, String uid) { NamedNodeMap nnm = flipStrategyTag.getAttributes(); FlippingStrategy flipStrategy; if (nnm.getNamedItem(FLIPSTRATEGY_ATTCLASS) == null) { throw new IllegalArgumentException("Error syntax in configuration file : '" + FLIPSTRATEGY_ATTCLASS + "' is required for each flipstrategy (feature=" + uid + ")"); } try { // Attribute CLASS String clazzName = nnm.getNamedItem(FLIPSTRATEGY_ATTCLASS).getNodeValue(); Class<?> typeClass = Class.forName(clazzName); if (!FlippingStrategy.class.isAssignableFrom(typeClass)) { throw new IllegalArgumentException("Cannot create flipstrategy <" + clazzName + "> invalid type"); } flipStrategy = (FlippingStrategy) typeClass.newInstance(); // LIST OF PARAMS Map<String, String> parameters = new LinkedHashMap<String, String>(); NodeList initparamsNodes = flipStrategyTag.getElementsByTagName(FLIPSTRATEGY_PARAMTAG); for (int k = 0; k < initparamsNodes.getLength(); k++) { Element param = (Element) initparamsNodes.item(k); NamedNodeMap nnmap = param.getAttributes(); // Check for required attribute name String currentParamName; if (nnmap.getNamedItem(FLIPSTRATEGY_PARAMNAME) == null) { throw new IllegalArgumentException(ERROR_SYNTAX_IN_CONFIGURATION_FILE + "'name' is required for each param in flipstrategy(check " + uid + ")"); } currentParamName = nnmap.getNamedItem(FLIPSTRATEGY_PARAMNAME).getNodeValue(); // Check for value attribute if (nnmap.getNamedItem(FLIPSTRATEGY_PARAMVALUE) != null) { parameters.put(currentParamName, unEscapeXML( nnmap.getNamedItem(FLIPSTRATEGY_PARAMVALUE) .getNodeValue())); } else if (param.getFirstChild() != null) { parameters.put(currentParamName, unEscapeXML( param.getFirstChild().getNodeValue())); } else { throw new IllegalArgumentException("Parameter '" + currentParamName + "' in feature '" + uid + "' has no value, please check XML"); } } flipStrategy.init(uid, parameters); } catch (Exception e) { throw new IllegalArgumentException("An error occurs during flipstrategy parsing TAG" + uid, e); } return flipStrategy; }
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
parseFlipStrategy
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
991df72725f78adbc413d9b0fbb676201f1882e0
1
Analyze the following code function for security vulnerabilities
@Override public void updateActivityUsageStats(ComponentName activity, int userId, int event, IBinder appToken, ComponentName taskRoot) { ActivityManagerService.this.updateActivityUsageStats(activity, userId, event, appToken, taskRoot); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateActivityUsageStats 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
updateActivityUsageStats
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Test public void getByIdAsString(TestContext context) { Async async = context.async(); String uuid = randomUuid(); postgresClient = createFoo(context); postgresClient.save(FOO, uuid, xPojo, res -> { assertSuccess(context, res); String id = res.result(); postgresClient.getByIdAsString(FOO, id, get -> { assertSuccess(context, get); context.assertTrue(get.result().contains("\"key\"")); context.assertTrue(get.result().contains(":")); context.assertTrue(get.result().contains("\"x\"")); async.complete(); }); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByIdAsString File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
getByIdAsString
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void parseTechnology(final Node root) throws GameParseException { parseTechnologies(getSingleChild("technologies", root, true)); parsePlayerTech(getChildren("playerTech", root)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseTechnology File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseTechnology
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
void notifyAppResumed(boolean wasStopped) { if (getParent() == null) { Slog.w(TAG_WM, "Attempted to notify resumed of non-existing app token: " + token); return; } ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppResumed: wasStopped=%b %s", wasStopped, this); mAppStopped = false; // Allow the window to turn the screen on once the app is resumed again. setCurrentLaunchCanTurnScreenOn(true); if (!wasStopped) { destroySurfaces(true /*cleanupOnResume*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyAppResumed 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
notifyAppResumed
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void setIssuedByInUse(boolean issuedByInUse) { this.issuedByInUse = issuedByInUse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIssuedByInUse File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setIssuedByInUse
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected void internalExpireMessagesByPosition(AsyncResponse asyncResponse, String subName, boolean authoritative, MessageIdImpl messageId, boolean isExcluded, int batchIndex) { if (topicName.isGlobal()) { try { validateGlobalNamespaceOwnership(namespaceName); } catch (Exception e) { log.warn("[{}][{}] Failed to expire messages on subscription {} to position {}: {}", clientAppId(), topicName, subName, messageId, e.getMessage()); resumeAsyncResponseExceptionally(asyncResponse, e); return; } } validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.EXPIRE_MESSAGES); log.info("[{}][{}] received expire messages on subscription {} to position {}", clientAppId(), topicName, subName, messageId); // If the topic name is a partition name, no need to get partition topic metadata again if (!topicName.isPartitioned() && getPartitionedTopicMetadata(topicName, authoritative, false).partitions > 0) { log.warn("[{}] Not supported operation expire message up to {} on partitioned-topic {} {}", clientAppId(), messageId, topicName, subName); asyncResponse.resume(new RestException(Status.METHOD_NOT_ALLOWED, "Expire message at position is not supported for partitioned-topic")); return; } else if (messageId.getPartitionIndex() != topicName.getPartitionIndex()) { log.warn("[{}] Invalid parameter for expire message by position, partition index of passed in message" + " position {} doesn't match partition index of topic requested {}.", clientAppId(), messageId, topicName); asyncResponse.resume(new RestException(Status.PRECONDITION_FAILED, "Invalid parameter for expire message by position, partition index of message position " + "passed in doesn't match partition index for the topic.")); } else { PersistentTopic topic = (PersistentTopic) getTopicReference(topicName); if (topic == null) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Topic not found")); return; } try { PersistentSubscription sub = topic.getSubscription(subName); if (sub == null) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Subscription not found")); return; } CompletableFuture<Integer> batchSizeFuture = new CompletableFuture<>(); getEntryBatchSize(batchSizeFuture, topic, messageId, batchIndex); batchSizeFuture.thenAccept(bi -> { PositionImpl position = calculatePositionAckSet(isExcluded, bi, batchIndex, messageId); boolean issued; try { if (subName.startsWith(topic.getReplicatorPrefix())) { String remoteCluster = PersistentReplicator.getRemoteCluster(subName); PersistentReplicator repl = (PersistentReplicator) topic.getPersistentReplicator(remoteCluster); checkNotNull(repl); issued = repl.expireMessages(position); } else { checkNotNull(sub); issued = sub.expireMessages(position); } if (issued) { log.info("[{}] Message expire started up to {} on {} {}", clientAppId(), position, topicName, subName); } else { if (log.isDebugEnabled()) { log.debug("Expire message by position not issued on topic {} for subscription {} " + "due to ongoing message expiration not finished or subscription " + "almost catch up.", topicName, subName); } throw new RestException(Status.CONFLICT, "Expire message by position not issued on topic " + topicName + " for subscription " + subName + " due to ongoing message expiration" + " not finished or invalid message position provided."); } } catch (NullPointerException npe) { throw new RestException(Status.NOT_FOUND, "Subscription not found"); } catch (Exception exception) { log.error("[{}] Failed to expire messages up to {} on {} with subscription {} {}", clientAppId(), position, topicName, subName, exception); throw new RestException(exception); } }).exceptionally(e -> { log.error("[{}] Failed to expire messages up to {} on {} with subscription {} {}", clientAppId(), messageId, topicName, subName, e); asyncResponse.resume(e); return null; }); } catch (Exception e) { log.warn("[{}][{}] Failed to expire messages up to {} on subscription {} to position {}", clientAppId(), topicName, messageId, subName, messageId, e); resumeAsyncResponseExceptionally(asyncResponse, e); } } asyncResponse.resume(Response.noContent().build()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalExpireMessagesByPosition File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalExpireMessagesByPosition
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
private boolean onTouchEventImpl(MotionEvent event, boolean isTouchHandleEvent) { TraceEvent.begin("onTouchEvent"); try { int eventAction = event.getActionMasked(); if (eventAction == MotionEvent.ACTION_DOWN) { cancelRequestToScrollFocusedEditableNodeIntoView(); } if (SPenSupport.isSPenSupported(mContext)) eventAction = SPenSupport.convertSPenEventAction(eventAction); if (!isValidTouchEventActionForNative(eventAction)) return false; if (mNativeContentViewCore == 0) return false; // A zero offset is quite common, in which case the unnecessary copy should be avoided. MotionEvent offset = null; if (mCurrentTouchOffsetX != 0 || mCurrentTouchOffsetY != 0) { offset = createOffsetMotionEvent(event); event = offset; } final int pointerCount = event.getPointerCount(); final boolean consumed = nativeOnTouchEvent(mNativeContentViewCore, event, event.getEventTime(), eventAction, pointerCount, event.getHistorySize(), event.getActionIndex(), event.getX(), event.getY(), pointerCount > 1 ? event.getX(1) : 0, pointerCount > 1 ? event.getY(1) : 0, event.getPointerId(0), pointerCount > 1 ? event.getPointerId(1) : -1, event.getTouchMajor(), pointerCount > 1 ? event.getTouchMajor(1) : 0, event.getTouchMinor(), pointerCount > 1 ? event.getTouchMinor(1) : 0, event.getOrientation(), pointerCount > 1 ? event.getOrientation(1) : 0, event.getRawX(), event.getRawY(), event.getToolType(0), pointerCount > 1 ? event.getToolType(1) : MotionEvent.TOOL_TYPE_UNKNOWN, event.getButtonState(), event.getMetaState(), isTouchHandleEvent); if (offset != null) offset.recycle(); return consumed; } finally { TraceEvent.end("onTouchEvent"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTouchEventImpl 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
onTouchEventImpl
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
9d343ad2ea6ec395c377a4efa266057155bfa9c1
0
Analyze the following code function for security vulnerabilities
protected String getOCSubjectDataAuditsSql(String studySubjectOids) { return "(select ss.oc_oid as study_subject_oid, ale.audit_id, alet.name, ale.user_id," + " ale.audit_date, ale.reason_for_change, ale.old_value, ale.new_value, ale.audit_log_event_type_id" + " from audit_log_event ale, study_subject ss, audit_log_event_type alet" + " where audit_table = 'subject' and ss.oc_oid in (" + studySubjectOids + ") and ss.subject_id = ale.entity_id" + " and ale.audit_log_event_type_id = alet.audit_log_event_type_id" + " ) union " + " (select ss.oc_oid as study_subject_oid, ale.audit_id, alet.name, ale.user_id," + " ale.audit_date, ale.reason_for_change, ale.old_value, ale.new_value, ale.audit_log_event_type_id" + " from audit_log_event ale, study_subject ss, audit_log_event_type alet" + " where audit_table = 'study_subject' and ss.oc_oid in (" + studySubjectOids + ") and ss.study_subject_id = ale.entity_id" + " and ale.audit_log_event_type_id = alet.audit_log_event_type_id" + " ) union " + " (select ss.oc_oid as study_subject_oid, ale.audit_id, alet.name, ale.user_id," + " ale.audit_date, ale.reason_for_change, ale.old_value, ale.new_value, ale.audit_log_event_type_id" + " from audit_log_event ale, study_subject ss, subject_group_map sgm, audit_log_event_type alet" + " where audit_table = 'subject_group_map' and ss.oc_oid in (" + studySubjectOids + ") and ss.study_subject_id = sgm.study_subject_id" + " and ale.entity_id = sgm.subject_group_map_id and ale.audit_log_event_type_id = alet.audit_log_event_type_id" + " ) order by study_subject_oid, audit_id asc"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOCSubjectDataAuditsSql File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getOCSubjectDataAuditsSql
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
boolean isVoid() { return void.class == returnType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isVoid File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
isVoid
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public void setMenu(boolean menu) { this.menu = menu; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMenu File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-18927
LOW
3.5
sanluan/PublicCMS
setMenu
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java
2b411dc2821c69539138aaf7632b938b659a58fa
0
Analyze the following code function for security vulnerabilities
public void setDescription(String description) { this.description = description; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDescription File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
setDescription
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
public int getThemeResource(int r_attr_name, int r_drawable_def) { int[] attrs = {r_attr_name}; TypedArray ta = this.getTheme().obtainStyledAttributes(attrs); int res = ta.getResourceId(0, r_drawable_def); ta.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getThemeResource File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
getThemeResource
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private GenerationUnitGenerationResult generateTemplatesAmwTemplateModel(Set<TemplateDescriptorEntity> templates, List<GlobalFunctionEntity> globalFunctions, AmwTemplateModel model) throws IOException { //logPropertiesForTemplates(templates, contextualizedMap); AMWTemplateExceptionHandler templateExceptionHandler = new AMWTemplateExceptionHandler(); Configuration cfg = populateConfig(templates, globalFunctions, templateExceptionHandler); GenerationUnitGenerationResult result = new GenerationUnitGenerationResult(); List<GeneratedTemplate> generatedTemplates = new ArrayList<>(); for (TemplateDescriptorEntity template : templates) { try { GeneratedTemplate generatedTemplate = generateAmwTemplateModel(cfg, template, model); generatedTemplate.addAllErrorMessages(templateExceptionHandler.getErrorMessages()); generatedTemplates.add(generatedTemplate); // reset handler templateExceptionHandler.reset(); } catch (TemplateException te) { GeneratedTemplate errorTemplate = new GeneratedTemplate(template.getName(), template.getTargetPath(), ""); //logBeforeException(te, contextualizedMap); errorTemplate.addAllErrorMessages(Collections.singletonList(new TemplatePropertyException( "missing property value or propertydefinition in template. " + te.getMessage(), CAUSE.INVALID_PROPERTY, te))); generatedTemplates.add(errorTemplate); } catch (ParseException pe) { // Validation failed! - was not able to parse the template! GeneratedTemplate errorTemplate = new GeneratedTemplate(template.getName(), template.getTargetPath(), ""); logBeforeException(pe); errorTemplate.addAllErrorMessages(Collections.singletonList(new TemplatePropertyException( "invalid template. " + pe.getMessage(), CAUSE.PROCESSING_EXCEPTION, pe))); generatedTemplates.add(errorTemplate); } catch (IOException ioe) { log.log(Level.WARNING, ioe.getMessage()); throw ioe; } } result.setGeneratedTemplates(generatedTemplates); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateTemplatesAmwTemplateModel 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
generateTemplatesAmwTemplateModel
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
public boolean canEdit(Post showPost, Profile authUser) { return authUser != null ? (authUser.hasBadge(TEACHER) || isMod(authUser) || isMine(showPost, authUser)) : false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canEdit 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
canEdit
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public int getTotalNumOfTrackableAdvertisements() { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); return mAdapterProperties.getTotalNumOfTrackableAdvertisements(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTotalNumOfTrackableAdvertisements File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
getTotalNumOfTrackableAdvertisements
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public Stream<Map.Entry<String, JsonValue>> getObjectStream() { if (currentEvent != Event.START_OBJECT) { throw new IllegalStateException( JsonMessages.PARSER_GETOBJECT_ERR(currentEvent)); } Spliterator<Map.Entry<String, JsonValue>> spliterator = new Spliterators.AbstractSpliterator<Map.Entry<String, JsonValue>>(Long.MAX_VALUE, Spliterator.ORDERED) { @Override public Spliterator<Map.Entry<String,JsonValue>> trySplit() { return null; } @Override public boolean tryAdvance(Consumer<? super Map.Entry<String, JsonValue>> action) { if (action == null) { throw new NullPointerException(); } if (! hasNext()) { return false; } JsonParser.Event e = next(); if (e == JsonParser.Event.END_OBJECT) { return false; } if (e != JsonParser.Event.KEY_NAME) { throw new JsonException(JsonMessages.INTERNAL_ERROR()); } String key = getString(); if (! hasNext()) { throw new JsonException(JsonMessages.INTERNAL_ERROR()); } next(); JsonValue value = getValue(); action.accept(new AbstractMap.SimpleImmutableEntry<>(key, value)); return true; } }; return StreamSupport.stream(spliterator, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectStream File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
getObjectStream
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
public void addListener(@NonNull OnMagnificationChangedListener listener) { addListener(listener, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addListener File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
addListener
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasNavigationBar() { return mHasNavigationBar; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNavigationBar File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
hasNavigationBar
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public Object parseMessageFromBytes( ByteString bytes, ExtensionRegistryLite extensionRegistry, Descriptors.FieldDescriptor field, Message defaultInstance) throws IOException { Message.Builder subBuilder; // When default instance is not null. The field is an extension field. if (defaultInstance != null) { subBuilder = defaultInstance.newBuilderForType(); } else { subBuilder = builder.newBuilderForField(field); } if (!field.isRepeated()) { Message originalMessage = (Message) getField(field); if (originalMessage != null) { subBuilder.mergeFrom(originalMessage); } } subBuilder.mergeFrom(bytes, extensionRegistry); return subBuilder.buildPartial(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseMessageFromBytes File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
parseMessageFromBytes
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
@Override protected ResolveInfo newResult(PackageParser.ServiceIntentInfo filter, int match, int userId) { if (!sUserManager.exists(userId)) return null; final PackageParser.ServiceIntentInfo info = (PackageParser.ServiceIntentInfo)filter; if (!mSettings.isEnabledLPr(info.service.info, mFlags, userId)) { return null; } final PackageParser.Service service = info.service; if (mSafeMode && (service.info.applicationInfo.flags &ApplicationInfo.FLAG_SYSTEM) == 0) { return null; } PackageSetting ps = (PackageSetting) service.owner.mExtras; if (ps == null) { return null; } ServiceInfo si = PackageParser.generateServiceInfo(service, mFlags, ps.readUserState(userId), userId); if (si == null) { return null; } final ResolveInfo res = new ResolveInfo(); res.serviceInfo = si; if ((mFlags&PackageManager.GET_RESOLVED_FILTER) != 0) { res.filter = filter; } res.priority = info.getPriority(); res.preferredOrder = service.owner.mPreferredOrder; res.match = match; res.isDefault = info.hasDefault; res.labelRes = info.labelRes; res.nonLocalizedLabel = info.nonLocalizedLabel; res.icon = info.icon; res.system = res.serviceInfo.applicationInfo.isSystemApp(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newResult 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
newResult
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean getShouldReEnroll() { return mShouldReEnroll; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShouldReEnroll File: core/java/android/service/gatekeeper/GateKeeperResponse.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-0806
HIGH
9.3
android
getShouldReEnroll
core/java/android/service/gatekeeper/GateKeeperResponse.java
b87c968e5a41a1a09166199bf54eee12608f3900
0
Analyze the following code function for security vulnerabilities
public String getBaseUrl() { return base; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseUrl File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getBaseUrl
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private void doScript(StaplerRequest req, StaplerResponse rsp, RequestDispatcher view) throws IOException, ServletException { // ability to run arbitrary script is dangerous checkPermission(RUN_SCRIPTS); String text = req.getParameter("script"); if (text != null) { try { req.setAttribute("output", RemotingDiagnostics.executeGroovy(text, MasterComputer.localChannel)); } catch (InterruptedException e) { throw new ServletException(e); } } view.forward(req, rsp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doScript File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doScript
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private GoogleApiClient getmGoogleApiClient() { if (mGoogleApiClient == null) { mGoogleApiClient = new GoogleApiClient.Builder(AndroidNativeUtil.getContext()) .addApi(LocationServices.API) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .build(); if (!mGoogleApiClient.isConnected()) { mGoogleApiClient.connect(); } } return mGoogleApiClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getmGoogleApiClient File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
getmGoogleApiClient
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public Set<String> getSupportedExtensions() { return SUPPORTED_EXTENSIONS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSupportedExtensions File: src/platform/java/org/conscrypt/TrustManagerImpl.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-345" ]
CVE-2016-0818
MEDIUM
4.3
android
getSupportedExtensions
src/platform/java/org/conscrypt/TrustManagerImpl.java
c4ab1b959280413fb11bf4fd7f6b4c2ba38bd779
0
Analyze the following code function for security vulnerabilities
public int getNumOfAdvertisementInstancesSupported() { enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); return mAdapterProperties.getNumOfAdvertisementInstancesSupported(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNumOfAdvertisementInstancesSupported File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
getNumOfAdvertisementInstancesSupported
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public Reader getCharacterStream() { return fCharStream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCharacterStream File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
getCharacterStream
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
public String getUrl(SysSite site, boolean hasStatic, String url) { if (CommonUtils.empty(url) || url.contains("://") || url.startsWith("/")) { return url; } else { return hasStatic ? site.getSitePath() + url : site.getDynamicPath() + url; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrl File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
getUrl
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
public Builder withRoot(byte[] val) { root = XMSSUtil.cloneArray(val); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withRoot File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
withRoot
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
private void addAdministrationPages() { add(new DynamicPathPageMapper("administration", UserListPage.class)); add(new DynamicPathPageMapper("administration/users", UserListPage.class)); add(new DynamicPathPageMapper("administration/users/new", NewUserPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/profile", UserProfilePage.class)); add(new DynamicPathPageMapper("administration/users/${user}/groups", UserMembershipsPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/authorizations", UserAuthorizationsPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/avatar", UserAvatarPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/password", UserPasswordPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/ssh-keys", UserSshKeysPage.class)); add(new DynamicPathPageMapper("administration/users/${user}/access-token", UserAccessTokenPage.class)); add(new DynamicPathPageMapper("administration/roles", RoleListPage.class)); add(new DynamicPathPageMapper("administration/roles/new", NewRolePage.class)); add(new DynamicPathPageMapper("administration/roles/${role}", RoleDetailPage.class)); add(new DynamicPathPageMapper("administration/groups", GroupListPage.class)); add(new DynamicPathPageMapper("administration/groups/new", NewGroupPage.class)); add(new DynamicPathPageMapper("administration/groups/${group}/profile", GroupProfilePage.class)); add(new DynamicPathPageMapper("administration/groups/${group}/members", GroupMembershipsPage.class)); add(new DynamicPathPageMapper("administration/groups/${group}/authorizations", GroupAuthorizationsPage.class)); add(new DynamicPathPageMapper("administration/settings/system", SystemSettingPage.class)); add(new DynamicPathPageMapper("administration/settings/mail", MailSettingPage.class)); add(new DynamicPathPageMapper("administration/settings/backup", DatabaseBackupPage.class)); add(new DynamicPathPageMapper("administration/settings/security", GeneralSecuritySettingPage.class)); add(new DynamicPathPageMapper("administration/settings/authenticator", AuthenticatorPage.class)); add(new DynamicPathPageMapper("administration/settings/sso-connectors", SsoConnectorListPage.class)); add(new DynamicPathPageMapper("administration/settings/ssh", SshSettingPage.class)); add(new DynamicPathPageMapper("administration/settings/job-executors", JobExecutorsPage.class)); add(new DynamicPathPageMapper("administration/settings/groovy-scripts", GroovyScriptListPage.class)); add(new DynamicPathPageMapper("administration/settings/issue-fields", IssueFieldListPage.class)); add(new DynamicPathPageMapper("administration/settings/issue-states", IssueStateListPage.class)); add(new DynamicPathPageMapper("administration/settings/state-transitions", StateTransitionListPage.class)); add(new DynamicPathPageMapper("administration/settings/issue-boards", DefaultBoardListPage.class)); add(new DynamicPathPageMapper("administration/settings/issue-templates", IssueTemplateListPage.class)); add(new DynamicPathPageMapper("administration/server-log", ServerLogPage.class)); add(new DynamicPathPageMapper("administration/server-information", ServerInformationPage.class)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAdministrationPages File: server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-21242
HIGH
7.5
theonedev/onedev
addAdministrationPages
server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java
f864053176c08f59ef2d97fea192ceca46a4d9be
0
Analyze the following code function for security vulnerabilities
private boolean hasEncounterTypeTag(String xml) throws Exception { Document doc = HtmlFormEntryUtil.stringToDocument(xml); Node formNode = HtmlFormEntryUtil.findChild(doc, "htmlform"); return HtmlFormEntryUtil.findChild(formNode, "encounterType") != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasEncounterTypeTag File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormValidator.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-htmlformentry
hasEncounterTypeTag
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormValidator.java
458597984050461f1c88e4e3a403bf2b060f0844
0
Analyze the following code function for security vulnerabilities
@Override public void run() { mKeyguardBottomArea.setVisibility(View.GONE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run 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
run
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public int getConfiguredDefaultWorkersPerModel() { return getIntProperty(TS_DEFAULT_WORKERS_PER_MODEL, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredDefaultWorkersPerModel File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getConfiguredDefaultWorkersPerModel
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
public final Set<AbstractProject> getTransitiveDownstreamProjects() { return Jenkins.getInstance().getDependencyGraph().getTransitiveDownstream(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransitiveDownstreamProjects File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getTransitiveDownstreamProjects
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@NonNull public ArrayList<Action> getActionsListWithSystemActions() { // Define the system actions we expect to see final Action negativeAction = makeNegativeAction(); final Action answerAction = makeAnswerAction(); // Sort the expected actions into the correct order: // * If there's no answer action, put the hang up / decline action at the end // * Otherwise put the answer action at the end, and put the decline action at start. final Action firstAction = answerAction == null ? null : negativeAction; final Action lastAction = answerAction == null ? negativeAction : answerAction; // Start creating the result list. int nonContextualActionSlotsRemaining = MAX_ACTION_BUTTONS; ArrayList<Action> resultActions = new ArrayList<>(MAX_ACTION_BUTTONS); if (firstAction != null) { resultActions.add(firstAction); --nonContextualActionSlotsRemaining; } // Copy actions into the new list, correcting system actions. if (mBuilder.mActions != null) { for (Notification.Action action : mBuilder.mActions) { if (action.isContextual()) { // Always include all contextual actions resultActions.add(action); } else if (isActionAddedByCallStyle(action)) { // Drop any old versions of system actions } else { // Copy non-contextual actions; decrement the remaining action slots. resultActions.add(action); --nonContextualActionSlotsRemaining; } // If there's exactly one action slot left, fill it with the lastAction. if (nonContextualActionSlotsRemaining == 1) { resultActions.add(lastAction); --nonContextualActionSlotsRemaining; } } } // If there are any action slots left, the lastAction still needs to be added. if (nonContextualActionSlotsRemaining >= 1) { resultActions.add(lastAction); } return resultActions; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActionsListWithSystemActions File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getActionsListWithSystemActions
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void syncIssuesAttachment(IssuesUpdateRequest issuesRequest, File file, AttachmentSyncType syncType);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncIssuesAttachment File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
syncIssuesAttachment
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public final void installSystemProviders() { List<ProviderInfo> providers; synchronized (this) { ProcessRecord app = mProcessNames.get("system", Process.SYSTEM_UID); providers = generateApplicationProvidersLocked(app); if (providers != null) { for (int i=providers.size()-1; i>=0; i--) { ProviderInfo pi = (ProviderInfo)providers.get(i); if ((pi.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) == 0) { Slog.w(TAG, "Not installing system proc provider " + pi.name + ": not system .apk"); providers.remove(i); } } } } if (providers != null) { mSystemThread.installSystemProviders(providers); } mCoreSettingsObserver = new CoreSettingsObserver(this); //mUsageStatsService.monitorPackages(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installSystemProviders 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
installSystemProviders
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public void includeErrorpage(CmsWorkplace wp, Throwable t) throws JspException { CmsLog.getLog(wp).error(Messages.get().getBundle().key(Messages.ERR_WORKPLACE_DIALOG_0), t); getJsp().getRequest().setAttribute(SESSION_WORKPLACE_CLASS, wp); getJsp().getRequest().setAttribute(ATTRIBUTE_THROWABLE, t); getJsp().include(FILE_DIALOG_SCREEN_ERRORPAGE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: includeErrorpage File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
includeErrorpage
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
void setup(Context context) { verifyAndPurgeInvalidPhoneAccounts(context); startSipProfilesAsync(context, (String) null, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setup File: sip/src/com/android/services/telephony/sip/SipAccountRegistry.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
setup
sip/src/com/android/services/telephony/sip/SipAccountRegistry.java
a294ae5342410431a568126183efe86261668b5d
0
Analyze the following code function for security vulnerabilities
@Override public void clearProfileOwner(ComponentName who) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); final int userId = caller.getUserId(); Preconditions.checkCallingUser(!isManagedProfile(userId)); enforceUserUnlocked(userId); synchronized (getLockObject()) { // Check if this is the profile owner who is calling final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); mInjector.binderWithCleanCallingIdentity(() -> { clearProfileOwnerLocked(admin, userId); removeActiveAdminLocked(who, userId); sendOwnerChangedBroadcast(DevicePolicyManager.ACTION_PROFILE_OWNER_CHANGED, userId); }); Slogf.i(LOG_TAG, "Profile owner " + who + " removed from user " + userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearProfileOwner 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
clearProfileOwner
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected void detachLocked() { if (DEBUG_STACK) Slog.d(TAG_STACK, "detachLocked: " + this + " from display=" + mActivityDisplay + " Callers=" + Debug.getCallers(2)); if (mActivityDisplay != null) { mActivityDisplay.detachActivitiesLocked(mStack); mActivityDisplay = null; mStack.mDisplayId = -1; mStack.mStacks = null; mWindowManager.detachStack(mStackId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: detachLocked File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
detachLocked
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public Notification createFromParcel(Parcel parcel) { return new Notification(parcel); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFromParcel File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
createFromParcel
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public Document build(final URL url) throws JDOMException, IOException { try { return getEngine().build(url); } finally { if (!reuseParser) { engine = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: build File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
build
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
AppOpsManager getAppOpsManager() { return mContext.getSystemService(AppOpsManager.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppOpsManager 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
getAppOpsManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void closeSystemDialogs(String reason) { enforceNotIsolatedCaller("closeSystemDialogs"); final int pid = Binder.getCallingPid(); final int uid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); try { synchronized (this) { // Only allow this from foreground processes, so that background // applications can't abuse it to prevent system UI from being shown. if (uid >= Process.FIRST_APPLICATION_UID) { ProcessRecord proc; synchronized (mPidsSelfLocked) { proc = mPidsSelfLocked.get(pid); } if (proc.curRawAdj > ProcessList.PERCEPTIBLE_APP_ADJ) { Slog.w(TAG, "Ignoring closeSystemDialogs " + reason + " from background process " + proc); return; } } closeSystemDialogsLocked(reason); } } finally { Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeSystemDialogs 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
closeSystemDialogs
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private PendingAssistExtras enqueueAssistContext(int requestType, Intent intent, String hint, IAssistDataReceiver receiver, Bundle receiverExtras, IBinder activityToken, boolean checkActivityIsTop, boolean newSessionId, int userHandle, Bundle args, long timeout, int flags) { mAmInternal.enforceCallingPermission(android.Manifest.permission.GET_TOP_ACTIVITY_INFO, "enqueueAssistContext()"); synchronized (mGlobalLock) { final Task rootTask = getTopDisplayFocusedRootTask(); ActivityRecord activity = rootTask != null ? rootTask.getTopNonFinishingActivity() : null; if (activity == null) { Slog.w(TAG, "getAssistContextExtras failed: no top activity"); return null; } if (!activity.attachedToProcess()) { Slog.w(TAG, "getAssistContextExtras failed: no process for " + activity); return null; } if (checkActivityIsTop) { if (activityToken != null) { ActivityRecord caller = ActivityRecord.forTokenLocked(activityToken); if (activity != caller) { Slog.w(TAG, "enqueueAssistContext failed: caller " + caller + " is not current top " + activity); return null; } } } else { activity = ActivityRecord.forTokenLocked(activityToken); if (activity == null) { Slog.w(TAG, "enqueueAssistContext failed: activity for token=" + activityToken + " couldn't be found"); return null; } if (!activity.attachedToProcess()) { Slog.w(TAG, "enqueueAssistContext failed: no process for " + activity); return null; } } PendingAssistExtras pae; Bundle extras = new Bundle(); if (args != null) { extras.putAll(args); } extras.putString(Intent.EXTRA_ASSIST_PACKAGE, activity.packageName); extras.putInt(Intent.EXTRA_ASSIST_UID, activity.app.mUid); pae = new PendingAssistExtras(activity, extras, intent, hint, receiver, receiverExtras, userHandle); pae.isHome = activity.isActivityTypeHome(); // Increment the sessionId if necessary if (newSessionId) { mViSessionId++; } try { activity.app.getThread().requestAssistContextExtras(activity.token, pae, requestType, mViSessionId, flags); mPendingAssistExtras.add(pae); mUiHandler.postDelayed(pae, timeout); } catch (RemoteException e) { Slog.w(TAG, "getAssistContextExtras failed: crash calling " + activity); return null; } return pae; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enqueueAssistContext 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
enqueueAssistContext
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void setMpeg7CatalogService(Mpeg7CatalogService mpeg7CatalogService) { this.mpeg7CatalogService = mpeg7CatalogService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMpeg7CatalogService File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-21318
MEDIUM
5.5
opencast
setMpeg7CatalogService
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
b18c6a7f81f08ed14884592a6c14c9ab611ad450
0
Analyze the following code function for security vulnerabilities
static boolean compareSVNAuthentications(SVNAuthentication a1, SVNAuthentication a2) { if (a1==null && a2==null) return true; if (a1==null || a2==null) return false; if (a1.getClass()!=a2.getClass()) return false; try { return describeBean(a1).equals(describeBean(a2)); } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } catch (NoSuchMethodException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: compareSVNAuthentications File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
compareSVNAuthentications
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public static synchronized void requestThreadWhitelisting(Thread t) { INSTANCE.whitelistThread(t); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestThreadWhitelisting File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2024-23683
HIGH
8.2
ls1intum/Ares
requestThreadWhitelisting
src/main/java/de/tum/in/test/api/security/ArtemisSecurityManager.java
af4f28a56e2fe600d8750b3b415352a0a3217392
0
Analyze the following code function for security vulnerabilities
@JsonProperty("NotValidAfter") public Date getNotValidAfter() { return notValidAfter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNotValidAfter File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getNotValidAfter
base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override protected Boolean doInBackground(Void... unused) { try { KeyChainConnection keyChainConnection = KeyChain.bind(CertInstaller.this); try { return mCredentials.installCaCertsToKeyChain(keyChainConnection.getService()); } finally { keyChainConnection.close(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doInBackground File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
doInBackground
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public boolean revokeKeyPairFromApp(@Nullable ComponentName admin, @NonNull String alias, @NonNull String packageName) { throwIfParentInstance("revokeKeyPairFromApp"); try { return mService.setKeyGrantForApp( admin, mContext.getPackageName(), alias, packageName, false); } catch (RemoteException e) { e.rethrowFromSystemServer(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revokeKeyPairFromApp File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
revokeKeyPairFromApp
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int getBeginColumnNumber() { return fBeginColumnNumber; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBeginColumnNumber File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
getBeginColumnNumber
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) @UnsupportedAppUsage public static ActivityOptions makeRemoteAnimation( RemoteAnimationAdapter remoteAnimationAdapter) { final ActivityOptions opts = new ActivityOptions(); opts.mRemoteAnimationAdapter = remoteAnimationAdapter; opts.mAnimationType = ANIM_REMOTE_ANIMATION; return opts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeRemoteAnimation File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
makeRemoteAnimation
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
@Override public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize, String reportPackage) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(processName); data.writeInt(uid); data.writeLong(maxMemSize); data.writeString(reportPackage); mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDumpHeapDebugLimit File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setDumpHeapDebugLimit
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void setOptions(@NonNull ActivityOptions options) { mLaunchedFromBubble = options.getLaunchedFromBubble(); mPendingOptions = options; if (options.getAnimationType() == ANIM_REMOTE_ANIMATION) { mPendingRemoteAnimation = options.getRemoteAnimationAdapter(); } mPendingRemoteTransition = options.getRemoteTransition(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOptions 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
setOptions
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private final boolean checkUriPermissionLocked(GrantUri grantUri, int uid, final int modeFlags) { final boolean persistable = (modeFlags & Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION) != 0; final int minStrength = persistable ? UriPermission.STRENGTH_PERSISTABLE : UriPermission.STRENGTH_OWNED; // Root gets to do everything. if (uid == 0) { return true; } final ArrayMap<GrantUri, UriPermission> perms = mGrantedUriPermissions.get(uid); if (perms == null) return false; // First look for exact match final UriPermission exactPerm = perms.get(grantUri); if (exactPerm != null && exactPerm.getStrength(modeFlags) >= minStrength) { return true; } // No exact match, look for prefixes final int N = perms.size(); for (int i = 0; i < N; i++) { final UriPermission perm = perms.valueAt(i); if (perm.uri.prefix && grantUri.uri.isPathPrefixMatch(perm.uri.uri) && perm.getStrength(modeFlags) >= minStrength) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkUriPermissionLocked 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
checkUriPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void handleMessage(Message msg) { if (msg.what == MSG_WRITE_STATUS) { synchronized (mAuthorities) { writeStatusLocked(); } } else if (msg.what == MSG_WRITE_STATISTICS) { synchronized (mAuthorities) { writeStatisticsLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
handleMessage
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
static List<Double> getBearing(String bearingString) { if (bearingString == null || bearingString.isEmpty()) return Collections.EMPTY_LIST; String[] bearingArray = bearingString.split(";", -1); List<Double> bearings = new ArrayList<>(bearingArray.length); for (int i = 0; i < bearingArray.length; i++) { String singleBearing = bearingArray[i]; if (singleBearing.isEmpty()) { bearings.add(Double.NaN); } else { if (!singleBearing.contains(",")) { throw new IllegalArgumentException("You passed an invalid bearings parameter " + bearingString); } String[] singleBearingArray = singleBearing.split(","); try { bearings.add(Double.parseDouble(singleBearingArray[0])); } catch (NumberFormatException e) { throw new IllegalArgumentException("You passed an invalid bearings parameter " + bearingString); } } } return bearings; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBearing File: navigation/src/main/java/com/graphhopper/navigation/NavigateResource.java Repository: graphhopper The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-29506
MEDIUM
4
graphhopper
getBearing
navigation/src/main/java/com/graphhopper/navigation/NavigateResource.java
eb189be1fa7443ebf4ae881e737a18f818c95f41
0
Analyze the following code function for security vulnerabilities
public static ActivityOptions makeThumbnailScaleUpAnimation(View source, Bitmap thumbnail, int startX, int startY) { return makeThumbnailScaleUpAnimation(source, thumbnail, startX, startY, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeThumbnailScaleUpAnimation File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
makeThumbnailScaleUpAnimation
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
protected void parseSidNid (String sidStr, String nidStr) { if (sidStr != null) { String[] sid = sidStr.split(","); mHomeSystemId = new int[sid.length]; for (int i = 0; i < sid.length; i++) { try { mHomeSystemId[i] = Integer.parseInt(sid[i]); } catch (NumberFormatException ex) { loge("error parsing system id: " + ex); } } } if (DBG) log("CDMA_SUBSCRIPTION: SID=" + sidStr); if (nidStr != null) { String[] nid = nidStr.split(","); mHomeNetworkId = new int[nid.length]; for (int i = 0; i < nid.length; i++) { try { mHomeNetworkId[i] = Integer.parseInt(nid[i]); } catch (NumberFormatException ex) { loge("CDMA_SUBSCRIPTION: error parsing network id: " + ex); } } } if (DBG) log("CDMA_SUBSCRIPTION: NID=" + nidStr); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseSidNid File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
parseSidNid
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
private void renderEvalScripts(FacesContext context) throws IOException { PartialViewContext pvc = context.getPartialViewContext(); PartialResponseWriter writer = pvc.getPartialResponseWriter(); for (String evalScript : pvc.getEvalScripts()) { writer.startEval(); writer.write(evalScript); writer.endEval(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderEvalScripts File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
renderEvalScripts
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
boolean isNextTransitionForward() { int transit = mWindowManager.getPendingAppTransition(); return transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNextTransitionForward 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
isNextTransitionForward
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public static PolicyConstraintValue fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element pcvElement = document.getDocumentElement(); return fromDOM(pcvElement); }
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: fromXML File: base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java Repository: dogtagpki/pki Fixed Code: public static PolicyConstraintValue fromXML(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(new InputSource(new StringReader(xml))); Element pcvElement = document.getDocumentElement(); return fromDOM(pcvElement); }
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromXML
base/common/src/main/java/com/netscape/certsrv/profile/PolicyConstraintValue.java
16deffdf7548e305507982e246eb9fd1eac414fd
1
Analyze the following code function for security vulnerabilities
private void bindCallerVerification(RemoteViews contentView, StandardTemplateParams p) { String iconContentDescription = null; boolean showDivider = true; if (mVerificationIcon != null) { contentView.setImageViewIcon(R.id.verification_icon, mVerificationIcon); contentView.setDrawableTint(R.id.verification_icon, false /* targetBackground */, mBuilder.getSecondaryTextColor(p), PorterDuff.Mode.SRC_ATOP); contentView.setViewVisibility(R.id.verification_icon, View.VISIBLE); iconContentDescription = mBuilder.mContext.getString( R.string.notification_verified_content_description); showDivider = false; // the icon replaces the divider } else { contentView.setViewVisibility(R.id.verification_icon, View.GONE); } if (!TextUtils.isEmpty(mVerificationText)) { contentView.setTextViewText(R.id.verification_text, mVerificationText); mBuilder.setTextViewColorSecondary(contentView, R.id.verification_text, p); contentView.setViewVisibility(R.id.verification_text, View.VISIBLE); iconContentDescription = null; // let the app's text take precedence } else { contentView.setViewVisibility(R.id.verification_text, View.GONE); showDivider = false; // no divider if no text } contentView.setContentDescription(R.id.verification_icon, iconContentDescription); if (showDivider) { contentView.setViewVisibility(R.id.verification_divider, View.VISIBLE); mBuilder.setTextViewColorSecondary(contentView, R.id.verification_divider, p); } else { contentView.setViewVisibility(R.id.verification_divider, View.GONE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindCallerVerification File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bindCallerVerification
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public boolean isMeteredDataDisabledPackageForUser(@NonNull ComponentName admin, String packageName, @UserIdInt int userId) { throwIfParentInstance("getMeteredDataDisabledForUser"); if (mService != null) { try { return mService.isMeteredDataDisabledPackageForUser(admin, packageName, userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMeteredDataDisabledPackageForUser File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isMeteredDataDisabledPackageForUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override ActivityRecord asActivityRecord() { // I am an activity record! return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asActivityRecord 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
asActivityRecord
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public String[] getLocales() { synchronized (this) { ensureValidLocked(); return nativeGetLocales(mObject, false /*excludeSystem*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocales File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getLocales
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private void sendNewTaskResultRequestIfNeeded() { if (mStartActivity.resultTo != null && (mLaunchFlags & FLAG_ACTIVITY_NEW_TASK) != 0) { // For whatever reason this activity is being launched into a new task... // yet the caller has requested a result back. Well, that is pretty messed up, // so instead immediately send back a cancel and let the new task continue launched // as normal without a dependency on its originator. Slog.w(TAG, "Activity is launching as a new task, so cancelling activity result."); mStartActivity.resultTo.sendResult(INVALID_UID, mStartActivity.resultWho, mStartActivity.requestCode, RESULT_CANCELED, null /* data */, null /* dataGrants */); mStartActivity.resultTo = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendNewTaskResultRequestIfNeeded 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
sendNewTaskResultRequestIfNeeded
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
private int getAppCompatState(boolean ignoreVisibility) { if (!ignoreVisibility && !mVisibleRequested) { return APP_COMPAT_STATE_CHANGED__STATE__NOT_VISIBLE; } if (mInSizeCompatModeForBounds) { return APP_COMPAT_STATE_CHANGED__STATE__LETTERBOXED_FOR_SIZE_COMPAT_MODE; } // Letterbox for fixed orientation. This check returns true only when an activity is // letterboxed for fixed orientation. Aspect ratio restrictions are also applied if // present. But this doesn't return true when the activity is letterboxed only because // of aspect ratio restrictions. if (isLetterboxedForFixedOrientationAndAspectRatio()) { return APP_COMPAT_STATE_CHANGED__STATE__LETTERBOXED_FOR_FIXED_ORIENTATION; } // Letterbox for limited aspect ratio. if (mIsAspectRatioApplied) { return APP_COMPAT_STATE_CHANGED__STATE__LETTERBOXED_FOR_ASPECT_RATIO; } return APP_COMPAT_STATE_CHANGED__STATE__NOT_LETTERBOXED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppCompatState 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
getAppCompatState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static DocumentBuilder getValidatingXmlParser(File schemaFile) { DocumentBuilder db = null; try { DocumentBuilderFactory dbf = safeDocumentBuilderFactory(); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(schemaFile); dbf.setSchema(schema); db = dbf.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); } catch (ParserConfigurationException e) { log.warnf("%s: Unable to create XML parser\n", XMLUtils.class.getName()); log.warn(e); } catch (SAXException e) { log.warnf("%s: XML parsing exception while loading schema %s\n", XMLUtils.class.getName(),schemaFile.getPath()); log.warn(e); } catch(UnsupportedOperationException e) { log.warnf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName()); log.warn(e); } return db; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-0239 - Severity: HIGH - CVSS Score: 7.5 Description: Fix XML schema vulnerability Function: getValidatingXmlParser File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP Fixed Code: public static DocumentBuilder getValidatingXmlParser(File schemaFile) { DocumentBuilder db = null; try { DocumentBuilderFactory dbf = safeDocumentBuilderFactory(); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); Schema schema = factory.newSchema(schemaFile); dbf.setSchema(schema); db = dbf.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); } catch (ParserConfigurationException e) { log.warnf("%s: Unable to create XML parser\n", XMLUtils.class.getName()); log.warn(e); } catch (SAXException e) { log.warnf("%s: XML parsing exception while loading schema %s\n", XMLUtils.class.getName(),schemaFile.getPath()); log.warn(e); } catch(UnsupportedOperationException e) { log.warnf("%s: API error while setting up XML parser. Check your JAXP version\n", XMLUtils.class.getName()); log.warn(e); } return db; }
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
getValidatingXmlParser
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
1
Analyze the following code function for security vulnerabilities
@Override protected void flingToHeight(float vel, boolean expand, float target, float collapseSpeedUpFactor, boolean expandBecauseOfFalsing) { mHeadsUpTouchHelper.notifyFling(!expand); setClosingWithAlphaFadeout(!expand && getFadeoutAlpha() == 1.0f); super.flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flingToHeight 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
flingToHeight
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected void internalTerminatePartitionedTopic(AsyncResponse asyncResponse, boolean authoritative) { if (topicName.isGlobal()) { validateGlobalNamespaceOwnership(namespaceName); } validateTopicOwnership(topicName, authoritative); validateTopicOperation(topicName, TopicOperation.TERMINATE); List<MessageId> messageIds = new ArrayList<>(); PartitionedTopicMetadata partitionMetadata = getPartitionedTopicMetadata(topicName, authoritative, false); if (partitionMetadata.partitions > 0) { final List<CompletableFuture<MessageId>> futures = Lists.newArrayList(); for (int i = 0; i < partitionMetadata.partitions; i++) { TopicName topicNamePartition = topicName.getPartition(i); try { futures.add(pulsar().getAdminClient().topics() .terminateTopicAsync(topicNamePartition.toString()).whenComplete((messageId, throwable) -> { if (throwable != null) { log.error("[{}] Failed to terminate topic {}", clientAppId(), topicNamePartition, throwable); asyncResponse.resume(new RestException(throwable)); } messageIds.add(messageId); })); } catch (Exception e) { log.error("[{}] Failed to terminate topic {}", clientAppId(), topicNamePartition, e); throw new RestException(e); } } FutureUtil.waitForAll(futures).handle((result, exception) -> { if (exception != null) { Throwable t = exception.getCause(); if (t instanceof NotFoundException) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Topic not found")); } else { log.error("[{}] Failed to terminate topic {}", clientAppId(), topicName, t); asyncResponse.resume(new RestException(t)); } } asyncResponse.resume(messageIds); return null; }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalTerminatePartitionedTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalTerminatePartitionedTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public static Object convertToObject(List<String> strings) { if (strings.size() == 0) return null; else if (strings.size() == 1) return strings.iterator().next(); else throw new ValidationException("Not eligible for multi-value"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertToObject File: server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
convertToObject
server-core/src/main/java/io/onedev/server/model/support/inputspec/textinput/TextInput.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getParamNames(){ Set<String> names = request.getQueryParams().keySet(); return new ArrayList<>(names); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamNames File: sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getParamNames
sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public void resizeStack(int stackBoxId, Rect bounds) { enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS, "resizeStackBox()"); long ident = Binder.clearCallingIdentity(); try { mWindowManager.resizeStack(stackBoxId, bounds); } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeStack File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
resizeStack
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("GsmServiceStateTracker extends:"); super.dump(fd, pw, args); pw.println(" mPhone=" + mPhone); pw.println(" mSS=" + mSS); pw.println(" mNewSS=" + mNewSS); pw.println(" mCellLoc=" + mCellLoc); pw.println(" mNewCellLoc=" + mNewCellLoc); pw.println(" mPreferredNetworkType=" + mPreferredNetworkType); pw.println(" mMaxDataCalls=" + mMaxDataCalls); pw.println(" mNewMaxDataCalls=" + mNewMaxDataCalls); pw.println(" mReasonDataDenied=" + mReasonDataDenied); pw.println(" mNewReasonDataDenied=" + mNewReasonDataDenied); pw.println(" mGsmRoaming=" + mGsmRoaming); pw.println(" mDataRoaming=" + mDataRoaming); pw.println(" mEmergencyOnly=" + mEmergencyOnly); pw.println(" mNeedFixZoneAfterNitz=" + mNeedFixZoneAfterNitz); pw.flush(); pw.println(" mZoneOffset=" + mZoneOffset); pw.println(" mZoneDst=" + mZoneDst); pw.println(" mZoneTime=" + mZoneTime); pw.println(" mGotCountryCode=" + mGotCountryCode); pw.println(" mNitzUpdatedTime=" + mNitzUpdatedTime); pw.println(" mSavedTimeZone=" + mSavedTimeZone); pw.println(" mSavedTime=" + mSavedTime); pw.println(" mSavedAtTime=" + mSavedAtTime); pw.println(" mStartedGprsRegCheck=" + mStartedGprsRegCheck); pw.println(" mReportedGprsNoReg=" + mReportedGprsNoReg); pw.println(" mNotification=" + mNotification); pw.println(" mWakeLock=" + mWakeLock); pw.println(" mCurSpn=" + mCurSpn); pw.println(" mCurDataSpn=" + mCurDataSpn); pw.println(" mCurShowSpn=" + mCurShowSpn); pw.println(" mCurPlmn=" + mCurPlmn); pw.println(" mCurShowPlmn=" + mCurShowPlmn); pw.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
dump
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
@Override public void onChanged() { if (mResolverDrawerLayout == null) { return; } final int chooserTargetRows = mChooserRowAdapter.getServiceTargetRowCount(); int offset = 0; for (int i = 0; i < chooserTargetRows; i++) { final int pos = mChooserRowAdapter.getCallerTargetRowCount() + i; final int vt = mChooserRowAdapter.getItemViewType(pos); if (vt != mCachedViewType) { mCachedView = null; } final View v = mChooserRowAdapter.getView(pos, mCachedView, mListView); int height = ((RowViewHolder) (v.getTag())).measuredRowHeight; offset += (int) (height * mChooserRowAdapter.getRowScale(pos)); if (vt >= 0) { mCachedViewType = vt; mCachedView = v; } else { mCachedViewType = -1; } } mResolverDrawerLayout.setCollapsibleHeightReserved(offset); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onChanged File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
onChanged
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0