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
@Override public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter) throws IdentityApplicationManagementException { ApplicationDAO appDAO = null; // invoking the listeners Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPreGetApplicationBasicInfo(tenantDomain, username, filter)) { return new ApplicationBasicInfo[0]; } } try { startTenantFlow(tenantDomain, username); appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); } finally { endTenantFlow(); } if (!(appDAO instanceof AbstractApplicationDAOImpl)) { log.error("Get application basic info service is not supported."); throw new IdentityApplicationManagementException("This service is not supported."); } // invoking the listeners for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPostGetApplicationBasicInfo(appDAO, tenantDomain, username, filter)) { return new ApplicationBasicInfo[0]; } } return ((AbstractApplicationDAOImpl) appDAO).getApplicationBasicInfo(filter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationBasicInfo 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
getApplicationBasicInfo
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
@Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getCharacterEncoding() == null) { request.setCharacterEncoding("utf-8"); } response.setContentType("text/html; charset=UTF-8"); this.getServletContext().getRequestDispatcher("/header.jsp"). include(request, response); request.setAttribute("classifiers", classifiers); this.getServletContext().getRequestDispatcher("/ner.jsp"). include(request, response); addResults(request, response); this.getServletContext().getRequestDispatcher("/footer.jsp"). include(request, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doGet File: src/edu/stanford/nlp/ie/ner/webapp/NERServlet.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-44550
HIGH
7.5
stanfordnlp/CoreNLP
doGet
src/edu/stanford/nlp/ie/ner/webapp/NERServlet.java
5ee097dbede547023e88f60ed3f430ff09398b87
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getAlwaysOnVpnLockdownAllowlist(ComponentName admin) throws SecurityException { Objects.requireNonNull(admin, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); return mInjector.binderWithCleanCallingIdentity( () -> mInjector.getVpnManager().getVpnLockdownAllowlist(caller.getUserId())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlwaysOnVpnLockdownAllowlist 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
getAlwaysOnVpnLockdownAllowlist
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setNumExecutors(int n) throws IOException { this.numExecutors = n; save(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNumExecutors File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
setNumExecutors
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@NonNull public static SQLiteDatabase createInMemory(@NonNull OpenParams openParams) { return openDatabase(SQLiteDatabaseConfiguration.MEMORY_DB_PATH, openParams.toBuilder().addOpenFlags(CREATE_IF_NECESSARY).build()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createInMemory File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
createInMemory
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
@Override public void closeConnection() { response.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeConnection File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
closeConnection
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
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/client/petstore/java/resteasy/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/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void deflect(Call call, Uri address) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("deflect")) { try { logOutgoing("deflect %s", callId); mServiceInterface.deflect(callId, address, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deflect File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
deflect
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public boolean isPeerGoneAway() { return peerGoneAway; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPeerGoneAway 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
isPeerGoneAway
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public XWikiDocument copyDocument(DocumentReference newDocumentReference, XWikiContext context) throws XWikiException { return copyDocument(newDocumentReference, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyDocument 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
copyDocument
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
boolean checkAllowAppSwitchUid(int uid) { ArrayMap<String, Integer> types = mAllowAppSwitchUids.get(UserHandle.getUserId(uid)); if (types != null) { for (int i = types.size() - 1; i >= 0; i--) { if (types.valueAt(i).intValue() == uid) { return true; } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkAllowAppSwitchUid 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
checkAllowAppSwitchUid
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting public NewsReaderDetailFragment getNewsReaderDetailFragment() { return (NewsReaderDetailFragment) getSupportFragmentManager().findFragmentById(R.id.content_frame); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNewsReaderDetailFragment File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
getNewsReaderDetailFragment
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
protected QName createQName(String name, Namespace namespace, String qualifiedName) { return new QName(name, namespace, qualifiedName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createQName File: src/main/java/org/dom4j/tree/QNameCache.java Repository: dom4j The code follows secure coding practices.
[ "CWE-91" ]
CVE-2018-1000632
MEDIUM
5
dom4j
createQName
src/main/java/org/dom4j/tree/QNameCache.java
e598eb43d418744c4dbf62f647dd2381c9ce9387
0
Analyze the following code function for security vulnerabilities
public Map<String, Object> getCredentials() { return credentials; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCredentials File: services/src/main/java/org/keycloak/services/managers/ClientManager.java Repository: keycloak The code follows secure coding practices.
[ "CWE-798" ]
CVE-2019-14837
MEDIUM
6.4
keycloak
getCredentials
services/src/main/java/org/keycloak/services/managers/ClientManager.java
9a7c1a91a59ab85e7f8889a505be04a71580777f
0
Analyze the following code function for security vulnerabilities
private void saveNitzTimeZone(String zoneId) { mSavedTimeZone = zoneId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveNitzTimeZone File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
saveNitzTimeZone
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public String join(String separator) throws JSONException { int len = length(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < len; i += 1) { if (i > 0) { sb.append(separator); } sb.append(JSONObject.valueToString(this.myArrayList.get(i), escapeForwardSlashAlways)); } return sb.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
join
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
protected Optional<Instantiator> loadInstantiators() throws ServiceException { Lookup lookup = getContext().getAttribute(Lookup.class); List<Instantiator> instantiators = null; if (lookup != null) { // lookup may be null in tests Collection<InstantiatorFactory> factories = lookup .lookupAll(InstantiatorFactory.class); instantiators = new ArrayList<>(factories.size()); for (InstantiatorFactory factory : factories) { Instantiator instantiator = factory.createInstantitor(this); // if the existing instantiator is converted to new API then // let's respect its deprecated method if (instantiator != null && instantiator.init(this)) { instantiators.add(instantiator); } } } if (instantiators == null) { instantiators = new ArrayList<>(); } // the code to support previous way of loading instantiators StreamSupport .stream(ServiceLoader.load(Instantiator.class, getClassLoader()) .spliterator(), false) .filter(iterator -> iterator.init(this)) .forEach(instantiators::add); if (instantiators.size() > 1) { throw new ServiceException( "Cannot init VaadinService because there are multiple eligible instantiator implementations: " + instantiators); } return instantiators.stream().findFirst(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadInstantiators File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
loadInstantiators
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
@Override protected boolean removeEldestEntry(Map.Entry eldest) { // Note: one key takes about 1300 bytes in the keystore, so be // cautious about allowing more outstanding keys in the map that // may go beyond keystore's max length for one entry. return (size() > 3); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeEldestEntry File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
removeEldestEntry
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
public Column<T, V> setHidable(boolean hidable) { if (hidable != isHidable()) { getState().hidable = hidable; } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHidable File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setHidable
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(START_TASKS_FROM_RECENTS) @TestApi public static @NonNull ActivityOptions makeCustomTaskAnimation(@NonNull Context context, int enterResId, int exitResId, @Nullable Handler handler, @Nullable OnAnimationStartedListener startedListener, @Nullable OnAnimationFinishedListener finishedListener) { ActivityOptions opts = makeCustomAnimation(context, enterResId, exitResId, 0, handler, startedListener, finishedListener); opts.mOverrideTaskTransition = true; return opts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeCustomTaskAnimation File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
makeCustomTaskAnimation
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public void updateNClob(String columnName, @Nullable Reader reader, long length) throws SQLException { updateNClob(findColumn(columnName), reader, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNClob 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
updateNClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
AlarmManager getAlarmManager() { return mContext.getSystemService(AlarmManager.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAlarmManager 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
getAlarmManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected void setMinorEdit1(Boolean isMinor) { this.isMinorEdit = (isMinor != null && isMinor.booleanValue()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMinorEdit1 File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
setMinorEdit1
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public boolean testConnection(DatabaseConfiguration dbConfig) throws DatabaseServiceException { try { boolean connResult = false; Connection conn = getConnection(dbConfig); if (conn != null) { connResult = true; conn.close(); } return connResult; } catch (SQLException e) { logger.error("Test connection Failed!", e); throw new DatabaseServiceException(true, e.getSQLState(), e.getErrorCode(), e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testConnection File: extensions/database/src/com/google/refine/extension/database/sqlite/SQLiteConnectionManager.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-41886
HIGH
7.5
OpenRefine
testConnection
extensions/database/src/com/google/refine/extension/database/sqlite/SQLiteConnectionManager.java
2de1439f5be63d9d0e89bbacbd24fa28c8c3e29d
0
Analyze the following code function for security vulnerabilities
@Override protected boolean onTargetSelected(TargetInfo target, boolean alwaysCheck) { if (mRefinementIntentSender != null) { final Intent fillIn = new Intent(); final List<Intent> sourceIntents = target.getAllSourceIntents(); if (!sourceIntents.isEmpty()) { fillIn.putExtra(Intent.EXTRA_INTENT, sourceIntents.get(0)); if (sourceIntents.size() > 1) { final Intent[] alts = new Intent[sourceIntents.size() - 1]; for (int i = 1, N = sourceIntents.size(); i < N; i++) { alts[i - 1] = sourceIntents.get(i); } fillIn.putExtra(Intent.EXTRA_ALTERNATE_INTENTS, alts); } if (mRefinementResultReceiver != null) { mRefinementResultReceiver.destroy(); } mRefinementResultReceiver = new RefinementResultReceiver(this, target, null); fillIn.putExtra(Intent.EXTRA_RESULT_RECEIVER, mRefinementResultReceiver); try { mRefinementIntentSender.sendIntent(this, 0, fillIn, null, null); return false; } catch (SendIntentException e) { Log.e(TAG, "Refinement IntentSender failed to send", e); } } } return super.onTargetSelected(target, alwaysCheck); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTargetSelected File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
onTargetSelected
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@Override public boolean selectAll() { return selectAll(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectAll File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
selectAll
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private static SVNRevision getRevisionFromRemoteUrl( String remoteUrlPossiblyWithRevision) { int idx = remoteUrlPossiblyWithRevision.lastIndexOf('@'); int slashIdx = remoteUrlPossiblyWithRevision.lastIndexOf('/'); if (idx > 0 && idx > slashIdx) { String n = remoteUrlPossiblyWithRevision.substring(idx + 1); return SVNRevision.parse(n); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevisionFromRemoteUrl 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
getRevisionFromRemoteUrl
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public void setValue(String value) { this.value = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValue File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setValue
base/common/src/main/java/com/netscape/certsrv/profile/ProfileAttribute.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void setAdminConfiguration(Configuration adminConfiguration) { this.adminConfiguration = adminConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAdminConfiguration File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
setAdminConfiguration
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
private static int getAvailableGpu() { try { List<Integer> gpuIds = new ArrayList<>(); String visibleCuda = System.getenv("CUDA_VISIBLE_DEVICES"); if (visibleCuda != null && !visibleCuda.isEmpty()) { String[] ids = visibleCuda.split(","); for (String id : ids) { gpuIds.add(Integer.parseInt(id)); } } else { Process process = Runtime.getRuntime().exec("nvidia-smi --query-gpu=index --format=csv"); int ret = process.waitFor(); if (ret != 0) { return 0; } List<String> list = IOUtils.readLines(process.getInputStream(), StandardCharsets.UTF_8); if (list.isEmpty() || !"index".equals(list.get(0))) { throw new AssertionError("Unexpected nvidia-smi response."); } for (int i = 1; i < list.size(); i++) { gpuIds.add(Integer.parseInt(list.get(i))); } } return gpuIds.size(); } catch (IOException | InterruptedException e) { return 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAvailableGpu File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getAvailableGpu
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
private LookupResult resolveIPv6AddressForHostname(Object key) { final List<ADnsAnswer> aDnsAnswers; try { aDnsAnswers = dnsClient.resolveIPv6AddressForHostname(key.toString(), false); } catch (UnknownHostException e) { return getEmptyResult(); // UnknownHostException is a valid case when the DNS record does not exist. Do not log an error. } catch (Exception e) { LOG.error("Could not resolve [{}] records for hostname [{}]. Cause [{}]", AAAA_RECORD_LABEL, key, ExceptionUtils.getRootCauseOrMessage(e)); errorCounter.inc(); return getErrorResult(); } if (CollectionUtils.isNotEmpty(aDnsAnswers)) { return buildLookupResult(aDnsAnswers); } LOG.debug("Could not resolve [{}] records for hostname [{}].", AAAA_RECORD_LABEL, key); return getEmptyResult(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveIPv6AddressForHostname File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
resolveIPv6AddressForHostname
graylog2-server/src/main/java/org/graylog2/lookup/adapters/DnsLookupDataAdapter.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
static void traceBegin(long traceTag, String methodName, String subInfo) { if (Trace.isTagEnabled(traceTag)) { Trace.traceBegin(traceTag, methodName + subInfo); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: traceBegin 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
traceBegin
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected <T> void fillDataWith( final String key, final Map<String, T> data, final int valuesCount, final Function<Integer, T> getValueByIndex) { if (key.endsWith("[]") || key.contains("[].")) { String leftPart = key; // e.g. foo[].bar[].boo[] or foo[].bar[].boo String rightPart = ""; if (key.endsWith("[]")) { leftPart = key.substring(0, key.length() - 2); } for (int splitPosition; (splitPosition = leftPart.lastIndexOf("[].")) != -1; ) { if (key.endsWith("[]") || !rightPart.isEmpty()) { // is index already in use? leftPart = leftPart.substring(0, splitPosition) + "[0]" + leftPart.substring(splitPosition + 2); } else { rightPart = leftPart.substring(splitPosition + 2); leftPart = leftPart.substring(0, splitPosition); } } for (int i = 0; i < valuesCount; i++) { data.put( leftPart + "[" + i + "]" + rightPart, getValueByIndex.apply(i)); // E.g. foo[0].bar[0].boo[<index>] or foo[0].bar[<index>].boo } } else if (valuesCount > 0) { data.put(key, getValueByIndex.apply(0)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fillDataWith File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
fillDataWith
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
PdfIndirectReference getCryptoRef() { if (cryptoRef == null) return null; return new PdfIndirectReference(0, cryptoRef.getNumber(), cryptoRef.getGeneration()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCryptoRef File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getCryptoRef
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
public Integer getCacheControlNoStoreMaxResultsUpperLimit() { return myCacheControlNoStoreMaxResultsUpperLimit; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheControlNoStoreMaxResultsUpperLimit File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getCacheControlNoStoreMaxResultsUpperLimit
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getSkin(XWikiContext context) { String skin; try { skin = getInternalSkinManager().getCurrentSkinId(true); } catch (Exception e) { LOGGER.debug("Exception while determining current skin", e); skin = getDefaultBaseSkin(context); } return skin; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSkin File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getSkin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(token); mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0); reply.readException(); final boolean visible = reply.readInt() > 0; data.recycle(); reply.recycle(); return visible; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBackgroundVisibleBehind File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
isBackgroundVisibleBehind
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public boolean isMobileViewDisabled() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMobileViewDisabled File: wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
isMobileViewDisabled
wflow-core/src/main/java/org/joget/plugin/enterprise/UniversalTheme.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
0
Analyze the following code function for security vulnerabilities
private IResource loadAndAddConfDstu2(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); ca.uhn.fhir.model.dstu2.resource.Conformance conformance; try { conformance = (ca.uhn.fhir.model.dstu2.resource.Conformance) client.fetchConformance().ofType(Conformance.class).execute(); } catch (Exception e) { ourLog.warn("Failed to load conformance statement, error was: {}", e.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + e.toString(), e)); conformance = new ca.uhn.fhir.model.dstu2.resource.Conformance(); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(conformance)); Map<String, Number> resourceCounts = new HashMap<String, Number>(); long total = 0; for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) { for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource nextResource : nextRest.getResource()) { List<ExtensionDt> exts = nextResource.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((DecimalDt) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource>() { @Override public int compare(ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO1, ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO2) { DecimalDt count1 = new DecimalDt(); List<ExtensionDt> count1exts = theO1.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (DecimalDt) count1exts.get(0).getValue(); } DecimalDt count2 = new DecimalDt(); List<ExtensionDt> count2exts = theO2.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (DecimalDt) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("conf", conformance); theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); return conformance; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: loadAndAddConfDstu2 File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir Fixed Code: private IResource loadAndAddConfDstu2(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); ca.uhn.fhir.model.dstu2.resource.Conformance conformance; try { conformance = client.fetchConformance().ofType(Conformance.class).execute(); } catch (Exception e) { ourLog.warn("Failed to load conformance statement, error was: {}", e.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + e.toString(), e)); conformance = new ca.uhn.fhir.model.dstu2.resource.Conformance(); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(conformance)); Map<String, Number> resourceCounts = new HashMap<>(); long total = 0; for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) { for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource nextResource : nextRest.getResource()) { List<ExtensionDt> exts = nextResource.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((DecimalDt) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource>() { @Override public int compare(ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO1, ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource theO2) { DecimalDt count1 = new DecimalDt(); List<ExtensionDt> count1exts = theO1.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (DecimalDt) count1exts.get(0).getValue(); } DecimalDt count2 = new DecimalDt(); List<ExtensionDt> count2exts = theO2.getUndeclaredExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (DecimalDt) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("conf", conformance); theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); return conformance; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
loadAndAddConfDstu2
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
public ApiClient setUsername(String username) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(username); return this; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUsername File: samples/client/petstore/java/resteasy/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
setUsername
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public String getNewbadges() { return newbadges; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNewbadges 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
getNewbadges
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public void saveDocument(XWikiDocument document, String comment, boolean isMinorEdit, XWikiContext context) throws XWikiException { String currentWiki = context.getWikiId(); try { // Switch to document wiki context.setWikiId(document.getDocumentReference().getWikiReference().getName()); // Make sure the document is ready to be saved XWikiDocument originalDocument = prepareDocumentForSave(document, comment, isMinorEdit, context); // Notify listeners about the document about to be created or updated // Note that for the moment the event being send is a bridge event, as we are still passing around // an XWikiDocument as source and an XWikiContext as data. beforeSave(document, context); // Delete existing document if we replace with a new one if (document.isNew()) { if (!originalDocument.isNew()) { // We don't want to notify about this delete since from outside world point of view it's an update // and not a delete+create deleteDocument(originalDocument, true, false, context); } } else { // Put attachments to remove in recycle bin if (hasAttachmentRecycleBin(context)) { for (XWikiAttachmentToRemove attachment : document.getAttachmentsToRemove()) { if (attachment.isToRecycleBin()) { // Make sure the attachment will be deleted with its history attachment.getAttachment().loadArchive(context); getAttachmentRecycleBinStore().saveToRecycleBin(attachment.getAttachment(), context.getUser(), new Date(), context, true); } } } } // Actually save the document. getStore().saveXWikiDoc(document, context); // Since the store#saveXWikiDoc resets originalDocument, we need to temporarily put it // back to send notifications. XWikiDocument newOriginal = document.getOriginalDocument(); try { document.setOriginalDocument(originalDocument); // Notify listeners about the document having been created or updated // First the legacy notification mechanism // Then the new observation module // Note that for the moment the event being send is a bridge event, as we are still passing around // an XWikiDocument as source and an XWikiContext as data. // The old version is made available using doc.getOriginalDocument() afterSave(document, context); } catch (Exception ex) { LOGGER.error("Failed to send document save notification for document [" + getDefaultEntityReferenceSerializer().serialize(document.getDocumentReference()) + "]", ex); } finally { document.setOriginalDocument(newOriginal); } } finally { context.setWikiId(currentWiki); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
saveDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void handleMessage(Message m) { switch (m.what) { case MSG_TOGGLE_KEYBOARD_SHORTCUTS_MENU: toggleKeyboardShortcuts(m.arg1); break; case MSG_DISMISS_KEYBOARD_SHORTCUTS_MENU: dismissKeyboardShortcuts(); break; // End old BaseStatusBar.H handling. case MSG_OPEN_NOTIFICATION_PANEL: animateExpandNotificationsPanel(); break; case MSG_OPEN_SETTINGS_PANEL: animateExpandSettingsPanel((String) m.obj); break; case MSG_CLOSE_PANELS: animateCollapsePanels(); break; case MSG_LAUNCH_TRANSITION_TIMEOUT: onLaunchTransitionTimeout(); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage 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
handleMessage
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@RequiresPermission(value = MANAGE_DEVICE_POLICY_INPUT_METHODS, conditional = true) public @Nullable List<String> getPermittedInputMethods(@Nullable ComponentName admin) { if (mService != null) { try { return mService.getPermittedInputMethods(admin, mContext.getPackageName(), mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedInputMethods 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
getPermittedInputMethods
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public @ColorInt int getPrimaryAccentColor() { return mPrimaryAccentColor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrimaryAccentColor File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getPrimaryAccentColor
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public int getStackId() { synchronized (mService) { return mStackId; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStackId File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
getStackId
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition trace(final String path, final Route.Handler handler) { return appendDefinition(TRACE, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trace File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
trace
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
protected void markAsDirty() { grid.markAsDirty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: markAsDirty File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
markAsDirty
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public byte[] getLastProcessedMessageHash() { return lastProcessedMessageHash; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastProcessedMessageHash File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getLastProcessedMessageHash
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public void onUserSwitching(int userId) { if (DEBUG) Log.d(TAG, String.format("onUserSwitching %d", userId)); // Note that the mLockPatternUtils user has already been updated from setCurrentUser. // We need to force a reset of the views, since lockNow (called by // ActivityManagerService) will not reconstruct the keyguard if it is already showing. synchronized (KeyguardViewMediator.this) { resetKeyguardDonePendingLocked(); if (mLockPatternUtils.isLockScreenDisabled(userId)) { // If we are switching to a user that has keyguard disabled, dismiss keyguard. dismiss(null /* callback */, null /* message */); } else { resetStateLocked(); } adjustStatusBarLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserSwitching 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
onUserSwitching
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public final Iterable<HtmlElement> getHtmlElementDescendants() { return () -> new DescendantElementsIterator<>(HtmlElement.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHtmlElementDescendants 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
getHtmlElementDescendants
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
private PeerConnectionWrapper getOrCreatePeerConnectionWrapperForSessionIdAndType(String sessionId, String type, boolean publisher) { PeerConnectionWrapper peerConnectionWrapper; if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) { return peerConnectionWrapper; } else { if (peerConnectionFactory == null) { Log.e(TAG, "peerConnectionFactory was null in getOrCreatePeerConnectionWrapperForSessionIdAndType."); Toast.makeText(context, context.getResources().getString(R.string.nc_common_error_sorry), Toast.LENGTH_LONG).show(); hangup(true); return null; } if (hasMCU && publisher) { peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, iceServers, sdpConstraintsForMCU, sessionId, callSession, localStream, true, true, type); } else if (hasMCU) { peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, iceServers, sdpConstraints, sessionId, callSession, null, false, true, type); } else { if (!"screen".equals(type)) { peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, iceServers, sdpConstraints, sessionId, callSession, localStream, false, false, type); } else { peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, iceServers, sdpConstraints, sessionId, callSession, null, false, false, type); } } peerConnectionWrapperList.add(peerConnectionWrapper); if (publisher) { startSendingNick(); } return peerConnectionWrapper; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOrCreatePeerConnectionWrapperForSessionIdAndType File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
getOrCreatePeerConnectionWrapperForSessionIdAndType
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
@Override public abstract void serialize(Object bean, JsonGenerator gen, SerializerProvider provider) throws IOException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serialize File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
serialize
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private Document buildResponseDocumentBody(Document responseDocumentEnvelope) throws ConnectorException { Document responseDocumentBody = null; if (responseDocumentEnvelope != null) { try { responseDocumentBody = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); } catch (final ParserConfigurationException pce) { throw new ConnectorException(pce); } final Node bodyContent = getEnvelopeBodyContent(responseDocumentEnvelope); final Node clonedBodyContent = bodyContent.cloneNode(true); responseDocumentBody.adoptNode(clonedBodyContent); responseDocumentBody.importNode(clonedBodyContent, true); responseDocumentBody.appendChild(clonedBodyContent); } return responseDocumentBody; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2020-36640 - Severity: MEDIUM - CVSS Score: 4.9 Description: fix(vulnerabilities): fix XXE attacks vulnerabilities and other code smell (#17) * Access to external entities and network access should always be disable to avoid XXS attacks vulnerabilities. * Log error properly * refactor logger name to be compliant with java naming conventions Function: buildResponseDocumentBody File: src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java Repository: bonitasoft/bonita-connector-webservice Fixed Code: private Document buildResponseDocumentBody(Document responseDocumentEnvelope) throws ConnectorException { Document responseDocumentBody = null; if (responseDocumentEnvelope != null) { try { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); documentBuilderFactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); responseDocumentBody = documentBuilderFactory.newDocumentBuilder().newDocument(); } catch (final ParserConfigurationException pce) { throw new ConnectorException(pce); } final Node bodyContent = getEnvelopeBodyContent(responseDocumentEnvelope); final Node clonedBodyContent = bodyContent.cloneNode(true); responseDocumentBody.adoptNode(clonedBodyContent); responseDocumentBody.importNode(clonedBodyContent, true); responseDocumentBody.appendChild(clonedBodyContent); } return responseDocumentBody; }
[ "CWE-611" ]
CVE-2020-36640
MEDIUM
4.9
bonitasoft/bonita-connector-webservice
buildResponseDocumentBody
src/main/java/org/bonitasoft/connectors/ws/SecureWSConnector.java
a12ad691c05af19e9061d7949b6b828ce48815d5
1
Analyze the following code function for security vulnerabilities
public void setRestTemplate(RestTemplate restTemplate) { this.restTemplate = restTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRestTemplate File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setRestTemplate
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private void maybeSendAdminEnabledBroadcastLocked(int userHandle) { DevicePolicyData policyData = getUserData(userHandle); if (policyData.mAdminBroadcastPending) { // Send the initialization data to profile owner and delete the data ActiveAdmin admin = getProfileOwnerAdminLocked(userHandle); boolean clearInitBundle = true; if (admin != null) { PersistableBundle initBundle = policyData.mInitBundle; clearInitBundle = sendAdminCommandLocked(admin, DeviceAdminReceiver.ACTION_DEVICE_ADMIN_ENABLED, initBundle == null ? null : new Bundle(initBundle), /* result= */ null , /* inForeground= */ true); } if (clearInitBundle) { // If there's no admin or we've successfully called the admin, clear the init bundle // otherwise, keep it around policyData.mInitBundle = null; policyData.mAdminBroadcastPending = false; saveSettingsLocked(userHandle); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: maybeSendAdminEnabledBroadcastLocked 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
maybeSendAdminEnabledBroadcastLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Deprecated public Builder setSound(Uri sound, AudioAttributes audioAttributes) { mN.sound = sound; mN.audioAttributes = audioAttributes; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSound File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setSound
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public void confirmControlView() { if(myView == null){ return; } myView.getAndroidView().setVisibility(View.VISIBLE); //ugly workaround for a bug where on some android versions the async view //came back black from the background. if(myView instanceof AndroidAsyncView){ new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(1000); ((AndroidAsyncView)myView).setPaintViewOnBuffer(false); } catch (Exception e) { } } }).start(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: confirmControlView 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
confirmControlView
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
protected void writeDesign(Element cellElement, DesignContext designContext) { switch (cellState.type) { case TEXT: cellElement.attr("plain-text", true); cellElement.appendText(getText()); break; case HTML: cellElement.append(getHtml()); break; case WIDGET: cellElement.appendChild( designContext.createElement(getComponent())); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeDesign File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
writeDesign
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
public static String[] validateObject(ParaObject content) { if (content == null) { return new String[]{"Object cannot be null."}; } LinkedList<String> list = new LinkedList<>(); try { for (ConstraintViolation<ParaObject> constraintViolation : getValidator().validate(content)) { String prop = "'".concat(constraintViolation.getPropertyPath().toString()).concat("'"); list.add(prop.concat(" ").concat(constraintViolation.getMessage())); } } catch (Exception e) { logger.error(null, e); } return list.toArray(new String[]{}); }
Vulnerability Classification: - CWE: CWE-840 - CVE: CVE-2022-1848 - Severity: MEDIUM - CVSS Score: 4.3 Description: fixed password length issues Function: validateObject File: para-core/src/main/java/com/erudika/para/core/validation/ValidationUtils.java Repository: Erudika/para Fixed Code: public static String[] validateObject(ParaObject content) { if (content == null) { return new String[]{"Object cannot be null."}; } LinkedList<String> list = new LinkedList<>(); try { for (ConstraintViolation<ParaObject> constraintViolation : getValidator().validate(content)) { String prop = "'".concat(constraintViolation.getPropertyPath().toString()).concat("'"); list.add(prop.concat(" ").concat(constraintViolation.getMessage())); } if (content instanceof User && StringUtils.length(((User) content).getPassword()) > User.MAX_PASSWORD_LENGTH) { list.add(Utils.formatMessage("{0} must not be longer than {1}.", Config._PASSWORD, User.MAX_PASSWORD_LENGTH)); } } catch (Exception e) { logger.error(null, e); } return list.toArray(new String[]{}); }
[ "CWE-840" ]
CVE-2022-1848
MEDIUM
4.3
Erudika/para
validateObject
para-core/src/main/java/com/erudika/para/core/validation/ValidationUtils.java
fa677c629842df60099daa9c23bd802bc41b48d1
1
Analyze the following code function for security vulnerabilities
void moveTaskToFrontLocked(int taskId, int flags, SafeActivityOptions options, boolean fromRecents) { if (!checkAppSwitchAllowedLocked(Binder.getCallingPid(), Binder.getCallingUid(), -1, -1, "Task to front")) { SafeActivityOptions.abort(options); return; } final long origId = Binder.clearCallingIdentity(); try { final TaskRecord task = mStackSupervisor.anyTaskForIdLocked(taskId); if (task == null) { Slog.d(TAG, "Could not find task for id: "+ taskId); return; } if (mLockTaskController.isLockTaskModeViolation(task)) { Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode"); return; } ActivityOptions realOptions = options != null ? options.getOptions(mStackSupervisor) : null; mStackSupervisor.findTaskToMoveToFront(task, flags, realOptions, "moveTaskToFront", false /* forceNonResizable */); final ActivityRecord topActivity = task.getTopActivity(); if (topActivity != null) { // We are reshowing a task, use a starting window to hide the initial draw delay // so the transition can start earlier. topActivity.showStartingWindow(null /* prev */, false /* newTask */, true /* taskSwitch */, fromRecents); } } finally { Binder.restoreCallingIdentity(origId); } SafeActivityOptions.abort(options); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToFrontLocked 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
moveTaskToFrontLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public int getBackgroundColor() { if (mNativeContentViewCore != 0) { return nativeGetBackgroundColor(mNativeContentViewCore); } return Color.WHITE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBackgroundColor 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
getBackgroundColor
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void focusBody() { mBodyView.requestFocus(); resetBodySelection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: focusBody File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
focusBody
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public Builder setUseProxyProperties(boolean useProxyProperties) { this.useProxyProperties = useProxyProperties; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseProxyProperties File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setUseProxyProperties
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
private int removeDataDirsLI(String volumeUuid, String packageName) { int[] users = sUserManager.getUserIds(); int res = 0; for (int user : users) { int resInner = mInstaller.remove(volumeUuid, packageName, user); if (resInner < 0) { res = resInner; } } return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeDataDirsLI 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
removeDataDirsLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void parseKeyVal(TomlObjectNode target, int nextState) throws IOException { // keyval = key keyval-sep val FieldRef fieldRef = parseAndEnterKey(target, false); pollExpected(TomlToken.KEY_VAL_SEP, Lexer.EXPECT_VALUE); JsonNode value = parseValue(nextState); if (fieldRef.object.has(fieldRef.key)) { throw errorContext.atPosition(lexer).generic("Duplicate key"); } fieldRef.object.set(fieldRef.key, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseKeyVal File: toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java Repository: FasterXML/jackson-dataformats-text The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-3894
HIGH
7.5
FasterXML/jackson-dataformats-text
parseKeyVal
toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
20a209387931dba31e1a027b74976911c3df39fe
0
Analyze the following code function for security vulnerabilities
private boolean validateFileName(String name) { return FileUtils.validateFilename(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateFileName File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
validateFileName
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
private void writePendingOperationLocked(PendingOperation pop, XmlSerializer out) throws IOException { // Pending operation. out.startTag(null, "op"); out.attribute(null, XML_ATTR_VERSION, Integer.toString(PENDING_OPERATION_VERSION)); out.attribute(null, XML_ATTR_AUTHORITYID, Integer.toString(pop.authorityId)); out.attribute(null, XML_ATTR_SOURCE, Integer.toString(pop.syncSource)); out.attribute(null, XML_ATTR_EXPEDITED, Boolean.toString(pop.expedited)); out.attribute(null, XML_ATTR_REASON, Integer.toString(pop.reason)); extrasToXml(out, pop.extras); out.endTag(null, "op"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writePendingOperationLocked File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
writePendingOperationLocked
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@Override public int getSliceHighlightMenuRes() { return R.string.menu_key_location; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSliceHighlightMenuRes File: src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21247
HIGH
7.8
android
getSliceHighlightMenuRes
src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
edd4023805bc7fa54ae31de222cde02b9012bbc4
0
Analyze the following code function for security vulnerabilities
public static Account fromDOM(Element accountElement) { Account account = new Account(); String id = accountElement.getAttribute("id"); account.setID(id); fromDOM(accountElement, account); NodeList fullNameList = accountElement.getElementsByTagName("FullName"); if (fullNameList.getLength() > 0) { String value = fullNameList.item(0).getTextContent(); account.setFullName(value); } NodeList emailList = accountElement.getElementsByTagName("Email"); if (emailList.getLength() > 0) { String email = emailList.item(0).getTextContent(); account.setEmail(email); } NodeList roleList = accountElement.getElementsByTagName("Role"); int length = roleList.getLength(); if (length > 0) { for (int i=0; i<length; i++) { String role = roleList.item(i).getTextContent(); account.addRole(role); } } return account; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/account/Account.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/account/Account.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public String getDisplayName() { return name == null ? getUriForDisplay() : CaseInsensitiveString.str(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisplayName File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getDisplayName
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
private final int jjStopStringLiteralDfa_0(int pos, long active0) { switch (pos) { case 0: if ((active0 & 0x10L) != 0L) return 2; if ((active0 & 0xcL) != 0L) { jjmatchedKind = 1; return 4; } return -1; default : return -1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjStopStringLiteralDfa_0 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjStopStringLiteralDfa_0
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
@Override public void update(int batteryLevel, int bucket, long screenOffTime) { mBatteryLevel = batteryLevel; if (bucket >= 0) { mBucketDroppedNegativeTimeMs = 0; } else if (bucket < mBucket) { mBucketDroppedNegativeTimeMs = System.currentTimeMillis(); } mBucket = bucket; mScreenOffTime = screenOffTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
update
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
protected void scanCDATA() throws IOException { if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded("(scanCDATA: "); } fStringBuffer.clear(); if (fCDATASections) { if (fDocumentHandler != null && fElementCount >= fElementDepth) { fEndLineNumber = fCurrentEntity.getLineNumber(); fEndColumnNumber = fCurrentEntity.getColumnNumber(); fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); if (DEBUG_CALLBACKS) { System.out.println("startCDATA()"); } fDocumentHandler.startCDATA(locationAugs()); } } else { fStringBuffer.append("[CDATA["); } boolean eof = scanMarkupContent(fStringBuffer, ']'); if (!fCDATASections) { fStringBuffer.append("]]"); } if (fDocumentHandler != null && fElementCount >= fElementDepth) { fEndLineNumber = fCurrentEntity.getLineNumber(); fEndColumnNumber = fCurrentEntity.getColumnNumber(); fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); if (fCDATASections) { if (DEBUG_CALLBACKS) { System.out.println("characters("+fStringBuffer+")"); } fDocumentHandler.characters(fStringBuffer, locationAugs()); if (DEBUG_CALLBACKS) { System.out.println("endCDATA()"); } fDocumentHandler.endCDATA(locationAugs()); } else { if (DEBUG_CALLBACKS) { System.out.println("comment("+fStringBuffer+")"); } fDocumentHandler.comment(fStringBuffer, locationAugs()); } } if (DEBUG_BUFFER) { fCurrentEntity.debugBufferIfNeeded(")scanCDATA: "); } if (eof) { throw new EOFException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scanCDATA 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
scanCDATA
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@Override public Object getSystemService(@ServiceName @NonNull String name) { if (getBaseContext() == null) { throw new IllegalStateException( "System services not available to Activities before onCreate()"); } // Guarantee that we always return the same window manager instance. if (WINDOW_SERVICE.equals(name)) { if (mWindowManager == null) { mWindowManager = (WindowManager) getBaseContext().getSystemService(name); } return mWindowManager; } return super.getSystemService(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemService File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
getSystemService
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
@NonNull public Builder setContextual(boolean isContextual) { mIsContextual = isContextual; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setContextual File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setContextual
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public static String[] splitFileName(String mimeType, String displayName) { String name; String ext; { String mimeTypeFromExt; // Extract requested extension from display name final int lastDot = displayName.lastIndexOf('.'); if (lastDot > 0) { name = displayName.substring(0, lastDot); ext = displayName.substring(lastDot + 1); mimeTypeFromExt = MimeTypeMap.getSingleton().getMimeTypeFromExtension( ext.toLowerCase(Locale.ROOT)); } else { name = displayName; ext = null; mimeTypeFromExt = null; } if (mimeTypeFromExt == null) { mimeTypeFromExt = ClipDescription.MIMETYPE_UNKNOWN; } final String extFromMimeType; if (ClipDescription.MIMETYPE_UNKNOWN.equalsIgnoreCase(mimeType)) { extFromMimeType = null; } else { extFromMimeType = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType); } if (StringUtils.equalIgnoreCase(mimeType, mimeTypeFromExt) || StringUtils.equalIgnoreCase(ext, extFromMimeType)) { // Extension maps back to requested MIME type; allow it } else { // No match; insist that create file matches requested MIME name = displayName; ext = extFromMimeType; } } if (ext == null) { ext = ""; } return new String[] { name, ext }; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitFileName File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
splitFileName
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
@Override public void recycle(ActivityStarter starter) { starter.reset(true /* clearRequest*/); mStarterPool.release(starter); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recycle File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
recycle
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
public List<X509Certificate> getCertificates() { return mCerts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCertificates File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getCertificates
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
private void removePauseTimeout() { mAtmService.mH.removeCallbacks(mPauseTimeoutRunnable); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePauseTimeout File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
removePauseTimeout
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static boolean isBatteryUpdateInteresting(BatteryStatus old, BatteryStatus current) { final boolean nowPluggedIn = current.isPluggedIn(); final boolean wasPluggedIn = old.isPluggedIn(); final boolean stateChangedWhilePluggedIn = wasPluggedIn == true && nowPluggedIn == true && (old.status != current.status); // change in plug state is always interesting if (wasPluggedIn != nowPluggedIn || stateChangedWhilePluggedIn) { return true; } // change in battery level while plugged in if (nowPluggedIn && old.level != current.level) { return true; } // change where battery needs charging if (!nowPluggedIn && current.isBatteryLow() && current.level != old.level) { return true; } // change in charging current while plugged in if (nowPluggedIn && current.maxChargingWattage != old.maxChargingWattage) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBatteryUpdateInteresting File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isBatteryUpdateInteresting
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Override public boolean requestAutofillData(IAssistDataReceiver receiver, Bundle receiverExtras, IBinder activityToken, int flags) { return enqueueAssistContext(ActivityManager.ASSIST_CONTEXT_AUTOFILL, null, null, receiver, receiverExtras, activityToken, true, true, UserHandle.getCallingUserId(), null, PENDING_AUTOFILL_ASSIST_STRUCTURE_TIMEOUT, flags) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestAutofillData File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
requestAutofillData
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@JsonProperty("id") public CertId getSerialNumber() { return serialNumber; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSerialNumber File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getSerialNumber
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public WifiSsidPolicy getWifiSsidPolicy(String callerPackageName) { final CallerIdentity caller = getCallerIdentity(); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_WIFI, callerPackageName, caller.getUserId()); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller) || canQueryAdminPolicy(caller), "SSID policy can only be retrieved by a device owner or " + "a profile owner on an organization-owned device or " + "an app with the QUERY_ADMIN_POLICY permission."); } synchronized (getLockObject()) { ActiveAdmin admin; admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceOrSystemPermissionBasedAdminLocked(); return admin != null ? admin.mWifiSsidPolicy : null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWifiSsidPolicy 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
getWifiSsidPolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean getPackageAskScreenCompat(String packageName) { enforceNotIsolatedCaller("getPackageAskScreenCompat"); synchronized (mGlobalLock) { return mCompatModePackages.getPackageAskCompatModeLocked(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageAskScreenCompat File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getPackageAskScreenCompat
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private boolean mightHaveChunk(Class<? extends Component> componentClass, DependencyInfo dependencies) { if (!dependencies.isEmpty()) { return true; } return componentClass.getAnnotation(Route.class) != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mightHaveChunk File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
mightHaveChunk
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private void migrateLegacySettingsForUserLocked(DatabaseHelper dbHelper, SQLiteDatabase database, int userId) { // Move over the system settings. final int systemKey = makeKey(SETTINGS_TYPE_SYSTEM, userId); ensureSettingsStateLocked(systemKey); SettingsState systemSettings = mSettingsStates.get(systemKey); migrateLegacySettingsLocked(systemSettings, database, TABLE_SYSTEM); systemSettings.persistSyncLocked(); // Move over the secure settings. // Do this after System settings, since this is the first thing we check when deciding // to skip over migration from db to xml for a secondary user. final int secureKey = makeKey(SETTINGS_TYPE_SECURE, userId); ensureSettingsStateLocked(secureKey); SettingsState secureSettings = mSettingsStates.get(secureKey); migrateLegacySettingsLocked(secureSettings, database, TABLE_SECURE); ensureSecureSettingAndroidIdSetLocked(secureSettings); secureSettings.persistSyncLocked(); // Move over the global settings if owner. // Do this last, since this is the first thing we check when deciding // to skip over migration from db to xml for owner user. if (userId == UserHandle.USER_SYSTEM) { final int globalKey = makeKey(SETTINGS_TYPE_GLOBAL, userId); ensureSettingsStateLocked(globalKey); SettingsState globalSettings = mSettingsStates.get(globalKey); migrateLegacySettingsLocked(globalSettings, database, TABLE_GLOBAL); // If this was just created if (mSettingsCreationBuildId != null) { globalSettings.insertSettingLocked(Settings.Global.DATABASE_CREATION_BUILDID, mSettingsCreationBuildId, null, true, SettingsState.SYSTEM_PACKAGE_NAME); } globalSettings.persistSyncLocked(); } // Drop the database as now all is moved and persisted. if (DROP_DATABASE_ON_MIGRATION) { dbHelper.dropDatabase(); } else { dbHelper.backupDatabase(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateLegacySettingsForUserLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
migrateLegacySettingsForUserLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public void registerConverter(Converter converter) { registerConverter(converter, PRIORITY_NORMAL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerConverter File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
registerConverter
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
protected void processMucInvitation(final String room, final String inviter, final String reason, final String password) { String roomname = room; String inviter_name = null; if (getBareJID(inviter).equalsIgnoreCase(room)) { // from == participant JID, display as "user (MUC)" inviter_name = getNameForJID(inviter); } else { // from == user bare or full JID inviter_name = getNameForJID(getBareJID(inviter)); } String description = null; String inv_from = mService.getString(R.string.muc_invitation_from, inviter_name); // query room for info try { Log.d(TAG, "Requesting disco#info from " + room); RoomInfo ri = MultiUserChat.getRoomInfo(mXMPPConnection, room); String rn = ri.getRoomName(); if (rn != null && rn.length() > 0) roomname = String.format("%s (%s)", rn, roomname); description = ri.getSubject(); if (!TextUtils.isEmpty(description)) description = ri.getDescription(); description = mService.getString(R.string.muc_invitation_occupants, description, ri.getOccupantsCount()); Log.d(TAG, "MUC name after disco: " + roomname); } catch (XMPPException e) { // ignore a failed room info request Log.d(TAG, "MUC room IQ failed: " + room); e.printStackTrace(); } mServiceCallBack.mucInvitationReceived( roomname, room, password, inv_from, description); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processMucInvitation File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
processMucInvitation
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
private void updatePublicMode() { final boolean showingKeyguard = mStatusBarKeyguardViewManager.isShowing(); final boolean devicePublic = showingKeyguard && mStatusBarKeyguardViewManager.isSecure(mCurrentUserId); // Look for public mode users. Users are considered public in either case of: // - device keyguard is shown in secure mode; // - profile is locked with a work challenge. for (int i = mCurrentProfiles.size() - 1; i >= 0; i--) { final int userId = mCurrentProfiles.valueAt(i).id; boolean isProfilePublic = devicePublic; if (!devicePublic && userId != mCurrentUserId) { // We can't rely on KeyguardManager#isDeviceLocked() for unified profile challenge // due to a race condition where this code could be called before // TrustManagerService updates its internal records, resulting in an incorrect // state being cached in mLockscreenPublicMode. (b/35951989) if (mLockPatternUtils.isSeparateProfileChallengeEnabled(userId) && mStatusBarKeyguardViewManager.isSecure(userId)) { isProfilePublic = mKeyguardManager.isDeviceLocked(userId); } } setLockscreenPublicMode(isProfilePublic, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePublicMode 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
updatePublicMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void saveLockPassword(String password, String savedPassword, int quality, int userHandle) { try { DevicePolicyManager dpm = getDevicePolicyManager(); if (password == null || password.length() < MIN_LOCK_PASSWORD_SIZE) { throw new IllegalArgumentException("password must not be null and at least " + "of length " + MIN_LOCK_PASSWORD_SIZE); } getLockSettings().setLockPassword(password, savedPassword, userHandle); getLockSettings().setSeparateProfileChallengeEnabled(userHandle, true, null); int computedQuality = computePasswordQuality(password); // Update the device encryption password. if (userHandle == UserHandle.USER_SYSTEM && LockPatternUtils.isDeviceEncryptionEnabled()) { if (!shouldEncryptWithCredentials(true)) { clearEncryptionPassword(); } else { boolean numeric = computedQuality == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC; boolean numericComplex = computedQuality == DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX; int type = numeric || numericComplex ? StorageManager.CRYPT_TYPE_PIN : StorageManager.CRYPT_TYPE_PASSWORD; updateEncryptionPassword(type, password); } } setLong(PASSWORD_TYPE_KEY, Math.max(quality, computedQuality), userHandle); if (computedQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) { int letters = 0; int uppercase = 0; int lowercase = 0; int numbers = 0; int symbols = 0; int nonletter = 0; for (int i = 0; i < password.length(); i++) { char c = password.charAt(i); if (c >= 'A' && c <= 'Z') { letters++; uppercase++; } else if (c >= 'a' && c <= 'z') { letters++; lowercase++; } else if (c >= '0' && c <= '9') { numbers++; nonletter++; } else { symbols++; nonletter++; } } dpm.setActivePasswordState(Math.max(quality, computedQuality), password.length(), letters, uppercase, lowercase, numbers, symbols, nonletter, userHandle); } else { // The password is not anything. dpm.setActivePasswordState( DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED, 0, 0, 0, 0, 0, 0, 0, userHandle); } // Add the password to the password history. We assume all // password hashes have the same length for simplicity of implementation. String passwordHistory = getString(PASSWORD_HISTORY_KEY, userHandle); if (passwordHistory == null) { passwordHistory = ""; } int passwordHistoryLength = getRequestedPasswordHistoryLength(userHandle); if (passwordHistoryLength == 0) { passwordHistory = ""; } else { byte[] hash = passwordToHash(password, userHandle); passwordHistory = new String(hash, StandardCharsets.UTF_8) + "," + passwordHistory; // Cut it to contain passwordHistoryLength hashes // and passwordHistoryLength -1 commas. passwordHistory = passwordHistory.substring(0, Math.min(hash.length * passwordHistoryLength + passwordHistoryLength - 1, passwordHistory .length())); } setString(PASSWORD_HISTORY_KEY, passwordHistory, userHandle); onAfterChangingPassword(userHandle); } catch (RemoteException re) { // Cant do much Log.e(TAG, "Unable to save lock password " + re); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveLockPassword File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
saveLockPassword
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN) public void reportFailedPasswordAttempt(int userHandle) { if (mService != null) { try { mService.reportFailedPasswordAttempt(userHandle, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportFailedPasswordAttempt 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
reportFailedPasswordAttempt
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override protected void onCreate(Bundle savedState) { super.onCreate(savedState); Log.d(LOG_TAG, "Starting onCreate"); long startTime = System.currentTimeMillis(); final FeatureFactory factory = FeatureFactory.getFactory(this); mDashboardFeatureProvider = factory.getDashboardFeatureProvider(this); // Should happen before any call to getIntent() getMetaData(); final Intent intent = getIntent(); if (intent.hasExtra(EXTRA_UI_OPTIONS)) { getWindow().setUiOptions(intent.getIntExtra(EXTRA_UI_OPTIONS, 0)); } // Getting Intent properties can only be done after the super.onCreate(...) final String initialFragmentName = intent.getStringExtra(EXTRA_SHOW_FRAGMENT); final ComponentName cn = intent.getComponent(); final String className = cn.getClassName(); mIsShowingDashboard = className.equals(Settings.class.getName()); // This is a "Sub Settings" when: // - this is a real SubSettings // - or :settings:show_fragment_as_subsetting is passed to the Intent final boolean isSubSettings = this instanceof SubSettings || intent.getBooleanExtra(EXTRA_SHOW_FRAGMENT_AS_SUBSETTING, false); // If this is a sub settings, then apply the SubSettings Theme for the ActionBar content // insets if (isSubSettings) { setTheme(R.style.Theme_SubSettings); } setContentView(mIsShowingDashboard ? R.layout.settings_main_dashboard : R.layout.settings_main_prefs); mContent = findViewById(R.id.main_content); getFragmentManager().addOnBackStackChangedListener(this); if (savedState != null) { // We are restarting from a previous saved state; used that to initialize, instead // of starting fresh. setTitleFromIntent(intent); ArrayList<DashboardCategory> categories = savedState.getParcelableArrayList(SAVE_KEY_CATEGORIES); if (categories != null) { mCategories.clear(); mCategories.addAll(categories); setTitleFromBackStack(); } } else { launchSettingFragment(initialFragmentName, isSubSettings, intent); } if (mIsShowingDashboard) { findViewById(R.id.search_bar).setVisibility(View.VISIBLE); findViewById(R.id.action_bar).setVisibility(View.GONE); final Toolbar toolbar = findViewById(R.id.search_action_bar); FeatureFactory.getFactory(this).getSearchFeatureProvider() .initSearchToolbar(this, toolbar); setActionBar(toolbar); // Please forgive me for what I am about to do. // // Need to make the navigation icon non-clickable so that the entire card is clickable // and goes to the search UI. Also set the background to null so there's no ripple. View navView = toolbar.getNavigationView(); navView.setClickable(false); navView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); navView.setBackground(null); } ActionBar actionBar = getActionBar(); if (actionBar != null) { boolean deviceProvisioned = Utils.isDeviceProvisioned(this); actionBar.setDisplayHomeAsUpEnabled(deviceProvisioned); actionBar.setHomeButtonEnabled(deviceProvisioned); actionBar.setDisplayShowTitleEnabled(!mIsShowingDashboard); } mSwitchBar = findViewById(R.id.switch_bar); if (mSwitchBar != null) { mSwitchBar.setMetricsTag(getMetricsTag()); } // see if we should show Back/Next buttons if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false)) { View buttonBar = findViewById(R.id.button_bar); if (buttonBar != null) { buttonBar.setVisibility(View.VISIBLE); Button backButton = (Button) findViewById(R.id.back_button); backButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_CANCELED, null); finish(); } }); Button skipButton = (Button) findViewById(R.id.skip_button); skipButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_OK, null); finish(); } }); mNextButton = (Button) findViewById(R.id.next_button); mNextButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_OK, null); finish(); } }); // set our various button parameters if (intent.hasExtra(EXTRA_PREFS_SET_NEXT_TEXT)) { String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_NEXT_TEXT); if (TextUtils.isEmpty(buttonText)) { mNextButton.setVisibility(View.GONE); } else { mNextButton.setText(buttonText); } } if (intent.hasExtra(EXTRA_PREFS_SET_BACK_TEXT)) { String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_BACK_TEXT); if (TextUtils.isEmpty(buttonText)) { backButton.setVisibility(View.GONE); } else { backButton.setText(buttonText); } } if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_SKIP, false)) { skipButton.setVisibility(View.VISIBLE); } } } if (DEBUG_TIMING) { Log.d(LOG_TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms"); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2018-9501 - Severity: HIGH - CVSS Score: 7.2 Description: Disable changing lock when device is not provisioned. When the device is not yet provisioned and settings is launched: - disable the entry point for changing device lock - remove the search panel from settings home page - remove the search menu Bug: 110034419 Test: make RunSettingsRoboTests Change-Id: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2 Merged-In: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2 (cherry picked from commit 770f4abf9de2bb7d74497cc4b5f6795023229ef2) Function: onCreate File: src/com/android/settings/SettingsActivity.java Repository: android Fixed Code: @Override protected void onCreate(Bundle savedState) { super.onCreate(savedState); Log.d(LOG_TAG, "Starting onCreate"); long startTime = System.currentTimeMillis(); final FeatureFactory factory = FeatureFactory.getFactory(this); mDashboardFeatureProvider = factory.getDashboardFeatureProvider(this); // Should happen before any call to getIntent() getMetaData(); final Intent intent = getIntent(); if (intent.hasExtra(EXTRA_UI_OPTIONS)) { getWindow().setUiOptions(intent.getIntExtra(EXTRA_UI_OPTIONS, 0)); } // Getting Intent properties can only be done after the super.onCreate(...) final String initialFragmentName = intent.getStringExtra(EXTRA_SHOW_FRAGMENT); final ComponentName cn = intent.getComponent(); final String className = cn.getClassName(); mIsShowingDashboard = className.equals(Settings.class.getName()); // This is a "Sub Settings" when: // - this is a real SubSettings // - or :settings:show_fragment_as_subsetting is passed to the Intent final boolean isSubSettings = this instanceof SubSettings || intent.getBooleanExtra(EXTRA_SHOW_FRAGMENT_AS_SUBSETTING, false); // If this is a sub settings, then apply the SubSettings Theme for the ActionBar content // insets if (isSubSettings) { setTheme(R.style.Theme_SubSettings); } setContentView(mIsShowingDashboard ? R.layout.settings_main_dashboard : R.layout.settings_main_prefs); mContent = findViewById(R.id.main_content); getFragmentManager().addOnBackStackChangedListener(this); if (savedState != null) { // We are restarting from a previous saved state; used that to initialize, instead // of starting fresh. setTitleFromIntent(intent); ArrayList<DashboardCategory> categories = savedState.getParcelableArrayList(SAVE_KEY_CATEGORIES); if (categories != null) { mCategories.clear(); mCategories.addAll(categories); setTitleFromBackStack(); } } else { launchSettingFragment(initialFragmentName, isSubSettings, intent); } final boolean deviceProvisioned = Utils.isDeviceProvisioned(this); if (mIsShowingDashboard) { findViewById(R.id.search_bar).setVisibility( deviceProvisioned ? View.VISIBLE : View.INVISIBLE); findViewById(R.id.action_bar).setVisibility(View.GONE); final Toolbar toolbar = findViewById(R.id.search_action_bar); FeatureFactory.getFactory(this).getSearchFeatureProvider() .initSearchToolbar(this, toolbar); setActionBar(toolbar); // Please forgive me for what I am about to do. // // Need to make the navigation icon non-clickable so that the entire card is clickable // and goes to the search UI. Also set the background to null so there's no ripple. View navView = toolbar.getNavigationView(); navView.setClickable(false); navView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); navView.setBackground(null); } ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(deviceProvisioned); actionBar.setHomeButtonEnabled(deviceProvisioned); actionBar.setDisplayShowTitleEnabled(!mIsShowingDashboard); } mSwitchBar = findViewById(R.id.switch_bar); if (mSwitchBar != null) { mSwitchBar.setMetricsTag(getMetricsTag()); } // see if we should show Back/Next buttons if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, false)) { View buttonBar = findViewById(R.id.button_bar); if (buttonBar != null) { buttonBar.setVisibility(View.VISIBLE); Button backButton = (Button) findViewById(R.id.back_button); backButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_CANCELED, null); finish(); } }); Button skipButton = (Button) findViewById(R.id.skip_button); skipButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_OK, null); finish(); } }); mNextButton = (Button) findViewById(R.id.next_button); mNextButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { setResult(RESULT_OK, null); finish(); } }); // set our various button parameters if (intent.hasExtra(EXTRA_PREFS_SET_NEXT_TEXT)) { String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_NEXT_TEXT); if (TextUtils.isEmpty(buttonText)) { mNextButton.setVisibility(View.GONE); } else { mNextButton.setText(buttonText); } } if (intent.hasExtra(EXTRA_PREFS_SET_BACK_TEXT)) { String buttonText = intent.getStringExtra(EXTRA_PREFS_SET_BACK_TEXT); if (TextUtils.isEmpty(buttonText)) { backButton.setVisibility(View.GONE); } else { backButton.setText(buttonText); } } if (intent.getBooleanExtra(EXTRA_PREFS_SHOW_SKIP, false)) { skipButton.setVisibility(View.VISIBLE); } } } if (DEBUG_TIMING) { Log.d(LOG_TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms"); } }
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
onCreate
src/com/android/settings/SettingsActivity.java
5e43341b8c7eddce88f79c9a5068362927c05b54
1
Analyze the following code function for security vulnerabilities
static void killProcessGroup(int uid, int pid) { if (sKillHandler != null) { sKillHandler.sendMessage( sKillHandler.obtainMessage(KillHandler.KILL_PROCESS_GROUP_MSG, uid, pid)); } else { Slog.w(TAG, "Asked to kill process group before system bringup!"); Process.killProcessGroup(uid, pid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: killProcessGroup 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
killProcessGroup
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
static IDreamManager getDreamManager() { return IDreamManager.Stub.asInterface( ServiceManager.checkService(DreamService.DREAM_SERVICE)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDreamManager File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
getDreamManager
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Deprecated protected void showVariables( final String uri, final HttpServletResponse response, final String namespace, final boolean includeDoc, final boolean html, final String... vars ) throws IOException { final DisplayType displayType = html ? DisplayType.HTML : DisplayType.PLAINTEXT; showVariables(uri, response, namespace, includeDoc, displayType, vars); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showVariables File: varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
showVariables
varexport/src/main/java/com/indeed/util/varexport/servlet/ViewExportedVariablesServlet.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
@DELETE @Path("{username}") @RequiresPermissions(USERS_EDIT) @ApiOperation("Removes a user account.") @ApiResponses({@ApiResponse(code = 400, message = "When attempting to remove a read only user (e.g. built-in or LDAP user).")}) @AuditEvent(type = AuditEventTypes.USER_DELETE) public void deleteUser(@ApiParam(name = "username", value = "The name of the user to delete.", required = true) @PathParam("username") String username) { if (userManagementService.delete(username) == 0) { throw new NotFoundException("Couldn't find user " + username); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteUser File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
deleteUser
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
@Override public void setOrganizationName(@NonNull ComponentName who, CharSequence text) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); if (!TextUtils.equals(admin.organizationName, text)) { admin.organizationName = (text == null || text.length() == 0) ? null : text.toString(); saveSettingsLocked(caller.getUserId()); } } }
Vulnerability Classification: - CWE: CWE-20 - CVE: CVE-2023-21284 - Severity: MEDIUM - CVSS Score: 5.5 Description: Ensure policy has no absurdly long strings The following APIs now enforce limits and throw IllegalArgumentException when limits are violated: * DPM.setTrustAgentConfiguration() limits agent packgage name, component name, and strings within configuration bundle. * DPM.setPermittedAccessibilityServices() limits package names. * DPM.setPermittedInputMethods() limits package names. * DPM.setAccountManagementDisabled() limits account name. * DPM.setLockTaskPackages() limits package names. * DPM.setAffiliationIds() limits id. * DPM.transferOwnership() limits strings inside the bundle. Package names are limited at 223, because they become directory names and it is a filesystem restriction, see FrameworkParsingPackageUtils. All other strings are limited at 65535, because longer ones break binary XML serializer. The following APIs silently truncate strings that are long beyond reason: * DPM.setShortSupportMessage() truncates message at 200. * DPM.setLongSupportMessage() truncates message at 20000. * DPM.setOrganizationName() truncates org name at 200. Bug: 260729089 Test: atest com.android.server.devicepolicy (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5dd3e81347e3c841510094fb5effd51fc0fa995b) Merged-In: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Change-Id: Idcf54e408722f164d16bf2f24a00cd1f5b626d23 Function: setOrganizationName File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android Fixed Code: @Override public void setOrganizationName(@NonNull ComponentName who, CharSequence text) { if (!mHasFeature) { return; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); text = truncateIfLonger(text, MAX_ORG_NAME_LENGTH); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller); if (!TextUtils.equals(admin.organizationName, text)) { admin.organizationName = (text == null || text.length() == 0) ? null : text.toString(); saveSettingsLocked(caller.getUserId()); } } }
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
setOrganizationName
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
1
Analyze the following code function for security vulnerabilities
private Drawable getDefaultProfileBadgeDrawable() { return mContext.getPackageManager().getUserBadgeForDensityNoBackground( new UserHandle(mContext.getUserId()), 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultProfileBadgeDrawable File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getDefaultProfileBadgeDrawable
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override @Transactional( readOnly = true ) public Collection<Program> getPrograms( Collection<String> uids ) { return programStore.getByUid( uids ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrograms File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
getPrograms
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
ef04483a9b177d62e48dcf4e498b302a11f95e7d
0