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
private void removeCellFromGroup(CELLTYPE cell, Set<CELLTYPE> cellGroup) { String columnId = cell.getColumnId(); for (Set<String> group : rowState.cellGroups.keySet()) { if (group.contains(columnId)) { if (group.size() > 2) { // Update map key correctly CELLTYPE mergedCell = cellGroups.remove(cellGroup); cellGroup.remove(cell); cellGroups.put(cellGroup, mergedCell); group.remove(columnId); } else { // Only one cell remaining in the group, disband it // The contents of the group if removed rowState.cellGroups.remove(group); CELLTYPE mergedCell = cellGroups.remove(cellGroup); mergedCell.detach(); } return; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeCellFromGroup File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
removeCellFromGroup
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
protected PartitionedTopicMetadata internalGetPartitionedMetadata(boolean authoritative, boolean checkAllowAutoCreation) { PartitionedTopicMetadata metadata = getPartitionedTopicMetadata(topicName, authoritative, checkAllowAutoCreation); if (metadata.partitions == 0 && !checkAllowAutoCreation) { // The topic may be a non-partitioned topic, so check if it exists here. // However, when checkAllowAutoCreation is true, the client will create the topic if it doesn't exist. // In this case, `partitions == 0` means the automatically created topic is a non-partitioned topic so we // shouldn't check if the topic exists. try { if (!pulsar().getNamespaceService().checkTopicExists(topicName).get()) { throw new RestException(Status.NOT_FOUND, new PulsarClientException.NotFoundException("Topic not exist")); } } catch (InterruptedException | ExecutionException e) { log.error("Failed to check if topic '{}' exists", topicName, e); throw new RestException(Status.INTERNAL_SERVER_ERROR, "Failed to get topic metadata"); } } if (metadata.partitions > 1) { validateClientVersion(); } return metadata; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalGetPartitionedMetadata File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalGetPartitionedMetadata
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
private boolean isManagedProfileWithUnifiedLock(int userId) { return mUserManager.getUserInfo(userId).isManagedProfile() && !mLockPatternUtils.isSeparateProfileChallengeEnabled(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isManagedProfileWithUnifiedLock File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isManagedProfileWithUnifiedLock
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override protected long getEVP_AEAD(int keyLength) throws InvalidKeyException { final long evpAead; if (keyLength == 16) { return NativeCrypto.EVP_aead_aes_128_gcm(); } else if (keyLength == 32) { return NativeCrypto.EVP_aead_aes_256_gcm(); } else { throw new RuntimeException("Unexpected key length: " + keyLength); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEVP_AEAD File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
getEVP_AEAD
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
public int[] getRunningUserIds() throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRunningUserIds File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getRunningUserIds
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static String listAsString(List<?> list, String separator) { StringBuffer string = new StringBuffer(128); Iterator<?> it = list.iterator(); while (it.hasNext()) { string.append(it.next()); if (it.hasNext()) { string.append(separator); } } return string.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listAsString File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
listAsString
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private void checkupAfterGetFilename() throws RetryDirectly, DiscardSafely { final int id = model.getId(); if (model.isPathAsDirectory()) { // this scope for caring about the case of there is another task is provided // the same path to store file and the same url. final String targetFilePath = model.getTargetFilePath(); // get the ID after got the filename. final int fileCaseId = FileDownloadUtils.generateId(model.getUrl(), targetFilePath); // whether the file with the filename has been existed. if (FileDownloadHelper.inspectAndInflowDownloaded(id, targetFilePath, isForceReDownload, false)) { database.remove(id); database.removeConnections(id); throw new DiscardSafely(); } final FileDownloadModel fileCaseModel = database.find(fileCaseId); if (fileCaseModel != null) { // the task with the same file name and url has been exist. // whether the another task with the same file and url is downloading. if (FileDownloadHelper.inspectAndInflowDownloading(id, fileCaseModel, threadPoolMonitor, false)) { //it has been post to upper layer the 'warn' message, so the current // task no need to continue download. database.remove(id); database.removeConnections(id); throw new DiscardSafely(); } final List<ConnectionModel> connectionModelList = database .findConnectionModel(fileCaseId); // the another task with the same file name and url is paused database.remove(fileCaseId); database.removeConnections(fileCaseId); FileDownloadUtils.deleteTargetFile(model.getTargetFilePath()); if (FileDownloadUtils.isBreakpointAvailable(fileCaseId, fileCaseModel)) { model.setSoFar(fileCaseModel.getSoFar()); model.setTotal(fileCaseModel.getTotal()); model.setETag(fileCaseModel.getETag()); model.setConnectionCount(fileCaseModel.getConnectionCount()); database.update(model); // re connect to resume from breakpoint. if (connectionModelList != null) { for (ConnectionModel connectionModel : connectionModelList) { connectionModel.setId(id); database.insertConnectionModel(connectionModel); } } // retry throw new RetryDirectly(); } } // whether there is an another running task with the same target-file-path. if (FileDownloadHelper.inspectAndInflowConflictPath(id, model.getSoFar(), model.getTempFilePath(), targetFilePath, threadPoolMonitor)) { database.remove(id); database.removeConnections(id); throw new DiscardSafely(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkupAfterGetFilename File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
checkupAfterGetFilename
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
@Override public boolean inputMethodClientHasFocus(IInputMethodClient client) { synchronized (mWindowMap) { // The focus for the client is the window immediately below // where we would place the input method window. int idx = findDesiredInputMethodWindowIndexLocked(false); if (idx > 0) { // TODO(multidisplay): IMEs are only supported on the default display. WindowState imFocus = getDefaultWindowListLocked().get(idx-1); if (DEBUG_INPUT_METHOD) { Slog.i(TAG, "Desired input method target: " + imFocus); Slog.i(TAG, "Current focus: " + mCurrentFocus); Slog.i(TAG, "Last focus: " + mLastFocus); } if (imFocus != null) { // This may be a starting window, in which case we still want // to count it as okay. if (imFocus.mAttrs.type == LayoutParams.TYPE_APPLICATION_STARTING && imFocus.mAppToken != null) { // The client has definitely started, so it really should // have a window in this app token. Let's look for it. for (int i=0; i<imFocus.mAppToken.windows.size(); i++) { WindowState w = imFocus.mAppToken.windows.get(i); if (w != imFocus) { Log.i(TAG, "Switching to real app window: " + w); imFocus = w; break; } } } if (DEBUG_INPUT_METHOD) { Slog.i(TAG, "IM target client: " + imFocus.mSession.mClient); if (imFocus.mSession.mClient != null) { Slog.i(TAG, "IM target client binder: " + imFocus.mSession.mClient.asBinder()); Slog.i(TAG, "Requesting client binder: " + client.asBinder()); } } if (imFocus.mSession.mClient != null && imFocus.mSession.mClient.asBinder() == client.asBinder()) { return true; } } } // Okay, how about this... what is the current focus? // It seems in some cases we may not have moved the IM // target window, such as when it was in a pop-up window, // so let's also look at the current focus. (An example: // go to Gmail, start searching so the keyboard goes up, // press home. Sometimes the IME won't go down.) // Would be nice to fix this more correctly, but it's // way at the end of a release, and this should be good enough. if (mCurrentFocus != null && mCurrentFocus.mSession.mClient != null && mCurrentFocus.mSession.mClient.asBinder() == client.asBinder()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inputMethodClientHasFocus File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
inputMethodClientHasFocus
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryDictItemsByCode File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45207
CRITICAL
9.8
jeecgboot/jeecg-boot
queryDictItemsByCode
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
8632a835c23f558dfee3584d7658cc6a13ccec6f
0
Analyze the following code function for security vulnerabilities
public void createDisplayContentLocked(final Display display) { if (display == null) { throw new IllegalArgumentException("getDisplayContent: display must not be null"); } getDisplayContentLocked(display.getDisplayId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDisplayContentLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
createDisplayContentLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public String dialogContentEnd() { return dialogContent(HTML_END, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dialogContentEnd File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
dialogContentEnd
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public String getLocalUserName(String user, String format, boolean link) { try { return this.xwiki.getUserName(user.substring(user.indexOf(":") + 1), format, link, getXWikiContext()); } catch (Exception e) { return this.xwiki.getUserName(user, format, link, getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalUserName File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getLocalUserName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((certId == null) ? 0 : certId.hashCode()); result = prime * result + ((certRequestType == null) ? 0 : certRequestType.hashCode()); result = prime * result + ((certURL == null) ? 0 : certURL.hashCode()); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
hashCode
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void showConsoleNotificationIfActive() { if (!SystemProperties.get("init.svc.console").equals("running")) { return; } String title = mContext .getString(com.android.internal.R.string.console_running_notification_title); String message = mContext .getString(com.android.internal.R.string.console_running_notification_message); Notification notification = new Notification.Builder(mContext, SystemNotificationChannels.DEVELOPER) .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) .setWhen(0) .setOngoing(true) .setTicker(title) .setDefaults(0) // please be quiet .setColor(mContext.getColor( com.android.internal.R.color .system_notification_accent_color)) .setContentTitle(title) .setContentText(message) .setVisibility(Notification.VISIBILITY_PUBLIC) .build(); NotificationManager notificationManager = mContext.getSystemService(NotificationManager.class); notificationManager.notifyAsUser( null, SystemMessage.NOTE_SERIAL_CONSOLE_ENABLED, notification, UserHandle.ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showConsoleNotificationIfActive 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
showConsoleNotificationIfActive
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public final void attachApplication(IApplicationThread thread) { synchronized (this) { int callingPid = Binder.getCallingPid(); final long origId = Binder.clearCallingIdentity(); attachApplicationLocked(thread, callingPid); Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachApplication 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
attachApplication
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void itemClick(String rowKey, String columnInternalId, MouseEventDetails details, int rowIndex) { Column<T, ?> column = getColumnByInternalId(columnInternalId); T item = getDataCommunicator().getKeyMapper().get(rowKey); fireEvent(new ItemClick<>(Grid.this, column, item, details, rowIndex)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: itemClick File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
itemClick
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public ServerHttpResponse write(byte[] data, Consumer<Throwable> asyncResultHandler) { response.write(Buffer.buffer(data), new Handler<AsyncResult<Void>>() { @Override public void handle(AsyncResult<Void> event) { if (event.failed()) { asyncResultHandler.accept(event.cause()); } else { asyncResultHandler.accept(null); } } }); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
write
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
private void addFavoriteMenu() { // Favorite menu: final RepeatingView menuRepeater = new RepeatingView("menuRepeater"); add(menuRepeater); final Collection<MenuEntry> menuEntries = favoritesMenu.getMenuEntries(); if (menuEntries != null) { for (final MenuEntry menuEntry : menuEntries) { // Now we add a new menu area (title with sub menus): final WebMarkupContainer menuItem = new WebMarkupContainer(menuRepeater.newChildId()); menuRepeater.add(menuItem); final AbstractLink link = getMenuEntryLink(menuEntry, true); if (link == null) { menuItem.setVisible(false); continue; } menuItem.add(link); final WebMarkupContainer subMenuContainer = new WebMarkupContainer("subMenu"); menuItem.add(subMenuContainer); final WebMarkupContainer caret = new WebMarkupContainer("caret"); link.add(caret); if (menuEntry.hasSubMenuEntries() == false) { subMenuContainer.setVisible(false); caret.setVisible(false); continue; } menuItem.add(AttributeModifier.append("class", "dropdown")); link.add(AttributeModifier.append("class", "dropdown-toggle")); link.add(AttributeModifier.append("data-toggle", "dropdown")); final RepeatingView subMenuRepeater = new RepeatingView("subMenuRepeater"); subMenuContainer.add(subMenuRepeater); for (final MenuEntry subMenuEntry : menuEntry.getSubMenuEntries()) { // Now we add the next menu entry to the area: if (subMenuEntry.hasSubMenuEntries() == false) { final WebMarkupContainer subMenuItem = new WebMarkupContainer(subMenuRepeater.newChildId()); subMenuRepeater.add(subMenuItem); // Subsubmenu entries aren't yet supported, show only the sub entries without children, otherwise only the children are // displayed. final AbstractLink subLink = getMenuEntryLink(subMenuEntry, true); if (subLink == null) { subMenuItem.setVisible(false); continue; } subMenuItem.add(subLink); continue; } // final WebMarkupContainer subsubMenuContainer = new WebMarkupContainer("subsubMenu"); // subMenuItem.add(subsubMenuContainer); // if (subMenuEntry.hasSubMenuEntries() == false) { // subsubMenuContainer.setVisible(false); // continue; // } // final RepeatingView subsubMenuRepeater = new RepeatingView("subsubMenuRepeater"); // subsubMenuContainer.add(subsubMenuRepeater); for (final MenuEntry subsubMenuEntry : subMenuEntry.getSubMenuEntries()) { // Now we add the next menu entry to the sub menu: final WebMarkupContainer subMenuItem = new WebMarkupContainer(subMenuRepeater.newChildId()); subMenuRepeater.add(subMenuItem); // Subsubmenu entries aren't yet supported, show only the sub entries without children, otherwise only the children are // displayed. final AbstractLink subLink = getMenuEntryLink(subsubMenuEntry, true); if (subLink == null) { subMenuItem.setVisible(false); continue; } subMenuItem.add(subLink); // final WebMarkupContainer subsubMenuItem = new WebMarkupContainer(subsubMenuRepeater.newChildId()); // subsubMenuRepeater.add(subsubMenuItem); // final AbstractLink subsubLink = getMenuEntryLink(subsubMenuEntry, subsubMenuItem); // subsubMenuItem.add(subsubLink); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addFavoriteMenu File: src/main/java/org/projectforge/web/core/NavTopPanel.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
addFavoriteMenu
src/main/java/org/projectforge/web/core/NavTopPanel.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
public Jooby dateFormat(final String dateFormat) { this.dateFormat = requireNonNull(dateFormat, "DateFormat required."); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dateFormat File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
dateFormat
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private static Bitmap createThumbnail(String type, InputStream data) { if(MimeUtility.mimeTypeMatches(type, "image/*")) { return createImageThumbnail(data); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createThumbnail File: provider_src/com/android/email/provider/AttachmentProvider.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3918
MEDIUM
4.3
android
createThumbnail
provider_src/com/android/email/provider/AttachmentProvider.java
6b2b0bd7c771c698f11d7be89c2c57c8722c7454
0
Analyze the following code function for security vulnerabilities
protected final XMLResourceIdentifier resourceId() { /***/ fResourceId.clear(); return fResourceId; /*** // NOTE: Unfortunately, the Xerces DOM parser classes expect a // non-null resource identifier object to be passed to // startGeneralEntity. -Ac return null; /***/ }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resourceId File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
resourceId
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public String[] getParts() { return parts; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParts File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getParts
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
public void bind(int index, double value) { mPreparedStatement.bindDouble(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
@PUT @Path("task") @Operation(summary = "Attach Task Element on course", description = "This attaches a Task Element onto a given course. The element will be\n" + " 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.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Response attachTask(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId, @QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle, @QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives, @QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules, @QueryParam("text") String text, @QueryParam("points") Float points, @Context HttpServletRequest request) { TaskCustomConfig config = new TaskCustomConfig(points, text); return attach(courseId, parentNodeId, "ta", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: attachTask 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
attachTask
src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
c450df7d7ffe6afde39ebca6da9136f1caa16ec4
0
Analyze the following code function for security vulnerabilities
public void updateFilsAkms(int networkId, boolean isFilsSha256Supported, boolean isFilsSha384Supported) { WifiConfiguration internalConfig = getInternalConfiguredNetwork(networkId); if (internalConfig == null) { return; } internalConfig.enableFils(isFilsSha256Supported, isFilsSha384Supported); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateFilsAkms File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateFilsAkms
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public ActivityRecord getActivityRecord() { return mActivityRecord; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityRecord 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
getActivityRecord
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
boolean windowsAreFocusable(boolean fromUserTouch) { if (!fromUserTouch && mTargetSdk < Build.VERSION_CODES.Q) { final int pid = getPid(); final ActivityRecord topFocusedAppOfMyProcess = mWmService.mRoot.mTopFocusedAppByProcess.get(pid); if (topFocusedAppOfMyProcess != null && topFocusedAppOfMyProcess != this) { // For the apps below Q, there can be only one app which has the focused window per // process, because legacy apps may not be ready for a multi-focus system. return false; } } // Check isAttached() because the method may be called when removing this activity from // display, and WindowContainer#compareTo will throw exception if it doesn't have a parent // when updating focused window from DisplayContent#findFocusedWindow. return (canReceiveKeys() || isAlwaysFocusable()) && isAttached(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: windowsAreFocusable 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
windowsAreFocusable
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public ApiClient setBasePath(String basePath) { this.basePath = basePath; setOauthBasePath(basePath); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBasePath File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setBasePath
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private static ADnsAnswer decodeDnsRecord(DnsRecord dnsRecord, boolean includeIpVersion) { if (dnsRecord == null) { return null; } LOG.trace("Attempting to decode DNS record [{}]", dnsRecord); /* Read data from DNS record response. The data is a binary representation of the IP address * IPv4 address: 32 bits, IPv6 address: 128 bits */ byte[] ipAddressBytes; final DefaultDnsRawRecord dnsRawRecord = (DefaultDnsRawRecord) dnsRecord; try { final ByteBuf byteBuf = dnsRawRecord.content(); ipAddressBytes = new byte[byteBuf.readableBytes()]; int readerIndex = byteBuf.readerIndex(); byteBuf.getBytes(readerIndex, ipAddressBytes); } finally { /* Must manually release references on dnsRawRecord object since the DefaultDnsRawRecord class * extends ReferenceCounted. This also releases the above ByteBuf, since DefaultDnsRawRecord is * the holder for it. */ dnsRawRecord.release(); } LOG.trace("The IP address has [{}] bytes", ipAddressBytes.length); InetAddress ipAddress; try { ipAddress = InetAddress.getByAddress(ipAddressBytes); // Takes care of correctly creating an IPv4 or IPv6 address. } catch (UnknownHostException e) { // This should not happen. LOG.error("Could not extract IP address from DNS entry [{}]. Cause [{}]", dnsRecord.toString(), ExceptionUtils.getRootCauseMessage(e)); return null; } LOG.trace("The resulting IP address is [{}]", ipAddress.getHostAddress()); final ADnsAnswer.Builder builder = ADnsAnswer.builder() .ipAddress(ipAddress.getHostAddress()) .dnsTTL(dnsRecord.timeToLive()); if (includeIpVersion) { builder.ipVersion(ipAddress instanceof Inet4Address ? IP_4_VERSION : IP_6_VERSION); } return builder.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodeDnsRecord File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-345" ]
CVE-2023-41045
MEDIUM
5.3
Graylog2/graylog2-server
decodeDnsRecord
graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
466af814523cffae9fbc7e77bab7472988f03c3e
0
Analyze the following code function for security vulnerabilities
HeaderEntry<K, V> remove0(HeaderEntry<K, V> entry, HeaderEntry<K, V> previous) { int i = index(entry.hash); HeaderEntry<K, V> firstEntry = entries[i]; if (firstEntry == entry) { entries[i] = entry.next; previous = entries[i]; } else if (previous == null) { // If we don't have any existing starting point, then start from the beginning. previous = firstEntry; HeaderEntry<K, V> next = firstEntry.next; while (next != null && next != entry) { previous = next; next = next.next; } assert next != null: "Entry not found in its hash bucket: " + entry; previous.next = entry.next; } else { previous.next = entry.next; } entry.remove(); --size; return previous; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: remove0 File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
remove0
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder annotatedService(Object service) { virtualHostTemplate.annotatedService(service); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: annotatedService File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
annotatedService
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public boolean shouldDumpCheckIn() { return mDumpCheckIn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldDumpCheckIn 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
shouldDumpCheckIn
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public synchronized void insertRow() throws SQLException { checkUpdateable(); castNonNull(rows, "rows"); if (!onInsertRow) { throw new PSQLException(GT.tr("Not on the insert row."), PSQLState.INVALID_CURSOR_STATE); } HashMap<String, Object> updateValues = this.updateValues; if (updateValues == null || updateValues.isEmpty()) { throw new PSQLException(GT.tr("You must specify at least one column value to insert a row."), PSQLState.INVALID_PARAMETER_VALUE); } // loop through the keys in the insertTable and create the sql statement // we have to create the sql every time since the user could insert different // columns each time StringBuilder insertSQL = new StringBuilder("INSERT INTO ").append(tableName).append(" ("); StringBuilder paramSQL = new StringBuilder(") values ("); Iterator<String> columnNames = updateValues.keySet().iterator(); int numColumns = updateValues.size(); for (int i = 0; columnNames.hasNext(); i++) { String columnName = columnNames.next(); Utils.escapeIdentifier(insertSQL, columnName); if (i < numColumns - 1) { insertSQL.append(", "); paramSQL.append("?,"); } else { paramSQL.append("?)"); } } insertSQL.append(paramSQL.toString()); PreparedStatement insertStatement = null; Tuple rowBuffer = castNonNull(this.rowBuffer); try { insertStatement = connection.prepareStatement(insertSQL.toString(), Statement.RETURN_GENERATED_KEYS); Iterator<Object> values = updateValues.values().iterator(); for (int i = 1; values.hasNext(); i++) { insertStatement.setObject(i, values.next()); } insertStatement.executeUpdate(); if (usingOID) { // we have to get the last inserted OID and put it in the resultset long insertedOID = ((PgStatement) insertStatement).getLastOID(); updateValues.put("oid", insertedOID); } // update the underlying row to the new inserted data updateRowBuffer(insertStatement, rowBuffer, castNonNull(updateValues)); } finally { JdbcBlackHole.close(insertStatement); } castNonNull(rows).add(rowBuffer); // we should now reflect the current data in thisRow // that way getXXX will get the newly inserted data thisRow = rowBuffer; // need to clear this in case of another insert clearRowBuffer(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertRow File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
insertRow
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public List<BaseObject> getXObjectsToRemove() { return this.xObjectsToRemove; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXObjectsToRemove 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
getXObjectsToRemove
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
@SuppressWarnings("unchecked") public <T> T getTypeHandler() { return (T) _typeHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTypeHandler File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
getTypeHandler
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Override public void setStartUserSessionMessage( ComponentName admin, CharSequence startUserSessionMessage) { if (!mHasFeature) { return; } Objects.requireNonNull(admin, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); final String startUserSessionMessageString = startUserSessionMessage != null ? startUserSessionMessage.toString() : null; synchronized (getLockObject()) { final ActiveAdmin deviceOwner = getDeviceOwnerAdminLocked(); if (TextUtils.equals(deviceOwner.startUserSessionMessage, startUserSessionMessage)) { return; } deviceOwner.startUserSessionMessage = startUserSessionMessageString; saveSettingsLocked(caller.getUserId()); } mInjector.getActivityManagerInternal() .setSwitchingFromSystemUserMessage(startUserSessionMessageString); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStartUserSessionMessage 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
setStartUserSessionMessage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public float getCenterX() { final IAccessibilityServiceConnection connection = AccessibilityInteractionClient.getInstance().getConnection( mService.mConnectionId); if (connection != null) { try { return connection.getMagnificationCenterX(); } catch (RemoteException re) { Log.w(LOG_TAG, "Failed to obtain center X", re); re.rethrowFromSystemServer(); } } return 0.0f; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCenterX File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
getCenterX
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
private void filterRecentlyUsedApps(Collection<PackageParser.Package> pkgs) { // Filter out packages that aren't recently used. // // The exception is first boot of a non-eng device (aka !mLazyDexOpt), which // should do a full dexopt. if (mLazyDexOpt || (!isFirstBoot() && mPackageUsage.isHistoricalPackageUsageAvailable())) { int total = pkgs.size(); int skipped = 0; long now = System.currentTimeMillis(); for (Iterator<PackageParser.Package> i = pkgs.iterator(); i.hasNext();) { PackageParser.Package pkg = i.next(); long then = pkg.mLastPackageUsageTimeInMills; if (then + mDexOptLRUThresholdInMills < now) { if (DEBUG_DEXOPT) { Log.i(TAG, "Skipping dexopt of " + pkg.packageName + " last resumed: " + ((then == 0) ? "never" : new Date(then))); } i.remove(); skipped++; } } if (DEBUG_DEXOPT) { Log.i(TAG, "Skipped optimizing " + skipped + " of " + total); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: filterRecentlyUsedApps 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
filterRecentlyUsedApps
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private static LinkParser getLinkParser() { return Utils.getComponent(LinkParser.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLinkParser 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
getLinkParser
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
protected abstract boolean canExpand();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canExpand File: varexport/src/main/java/com/indeed/util/varexport/Variable.java Repository: indeedeng/util The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36634
MEDIUM
5.4
indeedeng/util
canExpand
varexport/src/main/java/com/indeed/util/varexport/Variable.java
c0952a9db51a880e9544d9fac2a2218a6bfc9c63
0
Analyze the following code function for security vulnerabilities
private static void cleanupToolsLabel(Element root) { assert (root != null); // Iterate on tools for (Element toolElt : XmlIterator.forChildElements(root, "tool")) { // Iterate on attribute nodes for (Element attrElt : XmlIterator.forChildElements(toolElt, "a")) { // Each attribute node should have a name field if (attrElt.hasAttribute("name")) { String aName = attrElt.getAttribute("name"); if (aName.equals("label")) { // Found a label node in a tool, clean it up! attrElt.setAttribute("val", ""); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupToolsLabel File: src/com/cburch/logisim/file/XmlReader.java Repository: logisim-evolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000889
MEDIUM
6.8
logisim-evolution
cleanupToolsLabel
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
public boolean getSyncAutomatically(Account account, int userId, String providerName) { synchronized (mAuthorities) { if (account != null) { AuthorityInfo authority = getAuthorityLocked( new EndPoint(account, providerName, userId), "getSyncAutomatically"); return authority != null && authority.enabled; } int i = mAuthorities.size(); while (i > 0) { i--; AuthorityInfo authorityInfo = mAuthorities.valueAt(i); if (authorityInfo.target.matchesSpec(new EndPoint(account, providerName, userId)) && authorityInfo.enabled) { return true; } } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSyncAutomatically File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getSyncAutomatically
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public <T> Jooby bind(final Class<T> type, final Class<? extends T> implementation) { use((env, conf, binder) -> { binder.bind(type).to(implementation); }); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
bind
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collection) value; } else { params.add(new Pair(name, parameterToString(value))); return params; } if (valueCollection.isEmpty()){ return params; } // get the collection format (default: csv) String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { for (Object item : valueCollection) { params.add(new Pair(name, parameterToString(item))); } return params; } String delimiter = ","; if ("csv".equals(format)) { delimiter = ","; } else if ("ssv".equals(format)) { delimiter = " "; } else if ("tsv".equals(format)) { delimiter = "\t"; } else if ("pipes".equals(format)) { delimiter = "|"; } StringBuilder sb = new StringBuilder() ; for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); } params.add(new Pair(name, sb.substring(1))); return params; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToPairs File: samples/client/petstore/java/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
parameterToPairs
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
protected CoercionAction _checkFromStringCoercion(DeserializationContext ctxt, String value) throws IOException { return _checkFromStringCoercion(ctxt, value, logicalType(), handledType()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _checkFromStringCoercion File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_checkFromStringCoercion
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { return myArrayList.hashCode(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
hashCode
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public int getInitialDelaySeconds() { return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInitialDelaySeconds File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
getInitialDelaySeconds
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
@Test public void parseQueryTSUIDTypeMulti() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&tsuid=sum:010101,020202"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals(2, sub.getTsuids().size()); assertEquals("010101", sub.getTsuids().get(0)); assertEquals("020202", sub.getTsuids().get(1)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryTSUIDTypeMulti File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryTSUIDTypeMulti
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
private static void cacheConfigXmlGenerator(XmlGenerator gen, Config config) { for (CacheSimpleConfig c : config.getCacheConfigs().values()) { gen.open("cache", "name", c.getName()); if (c.getKeyType() != null) { gen.node("key-type", null, "class-name", c.getKeyType()); } if (c.getValueType() != null) { gen.node("value-type", null, "class-name", c.getValueType()); } gen.node("statistics-enabled", c.isStatisticsEnabled()) .node("management-enabled", c.isManagementEnabled()) .node("read-through", c.isReadThrough()) .node("write-through", c.isWriteThrough()); checkAndFillCacheLoaderFactoryConfigXml(gen, c.getCacheLoaderFactory()); checkAndFillCacheLoaderConfigXml(gen, c.getCacheLoader()); checkAndFillCacheWriterFactoryConfigXml(gen, c.getCacheWriterFactory()); checkAndFillCacheWriterConfigXml(gen, c.getCacheWriter()); cacheExpiryPolicyFactoryConfigXmlGenerator(gen, c.getExpiryPolicyFactoryConfig()); gen.open("cache-entry-listeners"); for (CacheSimpleEntryListenerConfig el : c.getCacheEntryListeners()) { gen.open("cache-entry-listener", "old-value-required", el.isOldValueRequired(), "synchronous", el.isSynchronous()) .node("cache-entry-listener-factory", null, "class-name", el.getCacheEntryListenerFactory()) .node("cache-entry-event-filter-factory", null, "class-name", el.getCacheEntryEventFilterFactory()) .close(); } gen.close() .node("in-memory-format", c.getInMemoryFormat()) .node("backup-count", c.getBackupCount()) .node("async-backup-count", c.getAsyncBackupCount()); evictionConfigXmlGenerator(gen, c.getEvictionConfig()); wanReplicationConfigXmlGenerator(gen, c.getWanReplicationRef()); gen.node("quorum-ref", c.getQuorumName()); cachePartitionLostListenerConfigXmlGenerator(gen, c.getPartitionLostListenerConfigs()); gen.node("merge-policy", c.getMergePolicy()); appendHotRestartConfig(gen, c.getHotRestartConfig()); gen.node("disable-per-entry-invalidation-events", c.isDisablePerEntryInvalidationEvents()) .close(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cacheConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
cacheConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private void checkupBeforeConnect() throws FileDownloadGiveUpRetryException { // 1. check whether need access-network-state permission? if (isWifiRequired && !FileDownloadUtils.checkPermission(Manifest.permission.ACCESS_NETWORK_STATE)) { throw new FileDownloadGiveUpRetryException( FileDownloadUtils.formatString("Task[%d] can't start the download runnable," + " because this task require wifi, but user application " + "nor current process has %s, so we can't check whether " + "the network type connection.", model.getId(), Manifest.permission.ACCESS_NETWORK_STATE)); } // 2. check whether need wifi to download? if (isWifiRequired && FileDownloadUtils.isNetworkNotOnWifiType()) { throw new FileDownloadNetworkPolicyException(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkupBeforeConnect File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
checkupBeforeConnect
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
private void handleForwardingSettingsReadResult(AsyncResult ar, int idx) { if (DBG) Log.d(LOG_TAG, "handleForwardingSettingsReadResult: " + idx); Throwable error = null; if (ar.exception != null) { error = ar.exception; if (DBG) Log.d(LOG_TAG, "FwdRead: ar.exception=" + error.getMessage()); } if (ar.userObj instanceof Throwable) { error = (Throwable) ar.userObj; if (DBG) Log.d(LOG_TAG, "FwdRead: userObj=" + error.getMessage()); } // We may have already gotten an error and decided to ignore the other results. if (mForwardingReadResults == null) { if (DBG) Log.d(LOG_TAG, "Ignoring fwd reading result: " + idx); return; } // In case of error ignore other results, show an error dialog if (error != null) { if (DBG) Log.d(LOG_TAG, "Error discovered for fwd read : " + idx); mForwardingReadResults = null; dismissDialogSafely(VoicemailDialogUtil.VM_FWD_READING_DIALOG); showDialogIfForeground(VoicemailDialogUtil.FWD_GET_RESPONSE_ERROR_DIALOG); return; } // Get the forwarding info. mForwardingReadResults[idx] = CallForwardInfoUtil.getCallForwardInfo( (CallForwardInfo[]) ar.result, VoicemailProviderSettings.FORWARDING_SETTINGS_REASONS[idx]); // Check if we got all the results already boolean done = true; for (int i = 0; i < mForwardingReadResults.length; i++) { if (mForwardingReadResults[i] == null) { done = false; break; } } if (done) { if (DBG) Log.d(LOG_TAG, "Done receiving fwd info"); dismissDialogSafely(VoicemailDialogUtil.VM_FWD_READING_DIALOG); if (mPreviousVMProviderKey.equals(VoicemailProviderListPreference.DEFAULT_KEY)) { VoicemailProviderSettingsUtil.save(mPhone.getContext(), VoicemailProviderListPreference.DEFAULT_KEY, new VoicemailProviderSettings(mOldVmNumber, mForwardingReadResults)); } saveVoiceMailAndForwardingNumberStage2(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleForwardingSettingsReadResult File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
handleForwardingSettingsReadResult
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
@Override public WeatherType getWeather() { if (getWorld().isThundering()) { return WeatherTypes.THUNDER_STORM; } else if (getWorld().hasStorm()) { return WeatherTypes.RAIN; } return WeatherTypes.CLEAR; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWeather 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
getWeather
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@Override public String getDescription() { return getUriForDisplay(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getDescription
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
private Optional<CorsOriginConfiguration> getConfiguration(String requestOrigin) { Map<String, CorsOriginConfiguration> corsConfigurations = corsConfiguration.getConfigurations(); for (Map.Entry<String, CorsOriginConfiguration> config : corsConfigurations.entrySet()) { List<String> allowedOrigins = config.getValue().getAllowedOrigins(); if (!allowedOrigins.isEmpty()) { boolean matches = false; if (isAny(allowedOrigins)) { matches = true; } if (!matches) { matches = allowedOrigins.stream().anyMatch(origin -> { if (origin.equals(requestOrigin)) { return true; } Pattern p = Pattern.compile(origin); Matcher m = p.matcher(requestOrigin); return m.matches(); }); } if (matches) { return Optional.of(config.getValue()); } } } return Optional.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguration File: http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getConfiguration
http-server/src/main/java/io/micronaut/http/server/cors/CorsFilter.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public void setProvider(Provider provider) { this.provider = provider; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProvider File: api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java Repository: openmrs/openmrs-module-appointmentscheduling The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4727
MEDIUM
6.1
openmrs/openmrs-module-appointmentscheduling
setProvider
api/src/main/java/org/openmrs/module/appointmentscheduling/AppointmentRequest.java
2ccbe39c020809765de41eeb8ee4c70b5ec49cc8
0
Analyze the following code function for security vulnerabilities
@Override public void drawShape(Object graphics, com.codename1.ui.geom.Shape shape, com.codename1.ui.Stroke stroke) { AndroidGraphics ag = (AndroidGraphics)graphics; Path p = cn1ShapeToAndroidPath(shape); ag.drawPath(p, stroke); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: drawShape 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
drawShape
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void highlightInMuc(Conversation conversation, String nick) { switchToConversation(conversation, null, false, nick, false); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2018-18467 - Severity: MEDIUM - CVSS Score: 5.0 Description: Do not insert text shared over XMPP uri when already drafting message XMPP uris in the style of `xmpp:test@domain.tld?body=Something` can be used to directly share a message with a specific contact. Previously the text was always appended to the message currently in draft. The message was never send automatically. Essentially those links where treated like normal text share intents (for example when sharing a URL from the browser) but without the contact selection. There is a concern (CVE-2018-18467) that when this URI is invoked automatically and the user is currently drafting a long message to that particular contact the text could be inserted in the draft field (input box) without the user noticing. To circumvent that the text shared over XMPP uris that contain a particular contact is now appended only if the draft box is currently empty. Sharing text normally (**with** manual contact selection) is still treated the same; meaning the shared text will be appended to the current draft. This is intended behaviour to make the 'Hey I have this cool link here;' *open browser*, *share link* - secenario work. Function: highlightInMuc File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java Repository: iNPUTmice/Conversations Fixed Code: public void highlightInMuc(Conversation conversation, String nick) { switchToConversation(conversation, null, false, nick, false, false); }
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
highlightInMuc
src/main/java/eu/siacs/conversations/ui/XmppActivity.java
7177c523a1b31988666b9337249a4f1d0c36f479
1
Analyze the following code function for security vulnerabilities
public static File dumpStackTraces(ArrayList<Integer> firstPids, ProcessCpuTracker processCpuTracker, SparseArray<Boolean> lastPids, ArrayList<Integer> nativePids, StringWriter logExceptionCreatingFile) { return dumpStackTraces(firstPids, processCpuTracker, lastPids, nativePids, logExceptionCreatingFile, null, null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpStackTraces 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
dumpStackTraces
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public static int copy(InputStream in, OutputStream out, int bufferSize, int sizeLimit) throws IOException { byte[] b = new byte[bufferSize]; int read, total = 0; while ((read = in.read(b)) != -1) { total += read; if (sizeLimit > 0 && total > sizeLimit) { throw new SizeLimitExceededException(); } out.write(b, 0, read); } return total; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copy File: src/main/java/com/mxgraph/online/Utils.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-284", "CWE-79" ]
CVE-2022-3065
HIGH
7.5
jgraph/drawio
copy
src/main/java/com/mxgraph/online/Utils.java
59887e45b36f06c8dd4919a32bacd994d9f084da
0
Analyze the following code function for security vulnerabilities
private static long calculateDirectorySize(IMediaContainerService mcs, File[] paths) throws RemoteException { long result = 0; for (File path : paths) { result += mcs.calculateDirectorySize(path.getAbsolutePath()); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateDirectorySize 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
calculateDirectorySize
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public DefaultJpaInstanceConfiguration db(JpaDb db) { this.db = db; put(PersistenceUnitProperties.JDBC_DRIVER, db.getDriver()); put(PersistenceUnitProperties.TARGET_DATABASE, db.getTargetDatabase()); if (connectionUrl != null) { url(connectionUrl); } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: db File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
db
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
public boolean verifyData(String x_app_id, String content_type, String package_name, String class_name, int app_type, boolean need_signature, boolean further_processing) { WapPushManDBHelper dbh = getDatabase(this); SQLiteDatabase db = dbh.getReadableDatabase(); WapPushManDBHelper.queryData lastapp = dbh.queryLastApp(db, x_app_id, content_type); db.close(); if (lastapp == null) return false; if (lastapp.packageName.equals(package_name) && lastapp.className.equals(class_name) && lastapp.appType == app_type && lastapp.needSignature == (need_signature ? 1 : 0) && lastapp.furtherProcessing == (further_processing ? 1 : 0)) { return true; } else { return false; } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2014-8507 - Severity: HIGH - CVSS Score: 7.5 Description: Externally Reported Moderate Security Issue: SQL Injection in WAPPushManager Bug 17969135 Use query (instead of rawQuery) and pass in arguments instead of building the query with a giant string. Add a unit test that fails with the old code but passes with the new code. Change-Id: Id04a1db6fb95fcd923e1f36f5ab3b94402590918 Function: verifyData File: packages/WAPPushManager/src/com/android/smspush/WapPushManager.java Repository: android Fixed Code: public boolean verifyData(String x_app_id, String content_type, String package_name, String class_name, int app_type, boolean need_signature, boolean further_processing) { WapPushManDBHelper dbh = getDatabase(this); SQLiteDatabase db = dbh.getReadableDatabase(); WapPushManDBHelper.queryData lastapp = dbh.queryLastApp(db, x_app_id, content_type); if (LOCAL_LOGV) Log.v(LOG_TAG, "verifyData app id: " + x_app_id + " content type: " + content_type + " lastapp: " + lastapp); db.close(); if (lastapp == null) return false; if (LOCAL_LOGV) Log.v(LOG_TAG, "verifyData lastapp.packageName: " + lastapp.packageName + " lastapp.className: " + lastapp.className + " lastapp.appType: " + lastapp.appType + " lastapp.needSignature: " + lastapp.needSignature + " lastapp.furtherProcessing: " + lastapp.furtherProcessing); if (lastapp.packageName.equals(package_name) && lastapp.className.equals(class_name) && lastapp.appType == app_type && lastapp.needSignature == (need_signature ? 1 : 0) && lastapp.furtherProcessing == (further_processing ? 1 : 0)) { return true; } else { return false; } }
[ "CWE-89" ]
CVE-2014-8507
HIGH
7.5
android
verifyData
packages/WAPPushManager/src/com/android/smspush/WapPushManager.java
48ed835468c6235905459e6ef7df032baf3e4df6
1
Analyze the following code function for security vulnerabilities
@Override public void setLockPattern(String pattern, String savedCredential, int userId) throws RemoteException { byte[] currentHandle = getCurrentHandle(userId); if (pattern == null) { getGateKeeperService().clearSecureUserId(userId); mStorage.writePatternHash(null, userId); setKeystorePassword(null, userId); return; } if (currentHandle == null) { if (savedCredential != null) { Slog.w(TAG, "Saved credential provided, but none stored"); } savedCredential = null; } byte[] enrolledHandle = enrollCredential(currentHandle, savedCredential, pattern, userId); if (enrolledHandle != null) { mStorage.writePatternHash(enrolledHandle, userId); } else { Slog.e(TAG, "Failed to enroll pattern"); } }
Vulnerability Classification: - CWE: CWE-255 - CVE: CVE-2016-3749 - Severity: MEDIUM - CVSS Score: 4.6 Description: Fix missing permission check when saving pattern/password Fixes bug 28163930 Change-Id: Ic98ef20933b352159b88fdef331e83e9ef6e1f20 Function: setLockPattern File: services/core/java/com/android/server/LockSettingsService.java Repository: android Fixed Code: @Override public void setLockPattern(String pattern, String savedCredential, int userId) throws RemoteException { checkWritePermission(userId); byte[] currentHandle = getCurrentHandle(userId); if (pattern == null) { getGateKeeperService().clearSecureUserId(userId); mStorage.writePatternHash(null, userId); setKeystorePassword(null, userId); return; } if (currentHandle == null) { if (savedCredential != null) { Slog.w(TAG, "Saved credential provided, but none stored"); } savedCredential = null; } byte[] enrolledHandle = enrollCredential(currentHandle, savedCredential, pattern, userId); if (enrolledHandle != null) { mStorage.writePatternHash(enrolledHandle, userId); } else { Slog.e(TAG, "Failed to enroll pattern"); } }
[ "CWE-255" ]
CVE-2016-3749
MEDIUM
4.6
android
setLockPattern
services/core/java/com/android/server/LockSettingsService.java
e83f0f6a5a6f35323f5367f99c8e287c440f33f5
1
Analyze the following code function for security vulnerabilities
@AfterClass public static void tearDownClass(TestContext context) { PostgresClient.stopEmbeddedPostgres(); if (vertx != null) { vertx.close(context.asyncAssertSuccess()); vertx = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tearDownClass 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
tearDownClass
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private static String getManagedProvisioningPackage(Context context) { return context.getResources().getString(R.string.config_managed_provisioning_package); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManagedProvisioningPackage 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
getManagedProvisioningPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public synchronized void write(int b) throws IOException { update(1); out.write(b); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: write File: android/guava/src/com/google/common/io/FileBackedOutputStream.java Repository: google/guava The code follows secure coding practices.
[ "CWE-552" ]
CVE-2023-2976
HIGH
7.1
google/guava
write
android/guava/src/com/google/common/io/FileBackedOutputStream.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public ApiClient setOauthAuthorizationCodeFlow(String code) { for (Authentication auth : authentications.values()) { if (auth instanceof OAuth) { ((OAuth) auth).useAuthorizationCodeFlow(code); return this; } } throw new RuntimeException("No OAuth2 authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOauthAuthorizationCodeFlow File: samples/client/petstore/java/okhttp-gson/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
setOauthAuthorizationCodeFlow
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void moveHomeStack(boolean toFront, String reason, ActivityStack lastFocusedStack) { ArrayList<ActivityStack> stacks = mHomeStack.mStacks; final int topNdx = stacks.size() - 1; if (topNdx <= 0) { return; } // The home stack should either be at the top or bottom of the stack list. if ((toFront && (stacks.get(topNdx) != mHomeStack)) || (!toFront && (stacks.get(0) != mHomeStack))) { if (DEBUG_STACK) Slog.d(TAG_STACK, "moveHomeTask: topStack old=" + ((lastFocusedStack != null) ? lastFocusedStack : stacks.get(topNdx)) + " new=" + mFocusedStack); stacks.remove(mHomeStack); stacks.add(toFront ? topNdx : 0, mHomeStack); } if (lastFocusedStack != null) { mLastFocusedStack = lastFocusedStack; } mFocusedStack = stacks.get(topNdx); EventLog.writeEvent(EventLogTags.AM_HOME_STACK_MOVED, mCurrentUser, toFront ? 1 : 0, stacks.get(topNdx).getStackId(), mFocusedStack == null ? -1 : mFocusedStack.getStackId(), reason); if (mService.mBooting || !mService.mBooted) { final ActivityRecord r = topRunningActivityLocked(); if (r != null && r.idle) { checkFinishBootingLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveHomeStack File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
moveHomeStack
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public static boolean jsFunction_changePassword(Context cx, Scriptable thisObj, Object[] args, Function funObj) throws APIManagementException { String username = (String) args[0]; String currentPassword = (String) args[1]; String newPassword = (String) args[2]; APIManagerConfiguration config = HostObjectComponent.getAPIManagerConfiguration(); String serverURL = config.getFirstProperty(APIConstants.AUTH_MANAGER_URL); String tenantDomain = MultitenantUtils.getTenantDomain(APIUtil.replaceEmailDomainBack(username)); //if the current password is wrong return false and ask to retry. if (!isAbleToLogin(username, currentPassword, serverURL, tenantDomain)) { return false; } boolean isTenantFlowStarted = false; try { if (tenantDomain != null && !MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { isTenantFlowStarted = true; PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext() .setTenantDomain(tenantDomain, true); } // get the signup configuration UserRegistrationConfigDTO signupConfig = SelfSignUpUtil.getSignupConfiguration(tenantDomain); // set tenant specific sign up user storage if (signupConfig != null && !"".equals(signupConfig.getSignUpDomain())) { if (!signupConfig.isSignUpEnabled()) { handleException("Self sign up has been disabled for this tenant domain"); } } changeTenantUserPassword(username, signupConfig, serverURL, newPassword); //if unable to login with new password if (!isAbleToLogin(username, newPassword, serverURL, tenantDomain)) { throw new APIManagementException("Password change failed"); } } catch (Exception e) { handleException("Error while changing the password for: " + username, e); } finally { if (isTenantFlowStarted) { PrivilegedCarbonContext.endTenantFlow(); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jsFunction_changePassword File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java Repository: wso2/carbon-apimgt The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20736
LOW
3.5
wso2/carbon-apimgt
jsFunction_changePassword
components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
490f2860822f89d745b7c04fa9570bd86bef4236
0
Analyze the following code function for security vulnerabilities
public int getId() { return id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getId File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getId
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
@Override public void deleteApplicationCacheFiles(final String packageName, final IPackageDataObserver observer) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.DELETE_CACHE_FILES, null); // Queue up an async operation since the package deletion may take a little while. final int userId = UserHandle.getCallingUserId(); mHandler.post(new Runnable() { public void run() { mHandler.removeCallbacks(this); final boolean succeded; synchronized (mInstallLock) { succeded = deleteApplicationCacheFilesLI(packageName, userId); } clearExternalStorageDataSync(packageName, userId, false); if (observer != null) { try { observer.onRemoveCompleted(packageName, succeded); } catch (RemoteException e) { Log.i(TAG, "Observer no longer exists."); } } //end if observer } //end run }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteApplicationCacheFiles 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
deleteApplicationCacheFiles
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public void unregisterAnrController(AnrController controller) { synchronized (mGlobalLock) { mAnrController.remove(controller); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterAnrController 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
unregisterAnrController
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void goForward() { if (mContentViewCore != null) mContentViewCore.goForward(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: goForward File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
goForward
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private static SQLiteDatabase openDatabase(@NonNull String path, @NonNull OpenParams openParams) { Preconditions.checkArgument(openParams != null, "OpenParams cannot be null"); SQLiteDatabase db = new SQLiteDatabase(path, openParams.mOpenFlags, openParams.mCursorFactory, openParams.mErrorHandler, openParams.mLookasideSlotSize, openParams.mLookasideSlotCount, openParams.mIdleConnectionTimeout, openParams.mJournalMode, openParams.mSyncMode); db.open(); return db; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openDatabase File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
openDatabase
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public void sendReply(final byte[] data) { sendBuffer(HttpResponseStatus.OK, ChannelBuffers.wrappedBuffer(data)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendReply File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
sendReply
src/tsd/HttpQuery.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
@Override public boolean containsDouble(K name, double value) { return contains(name, fromDouble(name, value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsDouble File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
containsDouble
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
protected void setWantClientAuth(boolean want) { want_client_auth = want; // reset the need_client_auth setting need_client_auth = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWantClientAuth File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
setWantClientAuth
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
private boolean joinRoom(final String room, String nickname, String password) { // work around smack3 bug: can't rejoin with "used" MultiUserChat instance MultiUserChat muc = new MultiUserChat(mXMPPConnection, room); Log.d(TAG, "created new MUC instance: " + room + " " + muc); muc.addUserStatusListener(new org.jivesoftware.smackx.muc.DefaultUserStatusListener() { @Override public void kicked(String actor, String reason) { debugLog("Kicked from " + room + " by " + actor + ": " + reason); handleKickedFromMUC(room, false, actor, reason); } @Override public void banned(String actor, String reason) { debugLog("Banned from " + room + " by " + actor + ": " + reason); handleKickedFromMUC(room, true, actor, reason); } }); DiscussionHistory history = new DiscussionHistory(); final String[] projection = new String[] { ChatConstants._ID, ChatConstants.DATE }; Cursor cursor = mContentResolver.query(ChatProvider.CONTENT_URI, projection, ChatConstants.JID + " = ? AND " + ChatConstants.DELIVERY_STATUS + " = " + ChatConstants.DS_SENT_OR_READ, new String[] { room }, "_id DESC LIMIT 1"); if(cursor.getCount()>0) { cursor.moveToFirst(); Date lastDate = new Date(cursor.getLong(1)); Log.d(TAG, "Getting room history for " + room + " starting at " + lastDate); history.setSince(lastDate); } else Log.d(TAG, "No last message for " + room); cursor.close(); ContentValues cvR = new ContentValues(); cvR.put(RosterProvider.RosterConstants.JID, room); cvR.put(RosterProvider.RosterConstants.ALIAS, room); cvR.put(RosterProvider.RosterConstants.STATUS_MESSAGE, mService.getString(R.string.muc_synchronizing)); cvR.put(RosterProvider.RosterConstants.STATUS_MODE, StatusMode.dnd.ordinal()); cvR.put(RosterProvider.RosterConstants.GROUP, RosterProvider.RosterConstants.MUCS); upsertRoster(cvR, room); cvR.clear(); try { Presence force_resync = new Presence(Presence.Type.unavailable); force_resync.setTo(room + "/" + nickname); mXMPPConnection.sendPacket(force_resync); muc.join(nickname, password, history, 10*PACKET_TIMEOUT); } catch (Exception e) { Log.e(TAG, "Could not join MUC-room "+room); e.printStackTrace(); cvR.put(RosterProvider.RosterConstants.STATUS_MESSAGE, mService.getString(R.string.conn_error, e.getLocalizedMessage())); cvR.put(RosterProvider.RosterConstants.STATUS_MODE, StatusMode.offline.ordinal()); upsertRoster(cvR, room); return false; } if(muc.isJoined()) { synchronized(this) { multiUserChats.put(room, muc); } String roomname = room.split("@")[0]; try { RoomInfo ri = MultiUserChat.getRoomInfo(mXMPPConnection, room); String rn = ri.getRoomName(); if (rn != null && rn.length() > 0) roomname = rn; Log.d(TAG, "MUC name after disco: " + roomname); } catch (XMPPException e) { // ignore a failed room info request Log.d(TAG, "MUC room IQ failed: " + room); e.printStackTrace(); } // delay requesting subject until room info IQ returned/failed String subject = muc.getSubject(); cvR.put(RosterProvider.RosterConstants.ALIAS, roomname); cvR.put(RosterProvider.RosterConstants.STATUS_MESSAGE, subject); cvR.put(RosterProvider.RosterConstants.STATUS_MODE, StatusMode.available.ordinal()); Log.d(TAG, "upserting MUC as online: " + roomname); upsertRoster(cvR, room); return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: joinRoom File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
joinRoom
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public int startActivityAsCaller(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); data.writeString(callingPackage); intent.writeToParcel(data, 0); data.writeString(resolvedType); data.writeStrongBinder(resultTo); data.writeString(resultWho); data.writeInt(requestCode); data.writeInt(startFlags); if (profilerInfo != null) { data.writeInt(1); profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { data.writeInt(0); } if (options != null) { data.writeInt(1); options.writeToParcel(data, 0); } else { data.writeInt(0); } data.writeInt(ignoreTargetSecurity ? 1 : 0); data.writeInt(userId); mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0); reply.readException(); int result = reply.readInt(); reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAsCaller File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivityAsCaller
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle) { try { Log.startSession("TSI.sUSOPA"); synchronized (mLock) { enforceModifyPermission(); UserHandle callingUserHandle = Binder.getCallingUserHandle(); long token = Binder.clearCallingIdentity(); try { mPhoneAccountRegistrar.setUserSelectedOutgoingPhoneAccount( accountHandle, callingUserHandle); } catch (Exception e) { Log.e(this, e, "setUserSelectedOutgoingPhoneAccount"); throw e; } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserSelectedOutgoingPhoneAccount File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
setUserSelectedOutgoingPhoneAccount
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public static void assertSwingDispatchThread() { if (!SwingUtilities.isEventDispatchThread()) { throw new Error("Must be called in Swing dispatch thread"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: assertSwingDispatchThread 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
assertSwingDispatchThread
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 void applyFixedRotationTransform(DisplayInfo info, DisplayFrames displayFrames, Configuration config) { super.applyFixedRotationTransform(info, displayFrames, config); ensureActivityConfiguration(0 /* globalChanges */, false /* preserveWindow */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyFixedRotationTransform 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
applyFixedRotationTransform
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public String getMethod() { return request.getMethod(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMethod File: sa-token-starter/sa-token-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getMethod
sa-token-starter/sa-token-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
public String escapeString(String str) { try { return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException e) { return str; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escapeString File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
escapeString
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void addItemsToDeny(final String[] items){ if (items == null){ return; } for (int i = 0; i < items.length; ++i) { String item = items[i]; this.addDeny(item); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItemsToDeny File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
addItemsToDeny
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
@Override public void setNativeBrowserScrollingEnabled(final PeerComponent browserPeer, final boolean e) { super.setNativeBrowserScrollingEnabled(browserPeer, e); if (getActivity() == null) { return; } getActivity().runOnUiThread(new Runnable() { public void run() { AndroidBrowserComponent bc = (AndroidBrowserComponent)browserPeer; bc.setScrollingEnabled(e); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setNativeBrowserScrollingEnabled 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
setNativeBrowserScrollingEnabled
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
boolean hide(boolean doAnimation, boolean requestAnim) { if (doAnimation) { if (!mToken.okToAnimate()) { doAnimation = false; } } boolean current = doAnimation ? mLegacyPolicyVisibilityAfterAnim : isLegacyPolicyVisibility(); if (!current) { // Already hiding. return false; } if (doAnimation) { mWinAnimator.applyAnimationLocked(TRANSIT_EXIT, false); if (!isAnimating(TRANSITION | PARENTS)) { doAnimation = false; } } mLegacyPolicyVisibilityAfterAnim = false; final boolean isFocused = isFocused(); if (!doAnimation) { if (DEBUG_VISIBILITY) Slog.v(TAG, "Policy visibility false: " + this); clearPolicyVisibilityFlag(LEGACY_POLICY_VISIBILITY); // Window is no longer visible -- make sure if we were waiting // for it to be displayed before enabling the display, that // we allow the display to be enabled now. mWmService.enableScreenIfNeededLocked(); if (isFocused) { ProtoLog.i(WM_DEBUG_FOCUS_LIGHT, "WindowState.hideLw: setting mFocusMayChange true"); mWmService.mFocusMayChange = true; } } if (requestAnim) { mWmService.scheduleAnimationLocked(); } if (isFocused) { mWmService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, false /* updateImWindows */); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hide 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
hide
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public synchronized void moveToInsertRow() throws SQLException { checkUpdateable(); // make sure the underlying data is null clearRowBuffer(false); onInsertRow = true; doingUpdates = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveToInsertRow File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
moveToInsertRow
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public void onEnrollmentError(int errMsgId, CharSequence errString) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onEnrollmentError File: core/java/android/hardware/fingerprint/FingerprintManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
onEnrollmentError
core/java/android/hardware/fingerprint/FingerprintManager.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
final void setObject(CharSequence name, Object... values) { final AsciiString normalizedName = normalizeName(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (Object v: values) { requireNonNullElement(values, v); add0(h, i, normalizedName, fromObject(v)); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: setObject File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void setObject(CharSequence name, Object... values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (Object v: values) { requireNonNullElement(values, v); add0(h, i, normalizedName, fromObject(v)); } }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
setObject
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
protected final void _loadToHaveAtLeast(int minAvailable) throws IOException { // No input stream, no leading (either we are closed, or have non-stream input source) if (_inputStream == null) { throw _constructError("Needed to read "+minAvailable+" bytes, reached end-of-input"); } // Need to move remaining data in front? int amount = _inputEnd - _inputPtr; if (amount > 0 && _inputPtr > 0) { //_currInputRowStart -= _inputPtr; System.arraycopy(_inputBuffer, _inputPtr, _inputBuffer, 0, amount); _inputEnd = amount; } else { _inputEnd = 0; } // Needs to be done here, as per [dataformats-binary#178] _currInputProcessed += _inputPtr; _inputPtr = 0; while (_inputEnd < minAvailable) { int count = _inputStream.read(_inputBuffer, _inputEnd, _inputBuffer.length - _inputEnd); if (count < 1) { // End of input _closeInput(); // Should never return 0, so let's fail if (count == 0) { throw new IOException("InputStream.read() returned 0 characters when trying to read "+amount+" bytes"); } throw _constructError("Needed to read "+minAvailable+" bytes, missed "+minAvailable+" before end-of-input"); } _inputEnd += count; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _loadToHaveAtLeast File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_loadToHaveAtLeast
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@Override public boolean setProfileOwner(ComponentName who, int userHandle) { if (!mHasFeature) { logMissingFeatureAction("Cannot set " + ComponentName.flattenToShortString(who) + " as profile owner for user " + userHandle); return false; } Preconditions.checkArgument(who != null); final CallerIdentity caller = getCallerIdentity(); // Cannot be called while holding the lock: final boolean hasIncompatibleAccountsOrNonAdb = hasIncompatibleAccountsOrNonAdbNoLock(caller, userHandle, who); synchronized (getLockObject()) { enforceCanSetProfileOwnerLocked( caller, who, userHandle, hasIncompatibleAccountsOrNonAdb); final ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle); Preconditions.checkArgument( isPackageInstalledForUser(who.getPackageName(), userHandle) && admin != null && !getUserData(userHandle).mRemovingAdmins.contains(who), "Not active admin: " + who); final int parentUserId = getProfileParentId(userHandle); // When trying to set a profile owner on a new user, it may be that this user is // a profile - but it may not be a managed profile if there's a restriction on the // parent to add managed profiles (e.g. if the device has a device owner). if (parentUserId != userHandle && mUserManager.hasUserRestriction( UserManager.DISALLOW_ADD_MANAGED_PROFILE, UserHandle.of(parentUserId))) { Slogf.i(LOG_TAG, "Cannot set profile owner because of restriction."); return false; } if (isAdb(caller)) { // Log profile owner provisioning was started using adb. MetricsLogger.action(mContext, PROVISIONING_ENTRY_POINT_ADB, LOG_TAG_PROFILE_OWNER); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.PROVISIONING_ENTRY_POINT_ADB) .setAdmin(who) .setStrings(LOG_TAG_PROFILE_OWNER) .write(); } // Shutting down backup manager service permanently. toggleBackupServiceActive(userHandle, /* makeActive= */ false); mOwners.setProfileOwner(who, userHandle); mOwners.writeProfileOwner(userHandle); Slogf.i(LOG_TAG, "Profile owner set: " + who + " on user " + userHandle); mInjector.binderWithCleanCallingIdentity(() -> { if (mUserManager.isManagedProfile(userHandle)) { maybeSetDefaultRestrictionsForAdminLocked(userHandle, admin); ensureUnknownSourcesRestrictionForProfileOwnerLocked(userHandle, admin, true /* newOwner */); } sendOwnerChangedBroadcast(DevicePolicyManager.ACTION_PROFILE_OWNER_CHANGED, userHandle); }); mDeviceAdminServiceController.startServiceForAdmin( who.getPackageName(), userHandle, "set-profile-owner"); return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProfileOwner 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
setProfileOwner
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setDeviceProvisioningConfigApplied() { try { mService.setDeviceProvisioningConfigApplied(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDeviceProvisioningConfigApplied File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setDeviceProvisioningConfigApplied
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int getDefaultWorkers() { if (isDebug()) { return 1; } int workers = getConfiguredDefaultWorkersPerModel(); if (workers == 0) { workers = getNumberOfGpu(); } if (workers == 0) { workers = Runtime.getRuntime().availableProcessors(); } return workers; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultWorkers File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getDefaultWorkers
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
@GetMapping(value = "/{modelId}/json") @Authorize(action = Permission.ACTION_GET) public Object getEditorJson(@PathVariable String modelId) { JSONObject modelNode; Model model = repositoryService.getModel(modelId); if (model == null) throw new NullPointerException("模型不存在"); if (StringUtils.isNotEmpty(model.getMetaInfo())) { modelNode = JSON.parseObject(model.getMetaInfo()); } else { modelNode = new JSONObject(); modelNode.put(MODEL_NAME, model.getName()); } modelNode.put(MODEL_ID, model.getId()); modelNode.put("model", JSON.parse(new String(repositoryService.getModelEditorSource(model.getId())))); return modelNode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEditorJson File: hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/FlowableModelManagerController.java Repository: hs-web/hsweb-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-20594
MEDIUM
4.3
hs-web/hsweb-framework
getEditorJson
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/FlowableModelManagerController.java
b72a2275ed21240296c6539bae1049c56abb542f
0
Analyze the following code function for security vulnerabilities
public synchronized void deleteView(View view) throws IOException { viewGroupMixIn.deleteView(view); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteView 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
deleteView
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private XWikiDocument prepareDocumentDelete(XWikiDocument doc, XWikiContext context) { // The source document is a new empty XWikiDocument to follow // DocumentUpdatedEvent policy: source document in new document and the old version is available using // doc.getOriginalDocument() XWikiDocument blankDoc = new XWikiDocument(doc.getDocumentReference()); // Again to follow general event policy, new document author is the user who modified the document // (here the modification is delete) blankDoc.setOriginalDocument(doc.getOriginalDocument()); blankDoc.setAuthorReference(context.getUserReference()); blankDoc.setContentAuthorReference(context.getUserReference()); return blankDoc; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareDocumentDelete 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
prepareDocumentDelete
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public final int getWidth() { return mWidth; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWidth File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getWidth
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
String getTypeName() { return name; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTypeName File: modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21428
MEDIUM
4.4
OpenAPITools/openapi-generator
getTypeName
modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java
be64b6f1b3d4d7b6cfdce12c0f3953be6a1ff195
0
Analyze the following code function for security vulnerabilities
public boolean onHoverEvent(MotionEvent event) { TraceEvent.begin("onHoverEvent"); MotionEvent offset = createOffsetMotionEvent(event); try { if (mBrowserAccessibilityManager != null) { return mBrowserAccessibilityManager.onHoverEvent(offset); } // Work around Android bug where the x, y coordinates of a hover exit // event are incorrect when touch exploration is on. if (mTouchExplorationEnabled && offset.getAction() == MotionEvent.ACTION_HOVER_EXIT) { return true; } mContainerView.removeCallbacks(mFakeMouseMoveRunnable); if (mNativeContentViewCore != 0) { nativeSendMouseMoveEvent(mNativeContentViewCore, offset.getEventTime(), offset.getX(), offset.getY()); } return true; } finally { offset.recycle(); TraceEvent.end("onHoverEvent"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onHoverEvent File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onHoverEvent
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0