instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public void registerProcessObserver(IProcessObserver observer) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerProcessObserver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
registerProcessObserver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void listRepositories(String projectName, AsyncMethodCallback resultHandler) { handle(allAsList(projectManager.get(projectName).repos().list().entrySet().stream() .map(e -> convert(e.getKey(), e.getValue())) .collect(toList())), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listRepositories File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java Repository: line/centraldogma The code follows secure coding practices.
[ "CWE-862" ]
CVE-2021-38388
MEDIUM
6.5
line/centraldogma
listRepositories
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
private static String parseSoapMethodName(InputStream stream, String charEncoding) { try { // newInstance() et pas newFactory() pour java 1.5 (issue 367) final XMLInputFactory factory = XMLInputFactory.newInstance(); final XMLStreamReader xmlReader; if (charEncoding != null) { xmlReader = factory.createXMLStreamReader(stream, charEncoding); } else { xmlReader = factory.createXMLStreamReader(stream); } //best-effort parsing //start document, go to first tag xmlReader.nextTag(); //expect first tag to be "Envelope" if (!"Envelope".equals(xmlReader.getLocalName())) { LOG.debug("Unexpected first tag of SOAP request: '" + xmlReader.getLocalName() + "' (expected 'Envelope')"); return null; //failed } //scan for body tag if (!scanForChildTag(xmlReader, "Body")) { LOG.debug("Unable to find SOAP 'Body' tag"); return null; //failed } xmlReader.nextTag(); //tag is method name return "." + xmlReader.getLocalName(); } catch (final XMLStreamException e) { LOG.debug("Unable to parse SOAP request", e); //failed return null; } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-15531 - Severity: HIGH - CVSS Score: 7.5 Description: fix for security Function: parseSoapMethodName File: javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java Repository: javamelody Fixed Code: private static String parseSoapMethodName(InputStream stream, String charEncoding) { try { // newInstance() et pas newFactory() pour java 1.5 (issue 367) final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); // disable DTDs entirely for that factory factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); // disable external entities final XMLStreamReader xmlReader; if (charEncoding != null) { xmlReader = factory.createXMLStreamReader(stream, charEncoding); } else { xmlReader = factory.createXMLStreamReader(stream); } //best-effort parsing //start document, go to first tag xmlReader.nextTag(); //expect first tag to be "Envelope" if (!"Envelope".equals(xmlReader.getLocalName())) { LOG.debug("Unexpected first tag of SOAP request: '" + xmlReader.getLocalName() + "' (expected 'Envelope')"); return null; //failed } //scan for body tag if (!scanForChildTag(xmlReader, "Body")) { LOG.debug("Unable to find SOAP 'Body' tag"); return null; //failed } xmlReader.nextTag(); //tag is method name return "." + xmlReader.getLocalName(); } catch (final XMLStreamException e) { LOG.debug("Unable to parse SOAP request", e); //failed return null; } }
[ "CWE-611" ]
CVE-2018-15531
HIGH
7.5
javamelody
parseSoapMethodName
javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java
ef111822562d0b9365bd3e671a75b65bd0613353
1
Analyze the following code function for security vulnerabilities
protected UploadPackageResultDto performUploadPackage(MultipartFile pluginPackageFile, File localFilePath) { String pluginPackageFileName = pluginPackageFile.getName(); if (!localFilePath.exists()) { if (localFilePath.mkdirs()) { log.info("Create directory [{}] successful", localFilePath.getAbsolutePath()); } else { String errMsg = String.format("Create directory [%s] failed.", localFilePath.getAbsolutePath()); throw new WecubeCoreException("3099", errMsg, localFilePath.getAbsolutePath()); } } File dest = new File(localFilePath, "/" + pluginPackageFileName); try { log.info("new file location: {}, filename: {}, canonicalpath: {}, canonicalfilename: {}", dest.getAbsoluteFile(), dest.getName(), dest.getCanonicalPath(), dest.getCanonicalFile().getName()); pluginPackageFile.transferTo(dest); } catch (IOException e) { log.error("errors to transfer uploaded files.", e); throw new WecubeCoreException("Failed to upload package,due to " + e.getMessage()); } UploadPackageResultDto result = null; try { result = parsePackageFile(dest, localFilePath); log.info("Package uploaded successfully."); } catch (Exception e) { log.error("Errors to parse uploaded package file.", e); throw new WecubeCoreException("Failed to upload package due to " + e.getMessage()); } return result; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-45746 - Severity: MEDIUM - CVSS Score: 5.0 Description: #2297 fix filepath manipulation issue Function: performUploadPackage File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform Fixed Code: protected UploadPackageResultDto performUploadPackage(MultipartFile pluginPackageFile, File localFilePath) { String pluginPackageFileName = pluginPackageFile.getName(); if(!validateUploadFilename(pluginPackageFileName)){ log.info("Invalid upload filename:{}", pluginPackageFileName); throw new WecubeCoreException("Invalid upload filename."); } if (!localFilePath.exists()) { if (localFilePath.mkdirs()) { log.info("Create directory [{}] successful", localFilePath.getAbsolutePath()); } else { String errMsg = String.format("Create directory [%s] failed.", localFilePath.getAbsolutePath()); throw new WecubeCoreException("3099", errMsg, localFilePath.getAbsolutePath()); } } //TODO File dest = new File(localFilePath, "/" + pluginPackageFileName); try { log.info("new file location: {}, filename: {}, canonicalpath: {}, canonicalfilename: {}", dest.getAbsoluteFile(), dest.getName(), dest.getCanonicalPath(), dest.getCanonicalFile().getName()); pluginPackageFile.transferTo(dest); } catch (IOException e) { log.error("errors to transfer uploaded files.", e); throw new WecubeCoreException("Failed to upload package,due to " + e.getMessage()); } UploadPackageResultDto result = null; try { result = parsePackageFile(dest, localFilePath); log.info("Package uploaded successfully."); } catch (Exception e) { log.error("Errors to parse uploaded package file.", e); throw new WecubeCoreException("Failed to upload package due to " + e.getMessage()); } return result; }
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
performUploadPackage
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
1
Analyze the following code function for security vulnerabilities
public void setParamDialogtype(String value) { m_paramDialogtype = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setParamDialogtype File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
setParamDialogtype
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
@Deprecated public XWikiAttachmentStoreInterface getAttachmentStore() { return getDefaultAttachmentContentStore(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttachmentStore File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getAttachmentStore
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private String[] getStringArrayForLogging(List list, boolean calledOnParentInstance) { List<String> stringList = new ArrayList<String>(); stringList.add(calledOnParentInstance ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT); if (list == null) { stringList.add(NULL_STRING_ARRAY); } else { stringList.addAll((List<String>) list); } return stringList.toArray(new String[0]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStringArrayForLogging 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
getStringArrayForLogging
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean createContentFile(SysSite site, CmsContent entity, CmsCategory category, CmsCategoryModel categoryModel) { if (null != site && null != entity) { if (!entity.isOnlyUrl()) { if (null == category) { category = categoryService.getEntity(entity.getCategoryId()); } if (null == categoryModel) { categoryModel = categoryModelService .getEntity(new CmsCategoryModelId(entity.getCategoryId(), entity.getModelId())); } if (null != categoryModel && null != category) { try { if (site.isUseStatic() && CommonUtils.notEmpty(categoryModel.getTemplatePath())) { String filePath = createContentFile(site, entity, category, true, categoryModel.getTemplatePath(), null, null); contentService.updateUrl(entity.getId(), filePath, true); } else { Map<String, Object> model = new HashMap<>(); initContentUrl(site, entity); initContentCover(site, entity); initCategoryUrl(site, category); model.put("content", entity); model.put("category", category); model.put(AbstractFreemarkerView.CONTEXT_SITE, site); String filePath = FreeMarkerUtils.generateStringByString(category.getContentPath(), webConfiguration, model); contentService.updateUrl(entity.getId(), filePath, false); } return true; } catch (IOException | TemplateException e) { log.error(e.getMessage(), e); return false; } } } else if (null != entity.getQuoteContentId()) { if (null != categoryModel && null != category) { CmsContent quote = contentService.getEntity(entity.getQuoteContentId()); if (null != quote) { contentService.updateUrl(entity.getId(), quote.getUrl(), false); } } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createContentFile File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
createContentFile
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
public void removePresenceListeners() { _presenceListeners.clear(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removePresenceListeners File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
removePresenceListeners
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
private void syncPluginIssueAttachment(Platform platform, SyncIssuesResult syncIssuesResult, AttachmentModuleRelationMapper batchAttachmentModuleRelationMapper) { Map<String, List<PlatformAttachment>> attachmentMap = syncIssuesResult.getAttachmentMap(); if (MapUtils.isNotEmpty(attachmentMap)) { for (String issueId : attachmentMap.keySet()) { // 查询我们平台的附件 Set<String> jiraAttachmentSet = new HashSet<>(); List<FileAttachmentMetadata> allMsAttachments = getIssueFileAttachmentMetadata(issueId); Set<String> attachmentsNameSet = allMsAttachments.stream() .map(FileAttachmentMetadata::getName) .collect(Collectors.toSet()); List<PlatformAttachment> syncAttachments = attachmentMap.get(issueId); for (PlatformAttachment syncAttachment : syncAttachments) { String fileName = syncAttachment.getFileName(); String fileKey = syncAttachment.getFileKey(); if (!attachmentsNameSet.contains(fileName)) { jiraAttachmentSet.add(fileName); saveAttachmentModuleRelation(platform, issueId, fileName, fileKey, batchAttachmentModuleRelationMapper); } } // 删除Jira中不存在的附件 deleteSyncAttachment(batchAttachmentModuleRelationMapper, jiraAttachmentSet, allMsAttachments); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: syncPluginIssueAttachment 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
syncPluginIssueAttachment
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public float optFloat(String key) { return this.optFloat(key, Float.NaN); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optFloat File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
optFloat
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public static boolean isMatchAllNetworkSpecifier(WifiNetworkSpecifier specifier) { PatternMatcher ssidPatternMatcher = specifier.ssidPatternMatcher; Pair<MacAddress, MacAddress> bssidPatternMatcher = specifier.bssidPatternMatcher; if (ssidPatternMatcher.match(MATCH_EMPTY_SSID_PATTERN_PATH) && bssidPatternMatcher.equals(MATCH_ALL_BSSID_PATTERN)) { return true; } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isMatchAllNetworkSpecifier File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
isMatchAllNetworkSpecifier
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
private void updateRegionForModalActivityWindow(Region outRegion) { // If the inner bounds of letterbox is available, then it will be used as the // touchable region so it won't cover the touchable letterbox and the touch // events can slip to activity from letterbox. mActivityRecord.getLetterboxInnerBounds(mTmpRect); if (mTmpRect.isEmpty()) { final Rect transformedBounds = mActivityRecord.getFixedRotationTransformDisplayBounds(); if (transformedBounds != null) { // Task is in the same orientation as display, so the rotated bounds should be // chosen as the touchable region. Then when the surface layer transforms the // region to display space, the orientation will be consistent. mTmpRect.set(transformedBounds); } else { // If this is a modal window we need to dismiss it if it's not full screen // and the touch happens outside of the frame that displays the content. This // means we need to intercept touches outside of that window. The dim layer // user associated with the window (task or root task) will give us the good // bounds, as they would be used to display the dim layer. final TaskFragment taskFragment = getTaskFragment(); if (taskFragment != null) { final Task task = taskFragment.asTask(); if (task != null) { task.getDimBounds(mTmpRect); } else { mTmpRect.set(taskFragment.getBounds()); } } else if (getRootTask() != null) { getRootTask().getDimBounds(mTmpRect); } } } adjustRegionInFreefromWindowMode(mTmpRect); outRegion.set(mTmpRect); cropRegionToRootTaskBoundsIfNeeded(outRegion); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateRegionForModalActivityWindow 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
updateRegionForModalActivityWindow
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public Query build(MetaData metadata, Map<String, String> params, boolean isCountQuery) { final List<Criterion> criteria = criterionFactory.build(metadata, params); String queryToFormat = isCountQuery ? MAIN_COUNT_QUERY : MAIN_QUERY; String whereClausePart = secure(toClauses(criteria), metadata); String sortDirectionPart = metadata.getSortDirection().orElse(SORT_ASCENDING).toUpperCase(); String queryString = String.format(queryToFormat, whereClausePart, sortDirectionPart); Query query; if (isCountQuery) { query = entityManager.createNativeQuery(queryString); } else { query = entityManager.createNativeQuery(queryString, CaseDetailsEntity.class); } addParameters(query, criteria); return query; }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2019-15569 - Severity: HIGH - CVSS Score: 7.5 Description: refactored to prevent sql injection introducing an enum Function: build File: src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java Repository: hmcts/ccd-data-store-api Fixed Code: public Query build(MetaData metadata, Map<String, String> params, boolean isCountQuery) { final List<Criterion> criteria = criterionFactory.build(metadata, params); String queryToFormat = isCountQuery ? MAIN_COUNT_QUERY : MAIN_QUERY; String whereClausePart = secure(toClauses(criteria), metadata); SortDirection direction = SortDirection.fromOptionalString(metadata.getSortDirection()); String queryString = String.format(queryToFormat, whereClausePart, direction.name()); Query query; if (isCountQuery) { query = entityManager.createNativeQuery(queryString); } else { query = entityManager.createNativeQuery(queryString, CaseDetailsEntity.class); } addParameters(query, criteria); return query; }
[ "CWE-89" ]
CVE-2019-15569
HIGH
7.5
hmcts/ccd-data-store-api
build
src/main/java/uk/gov/hmcts/ccd/data/casedetails/search/SearchQueryFactoryOperation.java
c942d5ce847ab1b4acce8753320096e596b42c72
1
Analyze the following code function for security vulnerabilities
public void updateSendButton() { boolean hasAttachments = mediaPreviewAdapter != null && mediaPreviewAdapter.hasAttachments(); boolean useSendButtonToIndicateStatus = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("send_button_status", getResources().getBoolean(R.bool.send_button_status)); final Conversation c = this.conversation; final Presence.Status status; final String text = this.binding.textinput == null ? "" : this.binding.textinput.getText().toString(); final SendButtonAction action; if (hasAttachments) { action = SendButtonAction.TEXT; } else { action = SendButtonTool.getAction(getActivity(), c, text); } if (useSendButtonToIndicateStatus && c.getAccount().getStatus() == Account.State.ONLINE) { if (activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) { status = Presence.Status.OFFLINE; } else if (c.getMode() == Conversation.MODE_SINGLE) { status = c.getContact().getShownStatus(); } else { status = c.getMucOptions().online() ? Presence.Status.ONLINE : Presence.Status.OFFLINE; } } else { status = Presence.Status.OFFLINE; } this.binding.textSendButton.setTag(action); this.binding.textSendButton.setImageResource(SendButtonTool.getSendButtonImageResource(getActivity(), action, status)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSendButton File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
updateSendButton
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
private void verifyCaCert(X509Certificate caCert) throws GeneralSecurityException, IOException { CertificateFactory factory = CertificateFactory.getInstance("X.509"); CertPathValidator validator = CertPathValidator.getInstance(CertPathValidator.getDefaultType()); CertPath path = factory.generateCertPath(Arrays.asList(caCert)); PKIXParameters params; if (mUseInjectedPKIX) { params = mInjectedPKIXParameters; } else { KeyStore ks = KeyStore.getInstance("AndroidCAStore"); ks.load(null, null); params = new PKIXParameters(ks); params.setRevocationEnabled(false); } validator.validate(path, params); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyCaCert 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
verifyCaCert
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@Override public void willStop() { log.info("Stopping UI Framework module"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: willStop File: api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java Repository: openmrs/openmrs-module-uiframework The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-24621
MEDIUM
6.5
openmrs/openmrs-module-uiframework
willStop
api/src/main/java/org/openmrs/module/uiframework/UiFrameworkActivator.java
0422fa52c7eba3d96cce2936cb92897dca4b680a
0
Analyze the following code function for security vulnerabilities
public boolean hasExpired() { return maxAgeSeconds <= 0 && maxAgeSeconds != Long.MIN_VALUE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasExpired File: src/gribbit/auth/Cookie.java Repository: lukehutch/gribbit The code follows secure coding practices.
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
hasExpired
src/gribbit/auth/Cookie.java
620418df247aebda3dd4be1dda10fe229ea505dd
0
Analyze the following code function for security vulnerabilities
@Override public final void activityRelaunched(IBinder token) { final long origId = Binder.clearCallingIdentity(); synchronized (this) { mStackSupervisor.activityRelaunchedLocked(token); } Binder.restoreCallingIdentity(origId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: activityRelaunched File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
activityRelaunched
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public <E> PageInfo<E> doSelectPageInfo(ISelect select) { select.doSelect(); return (PageInfo<E>) this.toPageInfo(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doSelectPageInfo File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
doSelectPageInfo
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
private void runArchiveFinalizers() throws ArchiverException { if (finalizers != null) { for (ArchiveFinalizer finalizer : finalizers) { finalizer.finalizeArchiveExtraction(this); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runArchiveFinalizers File: src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java Repository: codehaus-plexus/plexus-archiver The code follows secure coding practices.
[ "CWE-22", "CWE-61" ]
CVE-2023-37460
CRITICAL
9.8
codehaus-plexus/plexus-archiver
runArchiveFinalizers
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
54759839fbdf85caf8442076f001d5fd64e0dcb2
0
Analyze the following code function for security vulnerabilities
public static File buildUniqueFile(File parent, String mimeType, String displayName) throws FileNotFoundException { final String[] parts = splitFileName(mimeType, displayName); return buildUniqueFileWithExtension(parent, parts[0], parts[1]); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildUniqueFile File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
buildUniqueFile
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
public Endpoint getLogoutOIDCEndpoint() throws URISyntaxException { return getEndPoint(LogoutOIDCEndpoint.HINT); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogoutOIDCEndpoint File: oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java Repository: xwiki-contrib/oidc The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39387
HIGH
7.5
xwiki-contrib/oidc
getLogoutOIDCEndpoint
oidc-authenticator/src/main/java/org/xwiki/contrib/oidc/auth/internal/OIDCClientConfiguration.java
0247af1417925b9734ab106ad7cd934ee870ac89
0
Analyze the following code function for security vulnerabilities
ComponentName getSysUiServiceComponentLocked() { if (mSysUiServiceComponent == null) { final PackageManagerInternal pm = getPackageManagerInternalLocked(); mSysUiServiceComponent = pm.getSystemUiServiceComponent(); } return mSysUiServiceComponent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSysUiServiceComponentLocked File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getSysUiServiceComponentLocked
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
protected static long getLongValue(final String parameterName, final String value, long defaultValue) { if (isNullOrEmpty(value)) { return defaultValue; } return getLongValue(parameterName, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLongValue File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
getLongValue
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Test public void parseQueryTSUIDTypeWRateAndDS() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&tsuid=sum:1m-sum:rate:010101"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals(1, sub.getTsuids().size()); assertEquals("010101", sub.getTsuids().get(0)); assertEquals("1m-sum", sub.getDownsample()); assertTrue(sub.getRate()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryTSUIDTypeWRateAndDS File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryTSUIDTypeWRateAndDS
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public static List<Node> getNodes(Node node, String... nodePath) { List<Node> res = new ArrayList<>(); getMatchingNodes(node, nodePath, 0, res); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNodes File: src/edu/stanford/nlp/time/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
getNodes
src/edu/stanford/nlp/time/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
public boolean isDebugging() { return debugging; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDebugging File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
isDebugging
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public double getPluralOperand(Operand operand) { // If this assertion fails, you need to call roundToInfinity() or some other rounding method. // See the comment at the top of this file explaining the "isApproximate" field. assert !isApproximate; switch (operand) { case i: // Invert the negative sign if necessary return isNegative() ? -toLong(true) : toLong(true); case f: return toFractionLong(true); case t: return toFractionLong(false); case v: return fractionCount(); case w: return fractionCountWithoutTrailingZeros(); default: return Math.abs(toDouble()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPluralOperand File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java Repository: unicode-org/icu The code follows secure coding practices.
[ "CWE-190" ]
CVE-2018-18928
HIGH
7.5
unicode-org/icu
getPluralOperand
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
0
Analyze the following code function for security vulnerabilities
private void createBufferFD() throws SSLException { debug("JSSEngine: createBufferFD()"); // Create the basis for the ssl_fd from the pair of buffers we created // above. PRFDProxy fd; if (peer_info != null && peer_info.length() != 0) { // When we have peer information, indicate it via BufferPRFD so // that NSS can use it for session resumption. fd = PR.NewBufferPRFD(read_buf, write_buf, peer_info.getBytes()); } else { fd = PR.NewBufferPRFD(read_buf, write_buf, null); } if (fd == null) { throw new SSLException("Error creating buffer-backed PRFileDesc."); } SSLFDProxy model = null; if (as_server) { // As a performance improvement, we can copy the server template // (containing the desired key and certificate) rather than // re-creating it from scratch. This saves a significant amount of // time during construction. The implementation lives in JSSEngine, // to be shared by all other JSSEngine implementations. model = getServerTemplate(cert, key); } // Initialize ssl_fd from the model Buffer-backed PRFileDesc. ssl_fd = SSL.ImportFD(model, fd); if (ssl_fd == null) { PR.Close(fd); throw new SSLException("Error creating SSL socket on top of buffer-backed PRFileDesc."); } fd = null; closed_fd = false; // Turn on SSL Alert Logging for the ssl_fd object. int ret = SSL.EnableAlertLogging(ssl_fd); if (ret == SSL.SECFailure) { throw new SSLException("Unable to enable SSL Alert Logging on this SSLFDProxy instance."); } // Turn on notifications of handshake completion. This is the best // source of this information, compared to SSL_SecurityStatus().on; // the latter can indicate "on" before the final FINISHED method has // been sent. ret = SSL.EnableHandshakeCallback(ssl_fd); if (ret == SSL.SECFailure) { throw new SSLException("Unable to enable SSL Handshake Callback on this SSLFDProxy instance."); } // Pass this ssl_fd to the session object so that we can use // SSL methods to invalidate the session. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createBufferFD File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
createBufferFD
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
protected boolean shouldRenderPeerImage() { return lightweightMode || !isInitialized(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldRenderPeerImage File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
shouldRenderPeerImage
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public VolumeManager getVolumeManager() { return volumeManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVolumeManager File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2018-12418
MEDIUM
4.3
junrar
getVolumeManager
src/main/java/com/github/junrar/Archive.java
ad8d0ba8e155630da8a1215cee3f253e0af45817
0
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void stopOneTimePermissionSession(@NonNull String packageName) { try { mPermissionManager.stopOneTimePermissionSession(packageName, mContext.getUserId()); } catch (RemoteException e) { e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopOneTimePermissionSession File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
stopOneTimePermissionSession
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public List<List<ObjectDiff>> getObjectDiff(Document origdoc, Document newdoc) { try { if ((origdoc == null) && (newdoc == null)) { return Collections.emptyList(); } if (origdoc == null) { return this.doc.getObjectDiff(new XWikiDocument(newdoc.getDocumentReference()), newdoc.doc, getXWikiContext()); } if (newdoc == null) { return this.doc.getObjectDiff(origdoc.doc, new XWikiDocument(origdoc.getDocumentReference()), getXWikiContext()); } return this.doc.getObjectDiff(origdoc.doc, newdoc.doc, getXWikiContext()); } catch (Exception e) { java.lang.Object[] args = { origdoc.getFullName(), origdoc.getVersion(), newdoc.getVersion() }; List list = new ArrayList(); XWikiException xe = new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_OBJECT_ERROR, "Error while making meta object diff of {0} between version {1} and version {2}", e, args); String errormsg = Util.getHTMLExceptionMessage(xe, getXWikiContext()); list.add(errormsg); return list; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getObjectDiff 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
getObjectDiff
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public String display(String fieldname, String type, String pref, BaseObject obj, String wrappingSyntaxId, boolean isolated, XWikiContext context) { if (obj == null) { return ""; } boolean isInRenderingEngine = BooleanUtils.toBoolean((Boolean) context.get("isInRenderingEngine")); HashMap<String, Object> backup = new HashMap<String, Object>(); XWikiDocument currentSDoc = (XWikiDocument )context.get(CKEY_SDOC); try { if (isolated) { backupContext(backup, context); setAsContextDoc(context); } // Make sure to execute with the right of the document author instead of the content author // (because modifying object property does not modify content author) XWikiDocument sdoc = obj.getOwnerDocument(); if (sdoc != null && !Objects.equals(sdoc.getContentAuthorReference(), sdoc.getAuthorReference())) { // Hack the sdoc to make test module believe the content author is the author sdoc = sdoc.clone(); sdoc.setContentAuthorReference(sdoc.getAuthorReference()); context.put(CKEY_SDOC, sdoc); } type = type.toLowerCase(); StringBuffer result = new StringBuffer(); PropertyClass pclass = (PropertyClass) obj.getXClass(context).get(fieldname); String prefix = pref + LOCAL_REFERENCE_SERIALIZER.serialize(obj.getXClass(context).getDocumentReference()) + "_" + obj.getNumber() + "_"; if (pclass == null) { return ""; } else if (pclass.isCustomDisplayed(context)) { pclass.displayCustom(result, fieldname, prefix, type, obj, context); } else if (type.equals("view")) { pclass.displayView(result, fieldname, prefix, obj, isolated, context); } else if (type.equals("rendered")) { String fcontent = pclass.displayView(fieldname, prefix, obj, context); // This mode is deprecated for the new rendering and should also be removed for the old rendering // since the way to implement this now is to choose the type of rendering to do in the class itself. // Thus for the new rendering we simply make this mode work like the "view" mode. if (is10Syntax(wrappingSyntaxId)) { result.append(getRenderedContent(fcontent, getSyntaxId(), context)); } else { result.append(fcontent); } } else if (type.equals("edit")) { context.addDisplayedField(fieldname); // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId)) { // Don't use pre when not in the rendernig engine since for template we don't evaluate wiki syntax. if (isInRenderingEngine) { result.append("{pre}"); } } pclass.displayEdit(result, fieldname, prefix, obj, context); if (is10Syntax(wrappingSyntaxId)) { if (isInRenderingEngine) { result.append("{/pre}"); } } } else if (type.equals("hidden")) { // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{pre}"); } pclass.displayHidden(result, fieldname, prefix, obj, context); if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{/pre}"); } } else if (type.equals("search")) { // Backward compatibility // Check if the method has been injected using aspects Method searchMethod = null; for (Method method : pclass.getClass().getMethods()) { if (method.getName().equals("displaySearch") && method.getParameterTypes().length == 5) { searchMethod = method; break; } } if (searchMethod != null) { // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does // the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{pre}"); } prefix = LOCAL_REFERENCE_SERIALIZER.serialize(obj.getXClass(context).getDocumentReference()) + "_"; searchMethod.invoke(pclass, result, fieldname, prefix, context.get("query"), context); if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{/pre}"); } } else { pclass.displayView(result, fieldname, prefix, obj, context); } } else { pclass.displayView(result, fieldname, prefix, obj, context); } // If we're in new rendering engine we want to wrap the HTML returned by displayView() in // a {{html/}} macro so that the user doesn't have to do it. // We test if we're inside the rendering engine since it's also possible that this display() method is // called directly from a template and in this case we only want HTML as a result and not wiki syntax. // TODO: find a more generic way to handle html macro because this works only for XWiki 1.0 and XWiki 2.0 // Add the {{html}}{{/html}} only when result really contains html since it's not needed for pure text if (isInRenderingEngine && !is10Syntax(wrappingSyntaxId) && HTMLUtils.containsElementText(result)) { result.insert(0, "{{html clean=\"false\" wiki=\"false\"}}"); result.append("{{/html}}"); } return result.toString(); } catch (Exception ex) { // TODO: It would better to check if the field exists rather than catching an exception // raised by a NPE as this is currently the case here... LOGGER.warn("Failed to display field [" + fieldname + "] in [" + type + "] mode for Object of Class [" + getDefaultEntityReferenceSerializer().serialize(obj.getDocumentReference()) + "]", ex); return ""; } finally { if (!backup.isEmpty()) { restoreContext(backup, context); } context.put(CKEY_SDOC, currentSDoc); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2023-29523 - Severity: HIGH - CVSS Score: 8.8 Description: XWIKI-20327: Escape closing HTML macro in XWikiDocument#display Function: display File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform Fixed Code: public String display(String fieldname, String type, String pref, BaseObject obj, String wrappingSyntaxId, boolean isolated, XWikiContext context) { if (obj == null) { return ""; } boolean isInRenderingEngine = BooleanUtils.toBoolean((Boolean) context.get("isInRenderingEngine")); HashMap<String, Object> backup = new HashMap<String, Object>(); XWikiDocument currentSDoc = (XWikiDocument )context.get(CKEY_SDOC); try { if (isolated) { backupContext(backup, context); setAsContextDoc(context); } // Make sure to execute with the right of the document author instead of the content author // (because modifying object property does not modify content author) XWikiDocument sdoc = obj.getOwnerDocument(); if (sdoc != null && !Objects.equals(sdoc.getContentAuthorReference(), sdoc.getAuthorReference())) { // Hack the sdoc to make test module believe the content author is the author sdoc = sdoc.clone(); sdoc.setContentAuthorReference(sdoc.getAuthorReference()); context.put(CKEY_SDOC, sdoc); } type = type.toLowerCase(); StringBuffer result = new StringBuffer(); PropertyClass pclass = (PropertyClass) obj.getXClass(context).get(fieldname); String prefix = pref + LOCAL_REFERENCE_SERIALIZER.serialize(obj.getXClass(context).getDocumentReference()) + "_" + obj.getNumber() + "_"; if (pclass == null) { return ""; } else if (pclass.isCustomDisplayed(context)) { pclass.displayCustom(result, fieldname, prefix, type, obj, context); } else if (type.equals("view")) { pclass.displayView(result, fieldname, prefix, obj, isolated, context); } else if (type.equals("rendered")) { String fcontent = pclass.displayView(fieldname, prefix, obj, context); // This mode is deprecated for the new rendering and should also be removed for the old rendering // since the way to implement this now is to choose the type of rendering to do in the class itself. // Thus for the new rendering we simply make this mode work like the "view" mode. if (is10Syntax(wrappingSyntaxId)) { result.append(getRenderedContent(fcontent, getSyntaxId(), context)); } else { result.append(fcontent); } } else if (type.equals("edit")) { context.addDisplayedField(fieldname); // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId)) { // Don't use pre when not in the rendernig engine since for template we don't evaluate wiki syntax. if (isInRenderingEngine) { result.append("{pre}"); } } pclass.displayEdit(result, fieldname, prefix, obj, context); if (is10Syntax(wrappingSyntaxId)) { if (isInRenderingEngine) { result.append("{/pre}"); } } } else if (type.equals("hidden")) { // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{pre}"); } pclass.displayHidden(result, fieldname, prefix, obj, context); if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{/pre}"); } } else if (type.equals("search")) { // Backward compatibility // Check if the method has been injected using aspects Method searchMethod = null; for (Method method : pclass.getClass().getMethods()) { if (method.getName().equals("displaySearch") && method.getParameterTypes().length == 5) { searchMethod = method; break; } } if (searchMethod != null) { // If the Syntax id is "xwiki/1.0" then use the old rendering subsystem and prevent wiki syntax // rendering using the pre macro. In the new rendering system it's the XWiki Class itself that does // the // escaping. For example for a textarea check the TextAreaClass class. if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{pre}"); } prefix = LOCAL_REFERENCE_SERIALIZER.serialize(obj.getXClass(context).getDocumentReference()) + "_"; searchMethod.invoke(pclass, result, fieldname, prefix, context.get("query"), context); if (is10Syntax(wrappingSyntaxId) && isInRenderingEngine) { result.append("{/pre}"); } } else { pclass.displayView(result, fieldname, prefix, obj, context); } } else { pclass.displayView(result, fieldname, prefix, obj, context); } // If we're in new rendering engine we want to wrap the HTML returned by displayView() in // a {{html/}} macro so that the user doesn't have to do it. // We test if we're inside the rendering engine since it's also possible that this display() method is // called directly from a template and in this case we only want HTML as a result and not wiki syntax. // TODO: find a more generic way to handle html macro because this works only for XWiki 1.0 and XWiki 2.0 // Add the {{html}}{{/html}} only when result really contains html or { which could be part of an XWiki // macro syntax since it's not needed for pure text if (isInRenderingEngine && !is10Syntax(wrappingSyntaxId) && (HTMLUtils.containsElementText(result) || result.indexOf("{") != -1)) { result.insert(0, "{{html clean=\"false\" wiki=\"false\"}}"); // Escape closing HTML macro syntax. int startIndex = 0; // Start searching at the last match to avoid scanning the whole string again. while ((startIndex = result.indexOf(CLOSE_HTML_MACRO, startIndex)) != -1) { result.replace(startIndex, startIndex + 2, "&#123;&#123;"); } result.append(CLOSE_HTML_MACRO); } return result.toString(); } catch (Exception ex) { // TODO: It would better to check if the field exists rather than catching an exception // raised by a NPE as this is currently the case here... LOGGER.warn("Failed to display field [" + fieldname + "] in [" + type + "] mode for Object of Class [" + getDefaultEntityReferenceSerializer().serialize(obj.getDocumentReference()) + "]", ex); return ""; } finally { if (!backup.isEmpty()) { restoreContext(backup, context); } context.put(CKEY_SDOC, currentSDoc); } }
[ "CWE-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
display
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
1
Analyze the following code function for security vulnerabilities
public void playback() { fPlayback = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: playback File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
playback
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(name = "memory", meta = true) public static IRubyObject parse_memory(ThreadContext context, IRubyObject klazz, IRubyObject data, IRubyObject encoding) { Html4SaxParserContext ctx = Html4SaxParserContext.newInstance(context.runtime, (RubyClass) klazz); String javaEncoding = findEncodingName(context, encoding); if (javaEncoding != null) { CharSequence input = applyEncoding(rubyStringToString(data.convertToString()), javaEncoding); ByteArrayInputStream istream = new ByteArrayInputStream(input.toString().getBytes()); ctx.setInputSource(istream); ctx.getInputSource().setEncoding(javaEncoding); } return ctx; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parse_memory File: ext/java/nokogiri/Html4SaxParserContext.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-241" ]
CVE-2022-29181
MEDIUM
6.4
sparklemotion/nokogiri
parse_memory
ext/java/nokogiri/Html4SaxParserContext.java
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
0
Analyze the following code function for security vulnerabilities
public void handleRule(ApplContext ac, CssSelectors selector, ArrayList<CssProperty> properties) { if (selector.getAtRule() instanceof AtRulePage) { style.remove(selector); } for (CssProperty property : properties) { property.setSelectors(selector); style.addProperty(selector, property); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleRule File: org/w3c/css/css/StyleSheetParser.java Repository: w3c/css-validator The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-4070
LOW
3.5
w3c/css-validator
handleRule
org/w3c/css/css/StyleSheetParser.java
e5c09a9119167d3064db786d5f00d730b584a53b
0
Analyze the following code function for security vulnerabilities
public void sendPasswordResetEmail(String email, String token, HttpServletRequest req) { if (email != null && token != null) { Map<String, Object> model = new HashMap<String, Object>(); Map<String, String> lang = getLang(req); String url = CONF.serverUrl() + CONF.serverContextPath() + SIGNINLINK + "/iforgot?email=" + email + "&token=" + token; String subject = lang.get("iforgot.title"); String body1 = lang.get("notification.iforgot.body1") + "<br><br>"; String body2 = Utils.formatMessage("<b><a href=\"{0}\">" + lang.get("notification.iforgot.body2") + "</a></b><br><br>", url); String body3 = getDefaultEmailSignature(lang.get("notification.signature") + "<br><br>"); model.put("subject", escapeHtml(subject)); model.put("logourl", getSmallLogoUrl()); model.put("heading", lang.get("hello")); model.put("body", body1 + body2 + body3); emailer.sendEmail(Arrays.asList(email), subject, compileEmailTemplate(model)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendPasswordResetEmail File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
sendPasswordResetEmail
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public String displayHidden(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context) { return (pclass == null) ? "" : pclass.displayHidden(pclass.getName(), prefix, object, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayHidden 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
displayHidden
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 OHttpNetworkCommandManager getCommandManager() { return cmdManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCommandManager File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java Repository: orientechnologies/orientdb The code follows secure coding practices.
[ "CWE-352" ]
CVE-2015-2912
MEDIUM
6.8
orientechnologies/orientdb
getCommandManager
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
public boolean isTrustUsuallyManaged(int userId) { if (!(mLockSettingsService instanceof ILockSettings.Stub)) { throw new IllegalStateException("May only be called by TrustManagerService. " + "Use TrustManager.isTrustUsuallyManaged()"); } try { return getLockSettings().getBoolean(IS_TRUST_USUALLY_MANAGED, false, userId); } catch (RemoteException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTrustUsuallyManaged File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isTrustUsuallyManaged
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public BufferedImage readRasterImageFromURL() { if (isUrlOk()) try { final byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) return null; final ImageIcon tmp = new ImageIcon(bytes); return SecurityUtils.readRasterImage(tmp); } catch (Exception e) { Logme.error(e); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readRasterImageFromURL File: src/net/sourceforge/plantuml/security/SURL.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
readRasterImageFromURL
src/net/sourceforge/plantuml/security/SURL.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public void setValues(int beginLine, int beginColumn, int beginOffset, int endLine, int endColumn, int endOffset) { fBeginLineNumber = beginLine; fBeginColumnNumber = beginColumn; fBeginCharacterOffset = beginOffset; fEndLineNumber = endLine; fEndColumnNumber = endColumn; fEndCharacterOffset = endOffset; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValues File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
setValues
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
void setWillReplaceWindows(boolean animate) { ProtoLog.d(WM_DEBUG_ADD_REMOVE, "Marking app token %s with replacing windows.", this); for (int i = mChildren.size() - 1; i >= 0; i--) { final WindowState w = mChildren.get(i); w.setWillReplaceWindow(animate); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWillReplaceWindows 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
setWillReplaceWindows
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void setBufferSize(int i) { this.response.setBufferSize(i); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBufferSize File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-601" ]
CVE-2022-23618
MEDIUM
5.8
xwiki/xwiki-platform
setBufferSize
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiServletResponse.java
5251c02080466bf9fb55288f04a37671108f8096
0
Analyze the following code function for security vulnerabilities
public List<String> getDigits() { return StringUtil.stringToList(getMessage("digits")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDigits File: java/code/src/com/redhat/rhn/common/localization/LocalizationService.java Repository: spacewalkproject/spacewalk The code follows secure coding practices.
[ "CWE-79" ]
CVE-2016-3079
MEDIUM
4.3
spacewalkproject/spacewalk
getDigits
java/code/src/com/redhat/rhn/common/localization/LocalizationService.java
7b9ff9ad
0
Analyze the following code function for security vulnerabilities
protected HttpClientCodec newHttpClientCodec() { if (nettyProviderConfig != null) { return new HttpClientCodec(// nettyProviderConfig.getMaxInitialLineLength(),// nettyProviderConfig.getMaxHeaderSize(),// nettyProviderConfig.getMaxChunkSize(),// false); } else { return new HttpClientCodec(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newHttpClientCodec File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
newHttpClientCodec
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
protected Node xpathFindImpl(String xpath, NamespaceContext nsContext) throws XPathExpressionException { Node foundNode = (Node) this.xpathQuery(xpath, XPathConstants.NODE, nsContext); if (foundNode == null || foundNode.getNodeType() != Node.ELEMENT_NODE) { throw new XPathExpressionException("XPath expression \"" + xpath + "\" does not resolve to an Element in context " + this.xmlNode + ": " + foundNode); } return foundNode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: xpathFindImpl File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
xpathFindImpl
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private void sendBroadcastUploadsAdded() { Intent start = new Intent(getUploadsAddedMessage()); // nothing else needed right now start.setPackage(getPackageName()); localBroadcastManager.sendBroadcast(start); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendBroadcastUploadsAdded File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
sendBroadcastUploadsAdded
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
@Override public boolean canHandleReply(AMQCommand command) { return isResponseCompatibleWithRequest(request, command.getMethod()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canHandleReply File: src/main/java/com/rabbitmq/client/impl/AMQChannel.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
canHandleReply
src/main/java/com/rabbitmq/client/impl/AMQChannel.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
public static void setPermissionAPI(PermissionAPI permissionAPIRef) { permissionAPI = permissionAPIRef; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPermissionAPI File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
setPermissionAPI
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public final void installSystemProviders() { List<ProviderInfo> providers; synchronized (this) { ProcessRecord app = mProcessNames.get("system", SYSTEM_UID); providers = generateApplicationProvidersLocked(app); if (providers != null) { for (int i=providers.size()-1; i>=0; i--) { ProviderInfo pi = (ProviderInfo)providers.get(i); if ((pi.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) == 0) { Slog.w(TAG, "Not installing system proc provider " + pi.name + ": not system .apk"); providers.remove(i); } } } } if (providers != null) { mSystemThread.installSystemProviders(providers); } synchronized (this) { mSystemProvidersInstalled = true; } mConstants.start(mContext.getContentResolver()); mCoreSettingsObserver = new CoreSettingsObserver(this); mFontScaleSettingObserver = new FontScaleSettingObserver(); mDevelopmentSettingsObserver = new DevelopmentSettingsObserver(); GlobalSettingsToPropertiesMapper.start(mContext.getContentResolver()); // Now that the settings provider is published we can consider sending // in a rescue party. RescueParty.onSettingsProviderPublished(mContext); //mUsageStatsService.monitorPackages(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installSystemProviders File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
installSystemProviders
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String getModelSnapshot() { return prop.getProperty(MODEL_SNAPSHOT, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModelSnapshot File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java Repository: pytorch/serve The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43654
CRITICAL
9.8
pytorch/serve
getModelSnapshot
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
@Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isEmpty(value)) { return true; } try { Pattern.compile(value); return true; } catch (Exception ex) { String errorMessage = String.format("URL parameter '%s' is not a valid regexp", value); LOG.warn(errorMessage); context.buildConstraintViolationWithTemplate(errorMessage).addConstraintViolation(); } return false; }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2020-26282 - Severity: HIGH - CVSS Score: 7.5 Description: Fix Critical Java EL Injection RCE vulnerability from GHSL-2020-213 Function: isValid File: browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/PatternConstraint.java Repository: browserup/browserup-proxy Fixed Code: @Override public boolean isValid(String value, ConstraintValidatorContext context) { if (StringUtils.isEmpty(value)) { return true; } try { Pattern.compile(value); return true; } catch (Exception ex) { String escapedValue = MessageSanitizer.escape(value); String errorMessage = String.format("URL parameter '%s' is not a valid regexp", escapedValue); LOG.warn(errorMessage); context.buildConstraintViolationWithTemplate(errorMessage).addConstraintViolation(); } return false; }
[ "CWE-74" ]
CVE-2020-26282
HIGH
7.5
browserup/browserup-proxy
isValid
browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/PatternConstraint.java
4b38e7a3e20917e5c3329d0d4e9590bed9d578ab
1
Analyze the following code function for security vulnerabilities
protected void showSnackbar(final int message, final int action, final OnClickListener clickListener) { showSnackbar(message, action, clickListener, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showSnackbar File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
showSnackbar
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
public List<News> newsWithHighlightWord(String word){ //String query = "SELECT n FROM News n INNER JOIN n.highlights h WHERE h LIKE '%"+word+"%' ORDER BY date DESC"; String query = "select * from news n " + "inner join newshighlights h on n.newsid=h.newsid and h.highlight like '%murder%' order by date desc"; List<News> news = null; //news = (List<News>) em.createQuery(query).getResultList(); news = (List<News>) em.createNativeQuery(query).getResultList(); return news; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newsWithHighlightWord File: Cnn-EJB/ejbModule/ejbs/NewsBean.java Repository: rfsimoes/IS_Projecto2 The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-125038
MEDIUM
5.2
rfsimoes/IS_Projecto2
newsWithHighlightWord
Cnn-EJB/ejbModule/ejbs/NewsBean.java
aa128b2c9c9fdcbbf5ecd82c1e92103573017fe0
0
Analyze the following code function for security vulnerabilities
public void writeToStream(@NonNull OutputStream outputStream) throws IOException { TypedXmlSerializer serializer = Xml.newFastSerializer(); serializer.setOutput(outputStream, UTF_8.name()); serializer.startTag(null, "bundle"); try { saveToXml(serializer); } catch (XmlPullParserException e) { throw new IOException(e); } serializer.endTag(null, "bundle"); serializer.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeToStream File: core/java/android/os/PersistableBundle.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40074
MEDIUM
5.5
android
writeToStream
core/java/android/os/PersistableBundle.java
40e4ea759743737958dde018f3606d778f7a53f3
0
Analyze the following code function for security vulnerabilities
@Override protected void onCreate(Bundle savedStates) { super.onCreate(savedStates); mCredentials = createCredentialHelper(getIntent()); mState = (savedStates == null) ? STATE_INIT : STATE_RUNNING; if (mState == STATE_INIT) { if (!mCredentials.containsAnyRawData()) { toastErrorAndFinish(R.string.no_cert_to_saved); finish(); } else if (mCredentials.hasPkcs12KeyStore()) { showDialog(PKCS12_PASSWORD_DIALOG); } else { MyAction action = new InstallOthersAction(); if (needsKeyStoreAccess()) { sendUnlockKeyStoreIntent(); mNextAction = action; } else { action.run(this); } } } else { mCredentials.onRestoreStates(savedStates); mNextAction = (MyAction) savedStates.getSerializable(NEXT_ACTION_KEY); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: src/com/android/certinstaller/CertInstaller.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2422
HIGH
9.3
android
onCreate
src/com/android/certinstaller/CertInstaller.java
70dde9870e9450e10418a32206ac1bb30f036b2c
0
Analyze the following code function for security vulnerabilities
@Override public boolean isComplianceAcknowledgementRequired() { final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(isProfileOwnerOfOrganizationOwnedDevice(caller)); enforceUserUnlocked(caller.getUserId()); synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerLocked(caller); return admin.mProfileOffDeadline != 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isComplianceAcknowledgementRequired 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
isComplianceAcknowledgementRequired
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public String getSortOrderSQL(SortOrder order) { if (SortOrder.ASCENDING.equals(order)) { return "ASC"; } if (SortOrder.DESCENDING.equals(order)) { return "DESC"; } throw new IllegalArgumentException("Sort order not supported: " + order); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSortOrderSQL File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java Repository: dashbuilder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4999
HIGH
7.5
dashbuilder
getSortOrderSQL
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
8574899e3b6455547b534f570b2330ff772e524b
0
Analyze the following code function for security vulnerabilities
@Override public boolean isRinging(String callingPackage) { if (!canReadPhoneState(callingPackage, "isRinging")) { return false; } synchronized (mLock) { return mCallsManager.getCallState() == TelephonyManager.CALL_STATE_RINGING; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isRinging 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
isRinging
src/com/android/server/telecom/TelecomServiceImpl.java
2750faaa1ec819eed9acffea7bd3daf867fda444
0
Analyze the following code function for security vulnerabilities
public String getDialogRealUri() { return getJsp().link(getJsp().getRequestContext().getUri()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDialogRealUri File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
getDialogRealUri
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private VelocityContextFactory getVelocityContextFactory() { if (this.velocityContextFactory == null) { this.velocityContextFactory = Utils.getComponent(VelocityContextFactory.class); } return this.velocityContextFactory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVelocityContextFactory File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getVelocityContextFactory
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void stopLoading(final AwContents awContents) { getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { awContents.stopLoading(); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopLoading File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5155
MEDIUM
4.3
chromium
stopLoading
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") @ResponseBody @PostMapping(value = "/{id}/cloudinary-upload-link", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Map<String, Object>> generateCloudinaryUploadLink(@PathVariable String id, HttpServletRequest req) { if (!ScooldUtils.isCloudinaryAvatarRepositoryEnabled()) { return ResponseEntity.status(404).build(); } Profile authUser = utils.getAuthUser(req); Profile showUser = getProfileForEditing(id, authUser); if (showUser == null) { return ResponseEntity.status(403).build(); } String preset = "avatar"; String publicId = "avatars/" + id; long timestamp = Utils.timestamp() / 1000; Cloudinary cloudinary = new Cloudinary(CONF.cloudinaryUrl()); String signature = cloudinary.apiSignRequest(ObjectUtils.asMap( "public_id", publicId, "timestamp", String.valueOf(timestamp), "upload_preset", preset ), cloudinary.config.apiSecret); Map<String, Object> response = new HashMap<String, Object>(); response.put("url", "https://api.cloudinary.com/v1_1/" + cloudinary.config.cloudName + "/image/upload"); Map<String, Object> data = new HashMap<String, Object>(); data.put("resource_type", "image"); data.put("public_id", publicId); data.put("upload_preset", preset); data.put("filename", id); data.put("timestamp", timestamp); data.put("api_key", cloudinary.config.apiKey); data.put("signature", signature); response.put("data", data); return ResponseEntity.ok().body(response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateCloudinaryUploadLink File: src/main/java/com/erudika/scoold/controllers/ProfileController.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
generateCloudinaryUploadLink
src/main/java/com/erudika/scoold/controllers/ProfileController.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public static List<LockPatternView.Cell> stringToPattern(String string) { if (string == null) { return null; } List<LockPatternView.Cell> result = Lists.newArrayList(); final byte[] bytes = string.getBytes(); for (int i = 0; i < bytes.length; i++) { byte b = (byte) (bytes[i] - '1'); result.add(LockPatternView.Cell.of(b / 3, b % 3)); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stringToPattern File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
stringToPattern
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public void deinit(){ if (getActivity() == null) { return; } if (peerImage == null) { peerImage = generatePeerImage(); } final boolean [] removed = new boolean[1]; getActivity().runOnUiThread(new Runnable() { public void run() { try { if (layoutWrapper != null && AndroidImplementation.this.relativeLayout != null) { AndroidImplementation.this.relativeLayout.removeView(layoutWrapper); AndroidImplementation.this.relativeLayout.requestLayout(); layoutWrapper = null; } } finally { removed[0] = true; } } }); while (!removed[0]) { Display.getInstance().invokeAndBlock(new Runnable() { public void run() { if (!removed[0]) { try { Thread.sleep(5); } catch(InterruptedException er) {} } } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deinit File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
deinit
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private static Node migrateReport(Element reportElement) { List<NodeTuple> tuples = new ArrayList<>(); String classTag = getClassTag(reportElement.getName()); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "filePatterns"), new ScalarNode(Tag.STR, reportElement.elementText("filePatterns").trim()))); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "reportName"), new ScalarNode(Tag.STR, reportElement.elementText("reportName").trim()))); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "startPage"), new ScalarNode(Tag.STR, reportElement.elementText("startPage").trim()))); return new MappingNode(new Tag(classTag), tuples, FlowStyle.BLOCK); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateReport File: server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-538" ]
CVE-2021-21250
MEDIUM
4
theonedev/onedev
migrateReport
server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
9196fd795e87dab069b4260a3590a0ea886e770f
0
Analyze the following code function for security vulnerabilities
public String getURL(EntityReference reference) throws XWikiException { return this.xwiki.getURL(reference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURL 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
getURL
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
public void setMinorEdit(boolean isMinor) { getDoc().setMinorEdit(isMinor); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMinorEdit 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
setMinorEdit
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 void addOnRuntimePermissionStateChangedListener( OnRuntimePermissionStateChangedListener listener) { mPermissionManagerServiceImpl.addOnRuntimePermissionStateChangedListener(listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addOnRuntimePermissionStateChangedListener 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
addOnRuntimePermissionStateChangedListener
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@GetMapping("{sheetId:\\d+}") @ApiOperation("Gets a sheet") public SheetDetailVO getBy(@PathVariable("sheetId") Integer sheetId, @RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled, @RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) { SheetDetailVO sheetDetailVO = sheetService.convertToDetailVo(sheetService.getById(sheetId)); if (formatDisabled) { // Clear the format content sheetDetailVO.setFormatContent(null); } if (sourceDisabled) { // Clear the original content sheetDetailVO.setOriginalContent(null); } return sheetDetailVO; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBy File: src/main/java/run/halo/app/controller/content/api/SheetController.java Repository: halo-dev/halo The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-19007
LOW
3.5
halo-dev/halo
getBy
src/main/java/run/halo/app/controller/content/api/SheetController.java
d6b3d6cb5d681c7d8d64fd48de6c7c99b696bb8b
0
Analyze the following code function for security vulnerabilities
private void pregrantDefaultInteractAcrossProfilesAppOps(@UserIdInt int userId) { final String op = AppOpsManager.permissionToOp(Manifest.permission.INTERACT_ACROSS_PROFILES); for (String packageName : getConfigurableDefaultCrossProfilePackages(userId)) { if (!appOpIsDefaultOrAllowed(userId, op, packageName)) { continue; } mInjector.getCrossProfileApps(userId).setInteractAcrossProfilesAppOp( packageName, MODE_ALLOWED); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pregrantDefaultInteractAcrossProfilesAppOps 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
pregrantDefaultInteractAcrossProfilesAppOps
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean removeUser(int userHandle) { checkManageUsersPermission("Only the system can remove users"); if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean( UserManager.DISALLOW_REMOVE_USER, false)) { Log.w(LOG_TAG, "Cannot remove user. DISALLOW_REMOVE_USER is enabled."); return false; } long ident = Binder.clearCallingIdentity(); try { final UserInfo user; synchronized (mPackagesLock) { user = mUsers.get(userHandle); if (userHandle == 0 || user == null || mRemovingUserIds.get(userHandle)) { return false; } // We remember deleted user IDs to prevent them from being // reused during the current boot; they can still be reused // after a reboot. mRemovingUserIds.put(userHandle, true); try { mAppOpsService.removeUser(userHandle); } catch (RemoteException e) { Log.w(LOG_TAG, "Unable to notify AppOpsService of removing user", e); } // Set this to a partially created user, so that the user will be purged // on next startup, in case the runtime stops now before stopping and // removing the user completely. user.partial = true; // Mark it as disabled, so that it isn't returned any more when // profiles are queried. user.flags |= UserInfo.FLAG_DISABLED; writeUserLocked(user); } if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) { // Send broadcast to notify system that the user removed was a // managed user. sendProfileRemovedBroadcast(user.profileGroupId, user.id); } if (DBG) Slog.i(LOG_TAG, "Stopping user " + userHandle); int res; try { res = ActivityManagerNative.getDefault().stopUser(userHandle, new IStopUserCallback.Stub() { @Override public void userStopped(int userId) { finishRemoveUser(userId); } @Override public void userStopAborted(int userId) { } }); } catch (RemoteException e) { return false; } return res == ActivityManager.USER_OP_SUCCESS; } finally { Binder.restoreCallingIdentity(ident); } }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2016-3833 - Severity: HIGH - CVSS Score: 9.3 Description: Reduce shell power over user management. Remove MANAGE_USERS permission from shell and whitelist it for some specific functionality. Bug: 29189712 Change-Id: Ifb37448c091af91991964511e3efb1bb4dea1ff3 Function: removeUser File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android Fixed Code: public boolean removeUser(int userHandle) { checkManageOrCreateUsersPermission("Only the system can remove users"); if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean( UserManager.DISALLOW_REMOVE_USER, false)) { Log.w(LOG_TAG, "Cannot remove user. DISALLOW_REMOVE_USER is enabled."); return false; } long ident = Binder.clearCallingIdentity(); try { final UserInfo user; synchronized (mPackagesLock) { user = mUsers.get(userHandle); if (userHandle == 0 || user == null || mRemovingUserIds.get(userHandle)) { return false; } // We remember deleted user IDs to prevent them from being // reused during the current boot; they can still be reused // after a reboot. mRemovingUserIds.put(userHandle, true); try { mAppOpsService.removeUser(userHandle); } catch (RemoteException e) { Log.w(LOG_TAG, "Unable to notify AppOpsService of removing user", e); } // Set this to a partially created user, so that the user will be purged // on next startup, in case the runtime stops now before stopping and // removing the user completely. user.partial = true; // Mark it as disabled, so that it isn't returned any more when // profiles are queried. user.flags |= UserInfo.FLAG_DISABLED; writeUserLocked(user); } if (user.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID && user.isManagedProfile()) { // Send broadcast to notify system that the user removed was a // managed user. sendProfileRemovedBroadcast(user.profileGroupId, user.id); } if (DBG) Slog.i(LOG_TAG, "Stopping user " + userHandle); int res; try { res = ActivityManagerNative.getDefault().stopUser(userHandle, new IStopUserCallback.Stub() { @Override public void userStopped(int userId) { finishRemoveUser(userId); } @Override public void userStopAborted(int userId) { } }); } catch (RemoteException e) { return false; } return res == ActivityManager.USER_OP_SUCCESS; } finally { Binder.restoreCallingIdentity(ident); } }
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
removeUser
services/core/java/com/android/server/pm/UserManagerService.java
01875b0274e74f97edf6b0d5c92de822e0555d03
1
Analyze the following code function for security vulnerabilities
public static boolean isPlantUmlFileExtension(@Nonnull final String lowerCasedTrimmedExtension) { boolean result = false; if (lowerCasedTrimmedExtension.length() > 1 && lowerCasedTrimmedExtension.charAt(0) == 'p') { result = "pu".equals(lowerCasedTrimmedExtension) || "puml".equals(lowerCasedTrimmedExtension) || "plantuml".equals(lowerCasedTrimmedExtension); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPlantUmlFileExtension File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java Repository: raydac/netbeans-mmd-plugin The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000542
MEDIUM
6.8
raydac/netbeans-mmd-plugin
isPlantUmlFileExtension
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
9fba652bf06e649186b8f9e612d60e9cc15097e9
0
Analyze the following code function for security vulnerabilities
public void removeColumnReorderListener(ColumnReorderListener listener) { removeListener(ColumnReorderEvent.class, listener, COLUMN_REORDER_METHOD); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeColumnReorderListener File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
removeColumnReorderListener
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
void writeBroadcastsToProtoLocked(ProtoOutputStream proto) { if (mRegisteredReceivers.size() > 0) { Iterator it = mRegisteredReceivers.values().iterator(); while (it.hasNext()) { ReceiverList r = (ReceiverList)it.next(); r.writeToProto(proto, ActivityManagerServiceDumpBroadcastsProto.RECEIVER_LIST); } } mReceiverResolver.writeToProto(proto, ActivityManagerServiceDumpBroadcastsProto.RECEIVER_RESOLVER); for (BroadcastQueue q : mBroadcastQueues) { q.writeToProto(proto, ActivityManagerServiceDumpBroadcastsProto.BROADCAST_QUEUE); } for (int user=0; user<mStickyBroadcasts.size(); user++) { long token = proto.start(ActivityManagerServiceDumpBroadcastsProto.STICKY_BROADCASTS); proto.write(StickyBroadcastProto.USER, mStickyBroadcasts.keyAt(user)); for (Map.Entry<String, ArrayList<Intent>> ent : mStickyBroadcasts.valueAt(user).entrySet()) { long actionToken = proto.start(StickyBroadcastProto.ACTIONS); proto.write(StickyBroadcastProto.StickyAction.NAME, ent.getKey()); for (Intent intent : ent.getValue()) { intent.writeToProto(proto, StickyBroadcastProto.StickyAction.INTENTS, false, true, true, false); } proto.end(actionToken); } proto.end(token); } long handlerToken = proto.start(ActivityManagerServiceDumpBroadcastsProto.HANDLER); proto.write(ActivityManagerServiceDumpBroadcastsProto.MainHandler.HANDLER, mHandler.toString()); mHandler.getLooper().writeToProto(proto, ActivityManagerServiceDumpBroadcastsProto.MainHandler.LOOPER); proto.end(handlerToken); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeBroadcastsToProtoLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
writeBroadcastsToProtoLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public BuildStepMonitor getRequiredMonitorService() { return BuildStepMonitor.NONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRequiredMonitorService File: core/src/main/java/hudson/tasks/BuildTrigger.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getRequiredMonitorService
core/src/main/java/hudson/tasks/BuildTrigger.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String getCountry() { return country; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCountry File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getCountry
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public DynamicForm bindFromRequest(Http.Request request, String... allowedFields) { return bind( this.messagesApi.preferred(request).lang(), request.attrs(), requestData(request), requestFileData(request), allowedFields); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindFromRequest File: web/play-java-forms/src/main/java/play/data/DynamicForm.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
bindFromRequest
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLockTaskPackages File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
updateLockTaskPackages
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private String readStringInternal() throws IOException { read(); startCapture(); while (current!='"') { if (current=='\\') { pauseCapture(); readEscape(); startCapture(); } else if (current<0x20) { throw expected("valid string character"); } else { read(); } } String string=endCapture(); read(); return string; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readStringInternal File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readStringInternal
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
public int getPosition() { if ( realPos == -1 ) { realPos = ( getExecutable() == null ? 0 : 1 ); for ( int i = 0; i < position; i++ ) { Arg arg = (Arg) arguments.elementAt( i ); realPos += arg.getParts().length; } } return realPos; }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2017-1000487 - Severity: HIGH - CVSS Score: 7.5 Description: [PLXUTILS-161] Commandline shell injection problems Patch by Charles Duffy, applied unmodified Function: getPosition File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils Fixed Code: public int getPosition() { if ( realPos == -1 ) { realPos = ( getLiteralExecutable() == null ? 0 : 1 ); for ( int i = 0; i < position; i++ ) { Arg arg = (Arg) arguments.elementAt( i ); realPos += arg.getParts().length; } } return realPos; }
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getPosition
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
1
Analyze the following code function for security vulnerabilities
@Override protected Contentlet findContentletByIdentifier(String identifier, Boolean live, Long languageId) throws DotDataException { try { Client client = new ESClient().getClient(); StringWriter sw= new StringWriter(); sw.append(" +identifier:" + identifier); sw.append(" +languageid:" + languageId); sw.append(" +deleted:false"); SearchRequestBuilder request = createRequest(client, sw.toString()); IndiciesInfo info=APILocator.getIndiciesAPI().loadIndicies(); SearchResponse response = request.setIndices((live ? info.live : info.working)) .addFields("inode","identifier").execute().actionGet(); SearchHits hits = response.getHits(); Contentlet contentlet = find(hits.getAt(0).field("inode").getValue().toString()); return contentlet; } // if we don't have the con in this language catch(java.lang.ArrayIndexOutOfBoundsException aibex){ return null; } catch (Exception e) { throw new ElasticsearchException(e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findContentletByIdentifier File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
findContentletByIdentifier
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public TStruct readStructBegin( Map<Integer, com.facebook.thrift.meta_data.FieldMetaData> metaDataMap) { return ANONYMOUS_STRUCT; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readStructBegin File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
readStructBegin
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private boolean getPackageSizeInfoLI(String packageName, int userHandle, PackageStats pStats) { if (packageName == null) { Slog.w(TAG, "Attempt to get size of null packageName."); return false; } PackageParser.Package p; boolean dataOnly = false; String libDirRoot = null; String asecPath = null; PackageSetting ps = null; synchronized (mPackages) { p = mPackages.get(packageName); ps = mSettings.mPackages.get(packageName); if(p == null) { dataOnly = true; if((ps == null) || (ps.pkg == null)) { Slog.w(TAG, "Package named '" + packageName +"' doesn't exist."); return false; } p = ps.pkg; } if (ps != null) { libDirRoot = ps.legacyNativeLibraryPathString; } if (p != null && (p.isForwardLocked() || p.applicationInfo.isExternalAsec())) { final long token = Binder.clearCallingIdentity(); try { String secureContainerId = cidFromCodePath(p.applicationInfo.getBaseCodePath()); if (secureContainerId != null) { asecPath = PackageHelper.getSdFilesystem(secureContainerId); } } finally { Binder.restoreCallingIdentity(token); } } } String publicSrcDir = null; if(!dataOnly) { final ApplicationInfo applicationInfo = p.applicationInfo; if (applicationInfo == null) { Slog.w(TAG, "Package " + packageName + " has no applicationInfo."); return false; } if (p.isForwardLocked()) { publicSrcDir = applicationInfo.getBaseResourcePath(); } } // TODO: extend to measure size of split APKs // TODO(multiArch): Extend getSizeInfo to look at the full subdirectory tree, // not just the first level. // TODO(multiArch): Extend getSizeInfo to look at *all* instruction sets, not // just the primary. String[] dexCodeInstructionSets = getDexCodeInstructionSets(getAppDexInstructionSets(ps)); String apkPath; File packageDir = new File(p.codePath); if (packageDir.isDirectory() && p.canHaveOatDir()) { apkPath = packageDir.getAbsolutePath(); // If libDirRoot is inside a package dir, set it to null to avoid it being counted twice if (libDirRoot != null && libDirRoot.startsWith(apkPath)) { libDirRoot = null; } } else { apkPath = p.baseCodePath; } int res = mInstaller.getSizeInfo(p.volumeUuid, packageName, userHandle, apkPath, libDirRoot, publicSrcDir, asecPath, dexCodeInstructionSets, pStats); if (res < 0) { return false; } // Fix-up for forward-locked applications in ASEC containers. if (!isExternal(p)) { pStats.codeSize += pStats.externalCodeSize; pStats.externalCodeSize = 0L; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageSizeInfoLI 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
getPackageSizeInfoLI
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean openGuts( View view, int x, int y, NotificationMenuRowPlugin.MenuItem menuItem) { if (menuItem.getGutsView() instanceof NotificationGuts.GutsContent) { NotificationGuts.GutsContent gutsView = (NotificationGuts.GutsContent) menuItem.getGutsView(); if (gutsView.needsFalsingProtection()) { if (mStatusBarStateController instanceof StatusBarStateControllerImpl) { ((StatusBarStateControllerImpl) mStatusBarStateController) .setLeaveOpenOnKeyguardHide(true); } Optional<CentralSurfaces> centralSurfacesOptional = mCentralSurfacesOptionalLazy.get(); if (centralSurfacesOptional.isPresent()) { Runnable r = () -> mMainHandler.post( () -> openGutsInternal(view, x, y, menuItem)); centralSurfacesOptional.get().executeRunnableDismissingKeyguard( r, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, true /* deferred */); return true; } /** * When {@link CentralSurfaces} doesn't exist, falling through to call * {@link #openGutsInternal(View,int,int,NotificationMenuRowPlugin.MenuItem)}. */ } } return openGutsInternal(view, x, y, menuItem); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openGuts File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
openGuts
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
@Override public int getInt() { if (currentEvent != Event.VALUE_NUMBER) { throw new IllegalStateException( JsonMessages.PARSER_GETINT_ERR(currentEvent)); } return tokenizer.getInt(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInt File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
getInt
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
ab239fee273cb262910890f1a6fe666ae92cd623
0
Analyze the following code function for security vulnerabilities
private OldRendering getOldRendering() { if (this.oldRenderingProvider == null) { this.oldRenderingProvider = Utils.getComponent(OldRendering.TYPE_PROVIDER); } return this.oldRenderingProvider.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOldRendering File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getOldRendering
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public void stop() { if (discoveryMulticastResponder != null) { discoveryMulticastResponder.stop(); discoveryMulticastResponder = null; } backendManager.destroy(); backendManager = null; requestHandler = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stop File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
stop
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
private EntityReferenceSerializer<String> getDefaultEntityReferenceSerializer() { if (this.defaultEntityReferenceSerializer == null) { this.defaultEntityReferenceSerializer = Utils.getComponent(EntityReferenceSerializer.TYPE_STRING); } return this.defaultEntityReferenceSerializer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultEntityReferenceSerializer File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getDefaultEntityReferenceSerializer
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Test public void updateSectionX(TestContext context) { UpdateSection updateSection = new UpdateSection(); updateSection.addField("key").setValue("x"); createFoo(context) .update(FOO, updateSection, (Criterion) null, false, context.asyncAssertSuccess()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSectionX File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
updateSectionX
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public Cursor query(SQLiteDatabase db, String[] projectionIn, String selection, String[] selectionArgs, String groupBy, String having, String sortOrder) { return query(db, projectionIn, selection, selectionArgs, groupBy, having, sortOrder, null /* limit */, null /* cancellationSignal */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: query File: core/java/android/database/sqlite/SQLiteQueryBuilder.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
query
core/java/android/database/sqlite/SQLiteQueryBuilder.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private final void addBroadcastToHistoryLocked(BroadcastRecord r) { if (r.callingUid < 0) { // This was from a registerReceiver() call; ignore it. return; } r.finishTime = SystemClock.uptimeMillis(); mBroadcastHistory[mHistoryNext] = r; mHistoryNext = ringAdvance(mHistoryNext, 1, MAX_BROADCAST_HISTORY); mBroadcastSummaryHistory[mSummaryHistoryNext] = r.intent; mSummaryHistoryEnqueueTime[mSummaryHistoryNext] = r.enqueueClockTime; mSummaryHistoryDispatchTime[mSummaryHistoryNext] = r.dispatchClockTime; mSummaryHistoryFinishTime[mSummaryHistoryNext] = System.currentTimeMillis(); mSummaryHistoryNext = ringAdvance(mSummaryHistoryNext, 1, MAX_BROADCAST_SUMMARY_HISTORY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBroadcastToHistoryLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
addBroadcastToHistoryLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static <T> T lookup(Class<T> type) { return Jenkins.getInstance().lookup.get(type); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: lookup File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
lookup
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public void setClientId(final String clientId) { this.clientId = clientId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientId File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
setClientId
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
@Override public XMLBuilder2 data(byte[] data) { return cdata(data); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: data File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
data
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
public List<DhcpOption> getCustomDhcpOptions(@NonNull WifiSsid ssid, @NonNull List<byte[]> ouiList) { Set<DhcpOption> results = new HashSet<>(); for (byte[] oui : ouiList) { List<DhcpOption> options = mCustomDhcpOptions.get(new NetworkIdentifier(ssid, oui)); if (options != null) { results.addAll(options); } } return new ArrayList<>(results); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCustomDhcpOptions File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
getCustomDhcpOptions
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
boolean isUpdateable() throws SQLException { checkClosed(); if (resultsetconcurrency == ResultSet.CONCUR_READ_ONLY) { throw new PSQLException( GT.tr("ResultSets with concurrency CONCUR_READ_ONLY cannot be updated."), PSQLState.INVALID_CURSOR_STATE); } if (updateable) { return true; } connection.getLogger().log(Level.FINE, "checking if rs is updateable"); parseQuery(); if (tableName == null) { connection.getLogger().log(Level.FINE, "tableName is not found"); return false; } if (!singleTable) { connection.getLogger().log(Level.FINE, "not a single table"); return false; } usingOID = false; connection.getLogger().log(Level.FINE, "getting primary keys"); // // Contains the primary key? // List<PrimaryKey> primaryKeys = new ArrayList<PrimaryKey>(); this.primaryKeys = primaryKeys; int i = 0; int numPKcolumns = 0; // otherwise go and get the primary keys and create a list of keys @Nullable String[] s = quotelessTableName(castNonNull(tableName)); String quotelessTableName = castNonNull(s[0]); @Nullable String quotelessSchemaName = s[1]; java.sql.ResultSet rs = ((PgDatabaseMetaData)connection.getMetaData()).getPrimaryUniqueKeys("", quotelessSchemaName, quotelessTableName); String lastConstraintName = null; while (rs.next()) { String constraintName = castNonNull(rs.getString(6)); // get the constraintName if (lastConstraintName == null || !lastConstraintName.equals(constraintName)) { if (lastConstraintName != null) { if (i == numPKcolumns && numPKcolumns > 0) { break; } connection.getLogger().log(Level.FINE, "no of keys={0} from constraint {1}", new Object[]{i, lastConstraintName}); } i = 0; numPKcolumns = 0; primaryKeys.clear(); lastConstraintName = constraintName; } numPKcolumns++; boolean isNotNull = rs.getBoolean("IS_NOT_NULL"); /* make sure that only unique keys with all non-null attributes are handled */ if (isNotNull) { String columnName = castNonNull(rs.getString(4)); // get the columnName int index = findColumnIndex(columnName); /* make sure that the user has included the primary key in the resultset */ if (index > 0) { i++; primaryKeys.add(new PrimaryKey(index, columnName)); // get the primary key information } } } rs.close(); connection.getLogger().log(Level.FINE, "no of keys={0} from constraint {1}", new Object[]{i, lastConstraintName}); /* it is only updatable if the primary keys are available in the resultset */ updateable = (i == numPKcolumns) && (numPKcolumns > 0); connection.getLogger().log(Level.FINE, "checking primary key {0}", updateable); /* if we haven't found a primary key we can check to see if the query includes the oid This is now a questionable check as oid's have been deprecated. Might still be useful for catalog tables, but again the query would have to include the oid. */ if (!updateable) { int oidIndex = findColumnIndex("oid"); // 0 if not present // oidIndex will be >0 if the oid was in the select list if (oidIndex > 0) { primaryKeys.add(new PrimaryKey(oidIndex, "oid")); usingOID = true; updateable = true; } } if (!updateable) { throw new PSQLException(GT.tr("No eligible primary or unique key found for table {0}.", tableName), PSQLState.INVALID_CURSOR_STATE); } return updateable; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUpdateable 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
isUpdateable
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0