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 Date getUpdateTime() { return updateTime; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-7171 - Severity: LOW - CVSS Score: 3.3 Description: fix(novel-admin): 友情链接URL格式校验 Function: getUpdateTime File: novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java Repository: 201206030/novel-plus Fixed Code: public Date getUpdateTime() { return updateTime; }
[ "CWE-79" ]
CVE-2023-7171
LOW
3.3
201206030/novel-plus
getUpdateTime
novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
d6093d8182362422370d7eaf6c53afde9ee45215
1
Analyze the following code function for security vulnerabilities
@GuardedBy({"this", "mProcLock"}) final void setAppIdTempAllowlistStateLSP(int uid, boolean onAllowlist) { mOomAdjuster.setAppIdTempAllowlistStateLSP(uid, onAllowlist); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAppIdTempAllowlistStateLSP 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
setAppIdTempAllowlistStateLSP
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public static Version getVersion(Class<?> type) { final URL classLocation = classLocation(type); String path = classLocation.toString(); // try and extract from maven jar naming convention if (classLocation.getProtocol().equalsIgnoreCase("jar")) { String jarVersion = jarVersion(path); if (jarVersion != null) { return new Version(jarVersion); } // try manifest try { URL manifestLocation = manifestLocation(path); Manifest manifest = new Manifest(); try (InputStream content = manifestLocation.openStream()) { manifest.read(content); } for (String attribute : new String[] { "Implementation-Version", "Project-Version", "Specification-Version" }) { String value = manifest.getMainAttributes().getValue(attribute); if (value != null) { return new Version(value); } } } catch (IOException e) { // unavailable } } String name = type.getName(); if (name.startsWith("org.geotools") || name.startsWith("org.opengis")) { return GeoTools.getVersion(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVersion File: modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java Repository: geotools The code follows secure coding practices.
[ "CWE-917" ]
CVE-2022-24818
HIGH
7.5
geotools
getVersion
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
void unregisterRemoteAnimations() { mRemoteAnimationDefinition = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterRemoteAnimations 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
unregisterRemoteAnimations
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void deleteCookies() { try { CookieSyncManager.createInstance(this); CookieManager.getInstance().removeAllCookies(null); } catch (AndroidRuntimeException e) { Log_OC.e(TAG, e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteCookies File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
deleteCookies
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
private State readHeaders(ByteBuf buffer) { final HttpMessage message = this.message; final HttpHeaders headers = message.headers(); AppendableCharSequence line = headerParser.parse(buffer); if (line == null) { return null; } if (line.length() > 0) { do { char firstChar = line.charAtUnsafe(0); if (name != null && (firstChar == ' ' || firstChar == '\t')) { //please do not make one line from below code //as it breaks +XX:OptimizeStringConcat optimization String trimmedLine = line.toString().trim(); String valueStr = String.valueOf(value); value = valueStr + ' ' + trimmedLine; } else { if (name != null) { headers.add(name, value); } splitHeader(line); } line = headerParser.parse(buffer); if (line == null) { return null; } } while (line.length() > 0); } // Add the last header. if (name != null) { headers.add(name, value); } // reset name and value fields name = null; value = null; List<String> values = headers.getAll(HttpHeaderNames.CONTENT_LENGTH); int contentLengthValuesCount = values.size(); if (contentLengthValuesCount > 0) { // Guard against multiple Content-Length headers as stated in // https://tools.ietf.org/html/rfc7230#section-3.3.2: // // If a message is received that has multiple Content-Length header // fields with field-values consisting of the same decimal value, or a // single Content-Length header field with a field value containing a // list of identical decimal values (e.g., "Content-Length: 42, 42"), // indicating that duplicate Content-Length header fields have been // generated or combined by an upstream message processor, then the // recipient MUST either reject the message as invalid or replace the // duplicated field-values with a single valid Content-Length field // containing that decimal value prior to determining the message body // length or forwarding the message. if (contentLengthValuesCount > 1 && message.protocolVersion() == HttpVersion.HTTP_1_1) { throw new IllegalArgumentException("Multiple Content-Length headers found"); } contentLength = Long.parseLong(values.get(0)); } if (isContentAlwaysEmpty(message)) { HttpUtil.setTransferEncodingChunked(message, false); return State.SKIP_CONTROL_CHARS; } else if (HttpUtil.isTransferEncodingChunked(message)) { if (contentLengthValuesCount > 0 && message.protocolVersion() == HttpVersion.HTTP_1_1) { handleTransferEncodingChunkedWithContentLength(message); } return State.READ_CHUNK_SIZE; } else if (contentLength() >= 0) { return State.READ_FIXED_LENGTH_CONTENT; } else { return State.READ_VARIABLE_LENGTH_CONTENT; } }
Vulnerability Classification: - CWE: CWE-444 - CVE: CVE-2019-20445 - Severity: MEDIUM - CVSS Score: 6.4 Description: Add option to HttpObjectDecoder to allow duplicate Content-Lengths (#10349) Motivation: Since https://github.com/netty/netty/pull/9865 (Netty 4.1.44) the default behavior of the HttpObjectDecoder has been to reject any HTTP message that is found to have multiple Content-Length headers when decoding. This behavior is well-justified as per the risks outlined in https://github.com/netty/netty/issues/9861, however, we can see from the cited RFC section that there are multiple possible options offered for responding to this scenario: > If a message is received that has multiple Content-Length header > fields with field-values consisting of the same decimal value, or a > single Content-Length header field with a field value containing a > list of identical decimal values (e.g., "Content-Length: 42, 42"), > indicating that duplicate Content-Length header fields have been > generated or combined by an upstream message processor, then the > recipient MUST either reject the message as invalid or replace the > duplicated field-values with a single valid Content-Length field > containing that decimal value prior to determining the message body > length or forwarding the message. https://tools.ietf.org/html/rfc7230#section-3.3.2 Netty opted for the first option (rejecting as invalid), which seems like the safest, but the second option (replacing duplicate values with a single value) is also valid behavior. Modifications: * Introduce "allowDuplicateContentLengths" parameter to HttpObjectDecoder (defaulting to false). * When set to true, will allow multiple Content-Length headers only if they are all the same value. The duplicated field-values will be replaced with a single valid Content-Length field. * Add new parameterized test class for testing different variations of multiple Content-Length headers. Result: This is a backwards-compatible change with no functional change to the existing behavior. Note that the existing logic would result in NumberFormatExceptions for header values like "Content-Length: 42, 42". The new logic correctly reports these as IllegalArgumentException with the proper error message. Additionally note that this behavior is only applied to HTTP/1.1, but I suspect that we may want to expand that to include HTTP/1.0 as well... That behavior is not modified here to minimize the scope of this change. Function: readHeaders File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java Repository: netty Fixed Code: private State readHeaders(ByteBuf buffer) { final HttpMessage message = this.message; final HttpHeaders headers = message.headers(); AppendableCharSequence line = headerParser.parse(buffer); if (line == null) { return null; } if (line.length() > 0) { do { char firstChar = line.charAtUnsafe(0); if (name != null && (firstChar == ' ' || firstChar == '\t')) { //please do not make one line from below code //as it breaks +XX:OptimizeStringConcat optimization String trimmedLine = line.toString().trim(); String valueStr = String.valueOf(value); value = valueStr + ' ' + trimmedLine; } else { if (name != null) { headers.add(name, value); } splitHeader(line); } line = headerParser.parse(buffer); if (line == null) { return null; } } while (line.length() > 0); } // Add the last header. if (name != null) { headers.add(name, value); } // reset name and value fields name = null; value = null; List<String> contentLengthFields = headers.getAll(HttpHeaderNames.CONTENT_LENGTH); if (!contentLengthFields.isEmpty()) { // Guard against multiple Content-Length headers as stated in // https://tools.ietf.org/html/rfc7230#section-3.3.2: // // If a message is received that has multiple Content-Length header // fields with field-values consisting of the same decimal value, or a // single Content-Length header field with a field value containing a // list of identical decimal values (e.g., "Content-Length: 42, 42"), // indicating that duplicate Content-Length header fields have been // generated or combined by an upstream message processor, then the // recipient MUST either reject the message as invalid or replace the // duplicated field-values with a single valid Content-Length field // containing that decimal value prior to determining the message body // length or forwarding the message. boolean multipleContentLengths = contentLengthFields.size() > 1 || contentLengthFields.get(0).indexOf(COMMA) >= 0; if (multipleContentLengths && message.protocolVersion() == HttpVersion.HTTP_1_1) { if (allowDuplicateContentLengths) { // Find and enforce that all Content-Length values are the same String firstValue = null; for (String field : contentLengthFields) { String[] tokens = COMMA_PATTERN.split(field, -1); for (String token : tokens) { String trimmed = token.trim(); if (firstValue == null) { firstValue = trimmed; } else if (!trimmed.equals(firstValue)) { throw new IllegalArgumentException( "Multiple Content-Length values found: " + contentLengthFields); } } } // Replace the duplicated field-values with a single valid Content-Length field headers.set(HttpHeaderNames.CONTENT_LENGTH, firstValue); contentLength = Long.parseLong(firstValue); } else { // Reject the message as invalid throw new IllegalArgumentException( "Multiple Content-Length values found: " + contentLengthFields); } } else { contentLength = Long.parseLong(contentLengthFields.get(0)); } } if (isContentAlwaysEmpty(message)) { HttpUtil.setTransferEncodingChunked(message, false); return State.SKIP_CONTROL_CHARS; } else if (HttpUtil.isTransferEncodingChunked(message)) { if (!contentLengthFields.isEmpty() && message.protocolVersion() == HttpVersion.HTTP_1_1) { handleTransferEncodingChunkedWithContentLength(message); } return State.READ_CHUNK_SIZE; } else if (contentLength() >= 0) { return State.READ_FIXED_LENGTH_CONTENT; } else { return State.READ_VARIABLE_LENGTH_CONTENT; } }
[ "CWE-444" ]
CVE-2019-20445
MEDIUM
6.4
netty
readHeaders
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
f7fa9fce72dd423200af1131adf6f089b311128d
1
Analyze the following code function for security vulnerabilities
public static String getUserAgent(HttpServletRequest request) { return request.getHeader("user-agent"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserAgent File: publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
getUserAgent
publiccms-parent/publiccms-common/src/main/java/com/publiccms/common/tools/RequestUtils.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
static UnreadConversation getUnreadConversationFromBundle(Bundle b) { if (b == null) { return null; } Parcelable[] parcelableMessages = b.getParcelableArray(KEY_MESSAGES); String[] messages = null; if (parcelableMessages != null) { String[] tmp = new String[parcelableMessages.length]; boolean success = true; for (int i = 0; i < tmp.length; i++) { if (!(parcelableMessages[i] instanceof Bundle)) { success = false; break; } tmp[i] = ((Bundle) parcelableMessages[i]).getString(KEY_TEXT); if (tmp[i] == null) { success = false; break; } } if (success) { messages = tmp; } else { return null; } } PendingIntent onRead = b.getParcelable(KEY_ON_READ, PendingIntent.class); PendingIntent onReply = b.getParcelable(KEY_ON_REPLY, PendingIntent.class); RemoteInput remoteInput = b.getParcelable(KEY_REMOTE_INPUT, RemoteInput.class); String[] participants = b.getStringArray(KEY_PARTICIPANTS); if (participants == null || participants.length != 1) { return null; } return new UnreadConversation(messages, remoteInput, onReply, onRead, participants, b.getLong(KEY_TIMESTAMP)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUnreadConversationFromBundle File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getUnreadConversationFromBundle
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void setExecutableQuoteDelimiter( char exeQuoteDelimiterParameter ) { this.exeQuoteDelimiter = exeQuoteDelimiterParameter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExecutableQuoteDelimiter File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setExecutableQuoteDelimiter
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
public String toQueryString(Object... queryParameters) { return toQueryString(toQueryParameters(queryParameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toQueryString File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
toQueryString
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private int peekNextAppWidgetIdLocked(int userId) { if (mNextAppWidgetIds.indexOfKey(userId) < 0) { return AppWidgetManager.INVALID_APPWIDGET_ID + 1; } else { return mNextAppWidgetIds.get(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peekNextAppWidgetIdLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
peekNextAppWidgetIdLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
public static Map getAttributeMap( SAMLServiceManager.SOAPEntry partnerdest, List assertions, com.sun.identity.saml.assertion.Subject subject, String target) throws Exception { String srcID = partnerdest.getSourceID(); String name = null; String org = null; Map attrMap = new HashMap(); PartnerAccountMapper paMapper = partnerdest.getPartnerAccountMapper(); if (paMapper != null) { Map map = paMapper.getUser(assertions, srcID, target); name = (String) map.get(PartnerAccountMapper.NAME); org = (String) map.get(PartnerAccountMapper.ORG); attrMap = (Map) map.get(PartnerAccountMapper.ATTRIBUTE); } if (attrMap == null) { attrMap = new HashMap(); } attrMap.put(SAMLConstants.USER_NAME, name); if ((org != null) && (org.length() != 0)) { attrMap.put(SessionProvider.REALM, org); } else { attrMap.put(SessionProvider.REALM, "/"); } if (debug.messageEnabled()) { debug.message("getAttributeMap : " + "name = " + name + ", realm=" + org + ", attrMap = " + attrMap); } return attrMap; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributeMap File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
getAttributeMap
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
private void setDataProvider(int nodesPerLevel, int depth) { grid.setDataProvider( new LazyHierarchicalDataProvider(nodesPerLevel, depth) { @Override protected Stream<HierarchicalTestBean> fetchChildrenFromBackEnd( HierarchicalQuery<HierarchicalTestBean, Void> query) { VaadinRequest currentRequest = VaadinService .getCurrentRequest(); if (!currentRequest.equals(lastRequest)) { requestCount++; } lastRequest = currentRequest; requestCountField .setValue(String.valueOf(requestCount)); fetchCount++; fetchCountField.setValue(String.valueOf(fetchCount)); return super.fetchChildrenFromBackEnd(query); } @Override public Object getId(HierarchicalTestBean item) { return item != null ? item.toString() : "null"; } }); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2022-29567 - Severity: MEDIUM - CVSS Score: 5.0 Description: fix data provider getId implementation Function: setDataProvider File: vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridPreloadPage.java Repository: vaadin/flow-components Fixed Code: private void setDataProvider(int nodesPerLevel, int depth) { grid.setDataProvider( new LazyHierarchicalDataProvider(nodesPerLevel, depth) { @Override protected Stream<HierarchicalTestBean> fetchChildrenFromBackEnd( HierarchicalQuery<HierarchicalTestBean, Void> query) { VaadinRequest currentRequest = VaadinService .getCurrentRequest(); if (!currentRequest.equals(lastRequest)) { requestCount++; } lastRequest = currentRequest; requestCountField .setValue(String.valueOf(requestCount)); fetchCount++; fetchCountField.setValue(String.valueOf(fetchCount)); return super.fetchChildrenFromBackEnd(query); } @Override public Object getId(HierarchicalTestBean item) { return item != null ? item.getId() : "null"; } }); }
[ "CWE-200" ]
CVE-2022-29567
MEDIUM
5
vaadin/flow-components
setDataProvider
vaadin-grid-flow-parent/vaadin-grid-flow-integration-tests/src/main/java/com/vaadin/flow/component/treegrid/it/TreeGridPreloadPage.java
e70a2dff396d32999c6b5e771869b2fed0185e11
1
Analyze the following code function for security vulnerabilities
public synchronized boolean enable(boolean quietMode) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); debugLog("enable() - Enable called with quiet mode status = " + mQuietmode); mQuietmode = quietMode; Message m = mAdapterStateMachine.obtainMessage(AdapterState.BLE_TURN_ON); mAdapterStateMachine.sendMessage(m); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enable 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
enable
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private DocumentReferenceResolver<String> getExplicitDocumentReferenceResolver() { if (this.explicitDocumentReferenceResolver == null) { this.explicitDocumentReferenceResolver = Utils.getComponent(DocumentReferenceResolver.TYPE_STRING, "explicit"); } return this.explicitDocumentReferenceResolver; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExplicitDocumentReferenceResolver File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getExplicitDocumentReferenceResolver
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); MasterBuildConfiguration mbc = MasterBuildConfiguration.all().get(MasterBuildConfiguration.class); if (mbc!=null) mbc.configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); // back to the computer page }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doConfigExecutorsSubmit 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
doConfigExecutorsSubmit
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) @TestApi @UserHandleAware public boolean isNewUserDisclaimerAcknowledged() { if (mService != null) { try { return mService.isNewUserDisclaimerAcknowledged(mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNewUserDisclaimerAcknowledged 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
isNewUserDisclaimerAcknowledged
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void registerPhoneAccount(PhoneAccount account) { try { Log.startSession("TSI.rPA"); synchronized (mLock) { try { enforcePhoneAccountModificationForPackage( account.getAccountHandle().getComponentName().getPackageName()); if (account.hasCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)) { enforceRegisterSelfManaged(); if (account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) || account.hasCapabilities( PhoneAccount.CAPABILITY_CONNECTION_MANAGER) || account.hasCapabilities( PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { throw new SecurityException("Self-managed ConnectionServices " + "cannot also be call capable, connection managers, or " + "SIM accounts."); } // For self-managed CS, the phone account registrar will override the // label the user has set for the phone account. This ensures the // self-managed cs implementation can't spoof their app name. } if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { enforceRegisterSimSubscriptionPermission(); } if (account.hasCapabilities(PhoneAccount.CAPABILITY_MULTI_USER)) { enforceRegisterMultiUser(); } // These capabilities are for SIM-based accounts only, so only the platform // and carrier-designated SIM call manager can register accounts with these // capabilities. if (account.hasCapabilities( PhoneAccount.CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS) || account.hasCapabilities( PhoneAccount.CAPABILITY_VOICE_CALLING_AVAILABLE)) { enforceRegisterVoiceCallingIndicationCapabilities(account); } Bundle extras = account.getExtras(); if (extras != null && extras.getBoolean(PhoneAccount.EXTRA_SKIP_CALL_FILTERING)) { enforceRegisterSkipCallFiltering(); } final int callingUid = Binder.getCallingUid(); if (callingUid != Process.SHELL_UID) { enforceUserHandleMatchesCaller(account.getAccountHandle()); } if (TextUtils.isEmpty(account.getGroupId()) && mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { Log.w(this, "registerPhoneAccount - attempt to set a" + " group from a non-system caller."); // Not permitted to set group, so null it out. account = new PhoneAccount.Builder(account) .setGroupId(null) .build(); } final long token = Binder.clearCallingIdentity(); try { mPhoneAccountRegistrar.registerPhoneAccount(account); } finally { Binder.restoreCallingIdentity(token); } } catch (Exception e) { Log.e(this, e, "registerPhoneAccount %s", account); throw e; } } } finally { Log.endSession(); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21394 - Severity: MEDIUM - CVSS Score: 5.5 Description: Resolve account image icon profile boundary exploit. Because Telecom grants the INTERACT_ACROSS_USERS permission, an exploit is possible where the user can upload an image icon (belonging to another user) via registering a phone account. This CL provides a lightweight solution for parsing the image URI to detect profile exploitation. Fixes: 273502295 Fixes: 296915211 Test: Unit test to enforce successful/failure path (cherry picked from commit d0d1d38e37de54e58a7532a0020582fbd7d476b7) (cherry picked from commit e7d0ca3fe5be6e393f643f565792ea5e7ed05f48) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a604311f86ea8136ca2ac9f9ff0af7fa57ee3f42) Merged-In: I2b6418f019a373ee9f02ba8683e5b694e7ab80a5 Change-Id: I2b6418f019a373ee9f02ba8683e5b694e7ab80a5 Function: registerPhoneAccount File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android Fixed Code: @Override public void registerPhoneAccount(PhoneAccount account) { try { Log.startSession("TSI.rPA"); synchronized (mLock) { try { enforcePhoneAccountModificationForPackage( account.getAccountHandle().getComponentName().getPackageName()); if (account.hasCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)) { enforceRegisterSelfManaged(); if (account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER) || account.hasCapabilities( PhoneAccount.CAPABILITY_CONNECTION_MANAGER) || account.hasCapabilities( PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { throw new SecurityException("Self-managed ConnectionServices " + "cannot also be call capable, connection managers, or " + "SIM accounts."); } // For self-managed CS, the phone account registrar will override the // label the user has set for the phone account. This ensures the // self-managed cs implementation can't spoof their app name. } if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { enforceRegisterSimSubscriptionPermission(); } if (account.hasCapabilities(PhoneAccount.CAPABILITY_MULTI_USER)) { enforceRegisterMultiUser(); } // These capabilities are for SIM-based accounts only, so only the platform // and carrier-designated SIM call manager can register accounts with these // capabilities. if (account.hasCapabilities( PhoneAccount.CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS) || account.hasCapabilities( PhoneAccount.CAPABILITY_VOICE_CALLING_AVAILABLE)) { enforceRegisterVoiceCallingIndicationCapabilities(account); } Bundle extras = account.getExtras(); if (extras != null && extras.getBoolean(PhoneAccount.EXTRA_SKIP_CALL_FILTERING)) { enforceRegisterSkipCallFiltering(); } final int callingUid = Binder.getCallingUid(); if (callingUid != Process.SHELL_UID) { enforceUserHandleMatchesCaller(account.getAccountHandle()); } if (TextUtils.isEmpty(account.getGroupId()) && mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) { Log.w(this, "registerPhoneAccount - attempt to set a" + " group from a non-system caller."); // Not permitted to set group, so null it out. account = new PhoneAccount.Builder(account) .setGroupId(null) .build(); } // Validate the profile boundary of the given image URI. validateAccountIconUserBoundary(account.getIcon()); final long token = Binder.clearCallingIdentity(); try { mPhoneAccountRegistrar.registerPhoneAccount(account); } finally { Binder.restoreCallingIdentity(token); } } catch (Exception e) { Log.e(this, e, "registerPhoneAccount %s", account); throw e; } } } finally { Log.endSession(); } }
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
registerPhoneAccount
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
1
Analyze the following code function for security vulnerabilities
private static void resolveLimit(@NonNull Bundle queryArgs, @NonNull Consumer<String> honored) { final int limit = queryArgs.getInt(QUERY_ARG_LIMIT, Integer.MIN_VALUE); if (limit != Integer.MIN_VALUE) { String limitString = Integer.toString(limit); honored.accept(QUERY_ARG_LIMIT); final int offset = queryArgs.getInt(QUERY_ARG_OFFSET, Integer.MIN_VALUE); if (offset != Integer.MIN_VALUE) { limitString += " OFFSET " + offset; honored.accept(QUERY_ARG_OFFSET); } queryArgs.putString(QUERY_ARG_SQL_LIMIT, limitString); } else { honored.accept(QUERY_ARG_SQL_LIMIT); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveLimit File: src/com/android/providers/media/util/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-35683
MEDIUM
5.5
android
resolveLimit
src/com/android/providers/media/util/DatabaseUtils.java
23d156ed1bed6d2c2b325f0be540d0afca510c49
0
Analyze the following code function for security vulnerabilities
@Override public ServiceBindingBuilder route() { return new ServiceBindingBuilder(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: route File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
route
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public static void cursorDoubleToContentValues(Cursor cursor, String field, ContentValues values, String key) { int colIndex = cursor.getColumnIndex(field); if (!cursor.isNull(colIndex)) { values.put(key, cursor.getDouble(colIndex)); } else { values.put(key, (Double) null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorDoubleToContentValues File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorDoubleToContentValues
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public void setSystemProcess() { try { ServiceManager.addService(Context.ACTIVITY_SERVICE, this, true); ServiceManager.addService(ProcessStats.SERVICE_NAME, mProcessStats); ServiceManager.addService("meminfo", new MemBinder(this)); ServiceManager.addService("gfxinfo", new GraphicsBinder(this)); ServiceManager.addService("dbinfo", new DbBinder(this)); if (MONITOR_CPU_USAGE) { ServiceManager.addService("cpuinfo", new CpuBinder(this)); } ServiceManager.addService("permission", new PermissionController(this)); ServiceManager.addService("processinfo", new ProcessInfoService(this)); ApplicationInfo info = mContext.getPackageManager().getApplicationInfo( "android", STOCK_PM_FLAGS | MATCH_SYSTEM_ONLY); mSystemThread.installSystemApplicationInfo(info, getClass().getClassLoader()); synchronized (this) { ProcessRecord app = newProcessRecordLocked(info, info.processName, false, 0); app.persistent = true; app.pid = MY_PID; app.maxAdj = ProcessList.SYSTEM_ADJ; app.makeActive(mSystemThread.getApplicationThread(), mProcessStats); synchronized (mPidsSelfLocked) { mPidsSelfLocked.put(app.pid, app); } updateLruProcessLocked(app, false, null); updateOomAdjLocked(); } } catch (PackageManager.NameNotFoundException e) { throw new RuntimeException( "Unable to find android system package", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSystemProcess File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
setSystemProcess
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public String getCometId() { return cometId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCometId File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
getCometId
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
public void download(HttpServletResponse resp) { File file = new File(getRealFilePath()); if (this.get.get("path") != null && file.exists()) { resp.setHeader("Content-type", "application/force-download"); resp.setHeader("Content-Disposition", "inline;filename=\"" + fileRoot + this.get.get("path") + "\""); resp.setHeader("Content-Transfer-Encoding", "Binary"); resp.setHeader("Content-length", "" + file.length()); resp.setHeader("Content-Type", "application/octet-stream"); resp.setHeader("Content-Disposition", "attachment; filename=\"" + file.getName() + "\""); readFile(resp, file); } else { this.error(sprintf(lang("FILE_DOES_NOT_EXIST"), this.get.get("path"))); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: download File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java Repository: jflyfox/jfinal_cms The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-37262
MEDIUM
5
jflyfox/jfinal_cms
download
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
@Override protected void pointerPressed(final int[] x, final int[] y) { super.pointerPressed(x, y); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pointerPressed 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
pointerPressed
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public abstract byte get(String name, byte defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private static void offsetBounds(Configuration inOutConfig, int offsetX, int offsetY) { inOutConfig.windowConfiguration.getBounds().offset(offsetX, offsetY); inOutConfig.windowConfiguration.getAppBounds().offset(offsetX, offsetY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: offsetBounds 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
offsetBounds
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void setDefaultAttachmentContentStore(XWikiAttachmentStoreInterface attachmentContentStore) { this.defaultAttachmentContentStore = attachmentContentStore; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultAttachmentContentStore File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
setDefaultAttachmentContentStore
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public Jooby executor(final Executor executor) { this.defaultExecSet = true; this.executors.add(binder -> { binder.bind(Key.get(String.class, Names.named("deferred"))).toInstance("deferred"); binder.bind(Key.get(Executor.class, Names.named("deferred"))).toInstance(executor); }); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executor File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
executor
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public int runMovePrimaryStorage() { String volumeUuid = nextArg(); if ("internal".equals(volumeUuid)) { volumeUuid = null; } try { final int moveId = mPm.movePrimaryStorage(volumeUuid); int status = mPm.getMoveStatus(moveId); while (!PackageManager.isMoveStatusFinished(status)) { SystemClock.sleep(DateUtils.SECOND_IN_MILLIS); status = mPm.getMoveStatus(moveId); } if (status == PackageManager.MOVE_SUCCEEDED) { System.out.println("Success"); return 0; } else { System.err.println("Failure [" + status + "]"); return 1; } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runMovePrimaryStorage File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runMovePrimaryStorage
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0
Analyze the following code function for security vulnerabilities
public int readI32() throws TException { return zigzagToInt(readVarint32()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readI32 File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readI32
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private void incrementLoaderUseCount() { // For use by trusted code only if (System.getSecurityManager() != null) { System.getSecurityManager().checkPermission(new AllPermission()); } // NB: There will only ever be one class-loader per unique-key synchronized (getUniqueKeyLock(file.getUniqueKey())) { useCount++; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementLoaderUseCount File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
incrementLoaderUseCount
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
public synchronized void updateShort(@Positive int columnIndex, short x) throws SQLException { updateValue(columnIndex, x); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateShort 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
updateShort
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public List<BaseObject> addObjectsFromRequest(String className, XWikiContext context) throws XWikiException { return addObjectsFromRequest(className, "", context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObjectsFromRequest File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
addObjectsFromRequest
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
public void setPage(final String html, final String baseUrl) { act.runOnUiThread(new Runnable() { public void run() { web.loadDataWithBaseURL(baseUrl, html, "text/html", "UTF-8", null); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPage 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
setPage
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
DisplayInfo updateDisplayAndOrientationLocked() { // TODO(multidisplay): For now, apply Configuration to main screen only. final DisplayContent displayContent = getDefaultDisplayContentLocked(); // Use the effective "visual" dimensions based on current rotation final boolean rotated = (mRotation == Surface.ROTATION_90 || mRotation == Surface.ROTATION_270); final int realdw = rotated ? displayContent.mBaseDisplayHeight : displayContent.mBaseDisplayWidth; final int realdh = rotated ? displayContent.mBaseDisplayWidth : displayContent.mBaseDisplayHeight; int dw = realdw; int dh = realdh; if (mAltOrientation) { if (realdw > realdh) { // Turn landscape into portrait. int maxw = (int)(realdh/1.3f); if (maxw < realdw) { dw = maxw; } } else { // Turn portrait into landscape. int maxh = (int)(realdw/1.3f); if (maxh < realdh) { dh = maxh; } } } // Update application display metrics. final int appWidth = mPolicy.getNonDecorDisplayWidth(dw, dh, mRotation); final int appHeight = mPolicy.getNonDecorDisplayHeight(dw, dh, mRotation); final DisplayInfo displayInfo = displayContent.getDisplayInfo(); synchronized(displayContent.mDisplaySizeLock) { displayInfo.rotation = mRotation; displayInfo.logicalWidth = dw; displayInfo.logicalHeight = dh; displayInfo.logicalDensityDpi = displayContent.mBaseDisplayDensity; displayInfo.appWidth = appWidth; displayInfo.appHeight = appHeight; displayInfo.getLogicalMetrics(mRealDisplayMetrics, CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO, null); displayInfo.getAppMetrics(mDisplayMetrics); if (displayContent.mDisplayScalingDisabled) { displayInfo.flags |= Display.FLAG_SCALING_DISABLED; } else { displayInfo.flags &= ~Display.FLAG_SCALING_DISABLED; } mDisplayManagerInternal.setDisplayInfoOverrideFromWindowManager( displayContent.getDisplayId(), displayInfo); displayContent.mBaseDisplayRect.set(0, 0, dw, dh); } if (false) { Slog.i(TAG, "Set app display size: " + appWidth + " x " + appHeight); } mCompatibleScreenScale = CompatibilityInfo.computeCompatibleScaling(mDisplayMetrics, mCompatDisplayMetrics); return displayInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDisplayAndOrientationLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
updateDisplayAndOrientationLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public static CountingReader getReaderFromBinary(byte[] urlOrBinary, String compressionAlgo) { try { return getInputStreamFromBinary(urlOrBinary, compressionAlgo).asReader(); } catch (IOException e) { throw new RuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReaderFromBinary File: core/src/main/java/apoc/util/FileUtils.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
getReaderFromBinary
core/src/main/java/apoc/util/FileUtils.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
@Transactional @Override @Nonnull public <E extends KrailEntity<ID, VER>> Optional<E> deleteById(@Nonnull Class<E> entityClass, @Nonnull ID entityId) { checkNotNull(entityClass); checkNotNull(entityId); EntityManager entityManager = entityManagerProvider.get(); Optional<E> entity = findById(entityClass, entityId); if (entity.isPresent()) { entityManager.remove(entity.get()); log.debug("Deleted entity {}", entity); } else { log.debug("Attempting delete, but no entity found in {} for id {}", entityClass, entityId); } return entity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteById File: src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
deleteById
src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public void onInstallUpdateError( @InstallUpdateCallbackErrorConstants int errorCode, @NonNull String errorMessage) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onInstallUpdateError 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
onInstallUpdateError
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private void wrapWithChildContext(StringBuffer buffer, int index, String statement) { buffer.append(" ComponentContext context = ComponentContext.get();\n"); buffer.append(" if (context != null) {\n"); buffer.append(" ComponentContext childContext = context.getChildContext(\"input" + index + "\");\n"); buffer.append(" if (childContext != null) {\n"); buffer.append(" ComponentContext.push(childContext);\n"); buffer.append(" try {\n"); buffer.append(" " + statement + "\n"); buffer.append(" } finally {\n"); buffer.append(" ComponentContext.pop();\n"); buffer.append(" }\n"); buffer.append(" } else {\n"); buffer.append(" " + statement + "\n"); buffer.append(" }\n"); buffer.append(" } else {\n"); buffer.append(" " + statement + "\n"); buffer.append(" }\n"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrapWithChildContext 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
wrapWithChildContext
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasCustomLicense(Collection collection) { String license = collection.getLicenseCollection(); return StringUtils.isNotBlank(license); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasCustomLicense File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
hasCustomLicense
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
@Override public String getJMSMessageID() throws JMSException { return this.getStringProperty(JMS_MESSAGE_ID); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJMSMessageID File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
getJMSMessageID
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
private <T> void doGet( AsyncResult<SQLConnection> conn, String table, Class<T> clazz, String fieldName, String where, boolean returnCount, boolean returnIdField, boolean setId, List<FacetField> facets, String distinctOn, Handler<AsyncResult<Results<T>>> replyHandler ) { if (conn.failed()) { log.error(conn.cause().getMessage(), conn.cause()); replyHandler.handle(Future.failedFuture(conn.cause())); return; } SQLConnection connection = conn.result(); vertx.runOnContext(v -> { try { QueryHelper queryHelper = buildSelectQueryHelper(true, table, fieldName, where, returnIdField, facets, distinctOn); if (returnCount) { processQueryWithCount(connection, queryHelper, GET_STAT_METHOD, totaledResults -> processResults(totaledResults.set, totaledResults.total, clazz, setId), replyHandler); } else { processQuery(connection, queryHelper, null, GET_STAT_METHOD, totaledResults -> processResults(totaledResults.set, totaledResults.total, clazz, setId), replyHandler); } } catch (Exception e) { log.error(e.getMessage(), e); replyHandler.handle(Future.failedFuture(e)); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGet File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.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
doGet
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public Bundle toBundle() { Bundle bundle = new Bundle(); if (mText != null) { bundle.putCharSequence(KEY_TEXT, mText); } bundle.putLong(KEY_TIMESTAMP, mTimestamp); if (mSender != null) { // Legacy listeners need this bundle.putCharSequence(KEY_SENDER, safeCharSequence(mSender.getName())); bundle.putParcelable(KEY_SENDER_PERSON, mSender); } if (mDataMimeType != null) { bundle.putString(KEY_DATA_MIME_TYPE, mDataMimeType); } if (mDataUri != null) { bundle.putParcelable(KEY_DATA_URI, mDataUri); } if (mExtras != null) { bundle.putBundle(KEY_EXTRAS_BUNDLE, mExtras); } if (mRemoteInputHistory) { bundle.putBoolean(KEY_REMOTE_INPUT_HISTORY, mRemoteInputHistory); } return bundle; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toBundle File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
toBundle
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void delete(String table, String id, Handler<AsyncResult<UpdateResult>> replyHandler) { client.getConnection(conn -> delete(conn, table, id, closeAndHandleResult(conn, replyHandler))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.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
delete
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private CharSequence getCharSequence() { if (currentEvent == Event.KEY_NAME || currentEvent == Event.VALUE_STRING || currentEvent == Event.VALUE_NUMBER) { return tokenizer.getCharSequence(); } throw new IllegalStateException(JsonMessages.PARSER_GETSTRING_ERR(currentEvent)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCharSequence 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
getCharSequence
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setHidingToggleCaption(String hidingToggleCaption) { if (hidingToggleCaption != getHidingToggleCaption()) { getState().hidingToggleCaption = hidingToggleCaption; } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHidingToggleCaption 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
setHidingToggleCaption
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public String getOriginalExecutable() { return executable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOriginalExecutable File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getOriginalExecutable
src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
public String getTags() { return tags; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTags File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
getTags
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
@Override public void deleteDB(String databaseName) throws IOException { if (databaseName.startsWith("file://")) { deleteFile(databaseName); return; } getContext().deleteDatabase(databaseName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDB 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
deleteDB
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setDpcDownloaded(boolean downloaded) { throwIfParentInstance("setDpcDownloaded"); if (mService != null) { try { mService.setDpcDownloaded(downloaded); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDpcDownloaded 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
setDpcDownloaded
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int getTimeoutMs() { return timeoutMs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTimeoutMs File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
getTimeoutMs
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@Override public ActivityManager.RecentTaskInfo getMostRecentTaskFromBackground() { List<ActivityManager.RunningTaskInfo> runningTaskInfoList = getTasks(1); ActivityManager.RunningTaskInfo runningTaskInfo; if (runningTaskInfoList.size() > 0) { runningTaskInfo = runningTaskInfoList.get(0); } else { Slog.i(TAG, "No running task found!"); return null; } // Get 2 most recent tasks. List<ActivityManager.RecentTaskInfo> recentTaskInfoList = getRecentTasks( 2, ActivityManager.RECENT_IGNORE_UNAVAILABLE, mContext.getUserId()) .getList(); ActivityManager.RecentTaskInfo targetTask = null; for (ActivityManager.RecentTaskInfo info : recentTaskInfoList) { // Find a recent task that is not the current running task on screen. if (info.id != runningTaskInfo.id) { targetTask = info; break; } } return targetTask; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMostRecentTaskFromBackground 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
getMostRecentTaskFromBackground
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public boolean matches(CharSequence filterText) { if (TextUtils.isEmpty(filterText)) { // Always show item when the user input is empty return true; } if (!filterable) { // Service explicitly disabled filtering using a null Pattern. return false; } final String constraintLowerCase = filterText.toString().toLowerCase(); if (filter != null) { // Uses pattern provided by service return filter.matcher(constraintLowerCase).matches(); } else { // Compares it with dataset value with dataset return (value == null) ? (dataset.getAuthentication() == null) : value.toLowerCase().startsWith(constraintLowerCase); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: matches File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
matches
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
@Override protected void onClosingFinished() { super.onClosingFinished(); resetVerticalPanelPosition(); setClosingWithAlphaFadeout(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClosingFinished 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
onClosingFinished
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting boolean occludesParent(boolean includingFinishing) { if (!includingFinishing && finishing) { return false; } return mOccludesParent || showWallpaper(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: occludesParent 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
occludesParent
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override protected boolean fullyExpandedClearAllVisible() { return mNotificationStackScroller.isDismissViewNotGone() && mNotificationStackScroller.isScrolledToBottom() && !mQsExpandImmediate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fullyExpandedClearAllVisible 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
fullyExpandedClearAllVisible
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
protected void convertNumberToDouble() throws IOException { // Note: this MUST start with more accurate representations, since we don't know which // value is the original one (others get generated when requested) if ((_numTypesValid & NR_BIGDECIMAL) != 0) { _numberDouble = _numberBigDecimal.doubleValue(); } else if ((_numTypesValid & NR_FLOAT) != 0) { _numberDouble = (double) _numberFloat; } else if ((_numTypesValid & NR_BIGINT) != 0) { _numberDouble = _numberBigInt.doubleValue(); } else if ((_numTypesValid & NR_LONG) != 0) { _numberDouble = (double) _numberLong; } else if ((_numTypesValid & NR_INT) != 0) { _numberDouble = (double) _numberInt; } else { _throwInternal(); } _numTypesValid |= NR_DOUBLE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertNumberToDouble 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
convertNumberToDouble
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@GuardedBy("getLockObject()") private void migrateToProfileOnOrganizationOwnedDeviceIfCompLocked() { if (VERBOSE_LOG) Slogf.d(LOG_TAG, "Checking whether we need to migrate COMP "); final int doUserId = mOwners.getDeviceOwnerUserId(); if (doUserId == UserHandle.USER_NULL) { if (VERBOSE_LOG) Slogf.d(LOG_TAG, "No DO found, skipping migration."); return; } final List<UserInfo> profiles = mUserManager.getProfiles(doUserId); if (profiles.size() != 2) { if (profiles.size() == 1) { if (VERBOSE_LOG) Slogf.d(LOG_TAG, "Profile not found, skipping migration."); } else { Slogf.wtf(LOG_TAG, "Found " + profiles.size() + " profiles, skipping migration"); } return; } final int poUserId = getManagedUserId(doUserId); if (poUserId < 0) { Slogf.wtf(LOG_TAG, "Found DO and a profile, but it is not managed, skipping migration"); return; } final ActiveAdmin doAdmin = getDeviceOwnerAdminLocked(); final ActiveAdmin poAdmin = getProfileOwnerAdminLocked(poUserId); if (doAdmin == null || poAdmin == null) { Slogf.wtf(LOG_TAG, "Failed to get either PO or DO admin, aborting migration."); return; } final ComponentName doAdminComponent = mOwners.getDeviceOwnerComponent(); final ComponentName poAdminComponent = mOwners.getProfileOwnerComponent(poUserId); if (doAdminComponent == null || poAdminComponent == null) { Slogf.wtf(LOG_TAG, "Cannot find PO or DO component name, aborting migration."); return; } if (!doAdminComponent.getPackageName().equals(poAdminComponent.getPackageName())) { Slogf.e(LOG_TAG, "DO and PO are different packages, aborting migration."); return; } Slogf.i(LOG_TAG, "Migrating COMP to PO on a corp owned device; primary user: %d; " + "profile: %d", doUserId, poUserId); Slogf.i(LOG_TAG, "Giving the PO additional power..."); setProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked(poAdminComponent, poUserId, true); Slogf.i(LOG_TAG, "Migrating DO policies to PO..."); moveDoPoliciesToProfileParentAdminLocked(doAdmin, poAdmin.getParentActiveAdmin()); migratePersonalAppSuspensionLocked(doUserId, poUserId, poAdmin); saveSettingsLocked(poUserId); Slogf.i(LOG_TAG, "Clearing the DO..."); final ComponentName doAdminReceiver = doAdmin.info.getComponent(); clearDeviceOwnerLocked(doAdmin, doUserId); Slogf.i(LOG_TAG, "Removing admin artifacts..."); removeAdminArtifacts(doAdminReceiver, doUserId); Slogf.i(LOG_TAG, "Uninstalling the DO..."); uninstallOrDisablePackage(doAdminComponent.getPackageName(), doUserId); Slogf.i(LOG_TAG, "Migration complete."); // Note: KeyChain keys are not removed and will remain accessible for the apps that have // been given grants to use them. DevicePolicyEventLogger .createEvent(DevicePolicyEnums.COMP_TO_ORG_OWNED_PO_MIGRATED) .setAdmin(poAdminComponent) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateToProfileOnOrganizationOwnedDeviceIfCompLocked 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
migrateToProfileOnOrganizationOwnedDeviceIfCompLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void addColumn(String identifier, Column<T, ?> column) { if (getColumns().contains(column)) { return; } column.extend(this); columnSet.add(column); columnKeys.put(identifier, column); column.setInternalId(identifier); addDataGenerator(column.getDataGenerator()); getState().columnOrder.add(identifier); getHeader().addColumn(identifier); getFooter().addColumn(identifier); if (getDefaultHeaderRow() != null) { getDefaultHeaderRow().getCell(column).setText(column.getCaption()); } column.updateSortable(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addColumn 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
addColumn
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public Database openOrCreateDB(String databaseName) throws IOException { SQLiteDatabase db; if (databaseName.startsWith("file://")) { db = SQLiteDatabase.openOrCreateDatabase(FileSystemStorage.getInstance().toNativePath(databaseName), null); } else { db = getContext().openOrCreateDatabase(databaseName, getContext().MODE_PRIVATE, null); } return new AndroidDB(db); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openOrCreateDB 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
openOrCreateDB
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void registerAttributionSource(@NonNull AttributionSourceState source) { mAttributionSourceRegistry .registerAttributionSource(new AttributionSource(source)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerAttributionSource File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
registerAttributionSource
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public static byte[] read(InputStream is, byte[] data) throws IOException { return read(is, data, data.length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/java/net/sf/mpxj/common/InputStreamHelper.java Repository: joniles/mpxj The code follows secure coding practices.
[ "CWE-377", "CWE-200" ]
CVE-2022-41954
LOW
3.3
joniles/mpxj
read
src/main/java/net/sf/mpxj/common/InputStreamHelper.java
ae0af24345d79ad45705265d9927fe55e94a5721
0
Analyze the following code function for security vulnerabilities
public String getParamResource() { if ((m_paramResource != null) && !"null".equals(m_paramResource)) { return m_paramResource; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamResource 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
getParamResource
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public static String alterBodyHTML(String HTML, String serverName) { //This is the new Regular Expression for white spaces ([ .\r\n&&[^>]]*) // Replacing links "a href" like tags axcluding the mail to links HTML = HTML.replaceAll("(?i)(?s)<a[^>]+href=\"([^/(http://)(https://)(#)(mailto:\")])(.*)\"[^>]*>", "<a href=\"http://$1$2\">"); HTML = HTML.replaceAll( //"(?i)(?s)<a[^>]+href=\"([^>]+)\"[^>]*>(.*?)</[^>]*a[^>]*>", "(?i)(?s)<a href=\"([^#])([^>]+)\"[^>]*>(.*?)</[^>]*a[^>]*>", "<a href=\"http://" + serverName //+ "/redirect?r=<rId>&redir=$1\">$2</a>") + "/redirect?r=<rId>&redir=$1$2\">$3</a>") .replaceAll("<a href=\"http://" + serverName + "/redirect\\?r=<rId>&redir=(mailto:[^\"]+)\">", "<a href=\"$1\">"); HTML = alterBodyHtmlAbsolutizePaths(HTML, serverName); return HTML; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: alterBodyHTML File: src/com/dotmarketing/factories/EmailFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
alterBodyHTML
src/com/dotmarketing/factories/EmailFactory.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
protected KeyExchangeFuture requestNewKeysExchange() throws Exception { boolean kexRunning = kexHandler.updateState(() -> { boolean isRunning = !kexState.compareAndSet(KexState.DONE, KexState.INIT); if (!isRunning) { kexHandler.initNewKeyExchange(); } return Boolean.valueOf(isRunning); }).booleanValue(); if (kexRunning) { if (log.isDebugEnabled()) { log.debug("requestNewKeysExchange({}) KEX state not DONE: {}", this, kexState); } return null; } log.info("requestNewKeysExchange({}) Initiating key re-exchange", this); DefaultKeyExchangeFuture newFuture = new DefaultKeyExchangeFuture(toString(), null); DefaultKeyExchangeFuture kexFuture = kexFutureHolder.getAndSet(newFuture); if (kexFuture != null) { // Should actually never do anything. We don't reset the kexFuture at the end of KEX, and we do check for a // running KEX above. The old future should in all cases be fulfilled already. kexFuture.setValue(new SshException("New KEX started while previous one still ongoing")); } sendKexInit(); return newFuture; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestNewKeysExchange File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
requestNewKeysExchange
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public List<Endpoint> searchEndpoint(String keyword, String serviceId, int limit) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> condition = new ArrayList<>(5); sql.append("select * from ").append(EndpointTraffic.INDEX_NAME).append(" where "); sql.append(EndpointTraffic.SERVICE_ID).append("=?"); condition.add(serviceId); if (!Strings.isNullOrEmpty(keyword)) { sql.append(" and ").append(EndpointTraffic.NAME).append(" like '%").append(keyword).append("%' "); } sql.append(" limit ").append(limit); List<Endpoint> endpoints = new ArrayList<>(); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery( connection, sql.toString(), condition.toArray(new Object[0]))) { while (resultSet.next()) { Endpoint endpoint = new Endpoint(); endpoint.setId(resultSet.getString(H2TableInstaller.ID_COLUMN)); endpoint.setName(resultSet.getString(EndpointTraffic.NAME)); endpoints.add(endpoint); } } } catch (SQLException e) { throw new IOException(e); } return endpoints; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2020-13921 - Severity: HIGH - CVSS Score: 7.5 Description: fix fuzzy query sql injection Function: searchEndpoint File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java Repository: apache/skywalking Fixed Code: @Override public List<Endpoint> searchEndpoint(String keyword, String serviceId, int limit) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> condition = new ArrayList<>(5); sql.append("select * from ").append(EndpointTraffic.INDEX_NAME).append(" where "); sql.append(EndpointTraffic.SERVICE_ID).append("=?"); condition.add(serviceId); if (!Strings.isNullOrEmpty(keyword)) { sql.append(" and ").append(EndpointTraffic.NAME).append(" like concat('%',?,'%') "); condition.add(keyword); } sql.append(" limit ").append(limit); List<Endpoint> endpoints = new ArrayList<>(); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery( connection, sql.toString(), condition.toArray(new Object[0]))) { while (resultSet.next()) { Endpoint endpoint = new Endpoint(); endpoint.setId(resultSet.getString(H2TableInstaller.ID_COLUMN)); endpoint.setName(resultSet.getString(EndpointTraffic.NAME)); endpoints.add(endpoint); } } } catch (SQLException e) { throw new IOException(e); } return endpoints; }
[ "CWE-89" ]
CVE-2020-13921
HIGH
7.5
apache/skywalking
searchEndpoint
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2MetadataQueryDAO.java
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
1
Analyze the following code function for security vulnerabilities
void configureExecutors() { applicationThreadPool = Executors.newCachedThreadPool(new ThreadFactory() { public Thread newThread(Runnable r) { Thread t = new Thread(r, "AsyncHttpClient-Callback"); t.setDaemon(true); return t; } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configureExecutors File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
configureExecutors
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override public int getPacketBufferSize() { return MAX_ENCRYPTED_PACKET_LENGTH; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPacketBufferSize File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
getPacketBufferSize
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
public static boolean isInternalId(String schema) { String translatedId = translateLegacySystemId(schema); if (translatedId.startsWith(INTERNAL_SCHEME)) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInternalId File: src/org/opencms/xml/CmsXmlEntityResolver.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3312
MEDIUM
4
alkacon/opencms-core
isInternalId
src/org/opencms/xml/CmsXmlEntityResolver.java
92e035423aa6967822d343e54392d4291648c0ee
0
Analyze the following code function for security vulnerabilities
byte[] getData(String key) { return mBundle.get(key); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getData File: src/com/android/certinstaller/CredentialHelper.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
getData
src/com/android/certinstaller/CredentialHelper.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public static void recoverAbusiveSelection(@NonNull Bundle queryArgs) { final String origSelection = queryArgs.getString(QUERY_ARG_SQL_SELECTION); final String origGroupBy = queryArgs.getString(QUERY_ARG_SQL_GROUP_BY); final int index = (origSelection != null) ? origSelection.toUpperCase(Locale.ROOT).indexOf(" GROUP BY ") : -1; if (index != -1) { String selection = origSelection.substring(0, index); String groupBy = origSelection.substring(index + " GROUP BY ".length()); // Try balancing things out selection = maybeBalance(selection); groupBy = maybeBalance(groupBy); // Yell if we already had a group by requested if (!TextUtils.isEmpty(origGroupBy)) { throw new IllegalArgumentException( "Abusive '" + groupBy + "' conflicts with requested '" + origGroupBy + "'"); } Log.w(TAG, "Recovered abusive '" + selection + "' and '" + groupBy + "' from '" + origSelection + "'"); queryArgs.putString(QUERY_ARG_SQL_SELECTION, selection); queryArgs.putString(QUERY_ARG_SQL_GROUP_BY, groupBy); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recoverAbusiveSelection File: src/com/android/providers/media/util/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-35683
MEDIUM
5.5
android
recoverAbusiveSelection
src/com/android/providers/media/util/DatabaseUtils.java
23d156ed1bed6d2c2b325f0be540d0afca510c49
0
Analyze the following code function for security vulnerabilities
private void checkEmailIsExist(String email) { UserExample userExample = new UserExample(); UserExample.Criteria criteria = userExample.createCriteria(); criteria.andEmailEqualTo(email); List<User> userList = userMapper.selectByExample(userExample); if (!CollectionUtils.isEmpty(userList)) { MSException.throwException(Translator.get("user_email_already_exists")); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkEmailIsExist File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
checkEmailIsExist
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
public boolean canConvert(Class type) { if (this.type != null) { return type.equals(this.type); } return type.equals(HashMap.class) || type.equals(Hashtable.class) || type.getName().equals("java.util.LinkedHashMap") || type.getName().equals("java.util.concurrent.ConcurrentHashMap") || type.getName().equals("sun.font.AttributeMap") // Used by java.awt.Font in JDK 6 ; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canConvert File: xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
canConvert
xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
void dispatchMediaKeyRepeatWithWakeLock(KeyEvent event) { mHavePendingMediaKeyRepeatWithWakeLock = false; KeyEvent repeatEvent = KeyEvent.changeTimeRepeat(event, SystemClock.uptimeMillis(), 1, event.getFlags() | KeyEvent.FLAG_LONG_PRESS); if (DEBUG_INPUT) { Slog.d(TAG, "dispatchMediaKeyRepeatWithWakeLock: " + repeatEvent); } dispatchMediaKeyWithWakeLockToAudioService(repeatEvent); mBroadcastWakeLock.release(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchMediaKeyRepeatWithWakeLock 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
dispatchMediaKeyRepeatWithWakeLock
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void afterTextChanged(Editable editable) { filter(editable.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: afterTextChanged File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
afterTextChanged
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void onError(int errorCode, String errorMessage) { mNumErrors++; IAccountManagerResponse response = getResponseAndClose(); if (response != null) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, getClass().getSimpleName() + " calling onError() on response " + response); } try { response.onError(errorCode, errorMessage); } catch (RemoteException e) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Session.onError: caught RemoteException while responding", e); } } } else { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "Session.onError: already closed"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onError File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
onError
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@SneakyThrows public void drop(String tenantKey) { StopWatch stopWatch = createStarted(); log.info("START - SETUP:DeleteTenant:schema tenantKey: {}", tenantKey); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) { statement.executeUpdate(String.format(schemaDropResolver.getSchemaDropCommand(), tenantKey)); log.info("STOP - SETUP:DeleteTenant:schema tenantKey: {}, result: OK, time = {} ms", tenantKey, stopWatch.getTime()); } catch (Exception e) { log.info("STOP - SETUP:DeleteTenant:schema tenantKey: {}, result: FAIL, error: {}, time = {} ms", tenantKey, e.getMessage(), stopWatch.getTime()); throw e; } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15557 - Severity: HIGH - CVSS Score: 7.5 Description: add assertTenantKeyValid Function: drop File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java Repository: xm-online/xm-uaa Fixed Code: @SneakyThrows public void drop(String tenantKey) { StopWatch stopWatch = createStarted(); log.info("START - SETUP:DeleteTenant:schema tenantKey: {}", tenantKey); assertTenantKeyValid(tenantKey); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement()) { statement.executeUpdate(String.format(schemaDropResolver.getSchemaDropCommand(), tenantKey)); log.info("STOP - SETUP:DeleteTenant:schema tenantKey: {}, result: OK, time = {} ms", tenantKey, stopWatch.getTime()); } catch (Exception e) { log.info("STOP - SETUP:DeleteTenant:schema tenantKey: {}, result: FAIL, error: {}, time = {} ms", tenantKey, e.getMessage(), stopWatch.getTime()); throw e; } }
[ "CWE-89" ]
CVE-2019-15557
HIGH
7.5
xm-online/xm-uaa
drop
src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java
ffa9609c809c17e7a39ae1d92843c4463e3ca739
1
Analyze the following code function for security vulnerabilities
public MapEntry toRestMapEntry(String key, java.lang.Object value) throws XWikiRestException { MapEntry restMapEntry = this.objectFactory.createMapEntry(); restMapEntry.setKey(key); try { restMapEntry.setValue(this.jaxbConverter.serializeAny(value)); } catch (ParserConfigurationException e) { throw new XWikiRestException("Failed to serialize property [" + key + "] with value [" + value + "]", e); } return restMapEntry; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toRestMapEntry File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-35151
HIGH
7.5
xwiki/xwiki-platform
toRestMapEntry
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/ModelFactory.java
824cd742ecf5439971247da11bfe7e0ad2b10ede
0
Analyze the following code function for security vulnerabilities
@Override public String changePassword(String newPassword) { try { new AccountManager(mXMPPConnection).changePassword(newPassword); return "OK"; //HACK: hard coded string to differentiate from failure modes } catch (XMPPException e) { if (e.getXMPPError() != null) return e.getXMPPError().toString(); else return e.getLocalizedMessage(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: changePassword File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
changePassword
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition trace() { return appendDefinition(TRACE, "*", handler(TraceHandler.class)).name("*.trace"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trace File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
trace
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static MatrixCursor packageSettingForQuery(Setting setting, String[] projection) { if (setting.isNull()) { return new MatrixCursor(projection, 0); } MatrixCursor cursor = new MatrixCursor(projection, 1); appendSettingToCursor(cursor, setting); return cursor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: packageSettingForQuery File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
packageSettingForQuery
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
protected String getUser() { return System.getProperty(KieServerConstants.CFG_KIE_USER, "kieserver"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUser File: kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
getUser
kie-server-parent/kie-server-controller/kie-server-controller-impl/src/main/java/org/kie/server/controller/impl/client/RestKieServicesClientProvider.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getApplicationRestrictions(ComponentName who, String callerPackage, String packageName) { final CallerIdentity caller = getCallerIdentity(who, callerPackage); if (isUnicornFlagEnabled()) { EnforcingAdmin enforcingAdmin = enforceCanQueryAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_APP_RESTRICTIONS, caller.getPackageName(), caller.getUserId() ); LinkedHashMap<EnforcingAdmin, PolicyValue<Bundle>> policies = mDevicePolicyEngine.getLocalPoliciesSetByAdmins( PolicyDefinition.APPLICATION_RESTRICTIONS(packageName), caller.getUserId()); if (policies.isEmpty() || !policies.containsKey(enforcingAdmin)) { return Bundle.EMPTY; } return policies.get(enforcingAdmin).getValue(); } else { Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isProfileOwner(caller) || isDefaultDeviceOwner(caller))) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_APP_RESTRICTIONS))); return mInjector.binderWithCleanCallingIdentity(() -> { Bundle bundle = mUserManager.getApplicationRestrictions(packageName, caller.getUserHandle()); // if no restrictions were saved, mUserManager.getApplicationRestrictions // returns null, but DPM method should return an empty Bundle as per JavaDoc return bundle != null ? bundle : Bundle.EMPTY; }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationRestrictions 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
getApplicationRestrictions
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void removeUriPermissionsLocked() { if (uriPermissions != null) { uriPermissions.removeUriPermissions(); uriPermissions = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUriPermissionsLocked 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
removeUriPermissionsLocked
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public Optional<PropertyDefinition<T, ?>> getProperty(String name) { throw new IllegalStateException( "A Grid created without a bean type class literal or a custom property set" + " doesn't support finding properties by name."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProperty 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
getProperty
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public static byte[] cacheNameBytes(String cacheName) { return cacheName.equals(DEFAULT_CACHE_NAME) ? HotRodConstants.DEFAULT_CACHE_NAME_BYTES : cacheName.getBytes(HotRodConstants.HOTROD_STRING_CHARSET); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cacheNameBytes File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
cacheNameBytes
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
public Bundle getAssistContextExtras(int requestType) { PendingAssistExtras pae = enqueueAssistContext(requestType, null, null, UserHandle.getCallingUserId()); if (pae == null) { return null; } synchronized (pae) { while (!pae.haveResult) { try { pae.wait(); } catch (InterruptedException e) { } } if (pae.result != null) { pae.extras.putBundle(Intent.EXTRA_ASSIST_CONTEXT, pae.result); } } synchronized (this) { mPendingAssistExtras.remove(pae); mHandler.removeCallbacks(pae); } return pae.extras; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssistContextExtras 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
getAssistContextExtras
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@RequestMapping("execSql") @Csrf public String execSql(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String sql, HttpServletRequest request, ModelMap model) { if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) { return CommonConstants.TEMPLATE_ERROR; } if (sql.contains(CommonConstants.BLANK_SPACE)) { String type = sql.substring(0, sql.indexOf(CommonConstants.BLANK_SPACE)); try { if ("update".equalsIgnoreCase(type)) { model.addAttribute("result", sqlService.update(sql)); } else if ("insert".equalsIgnoreCase(type)) { model.addAttribute("result", sqlService.insert(sql)); } else if ("delete".equalsIgnoreCase(type)) { model.addAttribute("result", sqlService.delete(sql)); } else { model.addAttribute("result", JsonUtils.getString(sqlService.select(sql))); } } catch (Exception e) { model.addAttribute("error", e.getMessage()); } model.addAttribute("sql", sql); logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "execsql.site", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(model))); } return CommonConstants.TEMPLATE_DONE; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2020-20914 - Severity: CRITICAL - CVSS Score: 9.8 Description: https://github.com/sanluan/PublicCMS/issues/29 Function: execSql File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java Repository: sanluan/PublicCMS Fixed Code: @RequestMapping("execSql") @Csrf public String execSql(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String sqlcommand, String[] sqlparameters, HttpServletRequest request, ModelMap model) { if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) { return CommonConstants.TEMPLATE_ERROR; } if ("update_url".contains(sqlcommand)) { if (null != sqlparameters && 2 == sqlparameters.length) { try { String oldurl = sqlparameters[0]; String newurl = sqlparameters[1]; int i = sqlService.updateContentAttribute(oldurl, newurl); i += sqlService.updateContentRelated(oldurl, newurl); i += sqlService.updatePlace(oldurl, newurl); i += sqlService.updatePlaceAttribute(oldurl, newurl); model.addAttribute("result", i); } catch (Exception e) { model.addAttribute("error", e.getMessage()); } } } model.addAttribute("sqlcommand", sqlcommand); model.addAttribute("sqlparameters", sqlparameters); logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "execsql.site", RequestUtils.getIpAddress(request), CommonUtils.getDate(), JsonUtils.getString(model))); return CommonConstants.TEMPLATE_DONE; }
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
execSql
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
1
Analyze the following code function for security vulnerabilities
@Override public Map<String, Object> attributes() { return route.attributes(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attributes File: jooby/src/main/java/org/jooby/internal/RouteImpl.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-15477
MEDIUM
4.3
jooby-project/jooby
attributes
jooby/src/main/java/org/jooby/internal/RouteImpl.java
34856a738829d8fedca4ed27bd6ff413af87186f
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsEmptyArrayDisabled() throws Throwable { try { READER.readValue("[]"); fail("expected MismatchedInputException"); } catch (MismatchedInputException e) { verifyException(e, "Cannot deserialize instance of `java.time.Duration` out of START_ARRAY"); } try { newMapper() .configure(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS, true) .readerFor(Duration.class).readValue(aposToQuotes("[]")); fail("expected MismatchedInputException"); } catch (MismatchedInputException e) { verifyException(e, "Unexpected token (END_ARRAY), expected one of"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsEmptyArrayDisabled File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsEmptyArrayDisabled
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
byte[] downloadXtraData() { byte[] result = null; int startIndex = mNextServerIndex; if (mXtraServers == null) { return null; } // load balance our requests among the available servers while (result == null) { result = doDownload(mXtraServers[mNextServerIndex]); // increment mNextServerIndex and wrap around if necessary mNextServerIndex++; if (mNextServerIndex == mXtraServers.length) { mNextServerIndex = 0; } // break if we have tried all the servers if (mNextServerIndex == startIndex) break; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: downloadXtraData File: services/core/java/com/android/server/location/GpsXtraDownloader.java Repository: android The code follows secure coding practices.
[ "CWE-399" ]
CVE-2016-5348
HIGH
7.1
android
downloadXtraData
services/core/java/com/android/server/location/GpsXtraDownloader.java
218b813d5bc2d7d3952ea1861c38b4aa944ac59b
0
Analyze the following code function for security vulnerabilities
private final int jjStopStringLiteralDfa_2(int pos, long active0) { switch (pos) { case 0: if ((active0 & 0x80000L) != 0L) return 1; if ((active0 & 0x50755550070000L) != 0L) { jjmatchedKind = 58; return 6; } return -1; case 1: if ((active0 & 0x105550000000L) != 0L) return 6; if ((active0 & 0x50650000070000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 1; return 6; } return -1; case 2: if ((active0 & 0x50050000000000L) != 0L) return 6; if ((active0 & 0x600000070000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 2; return 6; } return -1; case 3: if ((active0 & 0x50000L) != 0L) return 6; if ((active0 & 0x600000020000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 3; return 6; } return -1; case 4: if ((active0 & 0x400000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 4; return 6; } if ((active0 & 0x200000020000L) != 0L) return 6; return -1; case 5: if ((active0 & 0x400000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 5; return 6; } return -1; case 6: if ((active0 & 0x400000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 6; return 6; } return -1; case 7: if ((active0 & 0x400000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 7; return 6; } return -1; case 8: if ((active0 & 0x400000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 8; return 6; } return -1; default : return -1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjStopStringLiteralDfa_2 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjStopStringLiteralDfa_2
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
public static void copy(File input, File output) throws IOException { org.apache.commons.io.FileUtils.copyFile(input, output); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copy File: src/main/java/com/openkm/util/FileUtils.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-377" ]
CVE-2022-3969
MEDIUM
5.5
openkm/document-management-system
copy
src/main/java/com/openkm/util/FileUtils.java
c069e4d73ab8864345c25119d8459495f45453e1
0
Analyze the following code function for security vulnerabilities
private static void fixInvalidToolbarLib(Element root) { assert (root != null); // Iterate on toolbars -- though there should be only one! for (Element toolbarElt : XmlIterator.forChildElements(root, "toolbar")) { cleanupToolsLabel(toolbarElt); } // Iterate on libs for (Element libsElt : XmlIterator.forChildElements(root, "lib")) { cleanupToolsLabel(libsElt); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fixInvalidToolbarLib File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
fixInvalidToolbarLib
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") protected void setSelectionModel(GridSelectionModel<T> model) { Objects.requireNonNull(model, "selection model cannot be null"); if (selectionModel != null) { // null when called from constructor selectionModel.remove(); } selectionModel = model; if (selectionModel instanceof AbstractListingExtension) { ((AbstractListingExtension<T>) selectionModel).extend(this); } else { addExtension(selectionModel); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSelectionModel 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
setSelectionModel
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public boolean shouldDeferAnimationFinish(Runnable endDeferFinishCallback) { return mAnimatingActivityRegistry != null && mAnimatingActivityRegistry.notifyAboutToFinish( this, endDeferFinishCallback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldDeferAnimationFinish 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
shouldDeferAnimationFinish
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public void service() throws ONetworkProtocolException, IOException { ++connection.data.totalRequests; connection.data.commandInfo = null; connection.data.commandDetail = null; final String callbackF; if ((request.parameters != null) && request.parameters.containsKey(OHttpUtils.CALLBACK_PARAMETER_NAME)) callbackF = request.parameters.get(OHttpUtils.CALLBACK_PARAMETER_NAME); else callbackF = null; response = new OHttpResponse(channel.outStream, request.httpVersion, additionalResponseHeaders, responseCharSet, connection.data.serverInfo, request.sessionId, callbackF, request.keepAlive, connection); response.setJsonErrorResponse(jsonResponseError); if (request.contentEncoding != null && request.contentEncoding.equals(OHttpUtils.CONTENT_ACCEPT_GZIP_ENCODED)) { response.setContentEncoding(OHttpUtils.CONTENT_ACCEPT_GZIP_ENCODED); } waitNodeIsOnline(); final long begin = System.currentTimeMillis(); boolean isChain; do { isChain = false; final String command; if (request.url.length() < 2) { command = ""; } else { command = request.url.substring(1); } final String commandString = getCommandString(command); final OServerCommand cmd = (OServerCommand) cmdManager.getCommand(commandString); Map<String, String> requestParams = cmdManager.extractUrlTokens(commandString); if (requestParams != null) { if (request.parameters == null) { request.parameters = new HashMap<String, String>(); } for (Map.Entry<String, String> entry : requestParams.entrySet()) { request.parameters.put(entry.getKey(), URLDecoder.decode(entry.getValue(), "UTF-8")); } } if (cmd != null) try { if (cmd.beforeExecute(request, response)) try { // EXECUTE THE COMMAND isChain = cmd.execute(request, response); } finally { cmd.afterExecute(request, response); } } catch (Exception e) { handleError(e); } else { try { OLogManager.instance().warn( this, "->" + channel.socket.getInetAddress().getHostAddress() + ": Command not found: " + request.httpMethod + "." + URLDecoder.decode(command, "UTF-8")); sendError(OHttpUtils.STATUS_INVALIDMETHOD_CODE, OHttpUtils.STATUS_INVALIDMETHOD_DESCRIPTION, null, OHttpUtils.CONTENT_TEXT_PLAIN, "Command not found: " + command, request.keepAlive); } catch (IOException e1) { sendShutdown(); } } } while (isChain); connection.data.lastCommandInfo = connection.data.commandInfo; connection.data.lastCommandDetail = connection.data.commandDetail; connection.data.lastCommandExecutionTime = System.currentTimeMillis() - begin; connection.data.totalCommandExecutionTime += connection.data.lastCommandExecutionTime; }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2015-2912 - Severity: MEDIUM - CVSS Score: 6.8 Description: Fixed issue #4824 by disabling JSONP support by default Function: service File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java Repository: orientechnologies/orientdb Fixed Code: public void service() throws ONetworkProtocolException, IOException { ++connection.data.totalRequests; connection.data.commandInfo = null; connection.data.commandDetail = null; final String callbackF; if (OGlobalConfiguration.NETWORK_HTTP_JSONP_ENABLED.getValueAsBoolean() && request.parameters != null && request.parameters.containsKey(OHttpUtils.CALLBACK_PARAMETER_NAME)) callbackF = request.parameters.get(OHttpUtils.CALLBACK_PARAMETER_NAME); else callbackF = null; response = new OHttpResponse(channel.outStream, request.httpVersion, additionalResponseHeaders, responseCharSet, connection.data.serverInfo, request.sessionId, callbackF, request.keepAlive, connection); response.setJsonErrorResponse(jsonResponseError); if (request.contentEncoding != null && request.contentEncoding.equals(OHttpUtils.CONTENT_ACCEPT_GZIP_ENCODED)) { response.setContentEncoding(OHttpUtils.CONTENT_ACCEPT_GZIP_ENCODED); } waitNodeIsOnline(); final long begin = System.currentTimeMillis(); boolean isChain; do { isChain = false; final String command; if (request.url.length() < 2) { command = ""; } else { command = request.url.substring(1); } final String commandString = getCommandString(command); final OServerCommand cmd = (OServerCommand) cmdManager.getCommand(commandString); Map<String, String> requestParams = cmdManager.extractUrlTokens(commandString); if (requestParams != null) { if (request.parameters == null) { request.parameters = new HashMap<String, String>(); } for (Map.Entry<String, String> entry : requestParams.entrySet()) { request.parameters.put(entry.getKey(), URLDecoder.decode(entry.getValue(), "UTF-8")); } } if (cmd != null) try { if (cmd.beforeExecute(request, response)) try { // EXECUTE THE COMMAND isChain = cmd.execute(request, response); } finally { cmd.afterExecute(request, response); } } catch (Exception e) { handleError(e); } else { try { OLogManager.instance().warn( this, "->" + channel.socket.getInetAddress().getHostAddress() + ": Command not found: " + request.httpMethod + "." + URLDecoder.decode(command, "UTF-8")); sendError(OHttpUtils.STATUS_INVALIDMETHOD_CODE, OHttpUtils.STATUS_INVALIDMETHOD_DESCRIPTION, null, OHttpUtils.CONTENT_TEXT_PLAIN, "Command not found: " + command, request.keepAlive); } catch (IOException e1) { sendShutdown(); } } } while (isChain); connection.data.lastCommandInfo = connection.data.commandInfo; connection.data.lastCommandDetail = connection.data.commandDetail; connection.data.lastCommandExecutionTime = System.currentTimeMillis() - begin; connection.data.totalCommandExecutionTime += connection.data.lastCommandExecutionTime; }
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
service
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
1
Analyze the following code function for security vulnerabilities
@Override protected XMLInputFactory initialValue() { return getXMLInputFactory(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialValue File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
initialValue
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
public void setPreExpandValueSets(boolean thePreExpandValueSets) { myPreExpandValueSets = thePreExpandValueSets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPreExpandValueSets File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setPreExpandValueSets
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0