instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public boolean setProcessMemoryTrimLevel(String process, int uid, int level) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessMemoryTrimLevel File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
setProcessMemoryTrimLevel
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public static File createTempFile() throws IOException { final List<IOException> exs = new ArrayList<>(); final File file = AccessController.doPrivileged(new PrivilegedAction<File>() { public File run() { File tempFile = null; try { tempFile = Files.createTempFile("rep", "tmp").toFile(); // Make sure the file is deleted when JVM is shutdown at last. tempFile.deleteOnExit(); } catch (IOException e) { exs.add(e); } return tempFile; } }); if (!exs.isEmpty()) { throw exs.get(0); } return file; }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2021-28168 - Severity: LOW - CVSS Score: 2.1 Description: atomicReference instead of collection Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com> Function: createTempFile File: core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java Repository: eclipse-ee4j/jersey Fixed Code: public static File createTempFile() throws IOException { final AtomicReference<IOException> exceptionReference = new AtomicReference<>(); final File file = AccessController.doPrivileged(new PrivilegedAction<File>() { public File run() { File tempFile = null; try { tempFile = Files.createTempFile("rep", "tmp").toFile(); // Make sure the file is deleted when JVM is shutdown at last. tempFile.deleteOnExit(); } catch (IOException e) { exceptionReference.set(e); } return tempFile; } }); if (exceptionReference.get() != null) { throw exceptionReference.get(); } return file; }
[ "CWE-668" ]
CVE-2021-28168
LOW
2.1
eclipse-ee4j/jersey
createTempFile
core-common/src/main/java/org/glassfish/jersey/message/internal/Utils.java
c9497de670901cb088c37aff8e691ea34d65297a
1
Analyze the following code function for security vulnerabilities
private PluginArtifactPullReq getPluginArtifactPullRequestEntity(PluginArtifactPullContext ctx) { PluginArtifactPullReq reqEntity = pluginArtifactPullReqMapper.selectByPrimaryKey(ctx.getRequestId()); if (reqEntity == null) { reqEntity = ctx.getEntity(); } if (reqEntity == null) { throw new WecubeCoreException("3102", String.format("Request entity %s does not exist", ctx.getRequestId()), ctx.getRequestId()); } return reqEntity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPluginArtifactPullRequestEntity File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
getPluginArtifactPullRequestEntity
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
private boolean nonSuperUser( User currentUser ) { return Objects.nonNull( currentUser ) && !currentUser.isSuper(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nonSuperUser File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java Repository: dhis2/dhis2-core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24848
MEDIUM
6.5
dhis2/dhis2-core
nonSuperUser
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/ProgramOrganisationUnitAssociationsQueryBuilder.java
3b245d04a58b78f0dc9bae8559f36ee4ca36dfac
0
Analyze the following code function for security vulnerabilities
public void setRequestStatus(RequestStatus requestStatus) { this.requestStatus = requestStatus; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestStatus File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setRequestStatus
base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public void writeStatus(final int iStatus, final String iReason) throws IOException { writeLine(httpVersion + " " + iStatus + " " + iReason); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeStatus File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
writeStatus
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
@Override protected boolean shouldUseStaticFilter() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldUseStaticFilter File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
shouldUseStaticFilter
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
default void onConnectChoiceRemoved(String choiceKey){ }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onConnectChoiceRemoved 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
onConnectChoiceRemoved
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public List<Group> search(Context context, String groupIdentifier, int offset, int limit) throws SQLException { List<Group> groups = new ArrayList<>(); UUID uuid = UUIDUtils.fromString(groupIdentifier); if (uuid == null) { //Search by group name groups = groupDAO.findByNameLike(context, groupIdentifier, offset, limit); } else { //Search by group id Group group = find(context, uuid); if (group != null) { groups.add(group); } } return groups; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: search File: dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
search
dspace-api/src/main/java/org/dspace/eperson/GroupServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
@Override public void executeMessage(Message message) { switch (message.what) { case DO_ON_ACCESSIBILITY_EVENT: { AccessibilityEvent event = (AccessibilityEvent) message.obj; if (event != null) { AccessibilityInteractionClient.getInstance().onAccessibilityEvent(event); mCallback.onAccessibilityEvent(event); // Make sure the event is recycled. try { event.recycle(); } catch (IllegalStateException ise) { /* ignore - best effort */ } } } return; case DO_ON_INTERRUPT: { mCallback.onInterrupt(); } return; case DO_INIT: { mConnectionId = message.arg1; SomeArgs args = (SomeArgs) message.obj; IAccessibilityServiceConnection connection = (IAccessibilityServiceConnection) args.arg1; IBinder windowToken = (IBinder) args.arg2; args.recycle(); if (connection != null) { AccessibilityInteractionClient.getInstance().addConnection(mConnectionId, connection); mCallback.init(mConnectionId, windowToken); mCallback.onServiceConnected(); } else { AccessibilityInteractionClient.getInstance().removeConnection( mConnectionId); mConnectionId = AccessibilityInteractionClient.NO_ID; AccessibilityInteractionClient.getInstance().clearCache(); mCallback.init(AccessibilityInteractionClient.NO_ID, null); } } return; case DO_ON_GESTURE: { final int gestureId = message.arg1; mCallback.onGesture(gestureId); } return; case DO_CLEAR_ACCESSIBILITY_CACHE: { AccessibilityInteractionClient.getInstance().clearCache(); } return; case DO_ON_KEY_EVENT: { KeyEvent event = (KeyEvent) message.obj; try { IAccessibilityServiceConnection connection = AccessibilityInteractionClient .getInstance().getConnection(mConnectionId); if (connection != null) { final boolean result = mCallback.onKeyEvent(event); final int sequence = message.arg1; try { connection.setOnKeyEventResult(result, sequence); } catch (RemoteException re) { /* ignore */ } } } finally { // Make sure the event is recycled. try { event.recycle(); } catch (IllegalStateException ise) { /* ignore - best effort */ } } } return; case DO_ON_MAGNIFICATION_CHANGED: { final SomeArgs args = (SomeArgs) message.obj; final Region region = (Region) args.arg1; final float scale = (float) args.arg2; final float centerX = (float) args.arg3; final float centerY = (float) args.arg4; mCallback.onMagnificationChanged(region, scale, centerX, centerY); } return; case DO_ON_SOFT_KEYBOARD_SHOW_MODE_CHANGED: { final int showMode = (int) message.arg1; mCallback.onSoftKeyboardShowModeChanged(showMode); } return; case DO_GESTURE_COMPLETE: { final boolean successfully = message.arg2 == 1; mCallback.onPerformGestureResult(message.arg1, successfully); } return; default : Log.w(LOG_TAG, "Unknown message type " + message.what); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeMessage File: core/java/android/accessibilityservice/AccessibilityService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3923
MEDIUM
4.3
android
executeMessage
core/java/android/accessibilityservice/AccessibilityService.java
5f256310187b4ff2f13a7abb9afed9126facd7bc
0
Analyze the following code function for security vulnerabilities
public String getContextPath() { return this.contextPath; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContextPath File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
getContextPath
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
void initAttributeSet(Element parentElt, AttributeSet attrs, AttributeDefaultProvider defaults) throws XmlReaderException { ArrayList<String> messages = null; HashMap<String, String> attrsDefined = new HashMap<String, String>(); for (Element attrElt : XmlIterator.forChildElements(parentElt, "a")) { if (!attrElt.hasAttribute("name")) { if (messages == null) messages = new ArrayList<String>(); messages.add(Strings.get("attrNameMissingError")); } else { String attrName = attrElt.getAttribute("name"); String attrVal; if (attrElt.hasAttribute("val")) { attrVal = attrElt.getAttribute("val"); if (attrName.equals("filePath")) { /* De-relativize the path */ String dirPath = ""; if (srcFilePath != null) dirPath = srcFilePath .substring(0, srcFilePath .lastIndexOf(File.separator)); Path tmp = Paths.get(dirPath, attrVal); attrVal = tmp.toString(); } } else { attrVal = attrElt.getTextContent(); } attrsDefined.put(attrName, attrVal); } } if (attrs == null) return; LogisimVersion ver = sourceVersion; boolean setDefaults = defaults != null && !defaults.isAllDefaultValues(attrs, ver); // We need to process this in order, and we have to refetch the // attribute list each time because it may change as we iterate // (as it will for a splitter). for (int i = 0; true; i++) { List<Attribute<?>> attrList = attrs.getAttributes(); if (i >= attrList.size()) break; @SuppressWarnings("unchecked") Attribute<Object> attr = (Attribute<Object>) attrList.get(i); String attrName = attr.getName(); String attrVal = attrsDefined.get(attrName); if (attrVal == null) { if (setDefaults) { Object val = defaults.getDefaultAttributeValue(attr, ver); if (val != null) { attrs.setValue(attr, val); } } } else { try { Object val = attr.parse(attrVal); attrs.setValue(attr, val); } catch (NumberFormatException e) { if (messages == null) messages = new ArrayList<String>(); messages.add(StringUtil.format( Strings.get("attrValueInvalidError"), attrVal, attrName)); } } } if (messages != null) { throw new XmlReaderException(messages); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initAttributeSet 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
initAttributeSet
src/com/cburch/logisim/file/XmlReader.java
90aee8f8ceef463884cc400af4f6d1f109fb0972
0
Analyze the following code function for security vulnerabilities
@RequestMapping({"/embed/userview/(*:appId)/(*:userviewId)/(~:key)","/embed/userview/(*:appId)/(*:userviewId)","/embed/userview/(*:appId)/(*:userviewId)/(*:key)/(*:menuId)"}) public String embedView(ModelMap map, HttpServletRequest request, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam("userviewId") String userviewId, @RequestParam(value = "menuId", required = false) String menuId, @RequestParam(value = "key", required = false) String key, Boolean embed, @RequestParam(value = "embed", required = false) Boolean embedParam) throws Exception { if (APMUtil.isGlowrootAvailable()) { //remove key & embed keyword from the url for better tracking String url = request.getRequestURL().toString(); url = url.substring(0, url.indexOf("/userview")) + "/userview/" + appId + "/" + userviewId; if (menuId != null && !menuId.isEmpty()) { url += "/" + menuId; } APMUtil.setTransactionName(url, 1001); } // validate input appId = SecurityUtil.validateStringInput(appId); userviewId = SecurityUtil.validateStringInput(userviewId); menuId = SecurityUtil.validateStringInput(menuId); key = SecurityUtil.validateStringInput(key); SecurityUtil.validateBooleanInput(embed); SecurityUtil.validateBooleanInput(embedParam); if (embedParam != null && !embedParam) { //exit embed mode by param return "redirect:/web/userview/" + appId + "/" + userviewId + "/" + ((key != null )?key:"") + "/" + menuId + '?' +StringUtil.decodeURL(request.getQueryString()); } else if (embed == null) { embed = true; } //check for empty key if (key != null && key.equals(Userview.USERVIEW_KEY_EMPTY_VALUE)) { key = ""; } // retrieve app and userview AppDefinition appDef = appService.getPublishedAppDefinition(appId); if (appDef == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return null; } map.addAttribute("appId", appDef.getId()); map.addAttribute("appDefinition", appDef); map.addAttribute("appVersion", appDef.getVersion()); map.addAttribute("key", key); map.addAttribute("menuId", menuId); map.addAttribute("embed", embed); map.addAttribute("queryString", request.getQueryString()); if (userviewService.isDefaultUserview(appDef.getId(), userviewId)) { request.setAttribute("isDefaultUserview", Boolean.TRUE); } UserviewDefinition userview = userviewDefinitionDao.loadById(userviewId, appDef); if (userview != null) { String json = userview.getJson(); Userview userviewObject = userviewService.createUserview(json, menuId, false, request.getContextPath(), request.getParameterMap(), key, embed); UserviewThemeProcesser processer = new UserviewThemeProcesser(userviewObject, request); map.addAttribute("userview", userviewObject); map.addAttribute("processer", processer); String view = processer.getView(); if (view != null) { if (view.startsWith("redirect:")) { map.clear(); } return view; } } return "ubuilder/view"; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-4560 - Severity: MEDIUM - CVSS Score: 6.1 Description: Fixed: wflow-core - Userview - Fixed XSS issue on key parameter. @7.0-SNAPSHOT Function: embedView File: wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java Repository: jogetworkflow/jw-community Fixed Code: @RequestMapping({"/embed/userview/(*:appId)/(*:userviewId)/(~:key)","/embed/userview/(*:appId)/(*:userviewId)","/embed/userview/(*:appId)/(*:userviewId)/(*:key)/(*:menuId)"}) public String embedView(ModelMap map, HttpServletRequest request, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam("userviewId") String userviewId, @RequestParam(value = "menuId", required = false) String menuId, @RequestParam(value = "key", required = false) String key, Boolean embed, @RequestParam(value = "embed", required = false) Boolean embedParam) throws Exception { if (APMUtil.isGlowrootAvailable()) { //remove key & embed keyword from the url for better tracking String url = request.getRequestURL().toString(); url = url.substring(0, url.indexOf("/userview")) + "/userview/" + appId + "/" + userviewId; if (menuId != null && !menuId.isEmpty()) { url += "/" + menuId; } APMUtil.setTransactionName(url, 1001); } // validate input appId = SecurityUtil.validateStringInput(appId); userviewId = SecurityUtil.validateStringInput(userviewId); menuId = SecurityUtil.validateStringInput(menuId); key = SecurityUtil.validateStringInput(key); SecurityUtil.validateBooleanInput(embed); SecurityUtil.validateBooleanInput(embedParam); if (embedParam != null && !embedParam) { //exit embed mode by param return "redirect:/web/userview/" + appId + "/" + userviewId + "/" + ((key != null )?key:"") + "/" + menuId + '?' +StringUtil.decodeURL(request.getQueryString()); } else if (embed == null) { embed = true; } //check for empty key if (key == null || (key != null && key.equals(Userview.USERVIEW_KEY_EMPTY_VALUE))) { key = ""; } // retrieve app and userview AppDefinition appDef = appService.getPublishedAppDefinition(appId); if (appDef == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return null; } map.addAttribute("appId", appDef.getId()); map.addAttribute("appDefinition", appDef); map.addAttribute("appVersion", appDef.getVersion()); map.addAttribute("key", key); map.addAttribute("menuId", menuId); map.addAttribute("embed", embed); map.addAttribute("queryString", request.getQueryString()); if (userviewService.isDefaultUserview(appDef.getId(), userviewId)) { request.setAttribute("isDefaultUserview", Boolean.TRUE); } UserviewDefinition userview = userviewDefinitionDao.loadById(userviewId, appDef); if (userview != null) { String json = userview.getJson(); Userview userviewObject = userviewService.createUserview(json, menuId, false, request.getContextPath(), request.getParameterMap(), key, embed); UserviewThemeProcesser processer = new UserviewThemeProcesser(userviewObject, request); map.addAttribute("userview", userviewObject); map.addAttribute("processer", processer); String view = processer.getView(); if (view != null) { if (view.startsWith("redirect:")) { map.clear(); } return view; } } return "ubuilder/view"; }
[ "CWE-79" ]
CVE-2022-4560
MEDIUM
6.1
jogetworkflow/jw-community
embedView
wflow-consoleweb/src/main/java/org/joget/apps/app/controller/UserviewWebController.java
ecf8be8f6f0cb725c18536ddc726d42a11bdaa1b
1
Analyze the following code function for security vulnerabilities
public String getMavenVersion() throws Exception { String version = getVersion(); int index = version.indexOf('-'); if (index > 0) { version = version.substring(0, index) + "-SNAPSHOT"; } return version; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMavenVersion File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
getMavenVersion
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private HashSet<String> dataChangedTargets(String packageName) { // If the caller does not hold the BACKUP permission, it can only request a // backup of its own data. if ((mContext.checkPermission(android.Manifest.permission.BACKUP, Binder.getCallingPid(), Binder.getCallingUid())) == PackageManager.PERMISSION_DENIED) { synchronized (mBackupParticipants) { return mBackupParticipants.get(Binder.getCallingUid()); } } // a caller with full permission can ask to back up any participating app HashSet<String> targets = new HashSet<String>(); if (PACKAGE_MANAGER_SENTINEL.equals(packageName)) { targets.add(PACKAGE_MANAGER_SENTINEL); } else { synchronized (mBackupParticipants) { int N = mBackupParticipants.size(); for (int i = 0; i < N; i++) { HashSet<String> s = mBackupParticipants.valueAt(i); if (s != null) { targets.addAll(s); } } } } return targets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dataChangedTargets File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
dataChangedTargets
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private void setOverrideApnsEnabledUnchecked(boolean enabled) { ContentValues value = new ContentValues(); value.put(ENFORCE_KEY, enabled); mInjector.binderWithCleanCallingIdentity(() -> mContext.getContentResolver().update( ENFORCE_MANAGED_URI, value, null, null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOverrideApnsEnabledUnchecked 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
setOverrideApnsEnabledUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void addAccountAsUser(final IAccountManagerResponse response, final String accountType, final String authTokenType, final String[] requiredFeatures, final boolean expectActivityLaunch, final Bundle optionsIn, int userId) { Bundle.setDefusable(optionsIn, true); int callingUid = Binder.getCallingUid(); if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "addAccount: accountType " + accountType + ", response " + response + ", authTokenType " + authTokenType + ", requiredFeatures " + Arrays.toString(requiredFeatures) + ", expectActivityLaunch " + expectActivityLaunch + ", caller's uid " + Binder.getCallingUid() + ", pid " + Binder.getCallingPid() + ", for user id " + userId); } Preconditions.checkArgument(response != null, "response cannot be null"); Preconditions.checkArgument(accountType != null, "accountType cannot be null"); // Only allow the system process to add accounts of other users if (isCrossUser(callingUid, userId)) { throw new SecurityException( String.format( "User %s trying to add account for %s" , UserHandle.getCallingUserId(), userId)); } // Is user disallowed from modifying accounts? if (!canUserModifyAccounts(userId, callingUid)) { try { response.onError(AccountManager.ERROR_CODE_USER_RESTRICTED, "User is not allowed to add an account!"); } catch (RemoteException re) { } showCantAddAccount(AccountManager.ERROR_CODE_USER_RESTRICTED, userId); return; } if (!canUserModifyAccountsForType(userId, accountType, callingUid)) { try { response.onError(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE, "User cannot modify accounts of this type (policy)."); } catch (RemoteException re) { } showCantAddAccount(AccountManager.ERROR_CODE_MANAGEMENT_DISABLED_FOR_ACCOUNT_TYPE, userId); return; } addAccountAndLogMetrics(response, accountType, authTokenType, requiredFeatures, expectActivityLaunch, optionsIn, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAccountAsUser File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
addAccountAsUser
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public void setHasOverlayUi(int pid, boolean hasOverlayUi) { synchronized (ActivityManagerService.this) { final ProcessRecord pr; synchronized (mPidsSelfLocked) { pr = mPidsSelfLocked.get(pid); if (pr == null) { Slog.w(TAG, "setHasOverlayUi called on unknown pid: " + pid); return; } } if (pr.mState.hasOverlayUi() == hasOverlayUi) { return; } pr.mState.setHasOverlayUi(hasOverlayUi); //Slog.i(TAG, "Setting hasOverlayUi=" + pr.hasOverlayUi + " for pid=" + pid); updateOomAdjLocked(pr, OomAdjuster.OOM_ADJ_REASON_UI_VISIBILITY); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHasOverlayUi 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
setHasOverlayUi
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void delete(AsyncResult<SQLConnection> connection, String table, CQLWrapper cql, Handler<AsyncResult<UpdateResult>> replyHandler) { try { String where = cql == null ? "" : cql.toString(); doDelete(connection, table, where, replyHandler); } catch (Exception e) { replyHandler.handle(Future.failedFuture(e)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
delete
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
protected void showRenderedPage() { if (mNativePage == null) return; NativePage previousNativePage = mNativePage; mNativePage = null; for (TabObserver observer : mObservers) observer.onContentChanged(this); destroyNativePageInternal(previousNativePage); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showRenderedPage 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
showRenderedPage
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private static void zipFolders(final File folder, final ZipOutputStream outputStream) throws BrutException, IOException { processFolder(folder, outputStream, folder.getPath().length() + 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: zipFolders File: brut.j.dir/src/main/java/brut/directory/ZipUtils.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
zipFolders
brut.j.dir/src/main/java/brut/directory/ZipUtils.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
@Override public int read() throws IOException { int readLen = read(singleByteBuffer); if (readLen == -1) { return -1; } return singleByteBuffer[0] & 0xff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: read File: src/main/java/net/lingala/zip4j/io/inputstream/CipherInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
read
src/main/java/net/lingala/zip4j/io/inputstream/CipherInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
private void add0(int h, int i, K name, V value) { // Update the hash table. entries[i] = newHeaderEntry(h, name, value, entries[i]); ++size; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: add0 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
add0
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
private void cancel() { synchronized (mInnerLock) { mIsFinished = true; cancelAlarmLocked(); try { mActivityManager.removeOnUidImportanceListener(mStartTimerListener); } catch (IllegalArgumentException e) { Log.e(LOG_TAG, "Could not remove start timer listener", e); } try { mActivityManager.removeOnUidImportanceListener(mSessionKillableListener); } catch (IllegalArgumentException e) { Log.e(LOG_TAG, "Could not remove session killable listener", e); } try { mActivityManager.removeOnUidImportanceListener(mGoneListener); } catch (IllegalArgumentException e) { Log.e(LOG_TAG, "Could not remove gone listener", e); } } }
Vulnerability Classification: - CWE: CWE-281 - CVE: CVE-2023-21249 - Severity: MEDIUM - CVSS Score: 5.5 Description: Watch uid proc state instead of importance for 1-time permissions The system process may bind to an app with the flag BIND_FOREGROUND_SERVICE, this will put the client in the foreground service importance level without the normal requirement that foreground services must show a notification. Looking at proc states instead allows us to differentiate between these two levels of foreground service and revoke the client when not in use. This change makes the parameters `importanceToResetTimer` and `importanceToKeepSessionAlive` in PermissionManager#startOneTimePermissionSession obsolete. Test: atest CtsPermissionTestCases + manual testing with mic/cam/loc Bug: 217981062 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0be78fbbf7d92bf29858aa0c48b171045ab5057f) Merged-In: I7a725647c001062d1a76a82b680a02e3e2edcb03 Change-Id: I7a725647c001062d1a76a82b680a02e3e2edcb03 Function: cancel File: services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java Repository: android Fixed Code: private void cancel() { synchronized (mInnerLock) { mIsFinished = true; cancelAlarmLocked(); try { mIActivityManager.unregisterUidObserver(mObserver); } catch (RemoteException e) { Log.e(LOG_TAG, "Unable to unregister uid observer.", e); } } }
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
cancel
services/core/java/com/android/server/pm/permission/OneTimePermissionUserManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
1
Analyze the following code function for security vulnerabilities
void updateDemandIssueLink(EditTestCaseRequest testCase, Project project);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateDemandIssueLink File: framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
updateDemandIssueLink
framework/sdk-parent/xpack-interface/src/main/java/io/metersphere/xpack/track/issue/IssuesPlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public BaseObject getXObject(EntityReference reference) { if (reference instanceof DocumentReference) { return getXObject((DocumentReference) reference); } else if (reference.getType() == EntityType.DOCUMENT) { // class reference return getXObject( getCurrentReferenceDocumentReferenceResolver().resolve(reference, getDocumentReference())); } else if (reference.getType() == EntityType.OBJECT) { // object reference return getXObject(getCurrentReferenceObjectReferenceResolver().resolve(reference, getDocumentReference())); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXObject 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
getXObject
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
@VisibleForTesting final File getUserFile(@UserIdInt int userId) { return new File(injectUserDataPath(userId), FILENAME_USER_PACKAGES); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserFile File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40092
MEDIUM
5.5
android
getUserFile
services/core/java/com/android/server/pm/ShortcutService.java
a5e55363e69b3c84d3f4011c7b428edb1a25752c
0
Analyze the following code function for security vulnerabilities
@Override protected void readLongToBcd(long n) { assert n != 0; if (n >= 10000000000000000L) { ensureCapacity(); int i = 0; for (; n != 0L; n /= 10L, i++) { bcdBytes[i] = (byte) (n % 10); } assert usingBytes; scale = 0; precision = i; } else { long result = 0L; int i = 16; for (; n != 0L; n /= 10L, i--) { result = (result >>> 4) + ((n % 10) << 60); } assert i >= 0; assert !usingBytes; bcdLong = result >>> (i * 4); scale = 0; precision = 16 - i; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readLongToBcd File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
readLongToBcd
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
@Override public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags) { enforceNotIsolatedCaller("getServices"); final int callingUid = Binder.getCallingUid(); final boolean canInteractAcrossUsers = (ActivityManager.checkUidPermission( INTERACT_ACROSS_USERS_FULL, callingUid) == PERMISSION_GRANTED); final boolean allowed = mAtmInternal.isGetTasksAllowed("getServices", Binder.getCallingPid(), callingUid); synchronized (this) { return mServices.getRunningServiceInfoLocked(maxNum, flags, callingUid, allowed, canInteractAcrossUsers); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServices 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
getServices
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public StackInfo getStackInfo(int stackId) { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "getStackInfo()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { return mStackSupervisor.getStackInfoLocked(stackId); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStackInfo File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
getStackInfo
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public boolean isStopping() { return stopping.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isStopping File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
isStopping
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public @Nullable CharSequence getLongSupportMessageForUser( @NonNull ComponentName admin, int userHandle) { if (mService != null) { try { return mService.getLongSupportMessageForUser(admin, userHandle); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLongSupportMessageForUser 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
getLongSupportMessageForUser
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings({"rawtypes", "unchecked"}) public Jooby bind(final Object service) { use((env, conf, binder) -> { Class type = service.getClass(); binder.bind(type).toInstance(service); }); 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 static XMLTypeValidator createXMLTypeValidator(String xmlSchema) { try { // create a SchemaFactory capable of understanding WXS schemas SchemaFactory factory = createSchemaFactoryInstance(); // load a WXS schema, represented by a Schema instance Source xmlSchemaSource = new StreamSource(new StringReader(xmlSchema)); return new XMLTypeValidator(factory.newSchema(xmlSchemaSource).newValidator()); } catch (SAXException e) { e.printStackTrace(); return null; } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-12544 - Severity: HIGH - CVSS Score: 7.5 Description: Added a test to verify XXE Function: createXMLTypeValidator File: vertx-web-api-contract/src/main/java/io/vertx/ext/web/api/validation/impl/XMLTypeValidator.java Repository: vert-x3/vertx-web Fixed Code: public static XMLTypeValidator createXMLTypeValidator(String xmlSchema) { try { // create a SchemaFactory capable of understanding WXS schemas SchemaFactory factory = createSchemaFactoryInstance(); // load a WXS schema, represented by a Schema instance Source xmlSchemaSource = new StreamSource(new StringReader(xmlSchema)); return new XMLTypeValidator(factory.newSchema(xmlSchemaSource).newValidator()); } catch (SAXException e) { throw new RuntimeException(e); } }
[ "CWE-611" ]
CVE-2018-12544
HIGH
7.5
vert-x3/vertx-web
createXMLTypeValidator
vertx-web-api-contract/src/main/java/io/vertx/ext/web/api/validation/impl/XMLTypeValidator.java
26db16c7b32e655b489d1a71605f9a785f788e41
1
Analyze the following code function for security vulnerabilities
@Override public char getChar(K name, char defaultValue) { Character v = getChar(name); return v != null ? v : defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChar 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
getChar
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@NonNull public BubbleMetadata.Builder setSuppressNotification(boolean shouldSuppressNotif) { setFlag(FLAG_SUPPRESS_NOTIFICATION, shouldSuppressNotif); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSuppressNotification File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setSuppressNotification
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
private Boolean isPathContext(char c) { return (c == DOC_CONTEXT || c == EVAL_CONTEXT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPathContext File: json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java Repository: json-path/JsonPath The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-51074
MEDIUM
5.3
json-path/JsonPath
isPathContext
json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java
f49ff25e3bad8c8a0c853058181f2c00b5beb305
0
Analyze the following code function for security vulnerabilities
private void handleKeyguardDoneDrawing() { Trace.beginSection("KeyguardViewMediator#handleKeyguardDoneDrawing"); synchronized(this) { if (DEBUG) Log.d(TAG, "handleKeyguardDoneDrawing"); if (mWaitingUntilKeyguardVisible) { if (DEBUG) Log.d(TAG, "handleKeyguardDoneDrawing: notifying mWaitingUntilKeyguardVisible"); mWaitingUntilKeyguardVisible = false; notifyAll(); // there will usually be two of these sent, one as a timeout, and one // as a result of the callback, so remove any remaining messages from // the queue mHandler.removeMessages(KEYGUARD_DONE_DRAWING); } } Trace.endSection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleKeyguardDoneDrawing File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
handleKeyguardDoneDrawing
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override public void showScreenPinningRequest(int taskId) { if (mKeyguardMonitor.isShowing()) { // Don't allow apps to trigger this from keyguard. return; } // Show screen pinning request, since this comes from an app, show 'no thanks', button. showScreenPinningRequest(taskId, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showScreenPinningRequest File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
showScreenPinningRequest
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private static void deleteDirectory(File directory) { /** * Go through each directory and check if it's not empty. We need to * delete files inside a directory before a directory can be deleted. **/ File[] files = directory.listFiles(); for (File file : files) { if (file.isDirectory()) { deleteDirectory(file); } else { file.delete(); } } // Now that the directory is empty. Delete it. directory.delete(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteDirectory File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
deleteDirectory
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
public boolean isMetadataEncrypted() { if (decrypt == null) return false; else return decrypt.isMetadataEncrypted(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMetadataEncrypted File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
isMetadataEncrypted
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@PUT @Path("{userId}/status/{newStatus}") @Consumes(MediaType.WILDCARD) @ApiOperation("Update the account status for a user") @AuditEvent(type = AuditEventTypes.USER_UPDATE) public Response updateAccountStatus( @ApiParam(name = "userId", value = "The id of the user whose status to change.", required = true) @PathParam("userId") @NotBlank String userId, @ApiParam(name = "newStatus", value = "The account status to be set", required = true, defaultValue = "enabled", allowableValues = "enabled,disabled,deleted") @PathParam("newStatus") @NotBlank String newStatusString, @Context UserContext userContext) throws ValidationException { if (userId.equalsIgnoreCase(userContext.getUserId())) { throw new BadRequestException("Users are not allowed to set their own status"); } final User.AccountStatus newStatus = User.AccountStatus.valueOf(newStatusString.toUpperCase(Locale.US)); final User user = loadUserById(userId); checkPermission(RestPermissions.USERS_EDIT, user.getName()); final User.AccountStatus oldStatus = user.getAccountStatus(); if (oldStatus.equals(newStatus)) { return Response.notModified().build(); } userManagementService.setUserStatus(user, newStatus); return Response.ok().build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAccountStatus File: graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
updateAccountStatus
graylog2-server/src/main/java/org/graylog2/rest/resources/users/UsersResource.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
@Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.hasModifiers(KeyEvent.META_CTRL_ON) && keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) { doSend(); return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onKey File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
onKey
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
@Override public void splitFromConference(String callId, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitFromConference File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
splitFromConference
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public boolean containsErrors() { return !mErrors.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsErrors File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
containsErrors
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
@Test public void testSerializationAsTimestamp02Milliseconds() throws Exception { Instant date = Instant.ofEpochSecond(123456789L, 183917322); String value = MAPPER.writer() .with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .without(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS) .writeValueAsString(date); assertEquals("The value is not correct.", "123456789183", value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testSerializationAsTimestamp02Milliseconds File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testSerializationAsTimestamp02Milliseconds
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
private boolean isLeanbackOnlyDevice() { boolean onLeanbackOnly = false; try { onLeanbackOnly = AppGlobals.getPackageManager().hasSystemFeature( PackageManager.FEATURE_LEANBACK_ONLY); } catch (RemoteException e) { // noop } return onLeanbackOnly; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLeanbackOnlyDevice 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
isLeanbackOnlyDevice
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public void setCarrierId(int carrierId) { this.mCarrierId = carrierId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCarrierId File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
setCarrierId
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public void log(String filename, String msg) { try { BufferedWriter out = new BufferedWriter(new FileWriter(filename, true)); out.append(msg + "\r\n"); out.close(); } catch (IOException e) { e.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: log File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java Repository: jflyfox/jfinal_cms The code follows secure coding practices.
[ "CWE-74" ]
CVE-2021-37262
MEDIUM
5
jflyfox/jfinal_cms
log
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
e7fd0fe9362464c4d2bd308318eecc89a847b116
0
Analyze the following code function for security vulnerabilities
@Override public R getNearestBuild(int n) { return builds.search(n, Direction.ASC); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNearestBuild File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getNearestBuild
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
private boolean acquireWakeLock(String lockName) { if (mWakeLock != null) { if (!lockName.equals(mWakeLockName)) { errorLog("Multiple wake lock acquisition attempted; aborting: " + lockName); return false; } // We're already holding the desired wake lock so return success. if (mWakeLock.isHeld()) { return true; } } mWakeLockName = lockName; mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, lockName); mWakeLock.acquire(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: acquireWakeLock File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
acquireWakeLock
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition get(final String path, final Route.ZeroArgHandler handler) { return appendDefinition(GET, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get 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
get
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@LargeTest @Test public void testIsOutgoingCallPermittedOngoingHoldable() throws Exception { // Start a regular call; the self-managed CS can make a call now since ongoing call can be // held IdPair ids = startAndMakeActiveIncomingCall("650-555-1212", mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA); assertEquals(Call.STATE_ACTIVE, mInCallServiceFixtureX.getCall(ids.mCallId).getState()); assertTrue(mTelecomSystem.getTelecomServiceImpl().getBinder() .isOutgoingCallPermitted(mPhoneAccountSelfManaged.getAccountHandle(), mPhoneAccountSelfManaged.getAccountHandle().getComponentName() .getPackageName())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testIsOutgoingCallPermittedOngoingHoldable File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testIsOutgoingCallPermittedOngoingHoldable
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public PutMethod executePut(Object resourceUri, Object restObject, Object... elements) throws Exception { return executePut(resourceUri, restObject, Collections.<String, Object[]>emptyMap(), elements); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executePut File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
executePut
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
private DocumentRevisionProvider getDocumentRevisionProvider() { if (this.documentRevisionProvider == null) { this.documentRevisionProvider = Utils.getComponent(DocumentRevisionProvider.class); } return this.documentRevisionProvider; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentRevisionProvider File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
getDocumentRevisionProvider
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SaveAction.java
30c52b01559b8ef5ed1035dac7c34aaf805764d5
0
Analyze the following code function for security vulnerabilities
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mResponseCode); if (mResponseCode == RESPONSE_RETRY) { dest.writeInt(mTimeout); } else if (mResponseCode == RESPONSE_OK) { dest.writeInt(mShouldReEnroll ? 1 : 0); if (mPayload != null) { dest.writeInt(mPayload.length); dest.writeByteArray(mPayload); } } }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2017-0806 - Severity: HIGH - CVSS Score: 9.3 Description: Fix security hole in GateKeeperResponse. GateKeeperResponse has inconsistent writeToParcel() and createFromParcel() methods, making it possible for a malicious app to create a Bundle that changes contents after reserialization. Such Bundles can be used to execute Intents with system privileges. This CL changes writeToParcel() to make serialization and deserialization consistent, thus fixing the issue. Bug: 62998805 Test: use the debug app (see bug) Change-Id: Ie1c64172c454c3a4b7a0919eb3454f0e38efcd09 (cherry picked from commit e74cae8f7c3e6b12f2bf2b75427ee8f5b53eca3c) Function: writeToParcel File: core/java/android/service/gatekeeper/GateKeeperResponse.java Repository: android Fixed Code: @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mResponseCode); if (mResponseCode == RESPONSE_RETRY) { dest.writeInt(mTimeout); } else if (mResponseCode == RESPONSE_OK) { dest.writeInt(mShouldReEnroll ? 1 : 0); if (mPayload != null) { dest.writeInt(mPayload.length); dest.writeByteArray(mPayload); } else { dest.writeInt(0); } } }
[ "CWE-502" ]
CVE-2017-0806
HIGH
9.3
android
writeToParcel
core/java/android/service/gatekeeper/GateKeeperResponse.java
b87c968e5a41a1a09166199bf54eee12608f3900
1
Analyze the following code function for security vulnerabilities
public static OutputManifestFile generateManifestFile( DigestAlgorithm jarEntryDigestAlgorithm, Map<String, byte[]> jarEntryDigests, byte[] sourceManifestBytes) throws ApkFormatException { Manifest sourceManifest = null; if (sourceManifestBytes != null) { try { sourceManifest = new Manifest(new ByteArrayInputStream(sourceManifestBytes)); } catch (IOException e) { throw new ApkFormatException("Malformed source META-INF/MANIFEST.MF", e); } } ByteArrayOutputStream manifestOut = new ByteArrayOutputStream(); Attributes mainAttrs = new Attributes(); // Copy the main section from the source manifest (if provided). Otherwise use defaults. // NOTE: We don't output our own Created-By header because this signer did not create the // JAR/APK being signed -- the signer only adds signatures to the already existing // JAR/APK. if (sourceManifest != null) { mainAttrs.putAll(sourceManifest.getMainAttributes()); } else { mainAttrs.put(Attributes.Name.MANIFEST_VERSION, ATTRIBUTE_VALUE_MANIFEST_VERSION); } try { ManifestWriter.writeMainSection(manifestOut, mainAttrs); } catch (IOException e) { throw new RuntimeException("Failed to write in-memory MANIFEST.MF", e); } List<String> sortedEntryNames = new ArrayList<>(jarEntryDigests.keySet()); Collections.sort(sortedEntryNames); SortedMap<String, byte[]> invidualSectionsContents = new TreeMap<>(); String entryDigestAttributeName = getEntryDigestAttributeName(jarEntryDigestAlgorithm); for (String entryName : sortedEntryNames) { checkEntryNameValid(entryName); byte[] entryDigest = jarEntryDigests.get(entryName); Attributes entryAttrs = new Attributes(); entryAttrs.putValue( entryDigestAttributeName, Base64.getEncoder().encodeToString(entryDigest)); ByteArrayOutputStream sectionOut = new ByteArrayOutputStream(); byte[] sectionBytes; try { ManifestWriter.writeIndividualSection(sectionOut, entryName, entryAttrs); sectionBytes = sectionOut.toByteArray(); manifestOut.write(sectionBytes); } catch (IOException e) { throw new RuntimeException("Failed to write in-memory MANIFEST.MF", e); } invidualSectionsContents.put(entryName, sectionBytes); } OutputManifestFile result = new OutputManifestFile(); result.contents = manifestOut.toByteArray(); result.mainSectionAttributes = mainAttrs; result.individualSectionsContents = invidualSectionsContents; return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateManifestFile File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
generateManifestFile
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeSigner.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public boolean isUserOnDuty(final String user, final Calendar time) throws IOException { update(); m_readLock.lock(); try { // if the user has no duty schedules then he is on duty if (!m_dutySchedules.containsKey(user)) return true; for (final DutySchedule curSchedule : m_dutySchedules.get(user)) { if (curSchedule.isInSchedule(time)) { return true; } } } finally { m_readLock.unlock(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUserOnDuty File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
isUserOnDuty
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public void unregisterCallback(ISessionControllerCallback cb) { synchronized (mLock) { int index = getControllerHolderIndexForCb(cb); if (index != -1) { try { cb.asBinder().unlinkToDeath( mControllerCallbackHolders.get(index).mDeathMonitor, 0); } catch (NoSuchElementException e) { Log.w(TAG, "error unlinking to binder death", e); } mControllerCallbackHolders.remove(index); } if (DEBUG) { Log.d(TAG, "unregistering callback " + cb.asBinder()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterCallback File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
unregisterCallback
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
@Override public boolean onEditorAction(TextView view, int action, KeyEvent keyEvent) { if (action == EditorInfo.IME_ACTION_DONE) { focusBody(); return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onEditorAction File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
onEditorAction
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private void readHierarchy(Object object, ObjectStreamClass classDesc) throws IOException, ClassNotFoundException, NotActiveException { if (object == null && mustResolve) { throw new NotActiveException(); } List<ObjectStreamClass> streamClassList = classDesc.getHierarchy(); if (object == null) { for (ObjectStreamClass objectStreamClass : streamClassList) { readObjectForClass(null, objectStreamClass); } } else { List<Class<?>> superclasses = cachedSuperclasses.get(object.getClass()); if (superclasses == null) { superclasses = cacheSuperclassesFor(object.getClass()); } int lastIndex = 0; for (int i = 0, end = superclasses.size(); i < end; ++i) { Class<?> superclass = superclasses.get(i); int index = findStreamSuperclass(superclass, streamClassList, lastIndex); if (index == -1) { readObjectNoData(object, superclass, ObjectStreamClass.lookupStreamClass(superclass)); } else { for (int j = lastIndex; j <= index; j++) { readObjectForClass(object, streamClassList.get(j)); } lastIndex = index + 1; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readHierarchy File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readHierarchy
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public static GitMaterial gitMaterial(String url) { return gitMaterial(url, null, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gitMaterial File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
gitMaterial
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
protected void handleKexInit(Buffer buffer) throws Exception { if (log.isDebugEnabled()) { log.debug("handleKexInit({}) SSH_MSG_KEXINIT", this); } receiveKexInit(buffer); doKexNegotiation(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleKexInit File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
handleKexInit
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
@Override public Route.Collection post(final String path1, final String path2, final Route.OneArgHandler handler) { return new Route.Collection( new Route.Definition[]{post(path1, handler), post(path2, handler)}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: post 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
post
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
void setTaskOverlay(boolean taskOverlay) { mTaskOverlay = taskOverlay; setAlwaysOnTop(mTaskOverlay); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTaskOverlay 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
setTaskOverlay
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
default void onNetworkTemporarilyDisabled(@NonNull WifiConfiguration config, int disableReason) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNetworkTemporarilyDisabled 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
onNetworkTemporarilyDisabled
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private IBaseResource loadAndAddConfDstu3(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); org.hl7.fhir.dstu3.model.CapabilityStatement capabilityStatement = new CapabilityStatement(); try { capabilityStatement = client.fetchConformance().ofType(org.hl7.fhir.dstu3.model.CapabilityStatement.class).execute(); } catch (Exception ex) { ourLog.warn("Failed to load conformance statement, error was: {}", ex.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + ex.toString(), ex)); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(capabilityStatement)); Map<String, Number> resourceCounts = new HashMap<String, Number>(); long total = 0; for (CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { for (CapabilityStatementRestResourceComponent nextResource : nextRest.getResource()) { List<Extension> exts = nextResource.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((DecimalType) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<CapabilityStatementRestResourceComponent>() { @Override public int compare(CapabilityStatementRestResourceComponent theO1, CapabilityStatementRestResourceComponent theO2) { DecimalType count1 = new DecimalType(); List<Extension> count1exts = theO1.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (DecimalType) count1exts.get(0).getValue(); } DecimalType count2 = new DecimalType(); List<Extension> count2exts = theO2.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (DecimalType) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); theModel.put("conf", capabilityStatement); return capabilityStatement; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2020-24301 - Severity: MEDIUM - CVSS Score: 4.3 Description: Resolve XSS vulnerability Function: loadAndAddConfDstu3 File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java Repository: hapifhir/hapi-fhir Fixed Code: private IBaseResource loadAndAddConfDstu3(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) { CaptureInterceptor interceptor = new CaptureInterceptor(); GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor); org.hl7.fhir.dstu3.model.CapabilityStatement capabilityStatement = new CapabilityStatement(); try { capabilityStatement = client.fetchConformance().ofType(org.hl7.fhir.dstu3.model.CapabilityStatement.class).execute(); } catch (Exception ex) { ourLog.warn("Failed to load conformance statement, error was: {}", ex.toString()); theModel.put("errorMsg", toDisplayError("Failed to load conformance statement, error was: " + ex.toString(), ex)); } theModel.put("jsonEncodedConf", getContext(theRequest).newJsonParser().encodeResourceToString(capabilityStatement)); Map<String, Number> resourceCounts = new HashMap<>(); long total = 0; for (CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { for (CapabilityStatementRestResourceComponent nextResource : nextRest.getResource()) { List<Extension> exts = nextResource.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (exts != null && exts.size() > 0) { Number nextCount = ((DecimalType) (exts.get(0).getValue())).getValueAsNumber(); resourceCounts.put(nextResource.getTypeElement().getValue(), nextCount); total += nextCount.longValue(); } } } theModel.put("resourceCounts", resourceCounts); if (total > 0) { for (CapabilityStatementRestComponent nextRest : capabilityStatement.getRest()) { Collections.sort(nextRest.getResource(), new Comparator<CapabilityStatementRestResourceComponent>() { @Override public int compare(CapabilityStatementRestResourceComponent theO1, CapabilityStatementRestResourceComponent theO2) { DecimalType count1 = new DecimalType(); List<Extension> count1exts = theO1.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count1exts != null && count1exts.size() > 0) { count1 = (DecimalType) count1exts.get(0).getValue(); } DecimalType count2 = new DecimalType(); List<Extension> count2exts = theO2.getExtensionsByUrl(RESOURCE_COUNT_EXT_URL); if (count2exts != null && count2exts.size() > 0) { count2 = (DecimalType) count2exts.get(0).getValue(); } int retVal = count2.compareTo(count1); if (retVal == 0) { retVal = theO1.getTypeElement().getValue().compareTo(theO2.getTypeElement().getValue()); } return retVal; } }); } } theModel.put("requiredParamExtension", ExtensionConstants.PARAM_IS_REQUIRED); theModel.put("conf", capabilityStatement); return capabilityStatement; }
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
loadAndAddConfDstu3
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/BaseController.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
1
Analyze the following code function for security vulnerabilities
@Override public void setGrid(final Grid grid) { if (grid != null) { extend(grid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setGrid 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
setGrid
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Transactional @Override @Nonnull public <E extends KrailEntity<ID, VER>> E merge(@Nonnull E entity) { checkNotNull(entity); EntityManager entityManager = entityManagerProvider.get(); E mergedEntity = entityManager.merge(entity); log.debug("{} merged", entity); return mergedEntity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: merge File: src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java Repository: KrailOrg/krail-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15018
MEDIUM
5.2
KrailOrg/krail-jpa
merge
src/main/java/uk/q3c/krail/jpa/persist/BaseJpaDao.java
c1e848665492e21ef6cc9be443205e36b9a1f6be
0
Analyze the following code function for security vulnerabilities
private boolean canReadPhoneState(String callingPackage, String callingFeatureId, String message) { // The system/default dialer can always read phone state - so that emergency calls will // still work. if (isPrivilegedDialerCalling(callingPackage)) { return true; } try { mContext.enforceCallingOrSelfPermission(READ_PRIVILEGED_PHONE_STATE, message); // SKIP checking run-time OP_READ_PHONE_STATE since caller or self has PRIVILEGED // permission return true; } catch (SecurityException e) { // Accessing phone state is gated by a special permission. mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, message); // Some apps that have the permission can be restricted via app ops. return mAppOpsManager.noteOp(AppOpsManager.OP_READ_PHONE_STATE, Binder.getCallingUid(), callingPackage, callingFeatureId, message) == AppOpsManager.MODE_ALLOWED; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canReadPhoneState 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
canReadPhoneState
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
protected int computeBarMode(int oldVis, int newVis, int transientFlag, int translucentFlag, int transparentFlag) { final int oldMode = barMode(oldVis, transientFlag, translucentFlag, transparentFlag); final int newMode = barMode(newVis, transientFlag, translucentFlag, transparentFlag); if (oldMode == newMode) { return -1; // no mode change } return newMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: computeBarMode File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
computeBarMode
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void startPendingIntent(PendingIntent pendingIntent, int requestCode) { try { getActivity().startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0); } catch (final SendIntentException ignored) { } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startPendingIntent File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
startPendingIntent
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private boolean isDownloaded(Dependency dependency) { if (dependencyRelocator.isRelocated(dependency)) { return true; } else { return Files.exists(directory.resolve(dependency.getFileName())); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDownloaded File: src/main/java/dev/hypera/dragonfly/Dragonfly.java Repository: HyperaDev/Dragonfly The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-41967
HIGH
7.5
HyperaDev/Dragonfly
isDownloaded
src/main/java/dev/hypera/dragonfly/Dragonfly.java
9661375e1135127ca6cdb5712e978bec33cc06b3
0
Analyze the following code function for security vulnerabilities
public static String relaunchReasonToString(int relaunchReason) { switch (relaunchReason) { case RELAUNCH_REASON_WINDOWING_MODE_RESIZE: return "window_resize"; case RELAUNCH_REASON_FREE_RESIZE: return "free_resize"; default: return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: relaunchReasonToString 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
relaunchReasonToString
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
private String toSpaceElement(String spaceReference) { return toSpaceElement( relativeReferenceResolver.resolve(spaceReference, EntityType.SPACE).getReversedReferenceChain()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toSpaceElement File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
toSpaceElement
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
public void addBadges(Badge[] larr) { for (Badge badge : larr) { addBadge(badge); addRep(badge.getReward()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBadges File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
addBadges
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private DocumentReference getContentAuthor(XWikiDocument doc) { DocumentReference user = doc.getContentAuthorReference(); if (user != null && XWikiConstants.GUEST_USER.equals(user.getName())) { // Public users (not logged in) should be passed as null in the new API. It may happen that badly // design code, and poorly written API does not take care, so we prevent security issue here. user = null; } return user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentAuthor File: xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
getContentAuthor
xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authorization/xwiki-platform-security-authorization-bridge/src/main/java/org/xwiki/security/authorization/internal/DefaultContextualAuthorizationManager.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
public void setParamFramename(String value) { m_paramFrameName = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setParamFramename 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
setParamFramename
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public void onResume() { super.onResume(); binding.messagesView.post(this::fireReadEvent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
onResume
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public void setCertInstallerPackage(ComponentName who, String installerPackage) throws SecurityException { setDelegatedScopePreO(who, installerPackage, DELEGATION_CERT_INSTALL); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_CERT_INSTALLER_PACKAGE) .setAdmin(who) .setStrings(installerPackage) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCertInstallerPackage 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
setCertInstallerPackage
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public List<ShortcutManager.ShareShortcutInfo> getMatchingShareTargets( @NonNull IntentFilter filter) { synchronized (mLock) { final List<ShareTargetInfo> matchedTargets = new ArrayList<>(); for (int i = 0; i < mShareTargets.size(); i++) { final ShareTargetInfo target = mShareTargets.get(i); for (ShareTargetInfo.TargetData data : target.mTargetData) { if (filter.hasDataType(data.mMimeType)) { // Matched at least with one data type matchedTargets.add(target); break; } } } if (matchedTargets.isEmpty()) { return new ArrayList<>(); } // Get the list of all dynamic shortcuts in this package. final ArrayList<ShortcutInfo> shortcuts = new ArrayList<>(); // Pass callingLauncher to ensure pinned flag marked by system ui, e.g. ShareSheet, are // included in the result findAll(shortcuts, ShortcutInfo::isNonManifestVisible, ShortcutInfo.CLONE_REMOVE_FOR_APP_PREDICTION, mShortcutUser.mService.mContext.getPackageName(), 0, /*getPinnedByAnyLauncher=*/ false); final List<ShortcutManager.ShareShortcutInfo> result = new ArrayList<>(); for (int i = 0; i < shortcuts.size(); i++) { final Set<String> categories = shortcuts.get(i).getCategories(); if (categories == null || categories.isEmpty()) { continue; } for (int j = 0; j < matchedTargets.size(); j++) { // Shortcut must have all of share target categories boolean hasAllCategories = true; final ShareTargetInfo target = matchedTargets.get(j); for (int q = 0; q < target.mCategories.length; q++) { if (!categories.contains(target.mCategories[q])) { hasAllCategories = false; break; } } if (hasAllCategories) { result.add(new ShortcutManager.ShareShortcutInfo(shortcuts.get(i), new ComponentName(getPackageName(), target.mTargetClass))); break; } } } return result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMatchingShareTargets File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
getMatchingShareTargets
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
public List<ApiScenarioDTO> list(ApiScenarioRequest request) { request = this.initRequest(request, true, true); List<ApiScenarioDTO> list = extApiScenarioMapper.list(request); if (BooleanUtils.isTrue(request.isSelectEnvironment())) { apiScenarioEnvService.setApiScenarioEnv(list); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: list File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
list
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public @Nullable Object getObjectImpl( String columnName, @Nullable Map<String, Class<?>> map) throws SQLException { return getObjectImpl(findColumn(columnName), map); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectImpl 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
getObjectImpl
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("topic:index") @GetMapping("/index") @ResponseBody public Result index(Integer id) { Topic topic = topicService.selectById(id); indexedService.indexTopic(String.valueOf(topic.getId()), topic.getTitle(), topic.getContent()); return success(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: index File: src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
index
src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
private static void parseGlobalAttributes(Element root, Map<String, Attribute> globalAttributes1, Map<String, Attribute> commonAttributes) throws PolicyException { for (Element ele : getByTagName(root, "attribute")) { String name = getAttributeValue(ele, "name"); Attribute toAdd = commonAttributes.get(name.toLowerCase()); if (toAdd != null) { globalAttributes1.put(name.toLowerCase(), toAdd); } else { throw new PolicyException("Global attribute '" + name + "' was not defined in <common-attributes>"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGlobalAttributes File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
parseGlobalAttributes
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
@LargeTest @Test public void testIncomingCallCallerInfoLookupTimesOutIsAllowed() throws Exception { when(mClockProxy.currentTimeMillis()).thenReturn(TEST_CREATE_TIME); when(mClockProxy.elapsedRealtime()).thenReturn(TEST_CREATE_ELAPSED_TIME); Bundle extras = new Bundle(); extras.putParcelable( TelecomManager.EXTRA_INCOMING_CALL_ADDRESS, Uri.fromParts(PhoneAccount.SCHEME_TEL, "650-555-1212", null)); mTelecomSystem.getTelecomServiceImpl().getBinder() .addNewIncomingCall(mPhoneAccountA0.getAccountHandle(), extras); waitForHandlerAction(mConnectionServiceFixtureA.mConnectionServiceDelegate.getHandler(), TEST_TIMEOUT); verify(mConnectionServiceFixtureA.getTestDouble()) .createConnection(any(PhoneAccountHandle.class), anyString(), any(ConnectionRequest.class), eq(true), eq(false), any()); waitForHandlerAction(mConnectionServiceFixtureA.mConnectionServiceDelegate.getHandler(), TEST_TIMEOUT); // Never reply to the caller info lookup. assertEquals(1, mCallerInfoAsyncQueryFactoryFixture.mRequests.size()); verify(mInCallServiceFixtureX.getTestDouble(), timeout(TEST_TIMEOUT)) .setInCallAdapter(any(IInCallAdapter.class)); verify(mInCallServiceFixtureY.getTestDouble(), timeout(TEST_TIMEOUT)) .setInCallAdapter(any(IInCallAdapter.class)); assertEquals(0, mConnectionServiceFixtureA.mConnectionService.rejectedCallIds.size()); assertEquals(0, mMissedCallNotifier.missedCallsNotified.size()); assertTrueWithTimeout(new Predicate<Void>() { @Override public boolean apply(Void v) { return mInCallServiceFixtureX.mInCallAdapter != null; } }); verify(mInCallServiceFixtureX.getTestDouble(), timeout(TEST_TIMEOUT)) .addCall(any(ParcelableCall.class)); verify(mInCallServiceFixtureY.getTestDouble(), timeout(TEST_TIMEOUT)) .addCall(any(ParcelableCall.class)); when(mClockProxy.currentTimeMillis()).thenReturn(TEST_CONNECT_TIME); when(mClockProxy.elapsedRealtime()).thenReturn(TEST_CONNECT_ELAPSED_TIME); disconnectCall(mInCallServiceFixtureX.mLatestCallId, mConnectionServiceFixtureA.mLatestConnectionId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testIncomingCallCallerInfoLookupTimesOutIsAllowed File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testIncomingCallCallerInfoLookupTimesOutIsAllowed
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private String extractPathInfo(String pUri, String pPathInfo) { if (pUri.contains("!//")) { // Special treatment for trailing slashes in paths Matcher matcher = PATH_PREFIX_PATTERN.matcher(pPathInfo); if (matcher.find()) { String prefix = matcher.group(); String pathInfoEncoded = pUri.replaceFirst("^.*?" + prefix, prefix); try { return URLDecoder.decode(pathInfoEncoded, "UTF-8"); } catch (UnsupportedEncodingException e) { // Should not happen at all ... so we silently fall through } } } return pPathInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractPathInfo File: agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
extractPathInfo
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
protected void hideSnackbar() { this.binding.snackbar.setVisibility(View.GONE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideSnackbar File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hideSnackbar
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public boolean canUndelete() { try { return hasAccessLevel(ADMIN_RIGHT, getFullName()) || hasAccessLevel("undelete", getFullName()) || (Objects.equals(this.context.getUserReference(), getDeleterReference()) && hasAccess(Right.EDIT, getDocumentReference())); } catch (XWikiException ex) { // Public APIs should not throw exceptions LOGGER.warn("Exception while checking if entry [{}] can be restored from the recycle bin", getId(), ex); return false; } }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2023-29208 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-16285: Error when accessing deleted document Function: canUndelete File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java Repository: xwiki/xwiki-platform Fixed Code: public boolean canUndelete() { return hasAccess(Right.EDIT); }
[ "CWE-668" ]
CVE-2023-29208
HIGH
7.5
xwiki/xwiki-platform
canUndelete
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/DeletedDocument.java
d9e947559077e947315bf700c5703dfc7dd8a8d7
1
Analyze the following code function for security vulnerabilities
@Test public void setYRangeParams() throws Exception { assertPlotParam("yrange","[0:1]"); assertPlotParam("yrange", "[:]"); assertPlotParam("yrange", "[:0]"); assertPlotParam("yrange", "[:42]"); assertPlotParam("yrange", "[:-42]"); assertPlotParam("yrange", "[:0.8]"); assertPlotParam("yrange", "[:-0.8]"); assertPlotParam("yrange", "[:42.4]"); assertPlotParam("yrange", "[:-42.4]"); assertPlotParam("yrange", "[:4e4]"); assertPlotParam("yrange", "[:-4e4]"); assertPlotParam("yrange", "[:4e-4]"); assertPlotParam("yrange", "[:-4e-4]"); assertPlotParam("yrange", "[:4.2e4]"); assertPlotParam("yrange", "[:-4.2e4]"); assertPlotParam("yrange", "[0:]"); assertPlotParam("yrange", "[5:]"); assertPlotParam("yrange", "[-5:]"); assertPlotParam("yrange", "[0.5:]"); assertPlotParam("yrange", "[-0.5:]"); assertPlotParam("yrange", "[10.5:]"); assertPlotParam("yrange", "[-10.5:]"); assertPlotParam("yrange", "[10e5:]"); assertPlotParam("yrange", "[-10e5:]"); assertPlotParam("yrange", "[10e-5:]"); assertPlotParam("yrange", "[-10e-5:]"); assertPlotParam("yrange", "[10.1e-5:]"); assertPlotParam("yrange", "[-10.1e-5:]"); assertPlotParam("yrange", "[-10.1e-5:-10.1e-6]"); assertInvalidPlotParam("yrange", "[33:system('touch /tmp/poc.txt')]"); }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2023-25826 - Severity: CRITICAL - CVSS Score: 9.8 Description: Improved fix for #2261. Regular expressions wouldn't catch the newlines or possibly other control characters. Now we'll use the TAG validation code to make sure the inputs are only plain ASCII printables first. Fixes CVE-2018-12972, CVE-2020-35476 Function: setYRangeParams File: test/tsd/TestGraphHandler.java Repository: OpenTSDB/opentsdb Fixed Code: @Test public void setYRangeParams() throws Exception { assertPlotParam("yrange","[0:1]"); assertPlotParam("yrange", "[:]"); assertPlotParam("yrange", "[:0]"); assertPlotParam("yrange", "[:42]"); assertPlotParam("yrange", "[:-42]"); assertPlotParam("yrange", "[:0.8]"); assertPlotParam("yrange", "[:-0.8]"); assertPlotParam("yrange", "[:42.4]"); assertPlotParam("yrange", "[:-42.4]"); assertPlotParam("yrange", "[:4e4]"); assertPlotParam("yrange", "[:-4e4]"); assertPlotParam("yrange", "[:4e-4]"); assertPlotParam("yrange", "[:-4e-4]"); assertPlotParam("yrange", "[:4.2e4]"); assertPlotParam("yrange", "[:-4.2e4]"); assertPlotParam("yrange", "[0:]"); assertPlotParam("yrange", "[5:]"); assertPlotParam("yrange", "[-5:]"); assertPlotParam("yrange", "[0.5:]"); assertPlotParam("yrange", "[-0.5:]"); assertPlotParam("yrange", "[10.5:]"); assertPlotParam("yrange", "[-10.5:]"); assertPlotParam("yrange", "[10e5:]"); assertPlotParam("yrange", "[-10e5:]"); assertPlotParam("yrange", "[10e-5:]"); assertPlotParam("yrange", "[-10e-5:]"); assertPlotParam("yrange", "[10.1e-5:]"); assertPlotParam("yrange", "[-10.1e-5:]"); assertPlotParam("yrange", "[-10.1e-5:-10.1e-6]"); assertInvalidPlotParam("yrange", "[33:system('touch /tmp/poc.txt')]"); assertInvalidPlotParam("y2range", "[42:%0a[33:system('touch /tmp/poc.txt')]"); }
[ "CWE-78" ]
CVE-2023-25826
CRITICAL
9.8
OpenTSDB/opentsdb
setYRangeParams
test/tsd/TestGraphHandler.java
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
1
Analyze the following code function for security vulnerabilities
HpackDecoder getDecoder() { return decoder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDecoder File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getDecoder
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 insertInstruction(String target, String data) { super.insertInstructionImpl(target, data); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertInstruction File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
insertInstruction
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private boolean isBoolType(byte b) { int lowerNibble = b & 0x0f; return lowerNibble == Types.BOOLEAN_TRUE || lowerNibble == Types.BOOLEAN_FALSE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBoolType File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
isBoolType
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public void enableWithId(@NonNull String shortcutId) { mutateShortcut(shortcutId, null, si -> { ensureNotImmutable(si, /*ignoreInvisible=*/ true); si.clearFlags(ShortcutInfo.FLAG_DISABLED); si.setDisabledReason(ShortcutInfo.DISABLED_REASON_NOT_DISABLED); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enableWithId File: services/core/java/com/android/server/pm/ShortcutPackage.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40075
MEDIUM
5.5
android
enableWithId
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
@Override public boolean updateConfiguration(Configuration values) { mAmInternal.enforceCallingPermission(CHANGE_CONFIGURATION, "updateConfiguration()"); synchronized (mGlobalLock) { if (mWindowManager == null) { Slog.w(TAG, "Skip updateConfiguration because mWindowManager isn't set"); return false; } if (values == null) { // sentinel: fetch the current configuration from the window manager values = mWindowManager.computeNewConfiguration(DEFAULT_DISPLAY); } mH.sendMessage(PooledLambda.obtainMessage( ActivityManagerInternal::updateOomLevelsForDisplay, mAmInternal, DEFAULT_DISPLAY)); final long origId = Binder.clearCallingIdentity(); try { if (values != null) { Settings.System.clearConfiguration(values); } updateConfigurationLocked(values, null, false, false /* persistent */, UserHandle.USER_NULL, false /* deferResume */, mTmpUpdateConfigurationResult); return mTmpUpdateConfigurationResult.changes != 0; } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateConfiguration 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
updateConfiguration
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(KEY_UI_STAGE, mUiStage.ordinal()); if (mChosenPattern != null) { outState.putParcelable(KEY_PATTERN_CHOICE, mChosenPattern); } if (mCurrentCredential != null) { outState.putParcelable(KEY_CURRENT_PATTERN, mCurrentCredential.duplicate()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSaveInstanceState File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
onSaveInstanceState
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public ApiClient setClientConfig(ClientConfig clientConfig) { this.clientConfig = clientConfig; // Rebuild HTTP Client according to the new "clientConfig" value. this.httpClient = buildHttpClient(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientConfig 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
setClientConfig
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public DocumentReference getDocumentReferenceWithLocale() { return this.doc.getDocumentReferenceWithLocale(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocumentReferenceWithLocale File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
getDocumentReferenceWithLocale
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public static boolean isJsonContentType(String contentType) { return contentType.contains("application/json") || contentType.contains("+json"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isJsonContentType File: vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-24815
MEDIUM
5.3
vert-x3/vertx-web
isJsonContentType
vertx-web/src/main/java/io/vertx/ext/web/impl/Utils.java
9e3a783b1d1a731055e9049078b1b1494ece9c15
0
Analyze the following code function for security vulnerabilities
private void doConnect() throws WebSocketException { // True if a proxy server is set. boolean proxied = mProxyHandshaker != null; try { // Connect to the server (either a proxy or a WebSocket endpoint). mSocket.connect(mAddress.toInetSocketAddress(), mConnectionTimeout); } catch (IOException e) { // Failed to connect the server. String message = String.format("Failed to connect to %s'%s': %s", (proxied ? "the proxy " : ""), mAddress, e.getMessage()); // Raise an exception with SOCKET_CONNECT_ERROR. throw new WebSocketException(WebSocketError.SOCKET_CONNECT_ERROR, message, e); } // If a proxy server is set. if (proxied) { // Perform handshake with the proxy server. // SSL handshake is performed as necessary, too. handshake(); } }
Vulnerability Classification: - CWE: CWE-295 - CVE: CVE-2017-1000209 - Severity: MEDIUM - CVSS Score: 4.3 Description: Verify that certificate is valid for server hostname Without this change, the WebSocket library will accept a trusted certificate issued for domain A when connecting to domain B. This could be exploited for Man-in-the-middle attacks. The underlying issue is that Java considers hostname verification to be a part of HTTPS and as such, will not perform it by default. This change adds the default HostnameVerifier used by Android, which in recent versions is derived from OkHttp. Minor changes were made to make it build for Java 1.6. Tested with and without a proxy configured. Function: doConnect File: src/main/java/com/neovisionaries/ws/client/SocketConnector.java Repository: TakahikoKawasaki/nv-websocket-client Fixed Code: private void doConnect() throws WebSocketException { // True if a proxy server is set. boolean proxied = mProxyHandshaker != null; try { // Connect to the server (either a proxy or a WebSocket endpoint). mSocket.connect(mAddress.toInetSocketAddress(), mConnectionTimeout); if (mSocket instanceof SSLSocket) { // Verify that the hostname matches the certificate here since // this is not automatically done by the SSLSocket. OkHostnameVerifier hostnameVerifier = OkHostnameVerifier.INSTANCE; SSLSession sslSession = ((SSLSocket) mSocket).getSession(); if (!hostnameVerifier.verify(mAddress.getHostname(), sslSession)) { throw new SSLPeerUnverifiedException("Hostname does not match certificate (" + sslSession.getPeerPrincipal() + ")"); } } } catch (IOException e) { // Failed to connect the server. String message = String.format("Failed to connect to %s'%s': %s", (proxied ? "the proxy " : ""), mAddress, e.getMessage()); // Raise an exception with SOCKET_CONNECT_ERROR. throw new WebSocketException(WebSocketError.SOCKET_CONNECT_ERROR, message, e); } // If a proxy server is set. if (proxied) { // Perform handshake with the proxy server. // SSL handshake is performed as necessary, too. handshake(); } }
[ "CWE-295" ]
CVE-2017-1000209
MEDIUM
4.3
TakahikoKawasaki/nv-websocket-client
doConnect
src/main/java/com/neovisionaries/ws/client/SocketConnector.java
feb9c8302757fd279f4cfc99cbcdfb6ee709402d
1