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 void initialize() throws InitializationException { // Cache CacheConfiguration cacheConfiguration = new CacheConfiguration("localization.bundle.document"); try { this.onDemandBundleCache = this.cacheManager.createNewCache(cacheConfiguration); } catch (CacheException e) { this.logger.error("Failed to create cache [{}]", cacheConfiguration.getConfigurationId(), e); } // Load existing translations from main wiki, wait for WikiReaderEvent for other wikis loadTranslations(this.wikiManager.getMainWikiId()); // Listeners this.observation.addListener(this.listener); this.observation.addListener(this.wikilistener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29510
HIGH
8.8
xwiki/xwiki-platform
initialize
xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
d06ff8a58480abc7f63eb1d4b8b366024d990643
0
Analyze the following code function for security vulnerabilities
void configureFilters() { requestFilters = new LinkedList<RequestFilter>(); responseFilters = new LinkedList<ResponseFilter>(); ioExceptionFilters = new LinkedList<IOExceptionFilter>(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configureFilters File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
configureFilters
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
public void setName(String name) { this.name = name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34602
HIGH
7.5
jeecgboot/jeecg-boot
setName
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/security/AbstractQueryBlackListHandler.java
dd7bf104e7ed59142909567ecd004335c3442ec5
0
Analyze the following code function for security vulnerabilities
public void broadcastNetworkConnectionEvent(String iface, int networkId, boolean filsHlpSent, WifiSsid ssid, String bssid) { sendMessage(iface, NETWORK_CONNECTION_EVENT, new NetworkConnectionEventInfo(networkId, ssid, bssid, filsHlpSent)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastNetworkConnectionEvent File: service/java/com/android/server/wifi/WifiMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
broadcastNetworkConnectionEvent
service/java/com/android/server/wifi/WifiMonitor.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private JsonArray randomUuidArray() { return new JsonArray().add(randomUuid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: randomUuidArray File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
randomUuidArray
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private String handleUserFilterModification(final JobDomainPeasSessionController jobDomainSC, final HttpRequest request) throws AdminException { jobDomainSC.getUserFilterManager().ifPresent(m -> request.setAttribute("domainUserFilterManager", m)); final String action = request.getParameter(ACTION_ATTR); try { final String newRule = defaultStringIfNotDefined(request.getParameter(DOMAIN_USER_FILTER_RULE_PARAM)); if ("verify".equals(action)) { final User[] arrayToConvert = jobDomainSC.verifyUserFilterRule(newRule); final SilverpeasList<User> users = SilverpeasList.as(arrayToConvert); request.setAttribute("users", UserUIEntity.convertList(users, emptySet())); } else if ("validate".equals(action)) { jobDomainSC.saveUserFilterRule(newRule); } } catch (Exception e) { request.setAttribute("technicalError", defaultStringIfNotDefined(e.getMessage(), "unknown error")); } return DOMAIN_USER_FILTER_MANAGEMENT_DEST; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUserFilterModification File: core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
handleUserFilterModification
core-war/src/main/java/org/silverpeas/web/jobdomain/servlets/JobDomainPeasRequestRouter.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
private ApnSetting getApnSetting(int apnId) { if (apnId < 0) { return null; } ApnSetting apnSetting = null; Cursor cursor = mInjector.binderWithCleanCallingIdentity( () -> mContext.getContentResolver().query( Uri.withAppendedPath(DPC_URI, Integer.toString(apnId)), null, null, null, Telephony.Carriers.DEFAULT_SORT_ORDER)); if (cursor != null) { while (cursor.moveToNext()) { apnSetting = ApnSetting.makeApnSetting(cursor); if (apnSetting != null) { break; } } cursor.close(); } return apnSetting; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApnSetting 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
getApnSetting
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String getRenderedContent(String text, String sourceSyntaxId, String targetSyntaxId) throws XWikiException { // Make sure we keep using current author as passed content author return this.doc.getRenderedContent(text, sourceSyntaxId, targetSyntaxId, false, getCallerDocument(getXWikiContext()), getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderedContent File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getRenderedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private String secure(String clauses, MetaData metadata) { return clauses + addUserCaseAccessClause() + addUserCaseStateAccessClause(metadata); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: secure File: src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java Repository: hmcts/ccd-data-store-api The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15569
HIGH
7.5
hmcts/ccd-data-store-api
secure
src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java
c942d5ce847ab1b4acce8753320096e596b42c72
0
Analyze the following code function for security vulnerabilities
public ParcelUuid getSubscriptionGroup() { return this.mSubscriptionGroup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubscriptionGroup File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getSubscriptionGroup
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
private void revertTransferOwnershipIfNecessaryLocked() { if (!mTransferOwnershipMetadataManager.metadataFileExists()) { return; } Slogf.e(LOG_TAG, "Owner transfer metadata file exists! Reverting transfer."); final TransferOwnershipMetadataManager.Metadata metadata = mTransferOwnershipMetadataManager.loadMetadataFile(); // Revert transfer if (metadata.adminType.equals(ADMIN_TYPE_PROFILE_OWNER)) { transferProfileOwnershipLocked(metadata.targetComponent, metadata.sourceComponent, metadata.userId); deleteTransferOwnershipMetadataFileLocked(); deleteTransferOwnershipBundleLocked(metadata.userId); } else if (metadata.adminType.equals(ADMIN_TYPE_DEVICE_OWNER)) { transferDeviceOwnershipLocked(metadata.targetComponent, metadata.sourceComponent, metadata.userId); deleteTransferOwnershipMetadataFileLocked(); deleteTransferOwnershipBundleLocked(metadata.userId); } updateSystemUpdateFreezePeriodsRecord(/* saveIfChanged */ true); pushUserControlDisabledPackagesLocked(metadata.userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: revertTransferOwnershipIfNecessaryLocked 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
revertTransferOwnershipIfNecessaryLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
static boolean shouldBackupApp(PackageInfo pi) { return (pi.applicationInfo.flags & ApplicationInfo.FLAG_ALLOW_BACKUP) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldBackupApp File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
shouldBackupApp
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
public void extractFile(final FileHeader hd, final OutputStream os) throws RarException { if (!this.headers.contains(hd)) { throw new HeaderNotInArchiveException(); } try { doExtractFile(hd, os); } catch (final Exception e) { if (e instanceof RarException) { throw (RarException) e; } else { throw new RarException(e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractFile File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
extractFile
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
final boolean updateOomAdjLocked(ProcessRecord app) { final ActivityRecord TOP_ACT = resumedAppLocked(); final ProcessRecord TOP_APP = TOP_ACT != null ? TOP_ACT.app : null; final boolean wasCached = app.cached; mAdjSeq++; // This is the desired cached adjusment we want to tell it to use. // If our app is currently cached, we know it, and that is it. Otherwise, // we don't know it yet, and it needs to now be cached we will then // need to do a complete oom adj. final int cachedAdj = app.curRawAdj >= ProcessList.CACHED_APP_MIN_ADJ ? app.curRawAdj : ProcessList.UNKNOWN_ADJ; boolean success = updateOomAdjLocked(app, cachedAdj, TOP_APP, false, SystemClock.uptimeMillis()); if (wasCached != app.cached || app.curRawAdj == ProcessList.UNKNOWN_ADJ) { // Changed to/from cached state, so apps after it in the LRU // list may also be changed. updateOomAdjLocked(); } return success; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateOomAdjLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
updateOomAdjLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected String getRelativePath( RequestContext requestContext, String absolutePath ) { HttpServletRequest req = requestContext.getHttpServletRequest(); String contextPath = req.getContextPath(); int pos = absolutePath.indexOf(contextPath); return pos > 0 ? absolutePath.substring(pos + contextPath.length()) : absolutePath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativePath File: core/src/main/java/org/opencrx/application/uses/net/sf/webdav/methods/WebDavMethod.java Repository: opencrx The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-46502
CRITICAL
9.8
opencrx
getRelativePath
core/src/main/java/org/opencrx/application/uses/net/sf/webdav/methods/WebDavMethod.java
ce7a71db0bb34ecbcb0e822d40598e410a48b399
0
Analyze the following code function for security vulnerabilities
private Setting getSystemSetting(String name, int requestingUserId) { if (DEBUG) { Slog.v(LOG_TAG, "getSystemSetting(" + name + ", " + requestingUserId + ")"); } // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); // Ensure the caller can access the setting. enforceSettingReadable(name, SETTINGS_TYPE_SYSTEM, UserHandle.getCallingUserId()); // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name); // Get the value. synchronized (mLock) { return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSystemSetting 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
getSystemSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public void bind(int index, int value) { mPreparedStatement.bindLong(index, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
bind
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public static final native long getElapsedCpuTime();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getElapsedCpuTime File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
getElapsedCpuTime
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
@Override public SecurityDesc getCodebaseSecurityDesc(final JARDesc jarDesc, final URL codebaseHost) { if (runInSandbox) { return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } else if (isPluginApplet()) { try { if (JarCertVerifier.isJarSigned(jarDesc, new PluginAppVerifier(), classLoader.tracker)) { return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.ALL_PERMISSIONS, codebaseHost); } else { return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } catch (final Exception e) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e); return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } else { return classLoader.file.getSecurity(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCodebaseSecurityDesc File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getCodebaseSecurityDesc
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override protected void focusGained() { Log.d("Codename One", "native focus gain"); // EDT super.focusGained(); if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable() { public void run() { // allow this one to gain focus blockNativeFocus(false); if (!v.hasFocus()) { if (v.isInTouchMode()) { v.requestFocusFromTouch(); } else { v.requestFocus(); } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: focusGained 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
focusGained
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Deprecated(since = "2.2M2") public BaseObject newObject(String className, XWikiContext context) throws XWikiException { return newXObject( getXClassEntityReferenceResolver().resolve(className, EntityType.DOCUMENT, getDocumentReference()), context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newObject 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
newObject
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
public InputStream getResourceAsStream(String s) throws MalformedURLException { InputStream is = getEngineContext().getResourceAsStream(s); if (is == null) { is = getEngineContext().getResourceAsStream("/" + s); } return is; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceAsStream 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
getResourceAsStream
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private ProcessingParameters getProcessingParameter(Map<String, String[]> pParameterMap) { Map<String,String> ret = new HashMap<String, String>(); if (pParameterMap != null) { for (Map.Entry<String,String[]> entry : pParameterMap.entrySet()) { String values[] = entry.getValue(); if (values != null && values.length > 0) { ret.put(entry.getKey(), values[0]); } } } return config.getProcessingParameters(ret); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProcessingParameter File: agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
getProcessingParameter
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
@POST @Path("singlepage") @Operation(summary = "Attach a Single Page Element on course", description = "This attaches a Single Page Element onto a given course. The element will\n" + " be inserted underneath the supplied parentNodeId") @ApiResponse(responseCode = "200", description = "The course node metadatas", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) }) @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient") @ApiResponse(responseCode = "404", description = "The course or parentNode not found") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachSinglePagePost(@PathParam("courseId") Long courseId, @Context HttpServletRequest request) { return attachSinglePage(courseId, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachSinglePagePost File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
attachSinglePagePost
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public void resetHard(ConsoleOutputStreamConsumer outputStreamConsumer, Revision revision) { log(outputStreamConsumer, "Updating working copy to revision " + revision.getRevision()); String[] args = new String[]{"reset", "--hard", revision.getRevision()}; CommandLine gitCmd = gitWd().withArgs(args); int result = run(gitCmd, outputStreamConsumer); if (result != 0) { throw new RuntimeException(format("git reset failed for [%s]", this.workingDir)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetHard File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
resetHard
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
protected void initExtraValues(ContentValues extraValues) { // DO NOTHING - Gmail will override }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initExtraValues 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
initExtraValues
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
public StandardTemplateParams decorationType(int decorationType) { hideTitle(true); // Minimally decorated custom views do not show certain pieces of chrome that have // always been shown when using DecoratedCustomViewStyle. boolean hideOtherFields = decorationType <= DECORATION_MINIMAL; hideLeftIcon(false); // The left icon decoration is better than showing nothing. hideRightIcon(hideOtherFields); hideProgress(hideOtherFields); hideActions(hideOtherFields); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decorationType File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
decorationType
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public int getErrorCount() { return errorCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getErrorCount File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
getErrorCount
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
private void setupView() { mNameField = (EditText) findViewById(R.id.fdn_name); if (mNameField != null) { mNameField.setOnFocusChangeListener(mOnFocusChangeHandler); mNameField.setOnClickListener(mClicked); mNameField.addTextChangedListener(mTextWatcher); } mNumberField = (EditText) findViewById(R.id.fdn_number); if (mNumberField != null) { mNumberField.setTextDirection(View.TEXT_DIRECTION_LTR); mNumberField.setKeyListener(DialerKeyListener.getInstance()); mNumberField.setOnFocusChangeListener(mOnFocusChangeHandler); mNumberField.setOnClickListener(mClicked); mNumberField.addTextChangedListener(mTextWatcher); } if (!mAddContact) { if (mNameField != null) { mNameField.setText(mName); } if (mNumberField != null) { mNumberField.setText(mNumber); } } mButton = (Button) findViewById(R.id.button); if (mButton != null) { mButton.setOnClickListener(mClicked); setButtonEnabled(); } mPinFieldContainer = (LinearLayout) findViewById(R.id.pinc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setupView File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
setupView
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public Object getObjectInputFilter(ObjectInputStream ois) { try { return getObjectInputFilterMethod.invoke(ois); } catch (IllegalAccessException | InvocationTargetException e) { LOG.warn("Could not read ObjectFilter from ObjectInputStream: " + e.getMessage()); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectInputFilter File: common/src/main/java/org/keycloak/common/util/DelegatingSerializationFilter.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
getObjectInputFilter
common/src/main/java/org/keycloak/common/util/DelegatingSerializationFilter.java
d962a42f561acf3cb9b0734ae56cfbb4a696bdf4
0
Analyze the following code function for security vulnerabilities
public static void setInitialized(boolean initialized) { CmsVersion.initialized = initialized; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInitialized File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-29784
MEDIUM
5
sanluan/PublicCMS
setInitialized
publiccms-parent/publiccms-core/src/main/java/com/publiccms/common/constants/CmsVersion.java
d8d7626cf51e4968fb384e1637a3c0c9921f33e9
0
Analyze the following code function for security vulnerabilities
public String getEmail() { return eMail; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEmail File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getEmail
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private Builder setTaskDescription(TaskDescription taskDescription) { mTaskDescription = taskDescription; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskDescription 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
setTaskDescription
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
boolean isFullyTransparentBarAllowed(Rect frame) { return mActivityRecord == null || mActivityRecord.isFullyTransparentBarAllowed(frame); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFullyTransparentBarAllowed File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
isFullyTransparentBarAllowed
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public Mode getMode() { return mode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMode 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
getMode
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public String getEnabledBy() { return enabledBy; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEnabledBy File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getEnabledBy
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public AuthorizationContext getAuthorizationContext() { return authorizationContext; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthorizationContext File: core/src/main/java/org/keycloak/KeycloakSecurityContext.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
getAuthorizationContext
core/src/main/java/org/keycloak/KeycloakSecurityContext.java
d5483d884de797e2ef6e69f92085bc10bf87e864
0
Analyze the following code function for security vulnerabilities
@GetMapping("{sheetId:\\d+}/comments/tree_view") @ApiOperation("Lists comments with tree view") public Page<BaseCommentVO> listCommentsTree(@PathVariable("sheetId") Integer sheetId, @RequestParam(name = "page", required = false, defaultValue = "0") int page, @SortDefault(sort = "createTime", direction = DESC) Sort sort) { Page<BaseCommentVO> result = sheetCommentService.pageVosBy(sheetId, PageRequest.of(page, optionService.getCommentPageSize(), sort)); return sheetCommentService.filterIpAddress(result); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listCommentsTree File: src/main/java/run/halo/app/controller/content/api/SheetController.java Repository: halo-dev/halo The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-19007
LOW
3.5
halo-dev/halo
listCommentsTree
src/main/java/run/halo/app/controller/content/api/SheetController.java
d6b3d6cb5d681c7d8d64fd48de6c7c99b696bb8b
0
Analyze the following code function for security vulnerabilities
private void cancelTransmission(Message message) { Transferable transferable = message.getTransferable(); if (transferable != null) { transferable.cancel(); } else if (message.getStatus() != Message.STATUS_RECEIVED) { activity.xmppConnectionService.markMessage(message, Message.STATUS_SEND_FAILED, Message.ERROR_MESSAGE_CANCELLED); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelTransmission File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
cancelTransmission
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private static byte[] number2BytesInNetworkOrder(int number) { byte[] orderBytes = new byte[4]; orderBytes[3] = (byte) (number & 0xFF); orderBytes[2] = (byte) (number >> 8 & 0xFF); orderBytes[1] = (byte) (number >> 16 & 0xFF); orderBytes[0] = (byte) (number >> 24 & 0xFF); return orderBytes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: number2BytesInNetworkOrder File: weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java Repository: Wechat-Group/WxJava The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20318
HIGH
7.5
Wechat-Group/WxJava
number2BytesInNetworkOrder
weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java
6272639f02e397fed40828a2d0da66c30264bc0e
0
Analyze the following code function for security vulnerabilities
public Class getRequiredType() { return (Class)types.peek(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequiredType File: xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
getRequiredType
xstream/src/java/com/thoughtworks/xstream/core/TreeUnmarshaller.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting ShortcutPackage getPackageShortcutForTest(String packageName, int userId) { synchronized (mLock) { final ShortcutUser user = mUsers.get(userId); if (user == null) return null; return user.getAllPackagesForTest().get(packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageShortcutForTest File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
getPackageShortcutForTest
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
void setPolicyVisibilityFlag(int policyVisibilityFlag) { mPolicyVisibility |= policyVisibilityFlag; mWmService.scheduleAnimationLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPolicyVisibilityFlag File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
setPolicyVisibilityFlag
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public UserInfo getCurrentUser() { return mUserController.getCurrentUser(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentUser 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
getCurrentUser
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting @Override void systemReady(int phase) { if (!mHasFeature) { return; } switch (phase) { case SystemService.PHASE_LOCK_SETTINGS_READY: onLockSettingsReady(); loadAdminDataAsync(); mOwners.systemReady(); break; case SystemService.PHASE_ACTIVITY_MANAGER_READY: synchronized (getLockObject()) { migrateToProfileOnOrganizationOwnedDeviceIfCompLocked(); applyProfileRestrictionsIfDeviceOwnerLocked(); } maybeStartSecurityLogMonitorOnActivityManagerReady(); break; case SystemService.PHASE_BOOT_COMPLETED: // Ideally it should be done earlier, but currently it relies on RecoverySystem, // which would hang on earlier phases factoryResetIfDelayedEarlier(); ensureDeviceOwnerUserStarted(); // TODO Consider better place to do this. break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: systemReady 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
systemReady
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void afterRemove(ChannelHandlerContext ctx) throws Exception { closeEngine(); // there is no need for synchronization here as we do not receive downstream events anymore Throwable cause = null; for (;;) { PendingWrite pw = pendingUnencryptedWrites.poll(); if (pw == null) { break; } if (cause == null) { cause = new IOException("Unable to write data"); } pw.future.setFailure(cause); } for (;;) { MessageEvent ev = pendingEncryptedWrites.poll(); if (ev == null) { break; } if (cause == null) { cause = new IOException("Unable to write data"); } ev.getFuture().setFailure(cause); } if (cause != null) { fireExceptionCaughtLater(ctx, cause); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: afterRemove File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
afterRemove
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
public int addWorkUnit(WorkUnit workUnit, long fileModificationTimeInMillis, long fileSize) { workUnitList.add(workUnit); if (fileModificationTimeInMillis < oldestFileModificationTime) { oldestFileModificationTime = fileModificationTimeInMillis; } if (fileModificationTimeInMillis > youngestFileModificationTime) { youngestFileModificationTime = fileModificationTimeInMillis; } totalFileSize += fileSize; return size(); }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2021-32634 - Severity: MEDIUM - CVSS Score: 6.5 Description: Merge pull request from GHSA-m5qf-gfmp-7638 * Remove unsafe serialization from PayloadUtil * This code will likely be removed wholesale, but this change should be used as a departure point for future development if we end up re-implementing moveTo and friends. * Removed vestigial MoveTo related code. * Remove unsafe serialization in WorkSpace infra. * Favor DataInput/DataOutputStream over ObjectInput/ObjectOutputStream * Implement lightweight serialization in WorkBundle/WorkUnit * Updates to WorkBundle serDe, added tests. - set limit on number of WorkUnits per bundle. In practice these are commonly less than 1024. - added null handling for WorkBundle/WorkUnit string fields. - confirmed readUTF/writeUTF has a limit ensuring strings will be 65535 characters or less. * Minor cleanup to WorkBundleTest * Minor Change to WorkBundleTest * Formatting updates Function: addWorkUnit File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary Fixed Code: public int addWorkUnit(WorkUnit workUnit, long fileModificationTimeInMillis, long fileSize) { addWorkUnit(workUnit); if (fileModificationTimeInMillis < oldestFileModificationTime) { oldestFileModificationTime = fileModificationTimeInMillis; } if (fileModificationTimeInMillis > youngestFileModificationTime) { youngestFileModificationTime = fileModificationTimeInMillis; } totalFileSize += fileSize; return size(); }
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
addWorkUnit
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
1
Analyze the following code function for security vulnerabilities
public String getAuthor() { return this.doc.getAuthor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthor File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getAuthor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private void populateContextMenu(ContextMenu menu) { final Message m = this.selectedMessage; final Transferable t = m.getTransferable(); Message relevantForCorrection = m; while (relevantForCorrection.mergeable(relevantForCorrection.next())) { relevantForCorrection = relevantForCorrection.next(); } if (m.getType() != Message.TYPE_STATUS) { if (m.getEncryption() == Message.ENCRYPTION_AXOLOTL_NOT_FOR_THIS_DEVICE) { return; } final boolean deleted = t != null && t instanceof TransferablePlaceholder; final boolean encrypted = m.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED || m.getEncryption() == Message.ENCRYPTION_PGP; final boolean receiving = m.getStatus() == Message.STATUS_RECEIVED && (t instanceof JingleConnection || t instanceof HttpDownloadConnection); activity.getMenuInflater().inflate(R.menu.message_context, menu); menu.setHeaderTitle(R.string.message_options); MenuItem copyMessage = menu.findItem(R.id.copy_message); MenuItem copyLink = menu.findItem(R.id.copy_link); MenuItem quoteMessage = menu.findItem(R.id.quote_message); MenuItem retryDecryption = menu.findItem(R.id.retry_decryption); MenuItem correctMessage = menu.findItem(R.id.correct_message); MenuItem shareWith = menu.findItem(R.id.share_with); MenuItem sendAgain = menu.findItem(R.id.send_again); MenuItem copyUrl = menu.findItem(R.id.copy_url); MenuItem downloadFile = menu.findItem(R.id.download_file); MenuItem cancelTransmission = menu.findItem(R.id.cancel_transmission); MenuItem deleteFile = menu.findItem(R.id.delete_file); MenuItem showErrorMessage = menu.findItem(R.id.show_error_message); if (!m.isFileOrImage() && !encrypted && !m.isGeoUri() && !m.treatAsDownloadable()) { copyMessage.setVisible(true); quoteMessage.setVisible(MessageUtils.prepareQuote(m).length() > 0); String body = m.getMergedBody().toString(); if (ShareUtil.containsXmppUri(body)) { copyLink.setTitle(R.string.copy_jabber_id); copyLink.setVisible(true); } else if (Patterns.AUTOLINK_WEB_URL.matcher(body).find()) { copyLink.setVisible(true); } } if (m.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED) { retryDecryption.setVisible(true); } if (relevantForCorrection.getType() == Message.TYPE_TEXT && relevantForCorrection.isLastCorrectableMessage() && m.getConversation() instanceof Conversation && (((Conversation) m.getConversation()).getMucOptions().nonanonymous() || m.getConversation().getMode() == Conversation.MODE_SINGLE)) { correctMessage.setVisible(true); } if ((m.isFileOrImage() && !deleted && !receiving) || (m.getType() == Message.TYPE_TEXT && !m.treatAsDownloadable())) { shareWith.setVisible(true); } if (m.getStatus() == Message.STATUS_SEND_FAILED) { sendAgain.setVisible(true); } if (m.hasFileOnRemoteHost() || m.isGeoUri() || m.treatAsDownloadable() || t instanceof HttpDownloadConnection) { copyUrl.setVisible(true); } if (m.isFileOrImage() && deleted && m.hasFileOnRemoteHost()) { downloadFile.setVisible(true); downloadFile.setTitle(activity.getString(R.string.download_x_file, UIHelper.getFileDescriptionString(activity, m))); } final boolean waitingOfferedSending = m.getStatus() == Message.STATUS_WAITING || m.getStatus() == Message.STATUS_UNSEND || m.getStatus() == Message.STATUS_OFFERED; final boolean cancelable = (t != null && !deleted) || waitingOfferedSending && m.needsUploading(); if (cancelable) { cancelTransmission.setVisible(true); } if (m.isFileOrImage() && !deleted && !cancelable) { String path = m.getRelativeFilePath(); if (path == null || !path.startsWith("/") || FileBackend.isInDirectoryThatShouldNotBeScanned(getActivity(), path)) { deleteFile.setVisible(true); deleteFile.setTitle(activity.getString(R.string.delete_x_file, UIHelper.getFileDescriptionString(activity, m))); } } if (m.getStatus() == Message.STATUS_SEND_FAILED && m.getErrorMessage() != null && !Message.ERROR_MESSAGE_CANCELLED.equals(m.getErrorMessage())) { showErrorMessage.setVisible(true); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateContextMenu File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
populateContextMenu
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
protected boolean hasStoragePermission(int requestCode) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode); return false; } else { return true; } } else { return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasStoragePermission File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hasStoragePermission
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private static X509TrustManager findFirstX509TrustManager(TrustManager[] tms) { for (TrustManager tm : tms) { if (tm instanceof X509TrustManager) { return (X509TrustManager) tm; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findFirstX509TrustManager File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
findFirstX509TrustManager
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
private void migrate65(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.elementTextTrim("key").equals("SYSTEM")) { Element valueElement = element.element("value"); valueElement.element("cpu").detach(); valueElement.element("memory").detach(); } } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate65 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate65
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
@Nonnull public static String rescaleImageAndEncodeAsBase64(@Nonnull Image image, final int maxSize) throws IOException { final int width = image.getWidth(null); final int height = image.getHeight(null); final int maxImageSideSize = maxSize > 0 ? maxSize : Math.max(width, height); final float imageScale = width > maxImageSideSize || height > maxImageSideSize ? (float) maxImageSideSize / (float) Math.max(width, height) : 1.0f; if (!(image instanceof RenderedImage) || Float.compare(imageScale, 1.0f) != 0) { final int swidth; final int sheight; if (Float.compare(imageScale, 1.0f) == 0) { swidth = width; sheight = height; } else { swidth = Math.round(imageScale * width); sheight = Math.round(imageScale * height); } final BufferedImage buffer = new BufferedImage(swidth, sheight, BufferedImage.TYPE_INT_ARGB); final Graphics2D gfx = (Graphics2D) buffer.createGraphics(); gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gfx.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); gfx.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY); gfx.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); gfx.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE); gfx.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); gfx.drawImage(image, AffineTransform.getScaleInstance(imageScale, imageScale), null); gfx.dispose(); image = buffer; } final ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { if (!ImageIO.write((RenderedImage) image, "png", bos)) { throw new IOException("Can't encode image as PNG"); } } finally { IOUtils.closeQuietly(bos); } return Utils.base64encode(bos.toByteArray()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rescaleImageAndEncodeAsBase64 File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
rescaleImageAndEncodeAsBase64
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
@Override public void dump(String cmd, FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean dumpAll, boolean dumpClient, String dumpPackage) { synchronized (mGlobalLock) { if (DUMP_ACTIVITIES_CMD.equals(cmd) || DUMP_ACTIVITIES_SHORT_CMD.equals(cmd)) { dumpActivitiesLocked(fd, pw, args, opti, dumpAll, dumpClient, dumpPackage); } else if (DUMP_LASTANR_CMD.equals(cmd)) { dumpLastANRLocked(pw); } else if (DUMP_LASTANR_TRACES_CMD.equals(cmd)) { dumpLastANRTracesLocked(pw); } else if (DUMP_STARTER_CMD.equals(cmd)) { dumpActivityStarterLocked(pw, dumpPackage); } else if (DUMP_CONTAINERS_CMD.equals(cmd)) { dumpActivityContainersLocked(pw); } else if (DUMP_RECENTS_CMD.equals(cmd) || DUMP_RECENTS_SHORT_CMD.equals(cmd)) { if (getRecentTasks() != null) { getRecentTasks().dump(pw, dumpAll, dumpPackage); } } else if (DUMP_TOP_RESUMED_ACTIVITY.equals(cmd)) { dumpTopResumedActivityLocked(pw); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void setAudioManager(AudioManager audioMananger) { mAudioManager = audioMananger; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAudioManager File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
setAudioManager
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public void waitForBroadcastIdle(@Nullable PrintWriter pw) { enforceCallingPermission(permission.DUMP, "waitForBroadcastIdle()"); while (true) { boolean idle = true; synchronized (this) { for (BroadcastQueue queue : mBroadcastQueues) { if (!queue.isIdle()) { final String msg = "Waiting for queue " + queue + " to become idle..."; if (pw != null) { pw.println(msg); pw.println(queue.describeState()); pw.flush(); } Slog.v(TAG, msg); queue.cancelDeferrals(); idle = false; } } } if (idle) { final String msg = "All broadcast queues are idle!"; if (pw != null) { pw.println(msg); pw.flush(); } Slog.v(TAG, msg); return; } else { SystemClock.sleep(1000); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: waitForBroadcastIdle 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
waitForBroadcastIdle
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected JsonDeserializer<Object> findDeserializerFromAnnotation(DeserializationContext ctxt, Annotated ann) throws JsonMappingException { AnnotationIntrospector intr = ctxt.getAnnotationIntrospector(); if (intr != null) { Object deserDef = intr.findDeserializer(ann); if (deserDef != null) { return ctxt.deserializerInstance(ann, deserDef); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findDeserializerFromAnnotation File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
findDeserializerFromAnnotation
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
void setFocusedTask(int taskId, ActivityRecord touchedActivity) { ProtoLog.d(WM_DEBUG_FOCUS, "setFocusedTask: taskId=%d touchedActivity=%s", taskId, touchedActivity); final Task task = mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_ONLY); if (task == null) { return; } final ActivityRecord r = task.topRunningActivityLocked(); if (r == null) { return; } if (r.moveFocusableActivityToTop("setFocusedTask")) { mRootWindowContainer.resumeFocusedTasksTopActivities(); } else if (touchedActivity != null && touchedActivity.isFocusable()) { final TaskFragment parent = touchedActivity.getTaskFragment(); if (parent != null && parent.isEmbedded()) { // Set the focused app directly if the focused window is currently embedded final DisplayContent displayContent = touchedActivity.getDisplayContent(); displayContent.setFocusedApp(touchedActivity); mWindowManager.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /* updateInputWindows */); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFocusedTask 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
setFocusedTask
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
void finishInstrumentationLocked(ProcessRecord app, int resultCode, Bundle results) { if (app.instrumentationWatcher != null) { mInstrumentationReporter.reportFinished(app.instrumentationWatcher, app.instrumentationClass, resultCode, results); } // Can't call out of the system process with a lock held, so post a message. if (app.instrumentationUiAutomationConnection != null) { mHandler.obtainMessage(SHUTDOWN_UI_AUTOMATION_CONNECTION_MSG, app.instrumentationUiAutomationConnection).sendToTarget(); } app.instrumentationWatcher = null; app.instrumentationUiAutomationConnection = null; app.instrumentationClass = null; app.instrumentationInfo = null; app.instrumentationProfileFile = null; app.instrumentationArguments = null; forceStopPackageLocked(app.info.packageName, -1, false, false, true, true, false, app.userId, "finished inst"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishInstrumentationLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
finishInstrumentationLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Override public void dropItem(Vector3 pt, BaseItemStack item) { World world = getWorld(); world.dropItemNaturally(BukkitAdapter.adapt(world, pt), BukkitAdapter.adapt(item)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dropItem File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
dropItem
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
public static ClassLoader getContextClassLoader() { return PlatformDependent0.getContextClassLoader(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContextClassLoader File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
getContextClassLoader
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
protected void setEncoding(String encoding) { source.setEncoding(encoding); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEncoding File: ext/java/nokogiri/internals/ParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
setEncoding
ext/java/nokogiri/internals/ParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public void setExpireSearchResults(boolean theDeleteStaleSearches) { myDeleteStaleSearches = theDeleteStaleSearches; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExpireSearchResults 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
setExpireSearchResults
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
public void loadUrlAsync(final AwContents awContents, final String url, final Map<String, String> extraHeaders) { getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { awContents.loadUrl(url, extraHeaders); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadUrlAsync File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
loadUrlAsync
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
public void setLogid(String logid) { synchronized (this) { if ("-".equals(logid)) { this.logid = ""; } else { this.logid = SolrTools.escapeSpecialCharacters(logid); } } }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-29014 - Severity: MEDIUM - CVSS Score: 6.1 Description: Only allow setting logId to a value matching [\w-]+ refs #24571 Function: setLogid File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core Fixed Code: public void setLogid(String logid) throws PresentationException { synchronized (this) { if ("-".equals(logid)) { this.logid = ""; } else if(StringUtils.isNotBlank(logid) && logid.matches("[\\w-]+")) { this.logid = SolrTools.escapeSpecialCharacters(logid); } else { throw new PresentationException("The passed logId " + SolrTools.escapeSpecialCharacters(logid) + " contains illegal characters"); } } }
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
setLogid
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
1
Analyze the following code function for security vulnerabilities
@Override public ApplicationInfo getApplicationInfo(String packageName, int flags, int userId) { if (!sUserManager.exists(userId)) return null; enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "get application info"); // writer synchronized (mPackages) { PackageParser.Package p = mPackages.get(packageName); if (DEBUG_PACKAGE_INFO) Log.v( TAG, "getApplicationInfo " + packageName + ": " + p); if (p != null) { PackageSetting ps = mSettings.mPackages.get(packageName); if (ps == null) return null; // Note: isEnabledLP() does not apply here - always return info return PackageParser.generateApplicationInfo( p, flags, ps.readUserState(userId), userId); } if ("android".equals(packageName)||"system".equals(packageName)) { return mAndroidApplication; } if ((flags & PackageManager.GET_UNINSTALLED_PACKAGES) != 0) { return generateApplicationInfoFromSettingsLPw(packageName, flags, userId); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationInfo 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
getApplicationInfo
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public synchronized SSLEngineResult wrap(ByteBuffer src, ByteBuffer dst) throws SSLException { try { return wrap(singleSrcBuffer(src), dst); } finally { resetSingleSrcBuffer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrap File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
wrap
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public boolean isPowerSaveActive() { return mBatteryController.isPowerSave(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPowerSaveActive 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
isPowerSaveActive
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static void encodeXid(final Xid xid, final ActiveMQBuffer out) { out.writeInt(xid.getFormatId()); out.writeInt(xid.getBranchQualifier().length); out.writeBytes(xid.getBranchQualifier()); out.writeInt(xid.getGlobalTransactionId().length); out.writeBytes(xid.getGlobalTransactionId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encodeXid File: artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XidCodecSupport.java Repository: apache/activemq-artemis The code follows secure coding practices.
[ "CWE-787" ]
CVE-2021-4040
MEDIUM
5.3
apache/activemq-artemis
encodeXid
artemis-core-client/src/main/java/org/apache/activemq/artemis/utils/XidCodecSupport.java
153d2e9a979aead8dff95fbc91d659ecc7d0fb82
0
Analyze the following code function for security vulnerabilities
private void setOauthBasePath(String basePath) { for(Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).setBasePath(basePath); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthBasePath File: samples/client/petstore/java/okhttp-gson-parcelableModel/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
setOauthBasePath
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private native static void classInitNative();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: classInitNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
classInitNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
static int value(String value, int defaultValue) { return ClickHouseChecker.isNullOrEmpty(value) ? defaultValue : Integer.parseInt(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: value File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
value
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
boolean isFocusedActivityOnDisplay() { return mDisplayContent.forAllTaskDisplayAreas(taskDisplayArea -> taskDisplayArea.getFocusedActivity() == this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFocusedActivityOnDisplay 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
isFocusedActivityOnDisplay
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void setProcessLimit(int max) { enforceCallingPermission(android.Manifest.permission.SET_PROCESS_LIMIT, "setProcessLimit()"); synchronized (this) { mConstants.setOverrideMaxCachedProcesses(max); } trimApplications(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessLimit 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
setProcessLimit
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void handleCancelKeyguardExitAnimation() { showSurfaceBehindKeyguard(); onKeyguardExitRemoteAnimationFinished(true /* cancelled */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleCancelKeyguardExitAnimation 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
handleCancelKeyguardExitAnimation
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public JSONArray put(Collection value) { put(new JSONArray(value)); return this; }
Vulnerability Classification: - CWE: CWE-674, CWE-787 - CVE: CVE-2022-45693 - Severity: HIGH - CVSS Score: 7.5 Description: Fixing StackOverflow error Function: put File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison Fixed Code: public JSONArray put(Collection value) throws JSONException { put(new JSONArray(value)); return this; }
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
1
Analyze the following code function for security vulnerabilities
public ValueGenerator getStateGenerator() { return stateGenerator; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStateGenerator File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
getStateGenerator
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
@Override public Date getCreationDate() { if (this.creationDate == null) { return new Date(); } else { return this.creationDate; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCreationDate 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
getCreationDate
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
default Properties asProperties() { Properties props = new Properties(); for (Map.Entry<String, V> entry : this) { String key = entry.getKey(); V value = entry.getValue(); if (value instanceof CharSequence || value instanceof Number) { props.setProperty(key, value.toString()); } } return props; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asProperties File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
asProperties
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public void setMtePolicy(int flags, String callerPackageName) { final Set<Integer> allowedModes = Set.of( DevicePolicyManager.MTE_NOT_CONTROLLED_BY_POLICY, DevicePolicyManager.MTE_DISABLED, DevicePolicyManager.MTE_ENABLED); Preconditions.checkArgument( allowedModes.contains(flags), "Provided mode is not one of the allowed values."); // In general, this API should be available when "bootctl_settings_toggle" is set, which // signals that there is a control for MTE in the user settings and this API fundamentally // is a way for the device admin to override that setting. // Allow bootctl_device_policy_manager as an override, e.g. to offer the // DevicePolicyManager only without a visible user setting. if (!mInjector.systemPropertiesGetBoolean( "ro.arm64.memtag.bootctl_device_policy_manager", mInjector.systemPropertiesGetBoolean( "ro.arm64.memtag.bootctl_settings_toggle", false))) { throw new UnsupportedOperationException("device does not support MTE"); } final CallerIdentity caller = getCallerIdentity(callerPackageName); // For now we continue to restrict the DISABLED setting to device owner - we might need // another permission for this in future. if (flags == DevicePolicyManager.MTE_DISABLED) { Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); } if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_MTE, caller.getPackageName(), UserHandle.USER_ALL); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller)); } synchronized (getLockObject()) { // TODO(b/261999445): Remove ActiveAdmin admin; if (isHeadlessFlagEnabled()) { admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked(); } else { admin = getDeviceOwnerOrProfileOwnerOfOrganizationOwnedDeviceLocked( UserHandle.USER_SYSTEM); } if (admin != null) { final String memtagProperty = "arm64.memtag.bootctl"; if (flags == DevicePolicyManager.MTE_ENABLED) { mInjector.systemPropertiesSet(memtagProperty, "memtag"); } else if (flags == DevicePolicyManager.MTE_DISABLED) { mInjector.systemPropertiesSet(memtagProperty, "memtag-off"); } admin.mtePolicy = flags; saveSettingsLocked(caller.getUserId()); DevicePolicyEventLogger.createEvent(DevicePolicyEnums.SET_MTE_POLICY) .setInt(flags) .setAdmin(caller.getPackageName()) .write(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMtePolicy 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
setMtePolicy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public Iterator<String> keys() { return this.keySet().iterator(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keys File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
keys
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public void registerObserver() { mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.HIDDEN_API_BLACKLIST_EXEMPTIONS), false, this); mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.HIDDEN_API_ACCESS_LOG_SAMPLING_RATE), false, this); mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.HIDDEN_API_POLICY_PRE_P_APPS), false, this); mContext.getContentResolver().registerContentObserver( Settings.Global.getUriFor(Settings.Global.HIDDEN_API_POLICY_P_APPS), false, this); update(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerObserver 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
registerObserver
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void insert(int pos, String s) { replace(pos, pos, s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insert File: src/main/java/com/google/json/JsonSanitizer.java Repository: OWASP/json-sanitizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-13973
MEDIUM
4.3
OWASP/json-sanitizer
insert
src/main/java/com/google/json/JsonSanitizer.java
53ceaac3e0a10e86d512ce96a0056578f2d1978f
0
Analyze the following code function for security vulnerabilities
void createFolders(OLATResourceable ores) { long start = 0; if (log.isDebugEnabled()) { start = System.currentTimeMillis(); } VFSContainer rootContainer = getWikiRootContainer(ores); VFSContainer unzippedDir = (VFSContainer) rootContainer.resolve(FileResourceManager.ZIPDIR); if (unzippedDir == null) { // check for _unzipped_ dir from imported wiki's if (rootContainer.createChildContainer(WIKI_RESOURCE_FOLDER_NAME) == null) throwError(ores); if (rootContainer.createChildContainer(WikiContainer.MEDIA_FOLDER_NAME) == null) throwError(ores); if (rootContainer.createChildContainer(VERSION_FOLDER_NAME) == null) throwError(ores); } else { // _unzipped_ dir found: move elements to wiki folder and delete // unzipped dir and zip files List<VFSItem> files = unzippedDir.getItems(); VFSContainer wikiCtn = rootContainer.createChildContainer(WIKI_RESOURCE_FOLDER_NAME); VFSContainer mediaCtn = rootContainer.createChildContainer(WikiContainer.MEDIA_FOLDER_NAME); if (rootContainer.createChildContainer(VERSION_FOLDER_NAME) == null) throwError(ores); if (wikiCtn == null) throwError(ores); // copy files to wiki and media folder for (Iterator<VFSItem> iter = files.iterator(); iter.hasNext();) { VFSLeaf leaf = ((VFSLeaf) iter.next()); if (leaf.getName().endsWith(WikiManager.WIKI_FILE_SUFFIX) || leaf.getName().endsWith(WikiManager.WIKI_PROPERTIES_SUFFIX)) { wikiCtn.copyFrom(leaf); } else { if (leaf.getName().contains(WikiManager.WIKI_FILE_SUFFIX+"-") || leaf.getName().contains(WikiManager.WIKI_PROPERTIES_SUFFIX+"-")) { leaf.delete(); // delete version history } else { mediaCtn.copyFrom(leaf); } } } unzippedDir.delete(); List<VFSItem> zipFiles = rootContainer.getItems(new VFSItemSuffixFilter(new String[] { "zip" })); // delete all zips for (Iterator<VFSItem> iter = zipFiles.iterator(); iter.hasNext();) { VFSLeaf element = (VFSLeaf) iter.next(); element.delete(); } //reset forum key and author references keys back to default as users and forums may not exist List<VFSItem> propertyLeafs = wikiCtn.getItems(new PropertiesFilter()); for (Iterator<VFSItem> iter = propertyLeafs.iterator(); iter.hasNext();) { VFSLeaf element = (VFSLeaf) iter.next(); WikiPage page = Wiki.assignPropertiesToPage(element); page.setForumKey(0); page.setInitalAuthor(0); page.setModifyAuthor(0); page.setModificationTime(0); page.setViewCount(0); page.setVersion("0"); page.setCreationTime(System.currentTimeMillis()); saveWikiPageProperties(ores, page); } } if (log.isDebugEnabled()) { long end = System.currentTimeMillis(); log.debug("creating folders and move files and updating properties to default values took: (milliseconds)"+(end-start)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFolders File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
createFolders
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override protected void drawableStateChanged() { super.drawableStateChanged(); if (mRefineIcon != null && mRefineIcon.isStateful()) { mRefineIcon.setState(getDrawableState()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: drawableStateChanged File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
drawableStateChanged
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
public String getText() { return fields.get("text"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getText File: src/main/java/org/olat/restapi/support/MultipartReader.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41242
HIGH
7.9
OpenOLAT
getText
src/main/java/org/olat/restapi/support/MultipartReader.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
@Override public ServiceProvider createApplicationWithTemplate(ServiceProvider serviceProvider, String tenantDomain, String username, String templateName) throws IdentityApplicationManagementException { // Call pre listeners. Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPreCreateApplication(serviceProvider, tenantDomain, username)) { throw buildServerException("Pre create application operation of listener: " + getName(listener) + " failed for application: " + serviceProvider.getApplicationName() + " of tenantDomain: " + tenantDomain); } } doPreAddApplicationChecks(serviceProvider, tenantDomain, username); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); serviceProvider.setOwner(getUser(tenantDomain, username)); int appId = doAddApplication(serviceProvider, tenantDomain, username, appDAO::createApplication); serviceProvider.setApplicationID(appId); setDisplayNamesOfLocalAuthenticators(serviceProvider, tenantDomain); SpTemplate spTemplate = this.getApplicationTemplate(templateName, tenantDomain); if (spTemplate != null) { updateSpFromTemplate(serviceProvider, tenantDomain, spTemplate); appDAO.updateApplication(serviceProvider, tenantDomain); } for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPostCreateApplication(serviceProvider, tenantDomain, username)) { log.error("Post create application operation of listener:" + getName(listener) + " failed for " + "application: " + serviceProvider.getApplicationName() + " of tenantDomain: " + tenantDomain); break; } } return serviceProvider; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createApplicationWithTemplate 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
createApplicationWithTemplate
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
void registerForAirplaneMode(IntentFilter filter) { final String airplaneModeRadios = Settings.System.getString(mContentResolver, Settings.Global.AIRPLANE_MODE_RADIOS); final String toggleableRadios = Settings.System.getString(mContentResolver, Settings.Global.AIRPLANE_MODE_TOGGLEABLE_RADIOS); mIsAirplaneSensitive = airplaneModeRadios == null ? true : airplaneModeRadios.contains(Settings.Global.RADIO_NFC); mIsAirplaneToggleable = toggleableRadios == null ? false : toggleableRadios.contains(Settings.Global.RADIO_NFC); if (mIsAirplaneSensitive) { filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerForAirplaneMode File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
registerForAirplaneMode
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
static MethodHandles.Lookup trustedIn(Class<?> target) { if (target == null) return ROOT; if (isOpenj9) { MethodHandles.Lookup lookup = ROOT.in(target); Unsafe.getUnsafe0().putLong(lookup, accessMode, ROOT.lookupModes()); return lookup; } return ROOT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trustedIn File: api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java Repository: Karlatemp/UnsafeAccessor The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-31139
MEDIUM
4.3
Karlatemp/UnsafeAccessor
trustedIn
api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java
4ef83000184e8f13239a1ea2847ee401d81585fd
0
Analyze the following code function for security vulnerabilities
@Override public void onTransferProgress( long progressRate, long totalTransferredSoFar, long totalToTransfer, String filePath ) { int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer)); if (percent != mLastPercent) { mNotificationBuilder.setProgress(100, percent, false); String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1); String text = String.format(getString(R.string.uploader_upload_in_progress_content), percent, fileName); mNotificationBuilder.setContentText(text); if (mNotificationManager == null) { mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); } mNotificationManager.notify(FOREGROUND_SERVICE_ID, mNotificationBuilder.build()); } mLastPercent = percent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onTransferProgress File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
onTransferProgress
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public Set<String> getSigFileEntryNames() { return mSigFileEntryNames; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSigFileEntryNames File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getSigFileEntryNames
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { /* * Possible GET parameters: * * resume= <workspace_item_id> - Resumes submitting the given workspace * item * * workflow= <workflow_id> - Starts editing the given workflow item in * workflow mode * * With no parameters, doDSGet() just calls doDSPost(), which continues * the current submission (if one exists in the Request), or creates a * new submission (if no existing submission can be found). */ // try to get a workspace ID or workflow ID String workspaceID = request.getParameter("resume"); String workflowID = request.getParameter("workflow"); String resumableFilename = request.getParameter("resumableFilename"); // If resuming a workspace item if (workspaceID != null) { try { // load the workspace item WorkspaceItem wi = WorkspaceItem.find(context, Integer .parseInt(workspaceID)); //load submission information SubmissionInfo si = SubmissionInfo.load(request, wi); //TD: Special case - If a user is resuming a submission //where the submission process now has less steps, then //we will need to reset the stepReached in the database //(Hopefully this will never happen, but just in case!) if(getStepReached(si) >= si.getSubmissionConfig().getNumberOfSteps()) { //update Stage Reached to the last step in the Process int lastStep = si.getSubmissionConfig().getNumberOfSteps()-1; wi.setStageReached(lastStep); //flag that user is on last page of last step wi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED); //commit all changes to database immediately wi.update(); context.commit(); //update submission info si.setSubmissionItem(wi); } // start over at beginning of first step setBeginningOfStep(request, true); doStep(context, request, response, si, FIRST_STEP); } catch (NumberFormatException nfe) { log.warn(LogManager.getHeader(context, "bad_workspace_id", "bad_id=" + workspaceID)); JSPManager.showInvalidIDError(request, response, workspaceID, -1); } } else if (workflowID != null) // if resuming a workflow item { try { // load the workflow item WorkflowItem wi = WorkflowItem.find(context, Integer .parseInt(workflowID)); //load submission information SubmissionInfo si = SubmissionInfo.load(request, wi); // start over at beginning of first workflow step setBeginningOfStep(request, true); doStep(context, request, response, si, WORKFLOW_FIRST_STEP); } catch (NumberFormatException nfe) { log.warn(LogManager.getHeader(context, "bad_workflow_id", "bad_id=" + workflowID)); JSPManager .showInvalidIDError(request, response, workflowID, -1); } } else if (!StringUtils.isEmpty(resumableFilename)) // if resumable.js asks whether a part of af file was received { if (request.getMethod().equals("GET")) { DoGetResumable(request, response); } } else { // otherwise, forward to doDSPost() to do usual processing doDSPost(context, request, response); } }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2022-31194 - Severity: HIGH - CVSS Score: 7.2 Description: [DS-4132] JPSUI resumable upload dir validation Function: doDSGet File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java Repository: DSpace Fixed Code: protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { /* * Possible GET parameters: * * resume= <workspace_item_id> - Resumes submitting the given workspace * item * * workflow= <workflow_id> - Starts editing the given workflow item in * workflow mode * * With no parameters, doDSGet() just calls doDSPost(), which continues * the current submission (if one exists in the Request), or creates a * new submission (if no existing submission can be found). */ // try to get a workspace ID or workflow ID String workspaceID = request.getParameter("resume"); String workflowID = request.getParameter("workflow"); String resumableFilename = request.getParameter("resumableFilename"); // If resuming a workspace item if (workspaceID != null) { try { // load the workspace item WorkspaceItem wi = WorkspaceItem.find(context, Integer .parseInt(workspaceID)); //load submission information SubmissionInfo si = SubmissionInfo.load(request, wi); //TD: Special case - If a user is resuming a submission //where the submission process now has less steps, then //we will need to reset the stepReached in the database //(Hopefully this will never happen, but just in case!) if(getStepReached(si) >= si.getSubmissionConfig().getNumberOfSteps()) { //update Stage Reached to the last step in the Process int lastStep = si.getSubmissionConfig().getNumberOfSteps()-1; wi.setStageReached(lastStep); //flag that user is on last page of last step wi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED); //commit all changes to database immediately wi.update(); context.commit(); //update submission info si.setSubmissionItem(wi); } // start over at beginning of first step setBeginningOfStep(request, true); doStep(context, request, response, si, FIRST_STEP); } catch (NumberFormatException nfe) { log.warn(LogManager.getHeader(context, "bad_workspace_id", "bad_id=" + workspaceID)); JSPManager.showInvalidIDError(request, response, workspaceID, -1); } } else if (workflowID != null) // if resuming a workflow item { try { // load the workflow item WorkflowItem wi = WorkflowItem.find(context, Integer .parseInt(workflowID)); //load submission information SubmissionInfo si = SubmissionInfo.load(request, wi); // start over at beginning of first workflow step setBeginningOfStep(request, true); doStep(context, request, response, si, WORKFLOW_FIRST_STEP); } catch (NumberFormatException nfe) { log.warn(LogManager.getHeader(context, "bad_workflow_id", "bad_id=" + workflowID)); JSPManager .showInvalidIDError(request, response, workflowID, -1); } } else if (!StringUtils.isEmpty(resumableFilename)) // if resumable.js asks whether a part of af file was received { if (request.getMethod().equals("GET")) { DoGetResumable(context, request, response); } } else { // otherwise, forward to doDSPost() to do usual processing doDSPost(context, request, response); } }
[ "CWE-22" ]
CVE-2022-31194
HIGH
7.2
DSpace
doDSGet
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/SubmissionController.java
d1dd7d23329ef055069759df15cfa200c8e3
1
Analyze the following code function for security vulnerabilities
@Override public void requestWifiBugReport(String shareTitle, String shareDescription) { requestBugReportWithDescription(shareTitle, shareDescription, BugreportParams.BUGREPORT_MODE_WIFI); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestWifiBugReport 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
requestWifiBugReport
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
final void scheduleTempWhitelistLocked(int uid, long duration, BroadcastRecord r) { if (duration > Integer.MAX_VALUE) { duration = Integer.MAX_VALUE; } // XXX ideally we should pause the broadcast until everything behind this is done, // or else we will likely start dispatching the broadcast before we have opened // access to the app (there is a lot of asynchronicity behind this). It is probably // not that big a deal, however, because the main purpose here is to allow apps // to hold wake locks, and they will be able to acquire their wake lock immediately // it just won't be enabled until we get through this work. StringBuilder b = new StringBuilder(); b.append("broadcast:"); UserHandle.formatUid(b, r.callingUid); b.append(":"); if (r.intent.getAction() != null) { b.append(r.intent.getAction()); } else if (r.intent.getComponent() != null) { b.append(r.intent.getComponent().flattenToShortString()); } else if (r.intent.getData() != null) { b.append(r.intent.getData()); } mHandler.obtainMessage(SCHEDULE_TEMP_WHITELIST_MSG, uid, (int)duration, b.toString()) .sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scheduleTempWhitelistLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
scheduleTempWhitelistLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static boolean isNormalBrowser(String userAgent) { if (StringUtils.isEmpty(userAgent)) { return false; } UserAgent ua = UserAgent.parseUserAgentString(userAgent); BrowserType browserType = ua.getBrowser().getBrowserType(); return browserType == BrowserType.MOBILE_BROWSER || browserType == BrowserType.WEB_BROWSER; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNormalBrowser File: common/src/main/java/com/zrlog/util/ZrLogUtil.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
isNormalBrowser
common/src/main/java/com/zrlog/util/ZrLogUtil.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
@Override public ComponentName setGlobalProxy(ComponentName who, String proxySpec, String exclusionList) { if (!mHasFeature) { return null; } synchronized (getLockObject()) { Objects.requireNonNull(who, "ComponentName is null"); // Only check if system user has set global proxy. We don't allow other users to set it. DevicePolicyData policy = getUserData(UserHandle.USER_SYSTEM); ActiveAdmin admin = getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_SETS_GLOBAL_PROXY); // Scan through active admins and find if anyone has already // set the global proxy. Set<ComponentName> compSet = policy.mAdminMap.keySet(); for (ComponentName component : compSet) { ActiveAdmin ap = policy.mAdminMap.get(component); if ((ap.specifiesGlobalProxy) && (!component.equals(who))) { // Another admin already sets the global proxy // Return it to the caller. return component; } } // If the user is not system, don't set the global proxy. Fail silently. if (UserHandle.getCallingUserId() != UserHandle.USER_SYSTEM) { Slogf.w(LOG_TAG, "Only the owner is allowed to set the global proxy. User " + UserHandle.getCallingUserId() + " is not permitted."); return null; } if (proxySpec == null) { admin.specifiesGlobalProxy = false; admin.globalProxySpec = null; admin.globalProxyExclusionList = null; } else { admin.specifiesGlobalProxy = true; admin.globalProxySpec = proxySpec; admin.globalProxyExclusionList = exclusionList; } // Reset the global proxy accordingly // Do this using system permissions, as apps cannot write to secure settings mInjector.binderWithCleanCallingIdentity(() -> resetGlobalProxyLocked(policy)); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGlobalProxy 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
setGlobalProxy
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean disallowEnterPictureInPictureWhileLaunching() { return mDisallowEnterPictureInPictureWhileLaunching; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disallowEnterPictureInPictureWhileLaunching File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
disallowEnterPictureInPictureWhileLaunching
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public int readUnsignedByte() throws IOException { return primitiveTypes.readUnsignedByte(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readUnsignedByte File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readUnsignedByte
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private ModelAndView putConsoleOutput(final JobIdentifier jobIdentifier, final InputStream inputStream) throws Exception { File consoleLogFile = consoleService.consoleLogFile(jobIdentifier); boolean updated = consoleService.updateConsoleLog(consoleLogFile, inputStream); if (updated) { consoleActivityMonitor.consoleUpdatedFor(jobIdentifier); return FileModelAndView.fileAppended(consoleLogFile.getPath()); } else { return FileModelAndView.errorSavingFile(consoleLogFile.getPath()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putConsoleOutput File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java Repository: gocd The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-43289
MEDIUM
5
gocd
putConsoleOutput
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
0
Analyze the following code function for security vulnerabilities
public void writeFieldEnd() throws TException {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeFieldEnd File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeFieldEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0