instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public Collection<String> getRenderIds() { assertNotReleased(); if (renderIds != null) { return renderIds; } renderIds = populatePhaseClientIds(PARTIAL_RENDER_PARAM); return renderIds; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderIds File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
getRenderIds
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("tag:edit") @GetMapping("/edit") public String edit(Integer id, Model model) { model.addAttribute("tag", tagService.selectById(id)); return "admin/tag/edit"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: edit File: src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
edit
src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
protected final static boolean _neitherNull(Object a, Object b) { return (a != null) && (b != null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _neitherNull File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_neitherNull
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public IssuesWithBLOBs updateIssues(IssuesUpdateRequest issuesRequest) { PlatformIssuesUpdateRequest platformIssuesUpdateRequest = JSON.parseObject(JSON.toJSONString(issuesRequest), PlatformIssuesUpdateRequest.class); Project project = baseProjectService.getProjectById(issuesRequest.getProjectId()); if (PlatformPluginService.isPluginPlatform(project.getPlatform())) { Platform platform = platformPluginService.getPlatform(project.getPlatform()); if (platform.isAttachmentUploadSupport()) { AttachmentRequest attachmentRequest = new AttachmentRequest(); attachmentRequest.setBelongId(issuesRequest.getId()); attachmentRequest.setBelongType(AttachmentType.ISSUE.type()); List<FileAttachmentMetadata> fileAttachmentMetadata = attachmentService.listMetadata(attachmentRequest); Set<String> msAttachmentNames = fileAttachmentMetadata.stream() .map(FileAttachmentMetadata::getName) .collect(Collectors.toSet()); // 获得缺陷MS附件名称 platformIssuesUpdateRequest.setMsAttachmentNames(msAttachmentNames); } List<PlatformCustomFieldItemDTO> customFieldItemDTOS = JSON.parseArray(JSON.toJSONString(issuesRequest.getRequestFields()), PlatformCustomFieldItemDTO.class); platformIssuesUpdateRequest.setCustomFieldList(customFieldItemDTOS); // todo 全部插件化后去掉 platformIssuesUpdateRequest.setUserPlatformUserConfig(userService.getCurrentPlatformInfoStr(SessionUtils.getCurrentWorkspaceId())); platformIssuesUpdateRequest.setProjectConfig(PlatformPluginService.getCompatibleProjectConfig(project)); IssuesWithBLOBs issue = platformPluginService.getPlatform(project.getPlatform()) .updateIssue(platformIssuesUpdateRequest); issue.setUpdateTime(System.currentTimeMillis()); issuesMapper.updateByPrimaryKeySelective(issue); handleTestCaseIssues(issuesRequest); } else { List<IssuesPlatform> platformList = getUpdatePlatforms(issuesRequest); platformList.forEach(platform -> { platform.updateIssue(issuesRequest); }); } customFieldIssuesService.editFields(issuesRequest.getId(), issuesRequest.getEditFields()); customFieldIssuesService.addFields(issuesRequest.getId(), issuesRequest.getAddFields()); return getIssue(issuesRequest.getId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateIssues File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
updateIssues
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public long getDelayUntilTime(EndPoint info) { synchronized (mAuthorities) { AuthorityInfo authority = getAuthorityLocked(info, "getDelayUntil"); if (authority == null) { return 0; } return authority.delayUntil; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDelayUntilTime File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
getDelayUntilTime
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public abstract Extension getExtensionType();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExtensionType File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/org/xwiki/skinx/internal/AbstractSxExportURLFactoryActionHandler.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-23620
MEDIUM
5.8
xwiki/xwiki-platform
getExtensionType
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/org/xwiki/skinx/internal/AbstractSxExportURLFactoryActionHandler.java
ab778254fb8f71c774e1c1239368c44fe3b6bba5
0
Analyze the following code function for security vulnerabilities
public void addItems(Context c, Collection[] mycollections, String sourceDir, String mapFile, boolean template) throws Exception { // create the mapfile File outFile = null; try { Map<String, String> skipItems = new HashMap<String, String>(); // set of items to skip if in 'resume' // mode System.out.println("Adding items from directory: " + sourceDir); System.out.println("Generating mapfile: " + mapFile); boolean directoryFileCollections = false; if (mycollections == null) { directoryFileCollections = true; } if (!isTest) { // get the directory names of items to skip (will be in keys of // hash) if (isResume) { skipItems = readMapFile(mapFile); } // sneaky isResume == true means open file in append mode outFile = new File(mapFile); mapOut = new PrintWriter(new FileWriter(outFile, isResume)); if (mapOut == null) { throw new Exception("can't open mapfile: " + mapFile); } } // open and process the source directory File d = new java.io.File(sourceDir); if (d == null || !d.isDirectory()) { throw new Exception("Error, cannot open source directory " + sourceDir); } String[] dircontents = d.list(directoryFilter); Arrays.sort(dircontents, ComparatorUtils.naturalComparator()); for (int i = 0; i < dircontents.length; i++) { if (skipItems.containsKey(dircontents[i])) { System.out.println("Skipping import of " + dircontents[i]); } else { Collection [] clist; if (directoryFileCollections) { String path = sourceDir + File.separatorChar + dircontents[i]; try { Collection[] cols = processCollectionFile(c, path, "collections"); if (cols == null) { System.out.println("No collections specified for item " + dircontents[i] + ". Skipping."); continue; } clist = cols; } catch (IllegalArgumentException e) { System.out.println(e.getMessage() + " Skipping." ); continue; } } else { clist = mycollections; } addItem(c, clist, sourceDir, dircontents[i], mapOut, template); System.out.println(i + " " + dircontents[i]); c.clearCache(); } } } finally { if(mapOut!=null) { mapOut.flush(); mapOut.close(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItems File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
addItems
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
@Override public void release() { released = true; ajaxRequest = null; renderAll = null; partialResponseWriter = null; executeIds = null; renderIds = null; evalScripts = null; ctx = null; partialRequest = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: release File: impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-17091
MEDIUM
4.3
eclipse-ee4j/mojarra
release
impl/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
a3fa9573789ed5e867c43ea38374f4dbd5a8f81f
0
Analyze the following code function for security vulnerabilities
@Override public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle) { synchronized (mLock) { enforceModifyPermission(); long token = Binder.clearCallingIdentity(); try { mPhoneAccountRegistrar.setUserSelectedOutgoingPhoneAccount(accountHandle); } catch (Exception e) { Log.e(this, e, "setUserSelectedOutgoingPhoneAccount"); throw e; } finally { Binder.restoreCallingIdentity(token); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserSelectedOutgoingPhoneAccount File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0847
HIGH
7.2
android
setUserSelectedOutgoingPhoneAccount
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
@Override public void animateExpandNotificationsPanel() { if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible); if (!panelsEnabled()) { return ; } mNotificationPanel.expand(true /* animate */); if (false) postStartTracing(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: animateExpandNotificationsPanel 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
animateExpandNotificationsPanel
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void fetchSignalingSettings() { Log.d(TAG, "fetchSignalingSettings"); int apiVersion = ApiUtils.getSignalingApiVersion(conversationUser, new int[]{ApiUtils.APIv3, 2, 1}); ncApi.getSignalingSettings(credentials, ApiUtils.getUrlForSignalingSettings(apiVersion, baseUrl)) .subscribeOn(Schedulers.io()) .retry(3) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<SignalingSettingsOverall>() { @Override public void onSubscribe(@io.reactivex.annotations.NonNull Disposable d) { // unused atm } @Override public void onNext(@io.reactivex.annotations.NonNull SignalingSettingsOverall signalingSettingsOverall) { if (signalingSettingsOverall.getOcs() != null && signalingSettingsOverall.getOcs().getSettings() != null) { externalSignalingServer = new ExternalSignalingServer(); if (!TextUtils.isEmpty( signalingSettingsOverall.getOcs().getSettings().getExternalSignalingServer()) && !TextUtils.isEmpty( signalingSettingsOverall.getOcs().getSettings().getExternalSignalingTicket())) { externalSignalingServer = new ExternalSignalingServer(); externalSignalingServer.setExternalSignalingServer( signalingSettingsOverall.getOcs().getSettings().getExternalSignalingServer()); externalSignalingServer.setExternalSignalingTicket( signalingSettingsOverall.getOcs().getSettings().getExternalSignalingTicket()); hasExternalSignalingServer = true; } else { hasExternalSignalingServer = false; } Log.d(TAG, " hasExternalSignalingServer: " + hasExternalSignalingServer); if (!conversationUser.getUserId().equals("?")) { try { userUtils.createOrUpdateUser(null, null, null, null, null, null, null, conversationUser.getId(), null, null, LoganSquare.serialize(externalSignalingServer)) .subscribeOn(Schedulers.io()) .subscribe(); } catch (IOException exception) { Log.e(TAG, "Failed to serialize external signaling server", exception); } } else { try { conversationUser.setExternalSignalingServer(LoganSquare.serialize(externalSignalingServer)); } catch (IOException exception) { Log.e(TAG, "Failed to serialize external signaling server", exception); } } if (signalingSettingsOverall.getOcs().getSettings().getStunServers() != null) { List<IceServer> stunServers = signalingSettingsOverall.getOcs().getSettings().getStunServers(); if (apiVersion == ApiUtils.APIv3) { for (IceServer stunServer : stunServers) { if (stunServer.getUrls() != null) { for (String url : stunServer.getUrls()) { Log.d(TAG, " STUN server url: " + url); iceServers.add(new PeerConnection.IceServer(url)); } } } } else { if (signalingSettingsOverall.getOcs().getSettings().getStunServers() != null) { for (IceServer stunServer : stunServers) { Log.d(TAG, " STUN server url: " + stunServer.getUrl()); iceServers.add(new PeerConnection.IceServer(stunServer.getUrl())); } } } } if (signalingSettingsOverall.getOcs().getSettings().getTurnServers() != null) { List<IceServer> turnServers = signalingSettingsOverall.getOcs().getSettings().getTurnServers(); for (IceServer turnServer : turnServers) { if (turnServer.getUrls() != null) { for (String url : turnServer.getUrls()) { Log.d(TAG, " TURN server url: " + url); iceServers.add(new PeerConnection.IceServer( url, turnServer.getUsername(), turnServer.getCredential() )); } } } } } checkCapabilities(); } @Override public void onError(@io.reactivex.annotations.NonNull Throwable e) { Log.e(TAG, e.getMessage(), e); } @Override public void onComplete() { // unused atm } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fetchSignalingSettings File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
fetchSignalingSettings
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
@Override public String getBaseContractsPath() { return META_INF_CONTRACTS_DIR; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseContractsPath File: impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java Repository: eclipse-ee4j/mojarra The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-6950
MEDIUM
4.3
eclipse-ee4j/mojarra
getBaseContractsPath
impl/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
cefbb9447e7be560e59da2da6bd7cb93776f7741
0
Analyze the following code function for security vulnerabilities
private @NonNull Set<String> fetchOemSystemHolders(int... roleResIds) { Set<String> packageNames = new ArraySet<>(); for (int roleResId : roleResIds) { String packageName = getDefaultRoleHolderPackageName(roleResId); if (packageName != null) { packageNames.add(packageName); } } return Collections.unmodifiableSet(packageNames); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fetchOemSystemHolders File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
fetchOemSystemHolders
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void handle(HttpServletRequest request, final HttpServletResponse response) throws Exception { // We're sending an XML response, so set the response content type to text/xml response.setContentType("text/xml"); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[256]; int read = request.getInputStream().read(buffer); while (read != -1) { out.write(buffer, 0, read); read = request.getInputStream().read(buffer); } String requestData = new String(out.toByteArray()); log.debug("Processing remote request: " + requestData); // Parse the incoming request as XML SAXReader xmlReader = new SAXReader(); Document doc = xmlReader.read( new StringReader(requestData) ); final Element env = doc.getRootElement(); final RequestContext ctx = unmarshalContext(env); // TODO - we really want to extract the page context from our request RemotingLifecycle.restorePageContext(); new ContextualHttpServletRequest(request) { @Override public void process() throws Exception { // Extract the calls from the request List<Call> calls = unmarshalCalls(env); // Execute each of the calls for (Call call : calls) { call.execute(); } // Store the conversation ID in the outgoing context ctx.setConversationId( Manager.instance().getCurrentConversationId() ); // Package up the response marshalResponse(calls, ctx, response.getOutputStream()); } @Override protected void restoreConversationId() { ConversationPropagation.instance().setConversationId( ctx.getConversationId() ); } @Override protected void handleConversationPropagation() {} }.run(); }
Vulnerability Classification: - CWE: CWE-264, CWE-200 - CVE: CVE-2013-6447 - Severity: MEDIUM - CVSS Score: 5.0 Description: https://issues.jboss.org/browse/WFK2-375 enhanced fix git-svn-id: https://svn.jboss.org/repos/seam/branches/enterprise/WFK-2_1@15651 a9c07ecc-ef43-0410-a306-c911db474e88 Function: handle File: jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java Repository: seam2/jboss-seam Fixed Code: public void handle(HttpServletRequest request, final HttpServletResponse response) throws Exception { // We're sending an XML response, so set the response content type to text/xml response.setContentType("text/xml"); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[256]; int read = request.getInputStream().read(buffer); while (read != -1) { out.write(buffer, 0, read); read = request.getInputStream().read(buffer); } String requestData = new String(out.toByteArray()); log.debug("Processing remote request: " + requestData); // Parse the incoming request as XML SAXReader xmlReader = XML.getSafeSaxReader(); Document doc = xmlReader.read( new StringReader(requestData) ); final Element env = doc.getRootElement(); final RequestContext ctx = unmarshalContext(env); // TODO - we really want to extract the page context from our request RemotingLifecycle.restorePageContext(); new ContextualHttpServletRequest(request) { @Override public void process() throws Exception { // Extract the calls from the request List<Call> calls = unmarshalCalls(env); // Execute each of the calls for (Call call : calls) { call.execute(); } // Store the conversation ID in the outgoing context ctx.setConversationId( Manager.instance().getCurrentConversationId() ); // Package up the response marshalResponse(calls, ctx, response.getOutputStream()); } @Override protected void restoreConversationId() { ConversationPropagation.instance().setConversationId( ctx.getConversationId() ); } @Override protected void handleConversationPropagation() {} }.run(); }
[ "CWE-264", "CWE-200" ]
CVE-2013-6447
MEDIUM
5
seam2/jboss-seam
handle
jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java
090aa6252affc978a96c388e3fc2c1c2688d9bb5
1
Analyze the following code function for security vulnerabilities
@Override public void requestLogMark(String message) { try { Log.startSession("TSI.rLM"); enforceShellOnly(Binder.getCallingUid(), "requestLogMark is for shell only"); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { mCallsManager.requestLogMark(message); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestLogMark 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
requestLogMark
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
@Override public StaticHandler setFilesReadOnly(boolean readOnly) { this.filesReadOnly = readOnly; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFilesReadOnly File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
setFilesReadOnly
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
@NonNull public CallStyle setDeclineButtonColorHint(@ColorInt int color) { mDeclineButtonColor = color; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDeclineButtonColorHint File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setDeclineButtonColorHint
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
void dispatchNewAnimatorScaleLocked(Session session) { mH.obtainMessage(H.NEW_ANIMATOR_SCALE, session).sendToTarget(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchNewAnimatorScaleLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
dispatchNewAnimatorScaleLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@Override SurfaceSession getSession() { if (mSession.mSurfaceSession != null) { return mSession.mSurfaceSession; } else { return getParent().getSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSession File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
getSession
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public String getActiveDiv(){ return activeDiv; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActiveDiv File: src/com/dotmarketing/cms/comment/struts/CommentsForm.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-254", "CWE-264" ]
CVE-2016-8600
MEDIUM
5
dotCMS/core
getActiveDiv
src/com/dotmarketing/cms/comment/struts/CommentsForm.java
cb84b130065c9eed1d1df9e4770ffa5d4bd30569
0
Analyze the following code function for security vulnerabilities
public static boolean isEmptyOrWhitespaceOnly(String value) { return isEmpty(value) || (value.trim().length() == 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEmptyOrWhitespaceOnly File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
isEmptyOrWhitespaceOnly
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Override public void onRestoreInstanceState(@NonNull Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); // AsyncTask boolean inProgress = savedInstanceState.getBoolean(KEY_ASYNC_TASK_IN_PROGRESS); if (inProgress) { String username = savedInstanceState.getString(KEY_USERNAME); String password = savedInstanceState.getString(KEY_PASSWORD); OwnCloudCredentials credentials = OwnCloudCredentialsFactory.newBasicCredentials(username, password); accessRootFolder(credentials); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRestoreInstanceState File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
onRestoreInstanceState
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
public boolean ensureSearchEntityLoaded() { if (mySearchEntity == null) { Optional<Search> searchOpt = mySearchCacheSvc.fetchByUuid(myUuid); if (!searchOpt.isPresent()) { return false; } setSearchEntity(searchOpt.get()); ourLog.trace("Retrieved search with version {} and total {}", mySearchEntity.getVersion(), mySearchEntity.getTotalCount()); return true; } if (mySearchEntity.getSearchType() == SearchTypeEnum.HISTORY) { if (mySearchEntity.getTotalCount() == null) { new TransactionTemplate(myTxManager).executeWithoutResult(t->{ HistoryBuilder historyBuilder = myHistoryBuilderFactory.newHistoryBuilder(mySearchEntity.getResourceType(), mySearchEntity.getResourceId(), mySearchEntity.getLastUpdatedLow(), mySearchEntity.getLastUpdatedHigh()); Long count = historyBuilder.fetchCount(getRequestPartitionId()); mySearchEntity.setTotalCount(count.intValue()); }); } } return true; }
Vulnerability Classification: - CWE: CWE-400 - CVE: CVE-2021-32053 - Severity: MEDIUM - CVSS Score: 5.0 Description: Address DOS issue in History operation Function: ensureSearchEntityLoaded File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java Repository: hapifhir/hapi-fhir Fixed Code: public boolean ensureSearchEntityLoaded() { if (mySearchEntity == null) { Optional<Search> searchOpt = mySearchCacheSvc.fetchByUuid(myUuid); if (!searchOpt.isPresent()) { return false; } setSearchEntity(searchOpt.get()); ourLog.trace("Retrieved search with version {} and total {}", mySearchEntity.getVersion(), mySearchEntity.getTotalCount()); return true; } if (mySearchEntity.getSearchType() == SearchTypeEnum.HISTORY) { if (mySearchEntity.getTotalCount() == null) { calculateHistoryCount(); } } return true; }
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
ensureSearchEntityLoaded
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
1
Analyze the following code function for security vulnerabilities
private void parseInitialization(final Node root) throws GameParseException { // parse territory owners final Node owner = getSingleChild("ownerInitialize", root, true); if (owner != null) { parseOwner(getChildren("territoryOwner", owner)); } // parse initial unit placement final Node unit = getSingleChild("unitInitialize", root, true); if (unit != null) { parseUnitPlacement(getChildren("unitPlacement", unit)); parseHeldUnits(getChildren("heldUnits", unit)); } // parse resources given final Node resource = getSingleChild("resourceInitialize", root, true); if (resource != null) { parseResourceInitialization(getChildren("resourceGiven", resource)); } // parse relationships final Node relationInitialize = getSingleChild("relationshipInitialize", root, true); if (relationInitialize != null) { parseRelationInitialize(getChildren("relationship", relationInitialize)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseInitialization File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseInitialization
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public void createBaseFileAssetFields(Structure structure) throws DotDataException, DotStateException { if (structure == null || !InodeUtils.isSet(structure.getInode())) { throw new DotStateException("Cannot create base fileasset fields on a structure that doesn't exist"); } if (structure.getStructureType() != Structure.STRUCTURE_TYPE_FILEASSET) { throw new DotStateException("Cannot create base fileasset fields on a structure that is not a file asset"); } Field field = new Field(HOST_FOLDER_FIELD_NAME, Field.FieldType.HOST_OR_FOLDER, Field.DataType.TEXT, structure, true, false, true, 1, "", "", "", true, false, true); field.setVelocityVarName(HOST_FOLDER_FIELD); FieldFactory.saveField(field); field = new Field(BINARY_FIELD_NAME, Field.FieldType.BINARY, Field.DataType.BINARY, structure, true, false, false, 2, "", "", "", true, false, false); field.setVelocityVarName(BINARY_FIELD); FieldFactory.saveField(field); field = new Field(TITLE_FIELD_NAME, Field.FieldType.TEXT, Field.DataType.TEXT, structure, true, true, true, 3, "", "", "", true, false, true); field.setVelocityVarName(TITLE_FIELD); field.setListed(false); FieldFactory.saveField(field); field = new Field(FILE_NAME_FIELD_NAME, Field.FieldType.TEXT, Field.DataType.TEXT, structure, false, true, true, 4, "", "", "", true, true, true); field.setVelocityVarName(FILE_NAME_FIELD); FieldFactory.saveField(field); field = new Field(META_DATA_TAB_NAME, Field.FieldType.TAB_DIVIDER, Field.DataType.SECTION_DIVIDER, structure, false, false, false, 5, "", "", "", false, false, false); field.setVelocityVarName("MetadataTab"); FieldFactory.saveField(field); field = new Field(META_DATA_FIELD_NAME, Field.FieldType.KEY_VALUE, Field.DataType.LONG_TEXT, structure, false, false, false, 6, "", "", "", true, true, true); field.setVelocityVarName(META_DATA_FIELD); FieldFactory.saveField(field); field = new Field(SHOW_ON_MENU_NAME, Field.FieldType.CHECKBOX, Field.DataType.TEXT, structure, false, false, true, 7, "|true", "false", "", true, false, false); field.setVelocityVarName(SHOW_ON_MENU); FieldFactory.saveField(field); field = new Field(SORT_ORDER_NAME, Field.FieldType.TEXT, Field.DataType.INTEGER, structure, false, false, true, 8, "", "0", "", true, false, false); field.setVelocityVarName(SORT_ORDER); FieldFactory.saveField(field); field = new Field(DESCRIPTION_NAME, Field.FieldType.TEXT, Field.DataType.TEXT, structure, false, true, true, 9, "", "", "", true, false, true); field.setVelocityVarName(DESCRIPTION); field.setListed(false); field.setSearchable(false); FieldFactory.saveField(field); FieldsCache.clearCache(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBaseFileAssetFields File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
createBaseFileAssetFields
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
protected Context getApplicationContext() { return mApplicationContext; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationContext 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
getApplicationContext
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void addImmutableTypeDynamically(String className, boolean isReferenceable) { Class type = JVM.loadClassForName(className); if (type != null) { addImmutableType(type, isReferenceable); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addImmutableTypeDynamically File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
addImmutableTypeDynamically
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Override public void next(String packageName) { mSessionCb.next(packageName, Binder.getCallingPid(), Binder.getCallingUid()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next 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
next
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
boolean shouldCheckTokenVisibleRequested() { return mActivityRecord != null || mToken.asWallpaperToken() != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldCheckTokenVisibleRequested File: services/core/java/com/android/server/wm/WindowState.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
shouldCheckTokenVisibleRequested
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
ContentViewDownloadDelegate getDownloadDelegate() { return mDownloadDelegate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDownloadDelegate File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getDownloadDelegate
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void select(String sql, JsonArray params, Handler<AsyncResult<ResultSet>> replyHandler) { client.getConnection(conn -> select(conn, sql, params, closeAndHandleResult(conn, replyHandler))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: select 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
select
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public boolean isUsingUnifiedPassword(ComponentName admin) { if (!mHasFeature) { return true; } Objects.requireNonNull(admin, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) || isProfileOwner(caller)); Preconditions.checkCallingUser(isManagedProfile(caller.getUserId())); return !isSeparateProfileChallengeEnabled(caller.getUserId()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUsingUnifiedPassword 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
isUsingUnifiedPassword
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static ShortcutPackage loadFromXml(ShortcutService s, ShortcutUser shortcutUser, TypedXmlPullParser parser, boolean fromBackup) throws IOException, XmlPullParserException { final String packageName = ShortcutService.parseStringAttribute(parser, ATTR_NAME); final ShortcutPackage ret = new ShortcutPackage(shortcutUser, shortcutUser.getUserId(), packageName); synchronized (ret.mLock) { ret.mIsAppSearchSchemaUpToDate = ShortcutService.parseIntAttribute( parser, ATTR_SCHEMA_VERSON, 0) == AppSearchShortcutInfo.SCHEMA_VERSION; ret.mApiCallCount = ShortcutService.parseIntAttribute(parser, ATTR_CALL_COUNT); ret.mLastResetTime = ShortcutService.parseLongAttribute(parser, ATTR_LAST_RESET); final int outerDepth = parser.getDepth(); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { if (type != XmlPullParser.START_TAG) { continue; } final int depth = parser.getDepth(); final String tag = parser.getName(); if (depth == outerDepth + 1) { switch (tag) { case ShortcutPackageInfo.TAG_ROOT: ret.getPackageInfo().loadFromXml(parser, fromBackup); continue; case TAG_SHORTCUT: try { final ShortcutInfo si = parseShortcut(parser, packageName, shortcutUser.getUserId(), fromBackup); // Don't use addShortcut(), we don't need to save the icon. ret.mShortcuts.put(si.getId(), si); } catch (Exception e) { // b/246540168 malformed shortcuts should be ignored Slog.e(TAG, "Failed parsing shortcut.", e); } continue; case TAG_SHARE_TARGET: ret.mShareTargets.add(ShareTargetInfo.loadFromXml(parser)); continue; } } ShortcutService.warnForInvalidTag(depth, tag); } } return ret; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadFromXml 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
loadFromXml
services/core/java/com/android/server/pm/ShortcutPackage.java
ae768fbb9975fdab267f525831cb52f485ab0ecc
0
Analyze the following code function for security vulnerabilities
private void renderInit(XWikiContext xcontext) throws Exception { RenderingContext renderingContext = Utils.getComponent(RenderingContext.class); MutableRenderingContext mutableRenderingContext = renderingContext instanceof MutableRenderingContext ? (MutableRenderingContext) renderingContext : null; if (mutableRenderingContext != null) { mutableRenderingContext.push(renderingContext.getTransformation(), renderingContext.getXDOM(), renderingContext.getDefaultSyntax(), "init.vm", renderingContext.isRestricted(), Syntax.XHTML_1_0); } xcontext.getResponse().setStatus(202); xcontext.getResponse().setContentType("text/html; charset=UTF-8"); try { Utils.getComponent(TemplateManager.class).render("init.vm", xcontext.getResponse().getWriter()); } finally { if (mutableRenderingContext != null) { mutableRenderingContext.pop(); } } xcontext.getResponse().flushBuffer(); xcontext.setFinished(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderInit File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
renderInit
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
0
Analyze the following code function for security vulnerabilities
@Deprecated // since 2.12 protected void _failDoubleToIntCoercion(JsonParser p, DeserializationContext ctxt, String type) throws IOException { ctxt.reportInputMismatch(handledType(), "Cannot coerce a floating-point value ('%s') into %s (enable `DeserializationFeature.ACCEPT_FLOAT_AS_INT` to allow)", p.getValueAsString(), type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _failDoubleToIntCoercion File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_failDoubleToIntCoercion
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
@Override public boolean isNdefPushEnabled() throws RemoteException { synchronized (NfcService.this) { return mState == NfcAdapter.STATE_ON && mIsNdefPushEnabled; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNdefPushEnabled File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
isNdefPushEnabled
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
private boolean isLocationProvidersAllowedRestricted(String name, int callingUserId, int owningUserId) { // Optimization - location providers are restricted only for managed profiles. if (callingUserId == owningUserId) { return false; } if (Settings.Secure.LOCATION_PROVIDERS_ALLOWED.equals(name) && mUserManager.hasUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, new UserHandle(callingUserId))) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLocationProvidersAllowedRestricted File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
isLocationProvidersAllowedRestricted
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
public void getAdminData(StudyBean study, DatasetBean dataset, OdmAdminDataBean data, String odmVersion) { String dbName = CoreResources.getDBName(); this.setStudyUsersTypesExpected(); ArrayList rows = this.select(this.getStudyUsersSql(study.getId() + "")); Iterator it = rows.iterator(); while (it.hasNext()) { HashMap row = (HashMap) it.next(); Integer userId = (Integer) row.get("user_id"); String firstName = (String) row.get("first_name"); String lastName = (String) row.get("last_name"); String organization = (String) row.get("institutional_affiliation"); UserBean user = new UserBean(); user.setOid("USR_" + userId); user.setFirstName(firstName); user.setLastName(lastName); user.setOrganization(organization); data.getUsers().add(user); } // LocationBean loc = new LocationBean(); // loc.setOid("LOC_"+study.getOid()); // loc.setName(study.getName()); MetaDataVersionRefBean meta = new MetaDataVersionRefBean(); meta.setElementDefOID(data.getMetaDataVersionOID()); meta.setStudyOID(study.getOid()); meta.setEffectiveDate(study.getCreatedDate()); // loc.setMetaDataVersionRef(meta); // data.getLocations().add(loc); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAdminData File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-24831
HIGH
7.5
OpenClinica
getAdminData
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
b152cc63019230c9973965a98e4386ea5322c18f
0
Analyze the following code function for security vulnerabilities
@CalledByNative protected long getNativePtr() { return mNativeTabAndroid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNativePtr 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
getNativePtr
chrome/android/java/src/org/chromium/chrome/browser/Tab.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void popPageAttributes() { pageInh.remove(pageInh.size() - 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: popPageAttributes 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
popPageAttributes
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private void instantCollapseNotificationPanel() { mNotificationPanel.instantCollapse(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: instantCollapseNotificationPanel 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
instantCollapseNotificationPanel
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void disableShortcuts(String packageName, List shortcutIds, CharSequence disabledMessage, int disabledMessageResId, @UserIdInt int userId) { verifyCaller(packageName, userId); Objects.requireNonNull(shortcutIds, "shortcutIds must be provided"); List<ShortcutInfo> changedShortcuts = null; List<ShortcutInfo> removedShortcuts = null; final ShortcutPackage ps; synchronized (mLock) { throwIfUserLockedL(userId); ps = getPackageShortcutsForPublisherLocked(packageName, userId); ps.ensureImmutableShortcutsNotIncludedWithIds((List<String>) shortcutIds, /*ignoreInvisible=*/ true); final String disabledMessageString = (disabledMessage == null) ? null : disabledMessage.toString(); for (int i = shortcutIds.size() - 1; i >= 0; i--) { final String id = Preconditions.checkStringNotEmpty((String) shortcutIds.get(i)); if (!ps.isShortcutExistsAndVisibleToPublisher(id)) { continue; } final ShortcutInfo deleted = ps.disableWithId(id, disabledMessageString, disabledMessageResId, /* overrideImmutable=*/ false, /*ignoreInvisible=*/ true, ShortcutInfo.DISABLED_REASON_BY_APP); if (deleted == null) { if (changedShortcuts == null) { changedShortcuts = new ArrayList<>(1); } changedShortcuts.add(ps.findShortcutById(id)); } else { if (removedShortcuts == null) { removedShortcuts = new ArrayList<>(1); } removedShortcuts.add(deleted); } } // We may have removed dynamic shortcuts which may have left a gap, so adjust the ranks. ps.adjustRanks(); } packageShortcutsChanged(ps, changedShortcuts, removedShortcuts); verifyStates(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: disableShortcuts File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
disableShortcuts
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private void updateAuthor() { // Temporary set as author of the document the current script author (until the document is saved) XWikiContext xcontext = getXWikiContext(); getDoc().setAuthorReference(xcontext.getAuthorReference()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateAuthor 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
updateAuthor
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
@Override public int getForegroundServiceType(ComponentName className, IBinder token) { synchronized (this) { return mServices.getForegroundServiceTypeLocked(className, token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getForegroundServiceType 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
getForegroundServiceType
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
protected void _reportInvalidOther(int mask, int ptr) throws JsonParseException { _inputPtr = ptr; _reportInvalidOther(mask); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _reportInvalidOther File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_reportInvalidOther
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@Override public String getHeader(String name) { return request.getHeader(name); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHeader File: sa-token-starter/sa-token-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getHeader
sa-token-starter/sa-token-servlet/src/main/java/cn/dev33/satoken/servlet/model/SaRequestForServlet.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
@Override public void onConnectChoiceRemoved(String choiceKey) { onUserConnectChoiceRemove(choiceKey); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onConnectChoiceRemoved File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
onConnectChoiceRemoved
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
static Details fromPlainPassword(String rawPassword) { return new Details(PASSWORD_ENCODER.encodePassword(rawPassword,null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromPlainPassword File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-200" ]
CVE-2014-2064
MEDIUM
5
jenkinsci/jenkins
fromPlainPassword
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
fbf96734470caba9364f04e0b77b0bae7293a1ec
0
Analyze the following code function for security vulnerabilities
@NonNull @Override public int[] getPermissionGids(@NonNull String permissionName, @UserIdInt int userId) { return mPermissionManagerServiceImpl.getPermissionGids(permissionName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionGids File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
getPermissionGids
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void connectionServiceFocusGained(Session.Info sessionInfo) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: connectionServiceFocusGained 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
connectionServiceFocusGained
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private final int reAddAppWindowsLocked(final DisplayContent displayContent, int index, WindowToken token) { final int NW = token.windows.size(); for (int i=0; i<NW; i++) { final WindowState win = token.windows.get(i); final DisplayContent winDisplayContent = win.getDisplayContent(); if (winDisplayContent == displayContent || winDisplayContent == null) { win.mDisplayContent = displayContent; index = reAddWindowLocked(index, win); } } return index; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reAddAppWindowsLocked File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
reAddAppWindowsLocked
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
private void saveGroupStateAsync(int groupId) { mSaveStateHandler.post(new SaveStateRunnable(groupId)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveGroupStateAsync File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
saveGroupStateAsync
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void initializeUi() { final int headerResId = R.string.downloading_administrator_header; final int titleResId = R.string.setup_device_progress; initializeLayoutParams(R.layout.empty_loading_layout, headerResId); setTitle(titleResId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeUi File: src/com/android/managedprovisioning/provisioning/AdminIntegratedFlowPrepareActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21275
HIGH
7.8
android
initializeUi
src/com/android/managedprovisioning/provisioning/AdminIntegratedFlowPrepareActivity.java
8277a2a946e617a7ea65056e4cedeb1fecf3a5f5
0
Analyze the following code function for security vulnerabilities
protected final NullValueProvider findValueNullProvider(DeserializationContext ctxt, SettableBeanProperty prop, PropertyMetadata propMetadata) throws JsonMappingException { if (prop != null) { return _findNullProvider(ctxt, prop, propMetadata.getValueNulls(), prop.getValueDeserializer()); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findValueNullProvider File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
findValueNullProvider
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
public void onUserForeground(int userId) { synchronized (mPackagesLock) { UserInfo user = mUsers.get(userId); long now = System.currentTimeMillis(); if (user == null || user.partial) { Slog.w(LOG_TAG, "userForeground: unknown user #" + userId); return; } if (now > EPOCH_PLUS_30_YEARS) { user.lastLoggedInTime = now; scheduleWriteUserLocked(user); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserForeground File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
onUserForeground
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
public synchronized void updateBoolean(String columnName, boolean x) throws SQLException { updateBoolean(findColumn(columnName), x); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateBoolean 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
updateBoolean
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
Set<String> names();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: names File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
names
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public void setPackageStoppedState(String packageName, boolean stopped, int userId) { if (!sUserManager.exists(userId)) return; final int uid = Binder.getCallingUid(); final int permission = mContext.checkCallingOrSelfPermission( android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE); final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED); enforceCrossUserPermission(uid, userId, true, true, "stop package"); // writer synchronized (mPackages) { if (mSettings.setPackageStoppedStateLPw(this, packageName, stopped, allowedByPermission, uid, userId)) { scheduleWritePackageRestrictionsLocked(userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackageStoppedState File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
setPackageStoppedState
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private native void nativePinchBy(long nativeContentViewCoreImpl, long timeMs, float anchorX, float anchorY, float deltaScale);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativePinchBy File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
nativePinchBy
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public String encodeUrl(String url) { return encodeURL(url); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encodeUrl File: src/java/winstone/WinstoneResponse.java Repository: jenkinsci/winstone The code follows secure coding practices.
[ "CWE-79" ]
CVE-2011-4344
LOW
2.6
jenkinsci/winstone
encodeUrl
src/java/winstone/WinstoneResponse.java
410ed3001d51c689cf59085b7417466caa2ded7b
0
Analyze the following code function for security vulnerabilities
public void setStringInputSource(ThreadContext context, IRubyObject data, IRubyObject url) { source = new InputSource(); ParserContext.setUrl(context, source, url); Ruby ruby = context.getRuntime(); if (!(data instanceof RubyString)) { throw ruby.newArgumentError("must be kind_of String"); } RubyString stringData = (RubyString) data; if (stringData.encoding(context) != null) { RubyString stringEncoding = stringData.encoding(context).asString(); String encName = NokogiriHelpers.getValidEncodingOrNull(stringEncoding); if (encName != null) { java_encoding = encName; } } ByteList bytes = stringData.getByteList(); stringDataSize = bytes.length() - bytes.begin(); ByteArrayInputStream stream = new ByteArrayInputStream(bytes.unsafeBytes(), bytes.begin(), bytes.length()); source.setByteStream(stream); source.setEncoding(java_encoding); }
Vulnerability Classification: - CWE: CWE-241 - CVE: CVE-2022-29181 - Severity: MEDIUM - CVSS Score: 6.4 Description: fix: {HTML4,XML}::SAX::{Parser,ParserContext} check arg types Previously, arguments of the wrong type might cause segfault on CRuby. Function: setStringInputSource File: ext/java/nokogiri/internals/ParserContext.java Repository: sparklemotion/nokogiri Fixed Code: public void setStringInputSource(ThreadContext context, IRubyObject data, IRubyObject url) { source = new InputSource(); ParserContext.setUrl(context, source, url); Ruby ruby = context.getRuntime(); if (!(data instanceof RubyString)) { throw ruby.newTypeError("must be kind_of String"); } RubyString stringData = (RubyString) data; if (stringData.encoding(context) != null) { RubyString stringEncoding = stringData.encoding(context).asString(); String encName = NokogiriHelpers.getValidEncodingOrNull(stringEncoding); if (encName != null) { java_encoding = encName; } } ByteList bytes = stringData.getByteList(); stringDataSize = bytes.length() - bytes.begin(); ByteArrayInputStream stream = new ByteArrayInputStream(bytes.unsafeBytes(), bytes.begin(), bytes.length()); source.setByteStream(stream); source.setEncoding(java_encoding); }
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
setStringInputSource
ext/java/nokogiri/internals/ParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
1
Analyze the following code function for security vulnerabilities
@NonNull public AccountAndUser[] getRunningAccounts() { final int[] runningUserIds; try { runningUserIds = ActivityManager.getService().getRunningUserIds(); } catch (RemoteException e) { // Running in system_server; should never happen throw new RuntimeException(e); } return getAccounts(runningUserIds); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRunningAccounts 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
getRunningAccounts
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private static EntityReferenceResolver<String> getRelativeEntityReferenceResolver() { return Utils.getComponent(EntityReferenceResolver.TYPE_STRING, "relative"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRelativeEntityReferenceResolver 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
getRelativeEntityReferenceResolver
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
@RequiresPermission(value = MANAGE_DEVICE_POLICY_RUNTIME_PERMISSIONS, conditional = true) public @PermissionGrantState int getPermissionGrantState(@Nullable ComponentName admin, @NonNull String packageName, @NonNull String permission) { throwIfParentInstance("getPermissionGrantState"); try { return mService.getPermissionGrantState(admin, mContext.getPackageName(), packageName, permission); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermissionGrantState 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
getPermissionGrantState
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); data.writeString(callingPackage); intent.writeToParcel(data, 0); data.writeString(resolvedType); data.writeStrongBinder(resultTo); data.writeString(resultWho); data.writeInt(requestCode); data.writeInt(startFlags); if (profilerInfo != null) { data.writeInt(1); profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); } else { data.writeInt(0); } if (options != null) { data.writeInt(1); options.writeToParcel(data, 0); } else { data.writeInt(0); } data.writeInt(userId); mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); reply.readException(); WaitResult result = WaitResult.CREATOR.createFromParcel(reply); reply.recycle(); data.recycle(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAndWait File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startActivityAndWait
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
void setMainWindowOpaque(boolean isOpaque) { final WindowState win = findMainWindow(); if (win == null) { return; } isOpaque = isOpaque & !PixelFormat.formatHasAlpha(win.getAttrs().format); win.mWinAnimator.setOpaqueLocked(isOpaque); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMainWindowOpaque 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
setMainWindowOpaque
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void trimApplications(boolean forceFullOomAdj, String oomAdjReason) { synchronized (this) { trimApplicationsLocked(forceFullOomAdj, oomAdjReason); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: trimApplications 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
trimApplications
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public ArtemisSecurityConfigurationBuilder withPathBlacklist(Collection<PathRule> blacklistedPaths) { this.blacklistedPaths = Set.copyOf(blacklistedPaths); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withPathBlacklist File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-501", "CWE-653" ]
CVE-2024-23682
HIGH
8.2
ls1intum/Ares
withPathBlacklist
src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java
4c146ff85a0fa6022087fb0cffa6b8021d51101f
0
Analyze the following code function for security vulnerabilities
@Override public boolean requiresWorkspaceForPolling() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requiresWorkspaceForPolling File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
requiresWorkspaceForPolling
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
@Override protected boolean onMiddleClicked() { switch (mStatusBar.getBarState()) { case StatusBarState.KEYGUARD: if (!mDozingOnDown) { mLockscreenGestureLogger.write( MetricsEvent.ACTION_LS_HINT, 0 /* lengthDp - N/A */, 0 /* velocityDp - N/A */); startUnlockHintAnimation(); } return true; case StatusBarState.SHADE_LOCKED: if (!mQsExpanded) { mStatusBar.goToKeyguard(); } return true; case StatusBarState.SHADE: // This gets called in the middle of the touch handling, where the state is still // that we are tracking the panel. Collapse the panel after this is done. post(mPostCollapseRunnable); return false; default: return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onMiddleClicked File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onMiddleClicked
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void addItemsToDeny0(final String[] items){ if (items == null){ return; } for (int i = 0; i < items.length; ++i) { String item = items[i]; this.addDenyInternal(item); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItemsToDeny0 File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
addItemsToDeny0
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
public ArtemisSecurityConfigurationBuilder withPath(Path executionPath) { this.executionPath = Objects.requireNonNull(executionPath); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withPath File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java Repository: ls1intum/Ares The code follows secure coding practices.
[ "CWE-501", "CWE-653" ]
CVE-2024-23682
HIGH
8.2
ls1intum/Ares
withPath
src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java
4c146ff85a0fa6022087fb0cffa6b8021d51101f
0
Analyze the following code function for security vulnerabilities
@Override public String getNameUnsafe() { return worldNameRef; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNameUnsafe File: worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
getNameUnsafe
worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
public List<BaseObject> updateXObjectsFromRequest(EntityReference classReference, String pref, XWikiContext context) throws XWikiException { DocumentReference absoluteClassReference = resolveClassReference(classReference); @SuppressWarnings("unchecked") Map<String, String[]> map = context.getRequest().getParameterMap(); List<Integer> objectsNumberDone = new ArrayList<Integer>(); List<BaseObject> objects = new ArrayList<BaseObject>(); String start = pref + LOCAL_REFERENCE_SERIALIZER.serialize(absoluteClassReference) + "_"; for (String name : map.keySet()) { if (name.startsWith(start)) { int pos = name.indexOf('_', start.length() + 1); String prefix = name.substring(0, pos); int num = Integer.decode(prefix.substring(prefix.lastIndexOf('_') + 1)).intValue(); if (!objectsNumberDone.contains(Integer.valueOf(num))) { objectsNumberDone.add(Integer.valueOf(num)); objects.add(updateXObjectFromRequest(classReference, pref, num, context)); } } } return objects; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateXObjectsFromRequest 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
updateXObjectsFromRequest
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
@Editable(name="User SSH Key Attribute", order=850, description="" + "Optionally specify name of the attribute inside the user LDAP entry whose values will be taken as user " + "SSH keys. SSH keys will be managed by LDAP only if this field is set") public String getUserSshKeyAttribute() { return userSshKeyAttribute; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserSshKeyAttribute File: server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-90" ]
CVE-2021-32651
MEDIUM
4.3
theonedev/onedev
getUserSshKeyAttribute
server-plugin/server-plugin-authenticator-ldap/src/main/java/io/onedev/server/plugin/authenticator/ldap/LdapAuthenticator.java
4440f0c57e440488d7e653417b2547eaae8ad19c
0
Analyze the following code function for security vulnerabilities
@Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true) public void editUser(SysUser user, String roles, String departs) { //step.1 修改用户基础信息 this.updateById(user); //step.2 修改角色 //处理用户角色 先删后加 sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId())); if(oConvertUtils.isNotEmpty(roles)) { String[] arr = roles.split(","); for (String roleId : arr) { SysUserRole userRole = new SysUserRole(user.getId(), roleId); sysUserRoleMapper.insert(userRole); } } //step.3 修改部门 String[] arr = {}; if(oConvertUtils.isNotEmpty(departs)){ arr = departs.split(","); } //查询已关联部门 List<SysUserDepart> userDepartList = sysUserDepartMapper.selectList(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId())); if(userDepartList != null && userDepartList.size()>0){ for(SysUserDepart depart : userDepartList ){ //修改已关联部门删除部门用户角色关系 if(!Arrays.asList(arr).contains(depart.getDepId())){ List<SysDepartRole> sysDepartRoleList = sysDepartRoleMapper.selectList( new QueryWrapper<SysDepartRole>().lambda().eq(SysDepartRole::getDepartId,depart.getDepId())); List<String> roleIds = sysDepartRoleList.stream().map(SysDepartRole::getId).collect(Collectors.toList()); if(roleIds != null && roleIds.size()>0){ departRoleUserMapper.delete(new QueryWrapper<SysDepartRoleUser>().lambda().eq(SysDepartRoleUser::getUserId, user.getId()) .in(SysDepartRoleUser::getDroleId,roleIds)); } } } } //先删后加 sysUserDepartMapper.delete(new QueryWrapper<SysUserDepart>().lambda().eq(SysUserDepart::getUserId, user.getId())); if(oConvertUtils.isNotEmpty(departs)) { for (String departId : arr) { SysUserDepart userDepart = new SysUserDepart(user.getId(), departId); sysUserDepartMapper.insert(userDepart); } } //step.4 修改手机号和邮箱 // 更新手机号、邮箱空字符串为 null userMapper.updateNullByEmptyString("email"); userMapper.updateNullByEmptyString("phone"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editUser File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
editUser
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
protected final void parseFeatures(XmlPullParser parser) throws Exception { streamFeatures.clear(); final int initialDepth = parser.getDepth(); while (true) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && parser.getDepth() == initialDepth + 1) { ExtensionElement streamFeature = null; String name = parser.getName(); String namespace = parser.getNamespace(); switch (name) { case StartTls.ELEMENT: streamFeature = PacketParserUtils.parseStartTlsFeature(parser); break; case Mechanisms.ELEMENT: streamFeature = new Mechanisms(PacketParserUtils.parseMechanisms(parser)); break; case Bind.ELEMENT: streamFeature = Bind.Feature.INSTANCE; break; case Session.ELEMENT: streamFeature = PacketParserUtils.parseSessionFeature(parser); break; case Compress.Feature.ELEMENT: streamFeature = PacketParserUtils.parseCompressionFeature(parser); break; default: ExtensionElementProvider<ExtensionElement> provider = ProviderManager.getStreamFeatureProvider(name, namespace); if (provider != null) { streamFeature = provider.parse(parser); } break; } if (streamFeature != null) { addStreamFeature(streamFeature); } } else if (eventType == XmlPullParser.END_TAG && parser.getDepth() == initialDepth) { break; } } if (hasFeature(Mechanisms.ELEMENT, Mechanisms.NAMESPACE)) { // Only proceed with SASL auth if TLS is disabled or if the server doesn't announce it if (!hasFeature(StartTls.ELEMENT, StartTls.NAMESPACE) || config.getSecurityMode() == SecurityMode.disabled) { saslFeatureReceived.reportSuccess(); } } // If the server reported the bind feature then we are that that we did SASL and maybe // STARTTLS. We can then report that the last 'stream:features' have been parsed if (hasFeature(Bind.ELEMENT, Bind.NAMESPACE)) { if (!hasFeature(Compress.Feature.ELEMENT, Compress.NAMESPACE) || !config.isCompressionEnabled()) { // This was was last features from the server is either it did not contain // compression or if we disabled it lastFeaturesReceived.reportSuccess(); } } afterFeaturesReceived(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseFeatures File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
parseFeatures
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected String escape(final String s) { if (s.startsWith("#")) { return StringUtil.EMPTY; } else if (s.startsWith("^") && s.endsWith("$")) { return "^" + Pattern.quote(s.substring(1, s.length() - 1)) + "$"; } else if (s.startsWith("^")) { return "^" + Pattern.quote(s.substring(1)); } else if (s.endsWith("$")) { return Pattern.quote(s.substring(0, s.length() - 1)) + "$"; } return Pattern.quote(s); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: escape File: src/main/java/org/codelibs/fess/util/GsaConfigParser.java Repository: codelibs/fess The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000822
HIGH
7.5
codelibs/fess
escape
src/main/java/org/codelibs/fess/util/GsaConfigParser.java
faa265b8d8f1c71e1bf3229fba5f8cc58a5611b7
0
Analyze the following code function for security vulnerabilities
public MetaClass getMetaclass() { return this.xwiki.getMetaclass(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMetaclass File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getMetaclass
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
protected static Document parseDocumentImpl(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(isNamespaceAware); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(inputSource); return document; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2014-125087 - Severity: MEDIUM - CVSS Score: 5.2 Description: Disable external entities by default to prevent XXE injection attacks, re #6 XML Builder classes now explicitly enable or disable 'external-general-entities' and 'external-parameter-entities' features of the DocumentBuilderFactory when #create or #parse methods are used. To prevent XML External Entity (XXE) injection attacks, these features are disabled by default. They can only be enabled by passing a true boolean value to new versions of the #create and #parse methods that accept a flag for this feature. Function: parseDocumentImpl File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder Fixed Code: protected static Document parseDocumentImpl( InputSource inputSource, boolean enableExternalEntities) throws ParserConfigurationException, SAXException, IOException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(isNamespaceAware); enableOrDisableExternalEntityParsing(factory, enableExternalEntities); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(inputSource); return document; }
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
parseDocumentImpl
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
1
Analyze the following code function for security vulnerabilities
private List<ValidationError> globalErrorsAsValidationErrors(BindingResult result) { return result.getGlobalErrors().stream() .map( error -> new ValidationError( "", error.getDefaultMessage(), convertErrorArguments(error.getArguments()))) .collect(Collectors.toList()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: globalErrorsAsValidationErrors File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
globalErrorsAsValidationErrors
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private String formatWithZeroZoneOffset(Instant date, String offset){ return '"' + FORMATTER.format(date).replaceFirst("Z$", offset) + '"'; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: formatWithZeroZoneOffset 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
formatWithZeroZoneOffset
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
public Service getService() { return service; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getService File: h2/src/main/org/h2/tools/Server.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
getService
h2/src/main/org/h2/tools/Server.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public static String getDiffString2(String prefix, int i, String suffix) { if(i==0) return ""; String s = Integer.toString(i); if(i>0) return prefix+"+"+s+suffix; else return prefix+s+suffix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDiffString2 File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
getDiffString2
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private static native @Nullable String nativeGetResourceTypeName(long ptr, @AnyRes int resid);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeGetResourceTypeName File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
nativeGetResourceTypeName
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private Proxy getProxy() { org.ballerinalang.toml.model.Proxy proxy = TomlParserUtils.readSettings().getProxy(); if (!"".equals(proxy.getHost())) { InetSocketAddress proxyInet = new InetSocketAddress(proxy.getHost(), proxy.getPort()); if (!"".equals(proxy.getUserName()) && "".equals(proxy.getPassword())) { Authenticator authenticator = new RemoteAuthenticator(); Authenticator.setDefault(authenticator); } return new Proxy(Proxy.Type.HTTP, proxyInet); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProxy File: compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/converters/URIDryConverter.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
getProxy
compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/converters/URIDryConverter.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
public static int calculateTau(int index, int height) { int tau = 0; for (int i = 0; i < height; i++) { if (((index >> i) & 1) == 0) { tau = i; break; } } return tau; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateTau File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
calculateTau
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSUtil.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
@CalledByNative public int getViewportSizeOffsetWidthPix() { return mViewportSizeOffsetWidthPix; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getViewportSizeOffsetWidthPix File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
getViewportSizeOffsetWidthPix
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public List<News> newsMoreRecentThan(String date){ Query query = em.createQuery("SELECT n FROM News n WHERE n.date > :d ORDER BY date DESC"); query.setParameter("d", date); @SuppressWarnings("unchecked") List<News> news = query.getResultList(); return news; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2014-125038 - Severity: MEDIUM - CVSS Score: 5.2 Description: data a funcionar mas sem proteger sql injection Function: newsMoreRecentThan File: Cnn-EJB/ejbModule/ejbs/NewsBean.java Repository: rfsimoes/IS_Projecto2 Fixed Code: public List<News> newsMoreRecentThan(String date){ Query query = em.createQuery("SELECT n FROM News n WHERE n.date > '"+date+"' ORDER BY date DESC"); //query.setParameter("d", date); @SuppressWarnings("unchecked") List<News> news = query.getResultList(); return news; }
[ "CWE-89" ]
CVE-2014-125038
MEDIUM
5.2
rfsimoes/IS_Projecto2
newsMoreRecentThan
Cnn-EJB/ejbModule/ejbs/NewsBean.java
aa128b2c9c9fdcbbf5ecd82c1e92103573017fe0
1
Analyze the following code function for security vulnerabilities
@Override public int doEndTag() throws JspException { RequestDataValueProcessor processor = getRequestContext().getRequestDataValueProcessor(); ServletRequest request = this.pageContext.getRequest(); if ((processor != null) && (request instanceof HttpServletRequest)) { writeHiddenFields(processor.getExtraHiddenFields((HttpServletRequest) request)); } this.tagWriter.endTag(); return EVAL_PAGE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doEndTag File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-1904
MEDIUM
4.3
spring-projects/spring-framework
doEndTag
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
private String getNotificationKeyForParent(ViewParent parent) { while (parent != null) { if (parent instanceof ExpandableNotificationRow) { return ((ExpandableNotificationRow) parent).getStatusBarNotification().getKey(); } parent = parent.getParent(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNotificationKeyForParent 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
getNotificationKeyForParent
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setConcurrentBuild(boolean b) throws IOException { concurrentBuild = b; save(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConcurrentBuild 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
setConcurrentBuild
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String getExternalAttachmentURL(String filename, String action, XWikiContext context) { URL url = context.getURLFactory().createAttachmentURL(filename, getSpace(), getName(), action, null, getDatabase(), context); return url.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExternalAttachmentURL 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
getExternalAttachmentURL
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public Builder setUseRawUrl(boolean useRawUrl) { this.useRawUrl = useRawUrl; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseRawUrl File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setUseRawUrl
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override public void crashApplicationWithType(int uid, int initialPid, String packageName, int userId, String message, boolean force, int exceptionTypeId) { crashApplicationWithTypeWithExtras(uid, initialPid, packageName, userId, message, force, exceptionTypeId, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: crashApplicationWithType 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
crashApplicationWithType
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private void begin(FilterEventParameters parameters) throws FilterException { DocumentReference documentReference = this.documentEntityResolver.resolve(this.currentEntityReference, getDefaultDocumentReference()); if (this.entity == null) { this.entity = new XWikiDocument(documentReference, this.currentLocale); } else { this.entity.setDocumentReference(documentReference); this.entity.setLocale(this.currentLocale); } // Find default author DocumentReference defaultAuthorDocumentReference; // TODO: move to UserReference based APIs in DocumentInstanceOutputProperties if (this.properties.isAuthorSet()) { defaultAuthorDocumentReference = this.properties.getAuthor(); } else { XWikiContext xcontext = xcontextProvider.get(); defaultAuthorDocumentReference = xcontext != null ? xcontext.getUserReference() : null; } UserReference defaultAuthorReference = this.userDocumentResolver.resolve(defaultAuthorDocumentReference); this.entity .setCreationDate(getDate(WikiDocumentFilter.PARAMETER_CREATION_DATE, this.currentLocaleParameters, null)); this.entity.getAuthors().setCreator(getUserReference(WikiDocumentFilter.PARAMETER_CREATION_AUTHOR, this.currentLocaleParameters, defaultAuthorReference)); this.entity.setDefaultLocale(this.currentDefaultLocale); this.entity.setSyntax(getSyntax(WikiDocumentFilter.PARAMETER_SYNTAX, parameters, null)); this.entity.setParentReference(getEntityReference(WikiDocumentFilter.PARAMETER_PARENT, parameters, null)); this.entity.setCustomClass(getString(WikiDocumentFilter.PARAMETER_CUSTOMCLASS, parameters, null)); this.entity.setTitle(getString(WikiDocumentFilter.PARAMETER_TITLE, parameters, null)); this.entity.setDefaultTemplate(getString(WikiDocumentFilter.PARAMETER_DEFAULTTEMPLATE, parameters, null)); this.entity.setValidationScript(getString(WikiDocumentFilter.PARAMETER_VALIDATIONSCRIPT, parameters, null)); this.entity.setHidden(getBoolean(WikiDocumentFilter.PARAMETER_HIDDEN, parameters, false)); this.entity.setMinorEdit(getBoolean(WikiDocumentFilter.PARAMETER_REVISION_MINOR, parameters, false)); this.entity.getAuthors().setEffectiveMetadataAuthor(getUserReference( WikiDocumentFilter.PARAMETER_REVISION_EFFECTIVEMETADATA_AUTHOR, parameters, defaultAuthorReference)); // Use effectuve metadata author as default as this value used to be used both both original and effective // metadata authors this.entity.getAuthors() .setOriginalMetadataAuthor(getUserReference(WikiDocumentFilter.PARAMETER_REVISION_ORIGINALMETADATA_AUTHOR, parameters, this.entity.getAuthors().getEffectiveMetadataAuthor())); this.entity.getAuthors().setContentAuthor( getUserReference(WikiDocumentFilter.PARAMETER_CONTENT_AUTHOR, parameters, defaultAuthorReference)); String revisions = getString(XWikiWikiDocumentFilter.PARAMETER_JRCSREVISIONS, this.currentLocaleParameters, null); if (revisions != null) { try { this.entity.setDocumentArchive(revisions); } catch (XWikiException e) { throw new FilterException("Failed to set document archive", e); } } if (this.currentVersion != null && this.properties.isVersionPreserved()) { if (VALID_VERSION.matcher(this.currentVersion).matches()) { this.entity.setVersion(this.currentVersion); } else if (NumberUtils.isDigits(this.currentVersion)) { this.entity.setVersion(this.currentVersion + ".1"); } else { // TODO: log something, probably a warning } } this.entity.setDate(getDate(WikiDocumentFilter.PARAMETER_REVISION_DATE, parameters, new Date())); this.entity.setComment(getString(WikiDocumentFilter.PARAMETER_REVISION_COMMENT, parameters, "")); this.entity.setContentUpdateDate(getDate(WikiDocumentFilter.PARAMETER_CONTENT_DATE, parameters, new Date())); // Content if (this.contentListener != null) { // Remember the current rendering context target syntax this.previousTargetSyntax = this.renderingContext.getTargetSyntax(); } if (parameters.containsKey(WikiDocumentFilter.PARAMETER_CONTENT)) { this.entity.setContent(getString(WikiDocumentFilter.PARAMETER_CONTENT, parameters, null)); if (this.contentListener != null) { // Cancel any existing content listener this.currentWikiPrinter = null; this.contentListener.setWrappedListener(null); } } else if (this.contentListener != null) { if (this.properties != null && this.properties.getDefaultSyntax() != null) { this.entity.setSyntax(this.properties.getDefaultSyntax()); } else { // Make sure to set the default syntax if none were provided this.entity.setSyntax(this.entity.getSyntax()); } ComponentManager componentManager = this.componentManagerProvider.get(); String syntaxString = this.entity.getSyntax().toIdString(); if (componentManager.hasComponent(PrintRendererFactory.class, syntaxString)) { PrintRendererFactory rendererFactory; try { rendererFactory = componentManager.getInstance(PrintRendererFactory.class, syntaxString); } catch (ComponentLookupException e) { throw new FilterException( String.format("Failed to find PrintRendererFactory for syntax [%s]", this.entity.getSyntax()), e); } this.currentWikiPrinter = new DefaultWikiPrinter(); ((MutableRenderingContext) this.renderingContext).setTargetSyntax(rendererFactory.getSyntax()); this.contentListener.setWrappedListener(rendererFactory.createRenderer(this.currentWikiPrinter)); } } // Initialize the class getBaseClassOutputFilterStream().setEntity(this.entity.getXClass()); }
Vulnerability Classification: - CWE: CWE-459 - CVE: CVE-2023-36468 - Severity: HIGH - CVSS Score: 8.8 Description: XWIKI-20594: Mark old revisions and deleted documents as restricted * Introduce a new "restricted" attribute on XWikiDocument * Mark any document that is restored from XML as restricted * Deny script right when the secure document is restricted * Make transformations restricted when the document is restricted * Do not execute Velocity in titles when the document is restricted * Make sure saved documents aren't restricted. * Add tests * Display a warning when a document is rendered in restricted mode and the user is advanced or there is actually an error in the output. Function: begin File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java Repository: xwiki/xwiki-platform Fixed Code: private void begin(FilterEventParameters parameters) throws FilterException { DocumentReference documentReference = this.documentEntityResolver.resolve(this.currentEntityReference, getDefaultDocumentReference()); if (this.entity == null) { this.entity = new XWikiDocument(documentReference, this.currentLocale); } else { this.entity.setDocumentReference(documentReference); this.entity.setLocale(this.currentLocale); } // Mark the document as restricted to avoid that any scripts are executed as scripts should only be executed // on the current, saved version, see https://jira.xwiki.org/browse/XWIKI-20594 this.entity.setRestricted(true); // Find default author DocumentReference defaultAuthorDocumentReference; // TODO: move to UserReference based APIs in DocumentInstanceOutputProperties if (this.properties.isAuthorSet()) { defaultAuthorDocumentReference = this.properties.getAuthor(); } else { XWikiContext xcontext = xcontextProvider.get(); defaultAuthorDocumentReference = xcontext != null ? xcontext.getUserReference() : null; } UserReference defaultAuthorReference = this.userDocumentResolver.resolve(defaultAuthorDocumentReference); this.entity .setCreationDate(getDate(WikiDocumentFilter.PARAMETER_CREATION_DATE, this.currentLocaleParameters, null)); this.entity.getAuthors().setCreator(getUserReference(WikiDocumentFilter.PARAMETER_CREATION_AUTHOR, this.currentLocaleParameters, defaultAuthorReference)); this.entity.setDefaultLocale(this.currentDefaultLocale); this.entity.setSyntax(getSyntax(WikiDocumentFilter.PARAMETER_SYNTAX, parameters, null)); this.entity.setParentReference(getEntityReference(WikiDocumentFilter.PARAMETER_PARENT, parameters, null)); this.entity.setCustomClass(getString(WikiDocumentFilter.PARAMETER_CUSTOMCLASS, parameters, null)); this.entity.setTitle(getString(WikiDocumentFilter.PARAMETER_TITLE, parameters, null)); this.entity.setDefaultTemplate(getString(WikiDocumentFilter.PARAMETER_DEFAULTTEMPLATE, parameters, null)); this.entity.setValidationScript(getString(WikiDocumentFilter.PARAMETER_VALIDATIONSCRIPT, parameters, null)); this.entity.setHidden(getBoolean(WikiDocumentFilter.PARAMETER_HIDDEN, parameters, false)); this.entity.setMinorEdit(getBoolean(WikiDocumentFilter.PARAMETER_REVISION_MINOR, parameters, false)); this.entity.getAuthors().setEffectiveMetadataAuthor(getUserReference( WikiDocumentFilter.PARAMETER_REVISION_EFFECTIVEMETADATA_AUTHOR, parameters, defaultAuthorReference)); // Use effectuve metadata author as default as this value used to be used both both original and effective // metadata authors this.entity.getAuthors() .setOriginalMetadataAuthor(getUserReference(WikiDocumentFilter.PARAMETER_REVISION_ORIGINALMETADATA_AUTHOR, parameters, this.entity.getAuthors().getEffectiveMetadataAuthor())); this.entity.getAuthors().setContentAuthor( getUserReference(WikiDocumentFilter.PARAMETER_CONTENT_AUTHOR, parameters, defaultAuthorReference)); String revisions = getString(XWikiWikiDocumentFilter.PARAMETER_JRCSREVISIONS, this.currentLocaleParameters, null); if (revisions != null) { try { this.entity.setDocumentArchive(revisions); } catch (XWikiException e) { throw new FilterException("Failed to set document archive", e); } } if (this.currentVersion != null && this.properties.isVersionPreserved()) { if (VALID_VERSION.matcher(this.currentVersion).matches()) { this.entity.setVersion(this.currentVersion); } else if (NumberUtils.isDigits(this.currentVersion)) { this.entity.setVersion(this.currentVersion + ".1"); } else { // TODO: log something, probably a warning } } this.entity.setDate(getDate(WikiDocumentFilter.PARAMETER_REVISION_DATE, parameters, new Date())); this.entity.setComment(getString(WikiDocumentFilter.PARAMETER_REVISION_COMMENT, parameters, "")); this.entity.setContentUpdateDate(getDate(WikiDocumentFilter.PARAMETER_CONTENT_DATE, parameters, new Date())); // Content if (this.contentListener != null) { // Remember the current rendering context target syntax this.previousTargetSyntax = this.renderingContext.getTargetSyntax(); } if (parameters.containsKey(WikiDocumentFilter.PARAMETER_CONTENT)) { this.entity.setContent(getString(WikiDocumentFilter.PARAMETER_CONTENT, parameters, null)); if (this.contentListener != null) { // Cancel any existing content listener this.currentWikiPrinter = null; this.contentListener.setWrappedListener(null); } } else if (this.contentListener != null) { if (this.properties != null && this.properties.getDefaultSyntax() != null) { this.entity.setSyntax(this.properties.getDefaultSyntax()); } else { // Make sure to set the default syntax if none were provided this.entity.setSyntax(this.entity.getSyntax()); } ComponentManager componentManager = this.componentManagerProvider.get(); String syntaxString = this.entity.getSyntax().toIdString(); if (componentManager.hasComponent(PrintRendererFactory.class, syntaxString)) { PrintRendererFactory rendererFactory; try { rendererFactory = componentManager.getInstance(PrintRendererFactory.class, syntaxString); } catch (ComponentLookupException e) { throw new FilterException( String.format("Failed to find PrintRendererFactory for syntax [%s]", this.entity.getSyntax()), e); } this.currentWikiPrinter = new DefaultWikiPrinter(); ((MutableRenderingContext) this.renderingContext).setTargetSyntax(rendererFactory.getSyntax()); this.contentListener.setWrappedListener(rendererFactory.createRenderer(this.currentWikiPrinter)); } } // Initialize the class getBaseClassOutputFilterStream().setEntity(this.entity.getXClass()); }
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
begin
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
1
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN) public long getRequiredStrongAuthTimeout(@Nullable ComponentName admin, @UserIdInt int userId) { if (mService != null) { try { return mService.getRequiredStrongAuthTimeout(admin, userId, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } return DEFAULT_STRONG_AUTH_TIMEOUT_MS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequiredStrongAuthTimeout 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
getRequiredStrongAuthTimeout
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void measure() { final int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); row.measure(spec, spec); measuredRowHeight = row.getMeasuredHeight(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: measure File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
measure
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@Override protected int doFinalInternal(byte[] output, int outputOffset, int maximumLen) throws IllegalBlockSizeException, BadPaddingException { EVP_AEAD_CTX cipherCtx = new EVP_AEAD_CTX(NativeCrypto.EVP_AEAD_CTX_init(evpAead, encodedKey, tagLen)); final int bytesWritten; try { if (isEncrypting()) { bytesWritten = NativeCrypto.EVP_AEAD_CTX_seal(cipherCtx, output, outputOffset, iv, buf, 0, bufCount, aad); } else { bytesWritten = NativeCrypto.EVP_AEAD_CTX_open(cipherCtx, output, outputOffset, iv, buf, 0, bufCount, aad); } } catch (BadPaddingException e) { Constructor<?> aeadBadTagConstructor = null; try { aeadBadTagConstructor = Class.forName("javax.crypto.AEADBadTagException") .getConstructor(String.class); } catch (ClassNotFoundException | NoSuchMethodException e2) { } if (aeadBadTagConstructor != null) { BadPaddingException badTagException = null; try { badTagException = (BadPaddingException) aeadBadTagConstructor.newInstance(e .getMessage()); badTagException.initCause(e.getCause()); } catch (IllegalAccessException | InstantiationException e2) { // Fall through } catch (InvocationTargetException e2) { throw (BadPaddingException) new BadPaddingException().initCause(e2 .getTargetException()); } if (badTagException != null) { throw badTagException; } } throw e; } reset(); return bytesWritten; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doFinalInternal File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
doFinalInternal
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
public JiffleRuntime getRuntimeInstance(Jiffle.RuntimeModel model) throws it.geosolutions.jaiext.jiffle.JiffleException { return createRuntimeInstance(model, getRuntimeBaseClass(model), false); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-24816 - Severity: HIGH - CVSS Score: 7.5 Description: Validate Jiffle input variable names according to grammar, escape javadocs when including Jiffle sources in output Function: getRuntimeInstance File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java Repository: geosolutions-it/jai-ext Fixed Code: public JiffleRuntime getRuntimeInstance(Jiffle.RuntimeModel model) throws it.geosolutions.jaiext.jiffle.JiffleException { return createRuntimeInstance(model, getRuntimeBaseClass(model), includeScript); }
[ "CWE-94" ]
CVE-2022-24816
HIGH
7.5
geosolutions-it/jai-ext
getRuntimeInstance
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/Jiffle.java
cb1d6565d38954676b0a366da4f965fef38da1cb
1