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
@Transactional(readOnly = false) public void completeFirstTask(String procInsId, String comment, String title, Map<String, Object> vars){ String userId = UserUtils.getUser().getLoginName(); Task task = taskService.createTaskQuery().taskAssignee(userId).processInstanceId(procInsId).active().singleResult(); if (task != null){ complete(task.getId(), procInsId, comment, title, vars); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: completeFirstTask File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
completeFirstTask
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
public static void addItem(final RequestScopedItem item) { final List<RequestScopedItem> cache = CACHE.get(); checkCacheForAdding(cache); cache.add(item); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItem File: impl/src/main/java/org/jboss/weld/context/cache/RequestScopedCache.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
addItem
impl/src/main/java/org/jboss/weld/context/cache/RequestScopedCache.java
6808b11cd6d97c71a2eed754ed4f955acd789086
0
Analyze the following code function for security vulnerabilities
public void unlinkDeathRecipient() { if (deathRecipient != null && thread != null) { thread.asBinder().unlinkToDeath(deathRecipient, 0); } deathRecipient = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlinkDeathRecipient File: services/core/java/com/android/server/am/ProcessRecord.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
unlinkDeathRecipient
services/core/java/com/android/server/am/ProcessRecord.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public Map<String, Authentication> getAuthentications() { return authentications; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthentications File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getAuthentications
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public static List<Structure> findStructuresUserCanUse(User user, String query, Integer structureType, int offset, int limit) throws DotDataException, DotSecurityException { return PermissionedWebAssetUtil.findStructuresForLimitedUser(query, structureType, "name", offset, limit, PermissionAPI.PERMISSION_READ, user, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findStructuresUserCanUse File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
findStructuresUserCanUse
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private int numberOfUsersOfTypeLocked(int flags, boolean excludeDying) { int count = 0; for (int i = mUsers.size() - 1; i >= 0; i--) { UserInfo user = mUsers.valueAt(i); if (!excludeDying || !mRemovingUserIds.get(user.id)) { if ((user.flags & flags) != 0) { count++; } } } return count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: numberOfUsersOfTypeLocked File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
numberOfUsersOfTypeLocked
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
private void closeInflater() { //GZIPInputStream allocates native resources //via inf.end() these resources are released. inf.end(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeInflater File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
closeInflater
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected OutputStream createFileOuputStream(String fileName) throws FileNotFoundException { return new FileOutputStream(removeFilePrefix(fileName)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFileOuputStream 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
createFileOuputStream
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void initDefaultGroupNames(Context context) throws SQLException, AuthorizeException { GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); // Check for Anonymous group. If not found, create it Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS); if (anonymousGroup == null) { anonymousGroup = groupService.create(context); anonymousGroup.setName(Group.ANONYMOUS); anonymousGroup.setPermanent(true); groupService.update(context, anonymousGroup); } // Check for Administrator group. If not found, create it Group adminGroup = groupService.findByName(context, Group.ADMIN); if (adminGroup == null) { adminGroup = groupService.create(context); adminGroup.setName(Group.ADMIN); adminGroup.setPermanent(true); groupService.update(context, adminGroup); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initDefaultGroupNames File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
initDefaultGroupNames
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
protected void filterContacts(String needle) { this.contacts.clear(); final List<Account> accounts = xmppConnectionService.getAccounts(); final boolean singleAccountActive = isSingleAccountActive(accounts); for (Account account : accounts) { if (account.getStatus() != Account.State.DISABLED) { for (Contact contact : account.getRoster().getContacts()) { Presence.Status s = contact.getShownStatus(); if ((contact.showInRoster() || (singleAccountActive && contact.showInPhoneBook())) && contact.match(this, needle) && (!this.mHideOfflineContacts || (needle != null && !needle.trim().isEmpty()) || s.compareTo(Presence.Status.OFFLINE) < 0)) { this.contacts.add(contact); } } } } Collections.sort(this.contacts); mContactsAdapter.notifyDataSetChanged(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterContacts 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
filterContacts
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Nullable String[] getResourceStringArray(@ArrayRes int resId) { synchronized (this) { ensureValidLocked(); return nativeGetResourceStringArray(mObject, resId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceStringArray File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getResourceStringArray
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private String tryRewrite(String s) throws IOException, InvalidKeyException { if (s.length()<24) return s; // Encrypting "" in Secret produces 24-letter characters, so this must be the minimum length if (!isBase64(s)) return s; // decode throws IOException if the input is not base64, and this is also a very quick way to filter byte[] in; try { in = Base64.decode(s.toCharArray()); } catch (IOException e) { return s; // not a valid base64 } cipher.init(Cipher.DECRYPT_MODE, key); Secret sec = Secret.tryDecrypt(cipher, in); if(sec!=null) // matched return sec.getEncryptedValue(); // replace by the new encrypted value else // not encrypted with the legacy key. leave it unmodified return s; }
Vulnerability Classification: - CWE: CWE-326 - CVE: CVE-2017-2598 - Severity: MEDIUM - CVSS Score: 4.0 Description: Merge pull request #105 from jenkinsci-cert/SECURITY-304-t3 [SECURITY-304] Encrypt new secrets with CBC and random IV instead of ECB Function: tryRewrite File: core/src/main/java/hudson/util/SecretRewriter.java Repository: jenkinsci/jenkins Fixed Code: private String tryRewrite(String s) throws IOException, InvalidKeyException { if (s.length()<24) return s; // Encrypting "" in Secret produces 24-letter characters, so this must be the minimum length if (!isBase64(s)) return s; // decode throws IOException if the input is not base64, and this is also a very quick way to filter byte[] in; try { in = Base64.decode(s.toCharArray()); } catch (IOException e) { return s; // not a valid base64 } cipher.init(Cipher.DECRYPT_MODE, key); Secret sec = HistoricalSecrets.tryDecrypt(cipher, in); if(sec!=null) // matched return sec.getEncryptedValue(); // replace by the new encrypted value else // not encrypted with the legacy key. leave it unmodified return s; }
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
tryRewrite
core/src/main/java/hudson/util/SecretRewriter.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
1
Analyze the following code function for security vulnerabilities
protected int getShortTextLimit() { if (this.shortTextLimit == -1) { try { this.shortTextLimit = this.componentManager.<HibernateStore>getInstance(HibernateStore.class) .getLimitSize(StringProperty.class, "value"); } catch (ComponentLookupException e) { this.logger.debug("Failed to get the max short text size", e); // Fallback on the expected default return 768; } } return this.shortTextLimit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getShortTextLimit File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
getShortTextLimit
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/metadata/AbstractSolrMetadataExtractor.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "14.0RC1") public DocumentReference getAuthorReference() { UserReference effectiveMetadataAuthor = getAuthors().getEffectiveMetadataAuthor(); if (this.getAuthors().getEffectiveMetadataAuthor() != null && effectiveMetadataAuthor != GuestUserReference.INSTANCE) { return this.getUserReferenceDocumentReferenceSerializer().serialize(effectiveMetadataAuthor); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthorReference 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
getAuthorReference
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 List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; } if (valueCollection.isEmpty()){ return params; } // get the collection format (default: csv) String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { for (Object item : valueCollection) { params.add(new Pair(name, parameterToString(item))); } return params; } String delimiter = ","; if ("csv".equals(format)) { delimiter = ","; } else if ("ssv".equals(format)) { delimiter = " "; } else if ("tsv".equals(format)) { delimiter = "\t"; } else if ("pipes".equals(format)) { delimiter = "|"; } StringBuilder sb = new StringBuilder() ; for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); } params.add(new Pair(name, sb.substring(1))); return params; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToPairs File: samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parameterToPairs
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void sendChangedNotification(int userHandle) { Intent intent = new Intent(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); mInjector.binderWithCleanCallingIdentity(() -> mContext.sendBroadcastAsUser(intent, new UserHandle(userHandle))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendChangedNotification 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
sendChangedNotification
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String optString(String key) { return optString(key, ""); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optString File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
optString
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
private boolean deleteSystemPackageLI(PackageSetting newPs, int[] allUserHandles, boolean[] perUserInstalled, int flags, PackageRemovedInfo outInfo, boolean writeSettings) { final boolean applyUserRestrictions = (allUserHandles != null) && (perUserInstalled != null); PackageSetting disabledPs = null; // Confirm if the system package has been updated // An updated system app can be deleted. This will also have to restore // the system pkg from system partition // reader synchronized (mPackages) { disabledPs = mSettings.getDisabledSystemPkgLPr(newPs.name); } if (DEBUG_REMOVE) Slog.d(TAG, "deleteSystemPackageLI: newPs=" + newPs + " disabledPs=" + disabledPs); if (disabledPs == null) { Slog.w(TAG, "Attempt to delete unknown system package "+ newPs.name); return false; } else if (DEBUG_REMOVE) { Slog.d(TAG, "Deleting system pkg from data partition"); } if (DEBUG_REMOVE) { if (applyUserRestrictions) { Slog.d(TAG, "Remembering install states:"); for (int i = 0; i < allUserHandles.length; i++) { Slog.d(TAG, " u=" + allUserHandles[i] + " inst=" + perUserInstalled[i]); } } } // Delete the updated package outInfo.isRemovedPackageSystemUpdate = true; if (disabledPs.versionCode < newPs.versionCode) { // Delete data for downgrades flags &= ~PackageManager.DELETE_KEEP_DATA; } else { // Preserve data by setting flag flags |= PackageManager.DELETE_KEEP_DATA; } boolean ret = deleteInstalledPackageLI(newPs, true, flags, allUserHandles, perUserInstalled, outInfo, writeSettings); if (!ret) { return false; } // writer synchronized (mPackages) { // Reinstate the old system package mSettings.enableSystemPackageLPw(newPs.name); // Remove any native libraries from the upgraded package. NativeLibraryHelper.removeNativeBinariesLI(newPs.legacyNativeLibraryPathString); } // Install the system package if (DEBUG_REMOVE) Slog.d(TAG, "Re-installing system package: " + disabledPs); int parseFlags = PackageParser.PARSE_MUST_BE_APK | PackageParser.PARSE_IS_SYSTEM; if (locationIsPrivileged(disabledPs.codePath)) { parseFlags |= PackageParser.PARSE_IS_PRIVILEGED; } final PackageParser.Package newPkg; try { newPkg = scanPackageLI(disabledPs.codePath, parseFlags, SCAN_NO_PATHS, 0, null); } catch (PackageManagerException e) { Slog.w(TAG, "Failed to restore system package:" + newPs.name + ": " + e.getMessage()); return false; } // writer synchronized (mPackages) { PackageSetting ps = mSettings.mPackages.get(newPkg.packageName); // Propagate the permissions state as we do not want to drop on the floor // runtime permissions. The update permissions method below will take // care of removing obsolete permissions and grant install permissions. ps.getPermissionsState().copyFrom(newPs.getPermissionsState()); updatePermissionsLPw(newPkg.packageName, newPkg, UPDATE_PERMISSIONS_ALL | UPDATE_PERMISSIONS_REPLACE_PKG); if (applyUserRestrictions) { if (DEBUG_REMOVE) { Slog.d(TAG, "Propagating install state across reinstall"); } for (int i = 0; i < allUserHandles.length; i++) { if (DEBUG_REMOVE) { Slog.d(TAG, " user " + allUserHandles[i] + " => " + perUserInstalled[i]); } ps.setInstalled(perUserInstalled[i], allUserHandles[i]); mSettings.writeRuntimePermissionsForUserLPr(allUserHandles[i], false); } // Regardless of writeSettings we need to ensure that this restriction // state propagation is persisted mSettings.writeAllUsersPackageRestrictionsLPr(); } // can downgrade to reader here if (writeSettings) { mSettings.writeLPr(); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteSystemPackageLI File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
deleteSystemPackageLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
static String loggerName(Class<?> klass, String oortURL, String name) { String result = klass.getName() + "." + replacePunctuation(oortURL, '_'); if (name != null) { result += "." + name; } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loggerName 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
loggerName
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalSetBacklogQuota(BacklogQuota.BacklogQuotaType backlogQuotaType, BacklogQuotaImpl backlogQuota) { validateTopicPolicyOperation(topicName, PolicyName.BACKLOG, PolicyOperation.WRITE); validatePoliciesReadOnlyAccess(); BacklogQuota.BacklogQuotaType finalBacklogQuotaType = backlogQuotaType == null ? BacklogQuota.BacklogQuotaType.destination_storage : backlogQuotaType; return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new); RetentionPolicies retentionPolicies = getRetentionPolicies(topicName, topicPolicies); if (!checkBacklogQuota(backlogQuota, retentionPolicies)) { log.warn( "[{}] Failed to update backlog configuration for topic {}: conflicts with retention quota", clientAppId(), topicName); return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED, "Backlog Quota exceeds configured retention quota for topic. " + "Please increase retention quota and retry")); } if (backlogQuota != null) { topicPolicies.getBackLogQuotaMap().put(finalBacklogQuotaType.name(), backlogQuota); } else { topicPolicies.getBackLogQuotaMap().remove(finalBacklogQuotaType.name()); } Map<String, BacklogQuotaImpl> backLogQuotaMap = topicPolicies.getBackLogQuotaMap(); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies) .thenRun(() -> { try { log.info("[{}] Successfully updated backlog quota map: namespace={}, topic={}, map={}", clientAppId(), namespaceName, topicName.getLocalName(), jsonMapper().writeValueAsString(backLogQuotaMap)); } catch (JsonProcessingException ignore) { } }); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetBacklogQuota File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetBacklogQuota
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public void setProcessForeground(IBinder token, int pid, boolean isForeground) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessForeground File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setProcessForeground
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static PluggableSCMMaterial pluggableSCMMaterial(String scmId, String scmName, ConfigurationProperty... properties) { return pluggableSCMMaterial(scmId, scmName, "pluginid", "version", Arrays.asList(properties)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pluggableSCMMaterial File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
pluggableSCMMaterial
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
private String addUserCaseStateAccessClause(MetaData metadata) { // restrict cases to the case states the user has access to List<String> caseStateIds = authorisedCaseDefinitionDataService.getUserAuthorisedCaseStateIds(metadata.getJurisdiction(), metadata.getCaseTypeId(), CAN_READ); if (!caseStateIds.isEmpty()) { return String.format(" AND state IN ('%s')", String.join("','", caseStateIds)); } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addUserCaseStateAccessClause File: src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java Repository: hmcts/ccd-data-store-api The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15569
HIGH
7.5
hmcts/ccd-data-store-api
addUserCaseStateAccessClause
src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java
c942d5ce847ab1b4acce8753320096e596b42c72
0
Analyze the following code function for security vulnerabilities
private PackageInfo getCallingPackageInfoOrThrow(int userId) { try { PackageInfo packageInfo = mPackageManager.getPackageInfo( getCallingPackage(), 0, userId); if (packageInfo != null) { return packageInfo; } } catch (RemoteException e) { /* ignore */ } throw new IllegalStateException("Calling package doesn't exist"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallingPackageInfoOrThrow 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
getCallingPackageInfoOrThrow
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; // also set the date format for model (de)serialization with Date properties this.json.setDateFormat((DateFormat) dateFormat.clone()); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDateFormat File: samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setDateFormat
samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Deprecated @Override public void requestTelephonyBugReport(String shareTitle, String shareDescription) { requestBugReportWithDescription(shareTitle, shareDescription, ActivityManager.BUGREPORT_OPTION_TELEPHONY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestTelephonyBugReport File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
requestTelephonyBugReport
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public ApiClient setUserAgent(String userAgent) { userAgent = userAgent; addDefaultHeader("User-Agent", userAgent); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserAgent File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setUserAgent
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void setActive(boolean active) { this.active = active; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setActive File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
setActive
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
@Override public List<Service> getAllServices(long startTimestamp, long endTimestamp) throws IOException { StringBuilder sql = new StringBuilder(); List<Object> condition = new ArrayList<>(5); sql.append("select * from ").append(ServiceTraffic.INDEX_NAME).append(" where "); sql.append(ServiceTraffic.NODE_TYPE).append("=?"); condition.add(NodeType.Normal.value()); sql.append(" limit ").append(metadataQueryMaxSize); try (Connection connection = h2Client.getConnection()) { try (ResultSet resultSet = h2Client.executeQuery( connection, sql.toString(), condition.toArray(new Object[0]))) { return buildServices(resultSet); } } catch (SQLException e) { throw new IOException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllServices 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 The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-13921
HIGH
7.5
apache/skywalking
getAllServices
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
0
Analyze the following code function for security vulnerabilities
private static void unexpectedException(final Exception exception) { Logging.unexpectedException(Hints.class, "scanSystemProperties", exception); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unexpectedException 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
unexpectedException
modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java
4f70fa3234391dd0cda883a20ab0ec75688cba49
0
Analyze the following code function for security vulnerabilities
public NavigationBarView getNavigationBarView() { return (NavigationBarView) mNavigationBar.getView(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNavigationBarView File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
getNavigationBarView
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public String getBaseURI() { return getPage().getUrl().toExternalForm(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseURI File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
getBaseURI
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
public List<IssuesPlatform> getAddPlatforms(IssuesUpdateRequest updateRequest) { List<String> platforms = new ArrayList<>(); // 缺陷管理关联 platforms.add(getPlatform(updateRequest.getProjectId())); if (CollectionUtils.isEmpty(platforms)) { platforms.add(IssuesManagePlatform.Local.toString()); } IssuesRequest issuesRequest = new IssuesRequest(); BeanUtils.copyBean(issuesRequest, updateRequest); return IssueFactory.createPlatforms(platforms, issuesRequest); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAddPlatforms File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getAddPlatforms
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
private BasePermission checkPermissionTreeLP(String permName) { if (permName != null) { BasePermission bp = findPermissionTreeLP(permName); if (bp != null) { if (bp.uid == UserHandle.getAppId(Binder.getCallingUid())) { return bp; } throw new SecurityException("Calling uid " + Binder.getCallingUid() + " is not allowed to add to permission tree " + bp.name + " owned by uid " + bp.uid); } } throw new SecurityException("No permission tree found for " + permName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermissionTreeLP File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
checkPermissionTreeLP
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void retrieveSettings() { final ContentResolver resolver = mContext.getContentResolver(); String debugApp = Settings.Global.getString( resolver, Settings.Global.DEBUG_APP); boolean waitForDebugger = Settings.Global.getInt( resolver, Settings.Global.WAIT_FOR_DEBUGGER, 0) != 0; boolean alwaysFinishActivities = Settings.Global.getInt( resolver, Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0) != 0; boolean forceRtl = Settings.Global.getInt( resolver, Settings.Global.DEVELOPMENT_FORCE_RTL, 0) != 0; // Transfer any global setting for forcing RTL layout, into a System Property SystemProperties.set(Settings.Global.DEVELOPMENT_FORCE_RTL, forceRtl ? "1":"0"); Configuration configuration = new Configuration(); Settings.System.getConfiguration(resolver, configuration); if (forceRtl) { // This will take care of setting the correct layout direction flags configuration.setLayoutDirection(configuration.locale); } synchronized (this) { mDebugApp = mOrigDebugApp = debugApp; mWaitForDebugger = mOrigWaitForDebugger = waitForDebugger; mAlwaysFinishActivities = alwaysFinishActivities; // This happens before any activities are started, so we can // change mConfiguration in-place. updateConfigurationLocked(configuration, null, false, true); if (DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION, "Initial config: " + mConfiguration); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveSettings File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
retrieveSettings
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Override public CommandData getCommandData() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommandData File: src/main/java/de/presti/ree6/commands/impl/community/YouTubeNotifier.java Repository: Ree6-Applications/Ree6 The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
getCommandData
src/main/java/de/presti/ree6/commands/impl/community/YouTubeNotifier.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
0
Analyze the following code function for security vulnerabilities
private static boolean validateSsid(String ssid, boolean isAdd) { if (isAdd) { if (ssid == null) { Log.e(TAG, "validateSsid : null string"); return false; } } else { if (ssid == null) { // This is an update, so the SSID can be null if that is not being changed. return true; } } if (ssid.isEmpty()) { Log.e(TAG, "validateSsid failed: empty string"); return false; } if (ssid.startsWith("\"")) { // UTF-8 SSID string byte[] ssidBytes = ssid.getBytes(StandardCharsets.UTF_8); if (ssidBytes.length < SSID_UTF_8_MIN_LEN) { Log.e(TAG, "validateSsid failed: utf-8 ssid string size too small: " + ssidBytes.length); return false; } if (ssidBytes.length > SSID_UTF_8_MAX_LEN) { Log.e(TAG, "validateSsid failed: utf-8 ssid string size too large: " + ssidBytes.length); return false; } } else { // HEX SSID string if (ssid.length() < SSID_HEX_MIN_LEN) { Log.e(TAG, "validateSsid failed: hex string size too small: " + ssid.length()); return false; } if (ssid.length() > SSID_HEX_MAX_LEN) { Log.e(TAG, "validateSsid failed: hex string size too large: " + ssid.length()); return false; } } try { NativeUtil.decodeSsid(ssid); } catch (IllegalArgumentException e) { Log.e(TAG, "validateSsid failed: malformed string: " + ssid); return false; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateSsid File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
validateSsid
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
public void onScreenTurnedOff() { mUpdateMonitor.dispatchScreenTurnedOff(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onScreenTurnedOff File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
onScreenTurnedOff
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private V fromInt(K name, int value) { try { return valueConverter.convertInt(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert int value for header '" + name + '\'', e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromInt File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
fromInt
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
public void setPassword( final String password ) { this.password = password; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPassword File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp The code follows secure coding practices.
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
setPassword
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
0189975691e9e6407a9fee87006f730e84f734ff
0
Analyze the following code function for security vulnerabilities
public Either<Exception, AccountBO> authenticateAndGetAccount(final String basicToken) { return handleBasicAuthentication(basicToken); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: authenticateAndGetAccount File: basic-auth/src/main/java/com/nexblocks/authguard/basic/BasicAuthProvider.java Repository: AuthGuard The code follows secure coding practices.
[ "CWE-287" ]
CVE-2021-45890
HIGH
7.5
AuthGuard
authenticateAndGetAccount
basic-auth/src/main/java/com/nexblocks/authguard/basic/BasicAuthProvider.java
9783b1143da6576028de23e15a1f198b1f937b82
0
Analyze the following code function for security vulnerabilities
private String getDefaultRoleHolderPackageSignature() { String[] info = getDefaultRoleHolderPackageNameAndSignature(); if (info == null || info.length < 2) { return null; } return info[1]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultRoleHolderPackageSignature 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
getDefaultRoleHolderPackageSignature
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String htmlStartStyle(String title, String stylesheet) { return pageHtmlStyle(HTML_START, title, stylesheet); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: htmlStartStyle 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
htmlStartStyle
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private RDFDescription parseAsResource(Node node) { // See: http://www.w3.org/TR/REC-rdf-syntax/#section-Syntax-parsetype-resource List<Entry> entries = new ArrayList<Entry>(); for (Node child : asIterable(node.getChildNodes())) { if (child.getNodeType() != Node.ELEMENT_NODE) { continue; } entries.add(new XMPEntry(child.getNamespaceURI() + child.getLocalName(), child.getLocalName(), getChildTextValue(child))); } return new RDFDescription(entries); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-23792 - Severity: HIGH - CVSS Score: 7.5 Description: Avoid fetching external resources in XMPReader. Function: parseAsResource File: imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java Repository: haraldk/TwelveMonkeys Fixed Code: private RDFDescription parseAsResource(Node node) { // See: http://www.w3.org/TR/REC-rdf-syntax/#section-Syntax-parsetype-resource List<Entry> entries = new ArrayList<>(); for (Node child : asIterable(node.getChildNodes())) { if (child.getNodeType() != Node.ELEMENT_NODE) { continue; } entries.add(new XMPEntry(child.getNamespaceURI() + child.getLocalName(), child.getLocalName(), getChildTextValue(child))); } return new RDFDescription(entries); }
[ "CWE-611" ]
CVE-2021-23792
HIGH
7.5
haraldk/TwelveMonkeys
parseAsResource
imageio/imageio-metadata/src/main/java/com/twelvemonkeys/imageio/metadata/xmp/XMPReader.java
da4efe98bf09e1cce91b7633cb251958a200fc80
1
Analyze the following code function for security vulnerabilities
private void hideUnreadMessagesCount() { if (this.binding == null) { return; } this.binding.scrollToBottomButton.setEnabled(false); this.binding.scrollToBottomButton.hide(); this.binding.unreadCountCustomView.setVisibility(View.GONE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideUnreadMessagesCount File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hideUnreadMessagesCount
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public ServiceProvider getApplicationByResourceId(String resourceId, String tenantDomain) throws IdentityApplicationManagementException { Collection<ApplicationResourceManagementListener> listeners = ApplicationMgtListenerServiceComponent.getApplicationResourceMgtListeners(); for (ApplicationResourceManagementListener listener : listeners) { if (listener.isEnabled() && !listener.doPreGetApplicationByResourceId(resourceId, tenantDomain)) { throw buildServerException("Pre Get application operation of " + "listener: " + getName(listener) + " failed for application with resourceId: " + resourceId); } } ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); ServiceProvider application = appDAO.getApplicationByResourceId(resourceId, tenantDomain); if (application == null) { if (log.isDebugEnabled()) { log.debug("Cannot find an application for resourceId: " + resourceId + " in tenantDomain: " + tenantDomain); } return null; } for (ApplicationResourceManagementListener listener : listeners) { if (listener.isEnabled() && !listener.doPostGetApplicationByResourceId(application, resourceId, tenantDomain)) { log.error("Post Get application operation of " + "listener: " + getName(listener) + " failed for application with resourceId: " + resourceId); break; } } return application; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationByResourceId File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getApplicationByResourceId
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
public Long getUpvotes() { return upvotes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUpvotes File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getUpvotes
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
void addPackageRegex(String regex) { mPackagePatterns.add(Pattern.compile(regex)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPackageRegex File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
addPackageRegex
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private static boolean isBase64(String s) { for (int i=0; i<s.length(); i++) if (!isBase64(s.charAt(i))) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBase64 File: core/src/main/java/hudson/util/SecretRewriter.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
isBase64
core/src/main/java/hudson/util/SecretRewriter.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
static SVNInfo parseSvnInfo(SVNURL remoteUrl, ISVNAuthenticationProvider authProvider) throws SVNException { final SvnClientManager manager = createClientManager(authProvider); try { final SVNWCClient svnWc = manager.getWCClient(); return svnWc.doInfo(remoteUrl, SVNRevision.HEAD, SVNRevision.HEAD); } finally { manager.dispose(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseSvnInfo File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
parseSvnInfo
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
private static List<Element> getChildElements(Element element) { LinkedList<Element> childElements = new LinkedList<>(); try { NodeList nodeList = element.getChildNodes(); for (int i=0; i<nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { childElements.add((Element) node); } } } catch (Exception e) { log.warning("Exception thrown getting all children for element=" + element+ ", e=" + e); } return childElements; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildElements File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
getChildElements
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public void destroy() { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: destroy File: core/src/main/java/jenkins/security/ApiTokenFilter.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-287" ]
CVE-2014-2062
MEDIUM
6.5
jenkinsci/jenkins
destroy
core/src/main/java/jenkins/security/ApiTokenFilter.java
5548b5220cfd496831b5721124189ff18fbb12a3
0
Analyze the following code function for security vulnerabilities
@Override protected void finalize() { try { reset(); } catch (Throwable t) { t.printStackTrace(System.err); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finalize File: guava/src/com/google/common/io/FileBackedOutputStream.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
finalize
guava/src/com/google/common/io/FileBackedOutputStream.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public static String fenToYuan(Integer fen) { return BigDecimal.valueOf(Double.valueOf(fen) / 100).setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fenToYuan File: weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java Repository: Wechat-Group/WxJava The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20318
HIGH
7.5
Wechat-Group/WxJava
fenToYuan
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java
6272639f02e397fed40828a2d0da66c30264bc0e
0
Analyze the following code function for security vulnerabilities
public OortComet deobserveComet(String cometURL) { return _membership.deobserveComet(cometURL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deobserveComet 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
deobserveComet
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
@Override public void showWaitingForDebugger(IApplicationThread who, boolean waiting) { synchronized (this) { ProcessRecord app = who != null ? getRecordForAppLocked(who) : null; if (app == null) return; Message msg = Message.obtain(); msg.what = WAIT_FOR_DEBUGGER_MSG; msg.obj = app; msg.arg1 = waiting ? 1 : 0; mHandler.sendMessage(msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showWaitingForDebugger 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
showWaitingForDebugger
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public boolean isViewFromObject(@NonNull View view, @NonNull Object fragment) { return ((Fragment) fragment).getView() == view; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isViewFromObject 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
isViewFromObject
src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public void setEncryptedPassword(final String userID, final String aPassword, final boolean salted) throws Exception { update(); m_writeLock.lock(); try { final User user = m_users.get(userID); if (user != null) { final Password pass = new Password(); pass.setEncryptedPassword(aPassword); pass.setSalt(salted); user.setPassword(pass); } _saveCurrent(); } finally { m_writeLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEncryptedPassword File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
setEncryptedPassword
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public void closeAndSaveGuts(boolean removeLeavebehinds, boolean force, boolean removeControls, int x, int y, boolean resetMenu) { if (mNotificationGutsExposed != null) { mNotificationGutsExposed.removeCallbacks(mOpenRunnable); mNotificationGutsExposed.closeControls(removeLeavebehinds, removeControls, x, y, force); } if (resetMenu) { mListContainer.resetExposedMenuView(false /* animate */, true /* force */); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeAndSaveGuts File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
closeAndSaveGuts
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
public void setHeader(String name, String value) { if (isIncluding()) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, "WinstoneResponse.HeaderInInclude", new String[] {name, value}); } else if (isCommitted()) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, "WinstoneResponse.HeaderAfterCommitted", new String[] {name, value}); } else { boolean found = false; for (int n = 0; (n < this.headers.size()); n++) { String header = (String) this.headers.get(n); if (header.startsWith(name + ": ")) { if (found) { this.headers.remove(n); continue; } if (name.equals(CONTENT_TYPE_HEADER)) { if (value != null) { StringBuffer remainderHeader = new StringBuffer(); String headerEncoding = getCharsetFromContentTypeHeader( value, remainderHeader); if (this.outputWriter != null) { value = remainderHeader + ";charset=" + getCharacterEncoding(); } else if (headerEncoding != null) { this.explicitEncoding = headerEncoding; } } } if (value != null) { this.headers.set(n, name + ": " + value); } else { this.headers.remove(n); } found = true; } } if (!found) { addHeader(name, value); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHeader File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
setHeader
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public static boolean isEqual(Object value1, Object value2) { if (value1 == null) { return (value2 == null); } return value1.equals(value2); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEqual File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
isEqual
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public boolean exists(DocumentReference reference) throws XWikiException { return this.xwiki.exists(reference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exists File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
exists
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
private void doCollectChanges(Consumer<NodeChange> collector, Stream<NodeFeature> features) { features.filter(this::hasChangeTracker).forEach(feature -> { feature.collectChanges(collector); changes.remove(feature.getClass()); }); isInitialChanges = false; if (changes != null && changes.isEmpty()) { changes = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doCollectChanges File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
doCollectChanges
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M1") public void setFullName(String fullName, XWikiContext context) { // We ignore the passed full name if it's null to be backward compatible with previous behaviors and to be // consistent with {@link #setName} and {@link #setSpace}. if (fullName != null) { // Note: We use the CurrentMixed Resolver since we want to use the default page name if the page isn't // specified in the passed string, rather than use the current document's page name. setDocumentReference(getCurrentMixedDocumentReferenceResolver().resolve(fullName)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFullName 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
setFullName
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
private boolean isOwnerUpdateRequest(User storedAppOwner, User updatedAppOwner) { if (updatedAppOwner != null) { boolean isValidAppOwnerInUpdateRequest = StringUtils.isNotEmpty(updatedAppOwner.getUserName()) && !CarbonConstants.REGISTRY_SYSTEM_USERNAME.equals(updatedAppOwner.getUserName()); boolean isOwnerChanged = !storedAppOwner.equals(updatedAppOwner); return isValidAppOwnerInUpdateRequest && isOwnerChanged; } else { // There is no app owner defined in the update request. Nothing to do there. return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOwnerUpdateRequest File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
isOwnerUpdateRequest
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
private int getUserProvisioningState(int userHandle) { return getUserData(userHandle).mUserProvisioningState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserProvisioningState 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
getUserProvisioningState
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void resetStateLocked() { if (DEBUG) Log.e(TAG, "resetStateLocked"); Message msg = mHandler.obtainMessage(RESET); mHandler.sendMessage(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetStateLocked File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
resetStateLocked
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public String getTempFolderPath() { return tempFolderPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTempFolderPath File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getTempFolderPath
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void requestPssAllProcsLocked(long now, boolean always, boolean memLowered) { if (!always) { if (now < (mLastFullPssTime + (memLowered ? FULL_PSS_LOWERED_INTERVAL : FULL_PSS_MIN_INTERVAL))) { return; } } if (DEBUG_PSS) Slog.d(TAG_PSS, "Requesting PSS of all procs! memLowered=" + memLowered); mLastFullPssTime = now; mFullPssPending = true; mPendingPssProcesses.ensureCapacity(mLruProcesses.size()); mPendingPssProcesses.clear(); for (int i = mLruProcesses.size() - 1; i >= 0; i--) { ProcessRecord app = mLruProcesses.get(i); if (app.thread == null || app.curProcState == ActivityManager.PROCESS_STATE_NONEXISTENT) { continue; } if (memLowered || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) { app.pssProcState = app.setProcState; app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true, mTestPssMode, isSleeping(), now); mPendingPssProcesses.add(app); } } mBgHandler.sendEmptyMessage(COLLECT_PSS_BG_MSG); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestPssAllProcsLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
requestPssAllProcsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsFloatEdgeCase10() throws Exception { String input = "1e-10000000"; Duration value = READER.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS) .readValue(input); assertEquals(0, value.getSeconds()); }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2018-1000873 - Severity: MEDIUM - CVSS Score: 4.3 Description: Avoid latency problems converting decimal to time. Fixes https://github.com/FasterXML/jackson-databind/issues/2141 Function: testDeserializationAsFloatEdgeCase10 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java Repository: FasterXML/jackson-modules-java8 Fixed Code: @Test(timeout = 100) public void testDeserializationAsFloatEdgeCase10() throws Exception { String input = "1e-10000000"; Duration value = READER.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS) .readValue(input); assertEquals(0, value.getSeconds()); }
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsFloatEdgeCase10
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
1
Analyze the following code function for security vulnerabilities
public static boolean isAutoRefresh(HttpServletRequest request) { String param = request.getParameter("auto_refresh"); if (param != null) { return Boolean.parseBoolean(param); } Cookie[] cookies = request.getCookies(); if(cookies==null) return false; // when API design messes it up, we all suffer for (Cookie c : cookies) { if (c.getName().equals("hudson_auto_refresh")) { return Boolean.parseBoolean(c.getValue()); } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoRefresh File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
isAutoRefresh
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private ResolveInfo createForwardingResolveInfo(IntentFilter filter, int sourceUserId, int targetUserId) { ResolveInfo forwardingResolveInfo = new ResolveInfo(); String className; if (targetUserId == UserHandle.USER_OWNER) { className = FORWARD_INTENT_TO_USER_OWNER; } else { className = FORWARD_INTENT_TO_MANAGED_PROFILE; } ComponentName forwardingActivityComponentName = new ComponentName( mAndroidApplication.packageName, className); ActivityInfo forwardingActivityInfo = getActivityInfo(forwardingActivityComponentName, 0, sourceUserId); if (targetUserId == UserHandle.USER_OWNER) { forwardingActivityInfo.showUserIcon = UserHandle.USER_OWNER; forwardingResolveInfo.noResourceId = true; } forwardingResolveInfo.activityInfo = forwardingActivityInfo; forwardingResolveInfo.priority = 0; forwardingResolveInfo.preferredOrder = 0; forwardingResolveInfo.match = 0; forwardingResolveInfo.isDefault = true; forwardingResolveInfo.filter = filter; forwardingResolveInfo.targetUserId = targetUserId; return forwardingResolveInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createForwardingResolveInfo File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
createForwardingResolveInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public abstract DescribableList<Publisher,Descriptor<Publisher>> getPublishersList();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPublishersList File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getPublishersList
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public void mkdir(String directory) { directory = removeFilePrefix(directory); new File(directory).mkdir(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mkdir 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
mkdir
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override protected Mono<Void> doNotify(InstanceEvent event, Instance instance) { return Mono.fromRunnable( () -> restTemplate.postForEntity(buildUrl(), createHipChatNotification(event, instance), Void.class)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doNotify File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
doNotify
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public static void cursorLongToContentValues(Cursor cursor, String field, ContentValues values, String key) { int colIndex = cursor.getColumnIndex(field); if (!cursor.isNull(colIndex)) { Long value = Long.valueOf(cursor.getLong(colIndex)); values.put(key, value); } else { values.put(key, (Long) null); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorLongToContentValues File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorLongToContentValues
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public @Nullable String getProfileOwnerName() throws IllegalArgumentException { if (mService != null) { try { return mService.getProfileOwnerName(mContext.getUserId()); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProfileOwnerName 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
getProfileOwnerName
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private boolean handleProgressBar(RemoteViews contentView, Bundle ex, StandardTemplateParams p) { final int max = ex.getInt(EXTRA_PROGRESS_MAX, 0); final int progress = ex.getInt(EXTRA_PROGRESS, 0); final boolean ind = ex.getBoolean(EXTRA_PROGRESS_INDETERMINATE); if (!p.mHideProgress && (max != 0 || ind)) { contentView.setViewVisibility(com.android.internal.R.id.progress, View.VISIBLE); contentView.setProgressBar(R.id.progress, max, progress, ind); contentView.setProgressBackgroundTintList(R.id.progress, mContext.getColorStateList(R.color.notification_progress_background_color)); ColorStateList progressTint = ColorStateList.valueOf(getPrimaryAccentColor(p)); contentView.setProgressTintList(R.id.progress, progressTint); contentView.setProgressIndeterminateTintList(R.id.progress, progressTint); return true; } else { contentView.setViewVisibility(R.id.progress, View.GONE); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleProgressBar File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
handleProgressBar
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private void pushMeteredDisabledPackages(int userId) { wtfIfInLock(); mInjector.getNetworkPolicyManagerInternal().setMeteredRestrictedPackages( getMeteredDisabledPackages(userId), userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pushMeteredDisabledPackages 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
pushMeteredDisabledPackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
static void updateLockTaskPackagesLocked(Context context, List<String> packages, int userId) { Binder.withCleanCallingIdentity(() -> { String[] packagesArray = null; if (!packages.isEmpty()) { // When adding packages, we need to include the exempt apps so they can still be // launched (ideally we should use a different AM API as these apps don't need to // use lock-task mode). // They're not added when the packages is empty though, as in that case we're // disabling lock-task mode. List<String> exemptApps = listPolicyExemptAppsUnchecked(context); if (!exemptApps.isEmpty()) { // TODO(b/175377361): add unit test to verify it (cannot be CTS because the // policy-exempt apps are provided by OEM and the test would have no control // over it) once tests are migrated to the new infra-structure HashSet<String> updatedPackages = new HashSet<>(packages); updatedPackages.addAll(exemptApps); if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "added %d policy-exempt apps to %d lock task " + "packages. Final list: %s", exemptApps.size(), packages.size(), updatedPackages); } packagesArray = updatedPackages.toArray(new String[updatedPackages.size()]); } } if (packagesArray == null) { packagesArray = packages.toArray(new String[packages.size()]); } try { ActivityManager.getService().updateLockTaskPackages(userId, packagesArray); } catch (RemoteException e) { // Shouldn't happen. Slog.wtf(LOG_TAG, "Remote Exception: ", e); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLockTaskPackagesLocked 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
updateLockTaskPackagesLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public Set<String> getBadColumnNames() { return _badColumnNames; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBadColumnNames File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
getBadColumnNames
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
private native void nativeSelectPopupMenuItems(long nativeContentViewCoreImpl, int[] indices);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeSelectPopupMenuItems File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativeSelectPopupMenuItems
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void sendKexInit() throws TransportException { log.debug("Sending SSH_MSG_KEXINIT"); List<String> knownHostAlgs = findKnownHostAlgs(transport.getRemoteHost(), transport.getRemotePort()); clientProposal = new Proposal(transport.getConfig(), knownHostAlgs); transport.write(clientProposal.getPacket()); kexInitSent.set(); }
Vulnerability Classification: - CWE: CWE-354 - CVE: CVE-2023-48795 - Severity: MEDIUM - CVSS Score: 5.9 Description: Implement OpenSSH strict key exchange extension Function: sendKexInit File: src/main/java/net/schmizz/sshj/transport/KeyExchanger.java Repository: hierynomus/sshj Fixed Code: private void sendKexInit() throws TransportException { log.debug("Sending SSH_MSG_KEXINIT"); List<String> knownHostAlgs = findKnownHostAlgs(transport.getRemoteHost(), transport.getRemotePort()); clientProposal = new Proposal(transport.getConfig(), knownHostAlgs, initialKex.get()); transport.write(clientProposal.getPacket()); kexInitSent.set(); }
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
sendKexInit
src/main/java/net/schmizz/sshj/transport/KeyExchanger.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
1
Analyze the following code function for security vulnerabilities
@Override public void handleEvent(Http2Channel channel) { parseTimeoutUpdater.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleEvent File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
handleEvent
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@NonNull public Person getUser() { return mUser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUser File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getUser
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(sender.asBinder()); mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); reply.readException(); Intent res = reply.readInt() != 0 ? Intent.CREATOR.createFromParcel(reply) : null; data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntentForIntentSender File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getIntentForIntentSender
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private BasePermission findPermissionTreeLP(String permName) { for(BasePermission bp : mSettings.mPermissionTrees.values()) { if (permName.startsWith(bp.name) && permName.length() > bp.name.length() && permName.charAt(bp.name.length()) == '.') { return bp; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findPermissionTreeLP File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
findPermissionTreeLP
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static final void deleteQuietly(File file) { if (file != null) { if (file.isDirectory()) { File[] children = file.listFiles(); if (children != null) { for (File child : children) { deleteQuietly(child); } } } // noinspection ResultOfMethodCallIgnored file.delete(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteQuietly File: src/main/java/net/sf/mpxj/common/FileHelper.java Repository: joniles/mpxj The code follows secure coding practices.
[ "CWE-377", "CWE-200" ]
CVE-2022-41954
LOW
3.3
joniles/mpxj
deleteQuietly
src/main/java/net/sf/mpxj/common/FileHelper.java
ae0af24345d79ad45705265d9927fe55e94a5721
0
Analyze the following code function for security vulnerabilities
public boolean isUsernameRetrieved(String username) { try { getDriver() .findElementWithoutWaiting(By.xpath("//div[@id='xwikicontent']//strong[text()='" + username + "']")); return true; } catch (NoSuchElementException e) { return false; } }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2021-32732 - Severity: MEDIUM - CVSS Score: 4.3 Description: XWIKI-18384: Improve ForgotUsername process * Ensure to send an email to users in case of forgot username request * Improve test (cherry picked from commit 21f8780680bbdea19e97c7caf63fdc1cfb2096db) Function: isUsernameRetrieved File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-pageobjects/src/main/java/org/xwiki/administration/test/po/ForgotUsernameCompletePage.java Repository: xwiki/xwiki-platform Fixed Code: @Deprecated public boolean isUsernameRetrieved(String username) { try { getDriver() .findElementWithoutWaiting(By.xpath("//div[@id='xwikicontent']//strong[text()='" + username + "']")); return true; } catch (NoSuchElementException e) { return false; } }
[ "CWE-352" ]
CVE-2021-32732
MEDIUM
4.3
xwiki/xwiki-platform
isUsernameRetrieved
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-pageobjects/src/main/java/org/xwiki/administration/test/po/ForgotUsernameCompletePage.java
f0440dfcbba705e03f7565cd88893dde57ca3fa8
1
Analyze the following code function for security vulnerabilities
@Override public void unremoveRepository(String projectName, String repositoryName, AsyncMethodCallback resultHandler) { handleAsVoidResult(executor.execute(Command.unremoveRepository(SYSTEM, projectName, repositoryName)) .thenCompose(unused -> mds.restoreRepo(SYSTEM, projectName, repositoryName)), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unremoveRepository File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
unremoveRepository
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
public boolean scheduleBuild() { return scheduleBuild(new LegacyCodeCause()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleBuild File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
scheduleBuild
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
@Override @Deprecated public String toString() { return value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: core/src/main/java/hudson/util/Secret.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
toString
core/src/main/java/hudson/util/Secret.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
0
Analyze the following code function for security vulnerabilities
@Override public void sendForegroundProfileChanged(int userId) { mUserController.sendForegroundProfileChanged(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendForegroundProfileChanged 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
sendForegroundProfileChanged
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void enforceUserHandleMatchesCaller(PhoneAccountHandle accountHandle) { if (!Binder.getCallingUserHandle().equals(accountHandle.getUserHandle())) { throw new SecurityException("Calling UserHandle does not match PhoneAccountHandle's"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceUserHandleMatchesCaller File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
enforceUserHandleMatchesCaller
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
private static void handleResponse(HttpURLConnection conn, int statusCode, String terminalWidth) { try { // 200 - modules found // Other - Error occurred, json returned with the error message MapValue payload; if (statusCode == HttpURLConnection.HTTP_OK) { try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream(), Charset.defaultCharset()))) { StringBuilder result = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { result.append(line); } payload = (MapValue) JSONParser.parse(result.toString()); } catch (IOException e) { throw ErrorUtil.createCommandException(e.getMessage()); } if (payload.getIntValue("count") > 0) { ArrayValue modules = payload.getArrayValue("modules"); printModules(modules, terminalWidth); } else { outStream.println("no modules found"); } } else { StringBuilder result = new StringBuilder(); try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getErrorStream(), Charset.defaultCharset()))) { String line; while ((line = reader.readLine()) != null) { result.append(line); } } catch (IOException e) { throw ErrorUtil.createCommandException(e.getMessage()); } payload = (MapValue) JSONParser.parse(result.toString()); throw ErrorUtil.createCommandException(payload.getStringValue("message")); } } finally { conn.disconnect(); } }
Vulnerability Classification: - CWE: CWE-306 - CVE: CVE-2021-32700 - Severity: MEDIUM - CVSS Score: 5.8 Description: Fix central connection Function: handleResponse File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java Repository: ballerina-platform/ballerina-lang Fixed Code: private static void handleResponse(HttpsURLConnection conn, int statusCode, String terminalWidth) { try { // 200 - modules found // Other - Error occurred, json returned with the error message MapValue payload; if (statusCode == HttpsURLConnection.HTTP_OK) { try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream(), Charset.defaultCharset()))) { StringBuilder result = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { result.append(line); } payload = (MapValue) JSONParser.parse(result.toString()); } catch (IOException e) { throw ErrorUtil.createCommandException(e.getMessage()); } if (payload.getIntValue("count") > 0) { ArrayValue modules = payload.getArrayValue("modules"); printModules(modules, terminalWidth); } else { outStream.println("no modules found"); } } else { StringBuilder result = new StringBuilder(); try (BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getErrorStream(), Charset.defaultCharset()))) { String line; while ((line = reader.readLine()) != null) { result.append(line); } } catch (IOException e) { throw ErrorUtil.createCommandException(e.getMessage()); } payload = (MapValue) JSONParser.parse(result.toString()); throw ErrorUtil.createCommandException(payload.getStringValue("message")); } } finally { conn.disconnect(); } }
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
handleResponse
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Search.java
4609ffee1744ecd16aac09303b1783bf0a525816
1
Analyze the following code function for security vulnerabilities
public void setStringList(String section, String subsection, String name, List<String> list) { for (String value : list) { setString(section, subsection, name, value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStringList File: src/main/java/com/gitblit/StoredUserConfig.java Repository: gitblit-org/gitblit The code follows secure coding practices.
[ "CWE-269" ]
CVE-2022-31267
HIGH
7.5
gitblit-org/gitblit
setStringList
src/main/java/com/gitblit/StoredUserConfig.java
9b4afad6f4be212474809533ec2c280cce86501a
0
Analyze the following code function for security vulnerabilities
public String getExecutable() { return executable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExecutable 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
getExecutable
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
boolean isEncodingCompatible(final String encoding1, final String encoding2) { try { try { return canRoundtrip(encoding1, encoding2); } catch (final UnsupportedOperationException e) { // if encoding1 only supports decode, we can test it the other way to only decode with it try { return canRoundtrip(encoding2, encoding1); } catch (final UnsupportedOperationException e1) { // encoding2 only supports decode too. Time to give up. return false; } } } catch (final UnsupportedEncodingException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEncodingCompatible File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
isEncodingCompatible
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Pure @Override public byte @Nullable [] getBytes(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getBytes columnIndex: {0}", columnIndex); byte[] value = getRawValue(columnIndex); if (value == null) { return null; } if (isBinary(columnIndex)) { // If the data is already binary then just return it return value; } if (fields[columnIndex - 1].getOID() == Oid.BYTEA) { return trimBytes(columnIndex, PGbytea.toBytes(value)); } else { return trimBytes(columnIndex, value); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBytes 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
getBytes
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void addHeader(String arg0, String arg1) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addHeader File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
addHeader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0