instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public Route.Definition sse(final String path, final Sse.Handler handler) { return appendDefinition(GET, path, handler).consumes(MediaType.sse); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sse File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
sse
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private native boolean initNative();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
initNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Override public final boolean isInterface() { return _class.isInterface(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInterface File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isInterface
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public boolean similar(Object other) { try { if (!(other instanceof JSONObject)) { return false; } if (!this.keySet().equals(((JSONObject)other).keySet())) { return false; } for (final Entry<String,?> entry : this.entrySet()) { String name = entry.getKey(); Object valueThis = entry.getValue(); Object valueOther = ((JSONObject)other).get(name); if(valueThis == valueOther) { continue; } if(valueThis == null) { return false; } if (valueThis instanceof JSONObject) { if (!((JSONObject)valueThis).similar(valueOther)) { return false; } } else if (valueThis instanceof JSONArray) { if (!((JSONArray)valueThis).similar(valueOther)) { return false; } } else if (valueThis instanceof Number && valueOther instanceof Number) { if (!isNumberSimilar((Number)valueThis, (Number)valueOther)) { return false; } } else if (valueThis instanceof JSONString && valueOther instanceof JSONString) { if (!((JSONString) valueThis).toJSONString().equals(((JSONString) valueOther).toJSONString())) { return false; } } else if (!valueThis.equals(valueOther)) { return false; } } return true; } catch (Throwable exception) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: similar 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
similar
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
@Override @Test public void testRepresentation() throws Exception { /* Everything is done in test methods. */ }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testRepresentation File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-37277
CRITICAL
9.6
xwiki/xwiki-platform
testRepresentation
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/AttachmentsResourceIT.java
4c175405faa0e62437df397811c7526dfc0fbae7
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = "/add-on/business-continuity/admin/dashboard.json", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public String dashboardData(HttpServletRequest request, HttpServletResponse response) { return renderAfterAuthentication(request, response, dashboardJSON); }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2021-43287 - Severity: MEDIUM - CVSS Score: 5.0 Description: #000 - Disable business-continuity Function: dashboardData File: server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java Repository: gocd Fixed Code: @ResponseBody public String dashboardData(HttpServletRequest request, HttpServletResponse response) { return renderAfterAuthentication(request, response, dashboardJSON); }
[ "CWE-200" ]
CVE-2021-43287
MEDIUM
5
gocd
dashboardData
server/src/main/java/com/thoughtworks/go/addon/businesscontinuity/standby/controller/DashBoardController.java
41abc210ac4e8cfa184483c9ff1c0cc04fb3511c
1
Analyze the following code function for security vulnerabilities
@JsonProperty("Banner") public String getBanner() { return banner; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBanner File: base/common/src/main/java/org/dogtagpki/common/Info.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getBanner
base/common/src/main/java/org/dogtagpki/common/Info.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@RequestMapping(params = "action=" + ACTION_CATCHIMAGE) @ResponseBody public Map<String, Object> catchimage(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, HttpServletRequest request, HttpSession session) { try (CloseableHttpClient httpclient = HttpClients.custom().setDefaultRequestConfig(CommonConstants.defaultRequestConfig) .build();) { String[] files = request.getParameterValues(FIELD_NAME + "[]"); if (CommonUtils.notEmpty(files)) { List<Map<String, Object>> list = new ArrayList<>(); for (String image : files) { HttpGet httpget = new HttpGet(image); CloseableHttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); if (null != entity) { BufferedInputStream inputStream = new BufferedInputStream(entity.getContent()); FileType fileType = FileTypeDetector.detectFileType(inputStream); String suffix = fileType.getCommonExtension(); if (CommonUtils.notEmpty(suffix)) { String fileName = CmsFileUtils.getUploadFileName(suffix); String filePath = siteComponent.getWebFilePath(site, fileName); CmsFileUtils.copyInputStreamToFile(inputStream, filePath); FileSize fileSize = CmsFileUtils.getFileSize(filePath, suffix); logUploadService.save(new LogUpload(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, CommonConstants.BLANK, CmsFileUtils.getFileType(suffix), entity.getContentLength(), fileSize.getWidth(), fileSize.getHeight(), RequestUtils.getIpAddress(request), CommonUtils.getDate(), fileName)); Map<String, Object> map = getResultMap(true); map.put("size", entity.getContentLength()); map.put("title", fileName); map.put("url", fileName); map.put("source", image); list.add(map); } } EntityUtils.consume(entity); } Map<String, Object> map = getResultMap(true); map.put("list", list); return map; } } catch (Exception e) { log.error(e.getMessage(), e); return getResultMap(false); } return getResultMap(false); }
Vulnerability Classification: - CWE: CWE-918 - CVE: CVE-2021-27693 - Severity: CRITICAL - CVSS Score: 9.8 Description: https://github.com/sanluan/PublicCMS/issues/51 Function: catchimage File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/UeditorAdminController.java Repository: sanluan/PublicCMS Fixed Code: @RequestMapping(params = "action=" + ACTION_CATCHIMAGE) @ResponseBody public Map<String, Object> catchimage(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, HttpServletRequest request, HttpSession session) { try (CloseableHttpClient httpclient = HttpClients.custom().setDefaultRequestConfig(CommonConstants.defaultRequestConfig) .build();) { String[] files = request.getParameterValues(FIELD_NAME + "[]"); if (CommonUtils.notEmpty(files)) { List<Map<String, Object>> list = new ArrayList<>(); for (String image : files) { HttpGet httpget = new HttpGet(image); CloseableHttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); if (null != entity) { BufferedInputStream inputStream = new BufferedInputStream(entity.getContent()); FileType fileType = FileTypeDetector.detectFileType(inputStream); String suffix = fileType.getCommonExtension(); if (null != fileType.getMimeType() && fileType.getMimeType().startsWith("image/") && CommonUtils.notEmpty(suffix)) { String fileName = CmsFileUtils.getUploadFileName(suffix); String filePath = siteComponent.getWebFilePath(site, fileName); CmsFileUtils.copyInputStreamToFile(inputStream, filePath); FileSize fileSize = CmsFileUtils.getFileSize(filePath, suffix); logUploadService.save(new LogUpload(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, CommonConstants.BLANK, CmsFileUtils.getFileType(suffix), entity.getContentLength(), fileSize.getWidth(), fileSize.getHeight(), RequestUtils.getIpAddress(request), CommonUtils.getDate(), fileName)); Map<String, Object> map = getResultMap(true); map.put("size", entity.getContentLength()); map.put("title", fileName); map.put("url", fileName); map.put("source", image); list.add(map); } } EntityUtils.consume(entity); } if (list.isEmpty()) { return getResultMap(false); } else { Map<String, Object> map = getResultMap(true); map.put("list", list); return map; } } } catch (Exception e) { log.error(e.getMessage(), e); return getResultMap(false); } return getResultMap(false); }
[ "CWE-918" ]
CVE-2021-27693
CRITICAL
9.8
sanluan/PublicCMS
catchimage
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/UeditorAdminController.java
0f4c4872914b6a71305e121a7d9a19c07cde0338
1
Analyze the following code function for security vulnerabilities
public Map<String, Object> getExternalScripts() { return CONF.externalScripts(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExternalScripts 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
getExternalScripts
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override @NonNull public Account[] getAccountsForPackage(String packageName, int uid, String opPackageName) { int callingUid = Binder.getCallingUid(); if (!UserHandle.isSameApp(callingUid, Process.SYSTEM_UID)) { // Don't do opPackageName check - caller is system. throw new SecurityException("getAccountsForPackage() called from unauthorized uid " + callingUid + " with uid=" + uid); } return getAccountsAsUserForPackage(null, UserHandle.getCallingUserId(), packageName, uid, opPackageName, true /* includeUserManagedNotVisible */); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccountsForPackage File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
getAccountsForPackage
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public void addDomChangeListener(final DomChangeListener listener) { WebAssert.notNull("listener", listener); synchronized (listeners_lock_) { if (domListeners_ == null) { domListeners_ = new LinkedHashSet<>(); } domListeners_.add(listener); domListenersList_ = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDomChangeListener File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
addDomChangeListener
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsFloatEdgeCase01() throws Exception { String input = Long.MAX_VALUE + ".999999999"; Duration value = READER.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS) .readValue(input); assertEquals(Long.MAX_VALUE, value.getSeconds()); assertEquals(999999999, value.getNano()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsFloatEdgeCase01 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsFloatEdgeCase01
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getCrossProfileCalendarPackages(ComponentName who) { if (!mHasFeature) { return Collections.emptyList(); } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwner(caller)); synchronized (getLockObject()) { final ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId()); return admin.mCrossProfileCalendarPackages; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCrossProfileCalendarPackages 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
getCrossProfileCalendarPackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public Builder setReplyAction( PendingIntent pendingIntent, RemoteInput remoteInput) { mRemoteInput = remoteInput; mReplyPendingIntent = pendingIntent; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setReplyAction File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setReplyAction
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setSyncAutomatically(Account account, int userId, String providerName, boolean sync) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.d(TAG, "setSyncAutomatically: " + /* account + */" provider " + providerName + ", user " + userId + " -> " + sync); } synchronized (mAuthorities) { AuthorityInfo authority = getOrCreateAuthorityLocked( new EndPoint(account, providerName, userId), -1 /* ident */, false); if (authority.enabled == sync) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.d(TAG, "setSyncAutomatically: already set to " + sync + ", doing nothing"); } return; } authority.enabled = sync; writeAccountInfoLocked(); } if (sync) { requestSync(account, userId, SyncOperation.REASON_SYNC_AUTO, providerName, new Bundle()); } reportChange(ContentResolver.SYNC_OBSERVER_TYPE_SETTINGS); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSyncAutomatically File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
setSyncAutomatically
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
public ApiClient addDefaultHeader(String key, String value) { defaultHeaderMap.put(key, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDefaultHeader File: samples/client/petstore/java/retrofit2-play26/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
addDefaultHeader
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
protected abstract String getPostfix();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPostfix File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
getPostfix
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
public String getName() { return mName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getName
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
@Override public String getOwningPackage() { return mAttrs.packageName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOwningPackage 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
getOwningPackage
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public String getDescription() { StringBuilder builder = new StringBuilder("class path resource ["); String pathToUse = path; if (this.clazz != null && !pathToUse.startsWith("/")) { builder.append(ClassUtils.classPackageAsResourcePath(this.clazz)); builder.append('/'); } if (pathToUse.startsWith("/")) { pathToUse = pathToUse.substring(1); } builder.append(pathToUse); builder.append(']'); return builder.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: src/main/java/spark/resource/ClassPathResource.java Repository: perwendel/spark The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-9159
MEDIUM
5
perwendel/spark
getDescription
src/main/java/spark/resource/ClassPathResource.java
a221a864db28eb736d36041df2fa6eb8839fc5cd
0
Analyze the following code function for security vulnerabilities
private boolean sameSessions(MediaController a, MediaController b) { if (a == b) return true; if (a == null) return false; return a.controlsSameSession(b); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sameSessions File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
sameSessions
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public Predicate getPathMatchPredicate(CriteriaBuilder builder, Path<Project> path, String pathPattern) { cacheLock.readLock().lock(); try { return Criteria.forManyValues(builder, path.get(Project.PROP_ID), getMatchingIds(pathPattern), cache.keySet()); } finally { cacheLock.readLock().unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPathMatchPredicate File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
getPathMatchPredicate
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
protected abstract void writeBody(ObjectOutput out, ByteArrayOutputStream bout) throws IOException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeBody File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
writeBody
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@Override public int getStatus() { return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStatus File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getStatus
src/main/java/org/olat/core/commons/modules/bc/commands/CmdUnzip.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
Task getTopDisplayFocusedRootTask() { return mRootWindowContainer.getTopDisplayFocusedRootTask(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTopDisplayFocusedRootTask 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
getTopDisplayFocusedRootTask
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public Object loadTrueTypeFont(String fontName, String fileName) { if(fontName.startsWith("native:")) { Typeface t = fontToRoboto(fontName); int fontStyle = com.codename1.ui.Font.STYLE_PLAIN; if(t.isBold()) { fontStyle |= com.codename1.ui.Font.STYLE_BOLD; } if(t.isItalic()) { fontStyle |= com.codename1.ui.Font.STYLE_ITALIC; } CodenameOneTextPaint newPaint = new CodenameOneTextPaint(t); newPaint.setAntiAlias(true); newPaint.setSubpixelText(true); return new NativeFont(com.codename1.ui.Font.FACE_SYSTEM, fontStyle, com.codename1.ui.Font.SIZE_MEDIUM, newPaint, fileName, 0, 0); } Typeface t = Typeface.createFromAsset(getContext().getAssets(), fileName); if(t == null) { throw new RuntimeException("Font not found: " + fileName); } CodenameOneTextPaint newPaint = new CodenameOneTextPaint(t); newPaint.setAntiAlias(true); newPaint.setSubpixelText(true); return new NativeFont(com.codename1.ui.Font.FACE_SYSTEM, com.codename1.ui.Font.STYLE_PLAIN, com.codename1.ui.Font.SIZE_MEDIUM, newPaint, fileName, 0, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadTrueTypeFont 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
loadTrueTypeFont
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void finishInstrumentation(IApplicationThread target, int resultCode, Bundle results) { int userId = UserHandle.getCallingUserId(); // Refuse possible leaked file descriptors if (results != null && results.hasFileDescriptors()) { throw new IllegalArgumentException("File descriptors passed in Intent"); } synchronized(this) { ProcessRecord app = getRecordForAppLocked(target); if (app == null) { Slog.w(TAG, "finishInstrumentation: no app for " + target); return; } final long origId = Binder.clearCallingIdentity(); finishInstrumentationLocked(app, resultCode, results); Binder.restoreCallingIdentity(origId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishInstrumentation 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
finishInstrumentation
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private Node composeNode(Node parent) { blockCommentsCollector.collectEvents(); if (parent != null) recursiveNodes.add(parent); final Node node; if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } node = anchors.get(anchor); if (!(node instanceof ScalarNode)) { this.nonScalarAliasesCount++; if (this.nonScalarAliasesCount > loadingConfig.getMaxAliasesForCollections()) { throw new YAMLException("Number of aliases for non-scalar nodes exceeds the specified max=" + loadingConfig.getMaxAliasesForCollections()); } } if (recursiveNodes.remove(node)) { node.setTwoStepsConstruction(true); } // drop comments, they can not be supported here blockCommentsCollector.consume(); inlineCommentsCollector.collectEvents().consume(); } else { NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = event.getAnchor(); // the check for duplicate anchors has been removed (issue 174) if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor, blockCommentsCollector.consume()); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } } recursiveNodes.remove(parent); return node; }
Vulnerability Classification: - CWE: CWE-776 - CVE: CVE-2022-25857 - Severity: HIGH - CVSS Score: 7.5 Description: Restrict nested depth for collections to avoid DoS attacks Function: composeNode File: src/main/java/org/yaml/snakeyaml/composer/Composer.java Repository: snakeyaml Fixed Code: private Node composeNode(Node parent) { blockCommentsCollector.collectEvents(); if (parent != null) recursiveNodes.add(parent); final Node node; if (parser.checkEvent(Event.ID.Alias)) { AliasEvent event = (AliasEvent) parser.getEvent(); String anchor = event.getAnchor(); if (!anchors.containsKey(anchor)) { throw new ComposerException(null, null, "found undefined alias " + anchor, event.getStartMark()); } node = anchors.get(anchor); if (!(node instanceof ScalarNode)) { this.nonScalarAliasesCount++; if (this.nonScalarAliasesCount > loadingConfig.getMaxAliasesForCollections()) { throw new YAMLException("Number of aliases for non-scalar nodes exceeds the specified max=" + loadingConfig.getMaxAliasesForCollections()); } } if (recursiveNodes.remove(node)) { node.setTwoStepsConstruction(true); } // drop comments, they can not be supported here blockCommentsCollector.consume(); inlineCommentsCollector.collectEvents().consume(); } else { NodeEvent event = (NodeEvent) parser.peekEvent(); String anchor = event.getAnchor(); increaseNestingDepth(); // the check for duplicate anchors has been removed (issue 174) if (parser.checkEvent(Event.ID.Scalar)) { node = composeScalarNode(anchor, blockCommentsCollector.consume()); } else if (parser.checkEvent(Event.ID.SequenceStart)) { node = composeSequenceNode(anchor); } else { node = composeMappingNode(anchor); } decreaseNestingDepth(); } recursiveNodes.remove(parent); return node; }
[ "CWE-776" ]
CVE-2022-25857
HIGH
7.5
snakeyaml
composeNode
src/main/java/org/yaml/snakeyaml/composer/Composer.java
fc300780da21f4bb92c148bc90257201220cf174
1
Analyze the following code function for security vulnerabilities
public Class<?> checkAutoType(String typeName, Class<?> expectClass, int features) { if (typeName == null) { return null; } if (autoTypeCheckHandlers != null) { for (AutoTypeCheckHandler h : autoTypeCheckHandlers) { Class<?> type = h.handler(typeName, expectClass, features); if (type != null) { return type; } } } final int safeModeMask = Feature.SafeMode.mask; boolean safeMode = this.safeMode || (features & safeModeMask) != 0 || (JSON.DEFAULT_PARSER_FEATURE & safeModeMask) != 0; if (safeMode) { throw new JSONException("safeMode not support autoType : " + typeName); } if (typeName.length() >= 192 || typeName.length() < 3) { throw new JSONException("autoType is not support. " + typeName); } final boolean expectClassFlag; if (expectClass == null) { expectClassFlag = false; } else { long expectHash = TypeUtils.fnv1a_64(expectClass.getName()); if (expectHash == 0x90a25f5baa21529eL || expectHash == 0x2d10a5801b9d6136L || expectHash == 0xaf586a571e302c6bL || expectHash == 0xed007300a7b227c6L || expectHash == 0x295c4605fd1eaa95L || expectHash == 0x47ef269aadc650b4L || expectHash == 0x6439c4dff712ae8bL || expectHash == 0xe3dd9875a2dc5283L || expectHash == 0xe2a8ddba03e69e0dL || expectHash == 0xd734ceb4c3e9d1daL ) { expectClassFlag = false; } else { expectClassFlag = true; } } String className = typeName.replace('$', '.'); Class<?> clazz; final long h1 = (fnv1a_64_magic_hashcode ^ className.charAt(0)) * fnv1a_64_magic_prime; if (h1 == 0xaf64164c86024f1aL) { // [ throw new JSONException("autoType is not support. " + typeName); } if ((h1 ^ className.charAt(className.length() - 1)) * fnv1a_64_magic_prime == 0x9198507b5af98f0L) { throw new JSONException("autoType is not support. " + typeName); } final long h3 = (((((fnv1a_64_magic_hashcode ^ className.charAt(0)) * fnv1a_64_magic_prime) ^ className.charAt(1)) * fnv1a_64_magic_prime) ^ className.charAt(2)) * fnv1a_64_magic_prime; long fullHash = TypeUtils.fnv1a_64(className); boolean internalWhite = Arrays.binarySearch(INTERNAL_WHITELIST_HASHCODES, fullHash) >= 0; if (internalDenyHashCodes != null) { long hash = h3; for (int i = 3; i < className.length(); ++i) { hash ^= className.charAt(i); hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(internalDenyHashCodes, hash) >= 0) { throw new JSONException("autoType is not support. " + typeName); } } } if ((!internalWhite) && (autoTypeSupport || expectClassFlag)) { long hash = h3; for (int i = 3; i < className.length(); ++i) { hash ^= className.charAt(i); hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(acceptHashCodes, hash) >= 0) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); if (clazz != null) { return clazz; } } if (Arrays.binarySearch(denyHashCodes, hash) >= 0 && TypeUtils.getClassFromMapping(typeName) == null) { if (Arrays.binarySearch(acceptHashCodes, fullHash) >= 0) { continue; } throw new JSONException("autoType is not support. " + typeName); } } } clazz = TypeUtils.getClassFromMapping(typeName); if (clazz == null) { clazz = deserializers.findClass(typeName); } if (clazz == null) { clazz = typeMapping.get(typeName); } if (internalWhite) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); } if (clazz != null) { if (expectClass != null && clazz != java.util.HashMap.class && clazz != java.util.LinkedHashMap.class && !expectClass.isAssignableFrom(clazz)) { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } return clazz; } if (!autoTypeSupport) { long hash = h3; for (int i = 3; i < className.length(); ++i) { char c = className.charAt(i); hash ^= c; hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(denyHashCodes, hash) >= 0) { throw new JSONException("autoType is not support. " + typeName); } // white list if (Arrays.binarySearch(acceptHashCodes, hash) >= 0) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); if (clazz == null) { return expectClass; } if (expectClass != null && expectClass.isAssignableFrom(clazz)) { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } return clazz; } } } boolean jsonType = false; InputStream is = null; try { String resource = typeName.replace('.', '/') + ".class"; if (defaultClassLoader != null) { is = defaultClassLoader.getResourceAsStream(resource); } else { is = ParserConfig.class.getClassLoader().getResourceAsStream(resource); } if (is != null) { ClassReader classReader = new ClassReader(is, true); TypeCollector visitor = new TypeCollector("<clinit>", new Class[0]); classReader.accept(visitor); jsonType = visitor.hasJsonType(); } } catch (Exception e) { // skip } finally { IOUtils.close(is); } final int mask = Feature.SupportAutoType.mask; boolean autoTypeSupport = this.autoTypeSupport || (features & mask) != 0 || (JSON.DEFAULT_PARSER_FEATURE & mask) != 0; if (autoTypeSupport || jsonType || expectClassFlag) { boolean cacheClass = autoTypeSupport || jsonType; clazz = TypeUtils.loadClass(typeName, defaultClassLoader, cacheClass); } if (clazz != null) { if (jsonType) { TypeUtils.addMapping(typeName, clazz); return clazz; } if (ClassLoader.class.isAssignableFrom(clazz) // classloader is danger || javax.sql.DataSource.class.isAssignableFrom(clazz) // dataSource can load jdbc driver || javax.sql.RowSet.class.isAssignableFrom(clazz) // ) { throw new JSONException("autoType is not support. " + typeName); } if (expectClass != null) { if (expectClass.isAssignableFrom(clazz)) { TypeUtils.addMapping(typeName, clazz); return clazz; } else { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } } JavaBeanInfo beanInfo = JavaBeanInfo.build(clazz, clazz, propertyNamingStrategy); if (beanInfo.creatorConstructor != null && autoTypeSupport) { throw new JSONException("autoType is not support. " + typeName); } } if (!autoTypeSupport) { throw new JSONException("autoType is not support. " + typeName); } if (clazz != null) { TypeUtils.addMapping(typeName, clazz); } return clazz; }
Vulnerability Classification: - CWE: CWE-502 - CVE: CVE-2022-25845 - Severity: MEDIUM - CVSS Score: 6.8 Description: bug fix for autoType Function: checkAutoType File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson Fixed Code: public Class<?> checkAutoType(String typeName, Class<?> expectClass, int features) { if (typeName == null) { return null; } if (autoTypeCheckHandlers != null) { for (AutoTypeCheckHandler h : autoTypeCheckHandlers) { Class<?> type = h.handler(typeName, expectClass, features); if (type != null) { return type; } } } final int safeModeMask = Feature.SafeMode.mask; boolean safeMode = this.safeMode || (features & safeModeMask) != 0 || (JSON.DEFAULT_PARSER_FEATURE & safeModeMask) != 0; if (safeMode) { throw new JSONException("safeMode not support autoType : " + typeName); } if (typeName.length() >= 192 || typeName.length() < 3) { throw new JSONException("autoType is not support. " + typeName); } final boolean expectClassFlag; if (expectClass == null) { expectClassFlag = false; } else { long expectHash = TypeUtils.fnv1a_64(expectClass.getName()); if (expectHash == 0x90a25f5baa21529eL || expectHash == 0x2d10a5801b9d6136L || expectHash == 0xaf586a571e302c6bL || expectHash == 0xed007300a7b227c6L || expectHash == 0x295c4605fd1eaa95L || expectHash == 0x47ef269aadc650b4L || expectHash == 0x6439c4dff712ae8bL || expectHash == 0xe3dd9875a2dc5283L || expectHash == 0xe2a8ddba03e69e0dL || expectHash == 0xd734ceb4c3e9d1daL ) { expectClassFlag = false; } else { expectClassFlag = true; } } String className = typeName.replace('$', '.'); Class<?> clazz; final long h1 = (fnv1a_64_magic_hashcode ^ className.charAt(0)) * fnv1a_64_magic_prime; if (h1 == 0xaf64164c86024f1aL) { // [ throw new JSONException("autoType is not support. " + typeName); } if ((h1 ^ className.charAt(className.length() - 1)) * fnv1a_64_magic_prime == 0x9198507b5af98f0L) { throw new JSONException("autoType is not support. " + typeName); } final long h3 = (((((fnv1a_64_magic_hashcode ^ className.charAt(0)) * fnv1a_64_magic_prime) ^ className.charAt(1)) * fnv1a_64_magic_prime) ^ className.charAt(2)) * fnv1a_64_magic_prime; long fullHash = TypeUtils.fnv1a_64(className); boolean internalWhite = Arrays.binarySearch(INTERNAL_WHITELIST_HASHCODES, fullHash) >= 0; if (internalDenyHashCodes != null) { long hash = h3; for (int i = 3; i < className.length(); ++i) { hash ^= className.charAt(i); hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(internalDenyHashCodes, hash) >= 0) { throw new JSONException("autoType is not support. " + typeName); } } } if ((!internalWhite) && (autoTypeSupport || expectClassFlag)) { long hash = h3; for (int i = 3; i < className.length(); ++i) { hash ^= className.charAt(i); hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(acceptHashCodes, hash) >= 0) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); if (clazz != null) { return clazz; } } if (Arrays.binarySearch(denyHashCodes, hash) >= 0 && TypeUtils.getClassFromMapping(typeName) == null) { if (Arrays.binarySearch(acceptHashCodes, fullHash) >= 0) { continue; } throw new JSONException("autoType is not support. " + typeName); } } } clazz = TypeUtils.getClassFromMapping(typeName); if (clazz == null) { clazz = deserializers.findClass(typeName); } if (expectClass == null && clazz != null && Throwable.class.isAssignableFrom(clazz) && !autoTypeSupport) { clazz = null; } if (clazz == null) { clazz = typeMapping.get(typeName); } if (internalWhite) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); } if (clazz != null) { if (expectClass != null && clazz != java.util.HashMap.class && clazz != java.util.LinkedHashMap.class && !expectClass.isAssignableFrom(clazz)) { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } return clazz; } if (!autoTypeSupport) { long hash = h3; for (int i = 3; i < className.length(); ++i) { char c = className.charAt(i); hash ^= c; hash *= fnv1a_64_magic_prime; if (Arrays.binarySearch(denyHashCodes, hash) >= 0) { throw new JSONException("autoType is not support. " + typeName); } // white list if (Arrays.binarySearch(acceptHashCodes, hash) >= 0) { clazz = TypeUtils.loadClass(typeName, defaultClassLoader, true); if (clazz == null) { return expectClass; } if (expectClass != null && expectClass.isAssignableFrom(clazz)) { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } return clazz; } } } boolean jsonType = false; InputStream is = null; try { String resource = typeName.replace('.', '/') + ".class"; if (defaultClassLoader != null) { is = defaultClassLoader.getResourceAsStream(resource); } else { is = ParserConfig.class.getClassLoader().getResourceAsStream(resource); } if (is != null) { ClassReader classReader = new ClassReader(is, true); TypeCollector visitor = new TypeCollector("<clinit>", new Class[0]); classReader.accept(visitor); jsonType = visitor.hasJsonType(); } } catch (Exception e) { // skip } finally { IOUtils.close(is); } final int mask = Feature.SupportAutoType.mask; boolean autoTypeSupport = this.autoTypeSupport || (features & mask) != 0 || (JSON.DEFAULT_PARSER_FEATURE & mask) != 0; if (autoTypeSupport || jsonType || expectClassFlag) { boolean cacheClass = autoTypeSupport || jsonType; clazz = TypeUtils.loadClass(typeName, defaultClassLoader, cacheClass); } if (clazz != null) { if (jsonType) { TypeUtils.addMapping(typeName, clazz); return clazz; } if (ClassLoader.class.isAssignableFrom(clazz) // classloader is danger || javax.sql.DataSource.class.isAssignableFrom(clazz) // dataSource can load jdbc driver || javax.sql.RowSet.class.isAssignableFrom(clazz) // ) { throw new JSONException("autoType is not support. " + typeName); } if (expectClass != null) { if (expectClass.isAssignableFrom(clazz)) { TypeUtils.addMapping(typeName, clazz); return clazz; } else { throw new JSONException("type not match. " + typeName + " -> " + expectClass.getName()); } } JavaBeanInfo beanInfo = JavaBeanInfo.build(clazz, clazz, propertyNamingStrategy); if (beanInfo.creatorConstructor != null && autoTypeSupport) { throw new JSONException("autoType is not support. " + typeName); } } if (!autoTypeSupport) { if (typeName.endsWith("Exception")) { return null; } throw new JSONException("autoType is not support. " + typeName); } if (clazz != null) { TypeUtils.addMapping(typeName, clazz); } return clazz; }
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
checkAutoType
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
35db4adad70c32089542f23c272def1ad920a60d
1
Analyze the following code function for security vulnerabilities
TelephonyManager getTelephonyManager() { return mContext.getSystemService(TelephonyManager.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTelephonyManager 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
getTelephonyManager
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
ArrayList<ProcessRecord> collectProcesses(PrintWriter pw, int start, boolean allPkgs, String[] args) { ArrayList<ProcessRecord> procs; synchronized (this) { if (args != null && args.length > start && args[start].charAt(0) != '-') { procs = new ArrayList<ProcessRecord>(); int pid = -1; try { pid = Integer.parseInt(args[start]); } catch (NumberFormatException e) { } for (int i=mLruProcesses.size()-1; i>=0; i--) { ProcessRecord proc = mLruProcesses.get(i); if (proc.pid == pid) { procs.add(proc); } else if (allPkgs && proc.pkgList != null && proc.pkgList.containsKey(args[start])) { procs.add(proc); } else if (proc.processName.equals(args[start])) { procs.add(proc); } } if (procs.size() <= 0) { return null; } } else { procs = new ArrayList<ProcessRecord>(mLruProcesses); } } return procs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: collectProcesses File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
collectProcesses
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private static String getSettingPrefix(Bundle args) { return (args != null) ? args.getString(Settings.CALL_METHOD_PREFIX_KEY) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingPrefix File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
getSettingPrefix
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
private EnforcingAdmin enforcePermissionAndGetEnforcingAdmin(@Nullable ComponentName admin, String permission, int deviceAdminPolicy, String callerPackageName, int targetUserId) { enforcePermission(permission, deviceAdminPolicy, callerPackageName, targetUserId); return getEnforcingAdminForCaller(admin, callerPackageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforcePermissionAndGetEnforcingAdmin 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
enforcePermissionAndGetEnforcingAdmin
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = "doUploadLicense", method = RequestMethod.POST) @Csrf public String upload(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, MultipartFile file, HttpServletRequest request, ModelMap model) { if (ControllerUtils.verifyCustom("noright", !siteComponent.isMaster(site.getId()), model)) { return CommonConstants.TEMPLATE_ERROR; } if (null != file && !file.isEmpty()) { try { CmsFileUtils.upload(file, siteComponent.getRootPath() + CommonConstants.LICENSE_FILENAME); logUploadService.save(new LogUpload(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "license.dat", CmsFileUtils.FILE_TYPE_OTHER, file.getSize(), null, null, RequestUtils.getIpAddress(request), CommonUtils.getDate(), CommonConstants.LICENSE_FILENAME)); return CommonConstants.TEMPLATE_DONE; } catch (IllegalStateException | IOException e) { log.error(e.getMessage(), e); } } return CommonConstants.TEMPLATE_ERROR; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: upload File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
upload
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/admin/sys/SysSiteAdminController.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
private PrivateKey loadPrivateKey(String keyFile) throws IOException, GeneralSecurityException { KeyFactory keyFactory = KeyFactory.getInstance("RSA"); try (InputStream is = Files.newInputStream(Paths.get(keyFile))) { String content = IOUtils.toString(is, StandardCharsets.UTF_8); content = content.replaceAll("-----(BEGIN|END)( RSA)? PRIVATE KEY-----\\s*", ""); byte[] buf = Base64.getMimeDecoder().decode(content); try { PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(buf); return keyFactory.generatePrivate(privKeySpec); } catch (InvalidKeySpecException e) { // old private key is OpenSSL format private key buf = OpenSslKey.convertPrivateKey(buf); PKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(buf); return keyFactory.generatePrivate(privKeySpec); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadPrivateKey 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
loadPrivateKey
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
391bdec3348e30de173fbb7c7277970e0b53c8ad
0
Analyze the following code function for security vulnerabilities
@Override public String toString() { return String.format("%s[%s %s on %s]", getClass().getName(), getUserId(), isLocal() ? "local" : "remote", getSeti()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString 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
toString
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unused") @CalledByNative private void onFlingStartEventHadNoConsumer(int vx, int vy) { mTouchScrollInProgress = false; for (mGestureStateListenersIterator.rewind(); mGestureStateListenersIterator.hasNext();) { mGestureStateListenersIterator.next().onUnhandledFlingStartEvent(vx, vy); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onFlingStartEventHadNoConsumer File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onFlingStartEventHadNoConsumer
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
protected void sendTextContent(final int iCode, final String iReason, String iHeaders, final String iContentType, final String iContent, final boolean iKeepAlive) throws IOException { final boolean empty = iContent == null || iContent.length() == 0; sendStatus(empty && iCode == 200 ? 204 : iCode, iReason); sendResponseHeaders(iContentType, iKeepAlive); if (iHeaders != null) writeLine(iHeaders); final byte[] binaryContent = empty ? null : iContent.getBytes(utf8); writeLine(OHttpUtils.HEADER_CONTENT_LENGTH + (empty ? 0 : binaryContent.length)); writeLine(null); if (binaryContent != null) channel.writeBytes(binaryContent); channel.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendTextContent 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
sendTextContent
server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/ONetworkProtocolHttpAbstract.java
d5a45e608ba8764fd817c1bdd7cf966564e828e9
0
Analyze the following code function for security vulnerabilities
private FieldRef parseAndEnterKey( TomlObjectNode outer, boolean forTable ) throws IOException { TomlObjectNode node = outer; while (true) { if (node.closed) { throw errorContext.atPosition(lexer).generic("Object already closed"); } if (!forTable) { /* "Dotted keys create and define a table for each key part before the last one, provided that such * tables were not previously created." */ node.defined = true; } TomlToken partToken = peek(); String part; if (partToken == TomlToken.STRING) { part = lexer.textBuffer.contentsAsString(); } else if (partToken == TomlToken.UNQUOTED_KEY) { part = lexer.yytext(); } else { throw errorContext.atPosition(lexer).unexpectedToken(partToken, "quoted or unquoted key"); } pollExpected(partToken, Lexer.EXPECT_INLINE_KEY); if (peek() != TomlToken.DOT_SEP) { return new FieldRef(node, part); } pollExpected(TomlToken.DOT_SEP, Lexer.EXPECT_INLINE_KEY); JsonNode existing = node.get(part); if (existing == null) { node = (TomlObjectNode) node.putObject(part); } else if (existing.isObject()) { node = (TomlObjectNode) existing; } else if (existing.isArray()) { /* "Any reference to an array of tables points to the most recently defined table element of the array. * This allows you to define sub-tables, and even sub-arrays of tables, inside the most recent table." * * I interpret this somewhat broadly: I accept such references even if there were unrelated tables * in between, and I accept them for simple dotted keys as well (not just for tables). These cases don't * seem to be covered by the specification. */ TomlArrayNode array = (TomlArrayNode) existing; if (array.closed) { throw errorContext.atPosition(lexer).generic("Array already closed"); } // Only arrays declared by array tables are not closed, and those are always arrays of objects. node = (TomlObjectNode) array.get(array.size() - 1); } else { throw errorContext.atPosition(lexer).generic("Path into existing non-object value of type " + existing.getNodeType()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseAndEnterKey File: toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java Repository: FasterXML/jackson-dataformats-text The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-3894
HIGH
7.5
FasterXML/jackson-dataformats-text
parseAndEnterKey
toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
20a209387931dba31e1a027b74976911c3df39fe
0
Analyze the following code function for security vulnerabilities
@Override public void startUp(FloodlightModuleContext context) { floodlightProviderService.addOFMessageListener(OFType.PACKET_IN, this); restApiService.addRestletRoutable(new LoadBalancerWebRoutable()); debugCounterService.registerModule(this.getName()); counterPacketOut = debugCounterService.registerCounter(this.getName(), "packet-outs-written", "Packet outs written by the LoadBalancer", MetaData.WARN); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startUp File: src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java Repository: floodlight The code follows secure coding practices.
[ "CWE-362", "CWE-476" ]
CVE-2015-6569
MEDIUM
4.3
floodlight
startUp
src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
7f5bedb625eec3ff4d29987c31cef2553a962b36
0
Analyze the following code function for security vulnerabilities
@Override public void startSystemLockTaskMode(int taskId) throws RemoteException { enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "startSystemLockTaskMode"); // This makes inner call to look as if it was initiated by system. long ident = Binder.clearCallingIdentity(); try { synchronized (this) { startLockTaskMode(taskId); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startSystemLockTaskMode File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startSystemLockTaskMode
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public boolean isConnected() { return socketInstance != null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isConnected 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
isConnected
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public IBinder peekService(Intent service, String resolvedType, String callingPackage) { enforceNotIsolatedCaller("peekService"); // Refuse possible leaked file descriptors if (service != null && service.hasFileDescriptors() == true) { throw new IllegalArgumentException("File descriptors passed in Intent"); } if (callingPackage == null) { throw new IllegalArgumentException("callingPackage cannot be null"); } synchronized(this) { return mServices.peekServiceLocked(service, resolvedType, callingPackage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peekService 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
peekService
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private boolean isInCall() { return getTelecommManager().isInCall(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInCall File: packages/Keyguard/src/com/android/keyguard/EmergencyButton.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
isInCall
packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
@Override public Collection findByLegacyId(Context context, int id) throws SQLException { return collectionDAO.findByLegacyId(context, id, Collection.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findByLegacyId File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
findByLegacyId
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
private SearchResult lookupUser(String accountName) throws NamingException { InitialDirContext context = initContext(); String searchString = searchFilter.replace(":login", accountName); SearchControls searchControls = new SearchControls(); String[] attributeFilter = {idAttribute, nameAttribute, mailAttribute}; searchControls.setReturningAttributes(attributeFilter); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); NamingEnumeration<SearchResult> results = context.search(searchBase, searchString, searchControls); SearchResult searchResult = null; if (results.hasMoreElements()) { searchResult = results.nextElement(); if (results.hasMoreElements()) { LOGGER.warn("Matched multiple users for the accountName: " + accountName); return null; } } return searchResult; }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2020-5246 - Severity: MEDIUM - CVSS Score: 4.0 Description: Encode LDAP user names Function: lookupUser File: src/main/java/org/traccar/database/LdapProvider.java Repository: traccar Fixed Code: private SearchResult lookupUser(String accountName) throws NamingException { InitialDirContext context = initContext(); String searchString = searchFilter.replace(":login", encodeForLdap(accountName)); SearchControls searchControls = new SearchControls(); String[] attributeFilter = {idAttribute, nameAttribute, mailAttribute}; searchControls.setReturningAttributes(attributeFilter); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); NamingEnumeration<SearchResult> results = context.search(searchBase, searchString, searchControls); SearchResult searchResult = null; if (results.hasMoreElements()) { searchResult = results.nextElement(); if (results.hasMoreElements()) { LOGGER.warn("Matched multiple users for the accountName: " + accountName); return null; } } return searchResult; }
[ "CWE-74" ]
CVE-2020-5246
MEDIUM
4
traccar
lookupUser
src/main/java/org/traccar/database/LdapProvider.java
e4f6e74e57ab743b65d49ae00f6624a20ca0291e
1
Analyze the following code function for security vulnerabilities
private void notifyFinished(UserRequest ureq) { VFSContainer container = VFSManager.findInheritingSecurityCallbackContainer(folderComponent.getRootContainer()); VFSSecurityCallback secCallback = container.getLocalSecurityCallback(); if(secCallback != null) { SubscriptionContext subsContext = secCallback.getSubscriptionContext(); if (subsContext != null) { notificationsManager.markPublisherNews(subsContext, ureq.getIdentity(), true); } } fireEvent(ureq, FOLDERCOMMAND_FINISHED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyFinished File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
notifyFinished
src/main/java/org/olat/core/commons/modules/bc/commands/CmdMoveCopy.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
@Override public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "resizePinnedStack()"); final long ident = Binder.clearCallingIdentity(); try { synchronized (this) { mStackSupervisor.resizePinnedStackLocked(pinnedBounds, tempPinnedTaskBounds); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizePinnedStack 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
resizePinnedStack
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private static boolean isCompatible(TcpIpConfig c1, TcpIpConfig c2) { boolean c1Disabled = c1 == null || !c1.isEnabled(); boolean c2Disabled = c2 == null || !c2.isEnabled(); return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && nullSafeEqual(c1.getConnectionTimeoutSeconds(), c2.getConnectionTimeoutSeconds()) && nullSafeEqual(c1.getMembers(), c2.getMembers())) && nullSafeEqual(c1.getRequiredMember(), c2.getRequiredMember()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public boolean usesObjectId() { return (_objectIdWriter != null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: usesObjectId File: src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
usesObjectId
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private Builder setPersistentState(PersistableBundle persistentState) { mPersistentState = persistentState; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPersistentState 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
setPersistentState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public @Nullable List<String> getPermittedInputMethodsAsUser(@UserIdInt int userId) { final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userId)); Preconditions.checkCallAuthorization(canManageUsers(caller) || canQueryAdminPolicy(caller)); final long callingIdentity = Binder.clearCallingIdentity(); try { return getPermittedInputMethodsUnchecked(userId); } finally { Binder.restoreCallingIdentity(callingIdentity); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPermittedInputMethodsAsUser 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
getPermittedInputMethodsAsUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static Materials gitMaterials(String url, String submoduleFolder, String branch) { return new Materials(gitMaterial(url, submoduleFolder, branch)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gitMaterials File: domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
gitMaterials
domain/src/test/java/com/thoughtworks/go/helper/MaterialsMother.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
private void enforceRegisterSelfManaged() { mContext.enforceCallingPermission(android.Manifest.permission.MANAGE_OWN_CALLS, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceRegisterSelfManaged File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
enforceRegisterSelfManaged
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
@Bean(name = "jwtAuthenticationFilter") public JWTRequestParameterProcessingFilter jwtAuthFilter() throws Exception { return new JWTRequestParameterProcessingFilter(authenticationManager(), FAILURE_URL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jwtAuthFilter File: airsonic-main/src/main/java/org/airsonic/player/security/GlobalSecurityConfig.java Repository: airsonic The code follows secure coding practices.
[ "CWE-326" ]
CVE-2019-10907
MEDIUM
5
airsonic
jwtAuthFilter
airsonic-main/src/main/java/org/airsonic/player/security/GlobalSecurityConfig.java
3e07ea52885f88d3fbec444dfd592f27bfb65647
0
Analyze the following code function for security vulnerabilities
static String valueToString(Object value, boolean escapeForwardSlash) throws JSONException { if (value == null || value.equals(null)) { return "null"; } if (value instanceof JSONString) { String o; try { o = ((JSONString)value).toJSONString(); } catch (Exception e) { throw new JSONException(e); } if (o != null) { return o; } throw new JSONException("Bad value from toJSONString: " + o); } if (value instanceof Number) { return numberToString((Number) value); } if (value instanceof Boolean || value instanceof JSONObject || value instanceof JSONArray) { return value.toString(); } return quote(value.toString(), escapeForwardSlash); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: valueToString File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
valueToString
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Nullable CompatDisplayInsets getCompatDisplayInsets() { return mCompatDisplayInsets; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompatDisplayInsets 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
getCompatDisplayInsets
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private void bindHeaderChronometerAndTime(RemoteViews contentView, StandardTemplateParams p, boolean hasTextToLeft) { if (!p.mHideTime && showsTimeOrChronometer()) { if (hasTextToLeft) { contentView.setViewVisibility(R.id.time_divider, View.VISIBLE); setTextViewColorSecondary(contentView, R.id.time_divider, p); } if (mN.extras.getBoolean(EXTRA_SHOW_CHRONOMETER)) { contentView.setViewVisibility(R.id.chronometer, View.VISIBLE); contentView.setLong(R.id.chronometer, "setBase", mN.when + (SystemClock.elapsedRealtime() - System.currentTimeMillis())); contentView.setBoolean(R.id.chronometer, "setStarted", true); boolean countsDown = mN.extras.getBoolean(EXTRA_CHRONOMETER_COUNT_DOWN); contentView.setChronometerCountDown(R.id.chronometer, countsDown); setTextViewColorSecondary(contentView, R.id.chronometer, p); } else { contentView.setViewVisibility(R.id.time, View.VISIBLE); contentView.setLong(R.id.time, "setTime", mN.when); setTextViewColorSecondary(contentView, R.id.time, p); } } else { // We still want a time to be set but gone, such that we can show and hide it // on demand in case it's a child notification without anything in the header contentView.setLong(R.id.time, "setTime", mN.when != 0 ? mN.when : mN.creationTime); setTextViewColorSecondary(contentView, R.id.time, p); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindHeaderChronometerAndTime File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
bindHeaderChronometerAndTime
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public Object readThisUnknownObjectXml(TypedXmlPullParser in, String tag) throws XmlPullParserException, IOException { if (TAG_PERSISTABLEMAP.equals(tag)) { return restoreFromXml(in); } throw new XmlPullParserException("Unknown tag=" + tag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readThisUnknownObjectXml File: core/java/android/os/PersistableBundle.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40074
MEDIUM
5.5
android
readThisUnknownObjectXml
core/java/android/os/PersistableBundle.java
40e4ea759743737958dde018f3606d778f7a53f3
0
Analyze the following code function for security vulnerabilities
@Override public String query() { return request.query(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: query File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
query
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
@Deprecated public Boolean getIgnoreIncomingSignatures() { logger.warn("Option 'ignoreIncomingSignatures' is deprecated and should not be used. Signatures are verified if " + "SAML2SignatureValidationHandler is available."); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIgnoreIncomingSignatures File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
getIgnoreIncomingSignatures
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
public void delete() { if (!tryDelete()) { if (assureDeletion) { fail("Unable to clean up temporary folder " + folder); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: src/main/java/org/junit/rules/TemporaryFolder.java Repository: junit-team/junit4 The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-15250
LOW
1.9
junit-team/junit4
delete
src/main/java/org/junit/rules/TemporaryFolder.java
610155b8c22138329f0723eec22521627dbc52ae
0
Analyze the following code function for security vulnerabilities
public String getFacebookLoginURL() { return "https://www.facebook.com/dialog/oauth?client_id=" + CONF.facebookAppId() + "&response_type=code&scope=email&redirect_uri=" + getParaEndpoint() + "/facebook_auth&state=" + getParaAppId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFacebookLoginURL 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
getFacebookLoginURL
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public void initialize() throws InitializationException { // Initialize the queues before starting the threads. this.resolveQueue = new LinkedBlockingQueue<>(); this.indexQueue = new LinkedBlockingQueue<>(this.configuration.getIndexerQueueCapacity()); // Launch the resolve thread this.resolveThread = new Thread(new Resolver()); this.resolveThread.setName("XWiki Solr resolve thread"); this.resolveThread.setDaemon(true); this.resolveThread.start(); this.resolveThread.setPriority(Thread.NORM_PRIORITY - 1); // Launch the index thread this.indexThread = new Thread(this); this.indexThread.setName("XWiki Solr index thread"); this.indexThread.setDaemon(true); this.indexThread.start(); this.indexThread.setPriority(Thread.NORM_PRIORITY - 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-312", "CWE-200" ]
CVE-2023-50719
HIGH
7.5
xwiki/xwiki-platform
initialize
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/src/main/java/org/xwiki/search/solr/internal/DefaultSolrIndexer.java
3e5272f2ef0dff06a8f4db10afd1949b2f9e6eea
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("GuardedBy") private void dumpSettingsLocked(SettingsState settingsState, PrintWriter pw) { List<String> names = settingsState.getSettingNamesLocked(); pw.println("version: " + settingsState.getVersionLocked()); final int nameCount = names.size(); for (int i = 0; i < nameCount; i++) { String name = names.get(i); Setting setting = settingsState.getSettingLocked(name); pw.print("_id:"); pw.print(toDumpString(setting.getId())); pw.print(" name:"); pw.print(toDumpString(name)); if (setting.getPackageName() != null) { pw.print(" pkg:"); pw.print(setting.getPackageName()); } pw.print(" value:"); pw.print(toDumpString(setting.getValue())); if (setting.getDefaultValue() != null) { pw.print(" default:"); pw.print(setting.getDefaultValue()); pw.print(" defaultSystemSet:"); pw.print(setting.isDefaultFromSystem()); } if (setting.getTag() != null) { pw.print(" tag:"); pw.print(setting.getTag()); } pw.println(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpSettingsLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
dumpSettingsLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public JSONObject put(String key, Object value) throws JSONException { return doPut(key, value, -1, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
put
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
private void executeCallback(int errorCode, String errorMessage, @NonNull @CallbackExecutor Executor executor, @NonNull InstallSystemUpdateCallback callback) { executor.execute(() -> callback.onInstallUpdateError(errorCode, errorMessage)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeCallback File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
executeCallback
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public String dialogRow(int segment) { if (segment == HTML_START) { return "<div class=\"dialogrow\">"; } else { return "</div>\n"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dialogRow 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
dialogRow
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public abstract double get(String name, double defaultValue) throws IOException, IllegalArgumentException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
get
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public <T> void join(JoinBy from, JoinBy to, String operation, String joinType, String cr, Class<T> returnedClass, boolean setId, Handler<AsyncResult<Results<T>>> replyHandler) { Function<TotaledResults, Results<T>> resultSetMapper = totaledResults -> processResults(totaledResults.set, totaledResults.total, returnedClass, setId); join(from, to, operation, joinType, cr, resultSetMapper, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
join
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
boolean isDoubleQuotedExecutableEscaped() { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDoubleQuotedExecutableEscaped File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
isDoubleQuotedExecutableEscaped
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@Override public boolean shouldConfirmCredentials(int userId) { return mUserController.shouldConfirmCredentials(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldConfirmCredentials File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
shouldConfirmCredentials
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public List<QName> getQNames() { List<QName> answer = new ArrayList<QName>(); answer.addAll(noNamespaceCache.values()); for (Map<String, QName> map : namespaceCache.values()) { answer.addAll(map.values()); } return answer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getQNames File: src/main/java/org/dom4j/tree/QNameCache.java Repository: dom4j The code follows secure coding practices.
[ "CWE-91" ]
CVE-2018-1000632
MEDIUM
5
dom4j
getQNames
src/main/java/org/dom4j/tree/QNameCache.java
e598eb43d418744c4dbf62f647dd2381c9ce9387
0
Analyze the following code function for security vulnerabilities
public static XWiki getXWiki(XWikiContext context) throws XWikiException { return getXWiki(true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXWiki 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
getXWiki
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 boolean isPotentialInCallMMICode(Uri handle) { if (handle != null && handle.getSchemeSpecificPart() != null && handle.getScheme().equals(PhoneAccount.SCHEME_TEL)) { String dialedNumber = handle.getSchemeSpecificPart(); return (dialedNumber.equals("0") || (dialedNumber.startsWith("1") && dialedNumber.length() <= 2) || (dialedNumber.startsWith("2") && dialedNumber.length() <= 2) || dialedNumber.equals("3") || dialedNumber.equals("4") || dialedNumber.equals("5")); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPotentialInCallMMICode File: src/com/android/server/telecom/CallsManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2423
MEDIUM
6.6
android
isPotentialInCallMMICode
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public static Action<Binder> memoryStore(Consumer<? super CacheBuilder<AsciiString, ByteBuf>> config) { return b -> memoryStore(b, config); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: memoryStore File: ratpack-session/src/main/java/ratpack/session/SessionModule.java Repository: ratpack The code follows secure coding practices.
[ "CWE-338" ]
CVE-2019-11808
MEDIUM
4.3
ratpack
memoryStore
ratpack-session/src/main/java/ratpack/session/SessionModule.java
f2b63eb82dd71194319fd3945f5edf29b8f3a42d
0
Analyze the following code function for security vulnerabilities
boolean isSecureLocked() { if ((mAttrs.flags & WindowManager.LayoutParams.FLAG_SECURE) != 0) { return true; } return !DevicePolicyCache.getInstance().isScreenCaptureAllowed(mShowUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSecureLocked 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
isSecureLocked
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public DynamicForm withError(final String key, final String error, final List<Object> args) { final Form<Dynamic> form = super.withError(asDynamicKey(key), error, args); return new DynamicForm( super.rawData(), super.files(), form.errors(), form.value(), this.messagesApi, this.formatters, this.validatorFactory, this.config, lang().orElse(null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withError 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
withError
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
public IntentBuilder setForBiometrics(boolean forBiometrics) { mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, forBiometrics); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setForBiometrics File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
setForBiometrics
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public <P> Column<T, V> setRenderer( ValueProvider<V, P> presentationProvider, Renderer<? super P> renderer) { Objects.requireNonNull(renderer, "Renderer can not be null"); Objects.requireNonNull(presentationProvider, "Presentation provider can not be null"); // Remove old renderer Connector oldRenderer = getState().renderer; if (oldRenderer instanceof Extension) { removeExtension((Extension) oldRenderer); } // Set new renderer getState().renderer = renderer; addExtension(renderer); this.presentationProvider = presentationProvider; // Trigger redraw getGrid().getDataCommunicator().reset(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRenderer 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
setRenderer
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override protected void bindBackgroundListener() { if (!checkBackgroundLocationPermission()) { return; } final Class bgListenerClass = getBackgroundLocationListener(); if (bgListenerClass == null) { return; } Thread t = new Thread(new Runnable() { @Override public void run() { //wait until the client is connected, otherwise the call to //requestLocationUpdates will fail while (!getmGoogleApiClient().isConnected()) { try { Thread.sleep(300); } catch (Exception ex) { } } Handler mHandler = new Handler(Looper.getMainLooper()); mHandler.post(new Runnable() { public void run() { //don't be too aggressive for location updates in the background LocationRequest req = LocationRequest.create(); setupBackgroundLocationRequest(req); Context context = AndroidNativeUtil.getContext().getApplicationContext(); PendingIntent pendingIntent = createBackgroundPendingIntent(); requestLocationUpdates(context, req, pendingIntent); } }); } }); t.setUncaughtExceptionHandler(AndroidImplementation.exceptionHandler); t.start(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindBackgroundListener File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
bindBackgroundListener
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void dispatchStartedWakingUp() { synchronized (this) { mDeviceInteractive = true; } mHandler.sendEmptyMessage(MSG_STARTED_WAKING_UP); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchStartedWakingUp File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
dispatchStartedWakingUp
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
@Pure @EnsuresNonNull("rows") protected void checkClosed() throws SQLException { if (rows == null) { throw new PSQLException(GT.tr("This ResultSet is closed."), PSQLState.OBJECT_NOT_IN_STATE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkClosed 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
checkClosed
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public String htmlStart() { return pageHtml(HTML_START, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: htmlStart 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
htmlStart
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private void reportEmptyContextHelpers() { if (!"/".equals(contextPath)) { LoggerFactory.getLogger(ResourceBundleTracker.class).error( "No {} services found matched context path '{}'", ServletContextHelper.class.getSimpleName(), contextPath); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportEmptyContextHelpers File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java Repository: vaadin/osgi The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-31407
MEDIUM
5
vaadin/osgi
reportEmptyContextHelpers
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
0
Analyze the following code function for security vulnerabilities
private static boolean isExternal(PackageSetting ps) { return (ps.pkgFlags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isExternal 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
isExternal
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@TestApi @GuardedBy("this") public @Nullable String getOverlayablesToString(String packageName) { synchronized (this) { ensureValidLocked(); return nativeGetOverlayablesToString(mObject, packageName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOverlayablesToString File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getOverlayablesToString
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private void handlePost(HttpServerResponse response, RoutingContext ctx, String requestedCharset) { try { JsonObject jsonObjectFromBody = getJsonObjectFromBody(ctx); if (hasQueryParameters(ctx) && allowPostWithQueryParameters) { JsonObject jsonObjectFromQueryParameters = getJsonObjectFromQueryParameters(ctx); JsonObject mergedJsonObject; if (jsonObjectFromBody != null) { mergedJsonObject = Json.createMergePatch(jsonObjectFromQueryParameters).apply(jsonObjectFromBody) .asJsonObject(); } else { mergedJsonObject = jsonObjectFromQueryParameters; } if (!mergedJsonObject.containsKey(QUERY)) { response.setStatusCode(400).end(MISSING_OPERATION); return; } doRequest(mergedJsonObject, response, ctx, requestedCharset); } else { if (jsonObjectFromBody == null) { response.setStatusCode(400).end(MISSING_OPERATION); return; } doRequest(jsonObjectFromBody, response, ctx, requestedCharset); } } catch (IOException ex) { throw new RuntimeException(ex); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePost File: extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-444" ]
CVE-2022-2466
CRITICAL
9.8
quarkusio/quarkus
handlePost
extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java
08e5c3106ce4bfb18b24a38514eeba6464668b07
0
Analyze the following code function for security vulnerabilities
public RetentionStrategy getRetentionStrategy() { return RetentionStrategy.NOOP; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRetentionStrategy 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
getRetentionStrategy
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") default Class<V> getValueType() { Optional<Class> type = GenericTypeUtils.resolveInterfaceTypeArgument(getClass(), ConvertibleValues.class); return type.orElse(Object.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValueType File: core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getValueType
core/src/main/java/io/micronaut/core/convert/value/ConvertibleValues.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
@Override public XWikiDocument getOriginalDocument() { return this.originalDocument; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOriginalDocument 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
getOriginalDocument
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
private void migrate92(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Issues.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.addElement("confidential").setText("false"); dom.writeToFile(file, false); } else if (file.getName().startsWith("Roles.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { if (element.elementTextTrim("codePrivilege").equals("WRITE")) element.addElement("accessConfidentialIssues").setText("true"); else element.addElement("accessConfidentialIssues").setText("false"); } dom.writeToFile(file, false); } else if (file.getName().startsWith("IssueChanges.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { Element dataElement = element.element("data"); if (dataElement.attributeValue("class").contains("IssueBatchUpdateData")) { dataElement.addElement("oldConfidential").setText("false"); dataElement.addElement("newConfidential").setText("false"); } } dom.writeToFile(file, false); } else if (file.getName().startsWith("Settings.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String key = element.elementTextTrim("key"); if (key.equals("SERVICE_DESK_SETTING")) { Element valueElement = element.element("value"); if (valueElement != null) { for (Element issueCreationSettingElement: valueElement.element("issueCreationSettings").elements()) issueCreationSettingElement.addElement("confidential").setText("false"); } } } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate92 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate92
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
protected CoercionAction _checkCoercionFail(DeserializationContext ctxt, CoercionAction act, Class<?> targetType, Object inputValue, String inputDesc) throws IOException { if (act == CoercionAction.Fail) { ctxt.reportBadCoercion(this, targetType, inputValue, "Cannot coerce %s to %s (but could if coercion was enabled using `CoercionConfig`)", inputDesc, _coercedTypeDesc()); } return act; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _checkCoercionFail File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_checkCoercionFail
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
private void deleteApiScenarioReport(List<String> scenarioIds) { if (scenarioIds == null || scenarioIds.isEmpty()) { return; } ApiScenarioReportExample scenarioReportExample = new ApiScenarioReportExample(); scenarioReportExample.createCriteria().andScenarioIdIn(scenarioIds); List<ApiScenarioReport> list = apiScenarioReportMapper.selectByExample(scenarioReportExample); if (CollectionUtils.isNotEmpty(list)) { List<String> ids = list.stream().map(ApiScenarioReport::getId).collect(Collectors.toList()); APIReportBatchRequest reportRequest = new APIReportBatchRequest(); reportRequest.setIds(ids); apiReportService.deleteAPIReportBatch(reportRequest); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteApiScenarioReport File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
deleteApiScenarioReport
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public String displayPrettyName(String fieldname, XWikiContext context) { return displayPrettyName(fieldname, false, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayPrettyName 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
displayPrettyName
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 ApiClient setServerIndex(Integer serverIndex) { this.serverIndex = serverIndex; updateBasePath(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServerIndex File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/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
setServerIndex
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void execute(Transaction t) throws SQLException { //Statement st = t.getConnection().createStatement(); Statement st = t.getConnection().prepareStatement(query, variables); try { ResultSet rs = st.executeQuery(query); ResultSetMetaData metaData = rs.getMetaData(); while (rs.next()) { Map map = new HashMap(); for (int i = 0; i < metaData.getColumnCount(); i++) { map.put(metaData.getColumnLabel(i + 1), rs.getString(i + 1)); } list.add(map); } } finally { st.close(); } }
Vulnerability Classification: - CWE: CWE-89 - CVE: CVE-2013-10013 - Severity: MEDIUM - CVSS Score: 5.2 Description: Prevent SQL-injection Function: execute File: src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java Repository: Bricco/authenticator-plugin Fixed Code: public void execute(Transaction t) throws SQLException { PreparedStatement prepStmt = t.getConnection().prepareStatement(query); prepStmt.setString(1, args[0]); prepStmt.setString(2, args[1]); try { ResultSet rs = prepStmt.executeQuery(); ResultSetMetaData metaData = rs.getMetaData(); while (rs.next()) { Map map = new HashMap(); for (int i = 0; i < metaData.getColumnCount(); i++) { map.put(metaData.getColumnLabel(i + 1), rs.getString(i + 1)); } list.add(map); } } finally { prepStmt.close(); } }
[ "CWE-89" ]
CVE-2013-10013
MEDIUM
5.2
Bricco/authenticator-plugin
execute
src/java/talentum/escenic/plugins/authenticator/authenticators/DBAuthenticator.java
a5456633ff75e8f13705974c7ed1ce77f3f142d5
1
Analyze the following code function for security vulnerabilities
@SystemApi @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public @Nullable String getDeviceOwner() { throwIfParentInstance("getDeviceOwner"); final ComponentName name = getDeviceOwnerComponentOnCallingUser(); return name != null ? name.getPackageName() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwner File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getDeviceOwner
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@GuardedBy("this") final ProcessRecord addAppLocked(ApplicationInfo info, String customProcess, boolean isolated, boolean disableHiddenApiChecks, boolean disableTestApiChecks, String abiOverride, int zygotePolicyFlags) { return addAppLocked( info, customProcess, isolated, /* isSdkSandbox= */ false, /* sdkSandboxUid= */ 0, /* sdkSandboxClientAppPackage= */ null, disableHiddenApiChecks, disableTestApiChecks, abiOverride, zygotePolicyFlags); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAppLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
addAppLocked
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void startEmbeddedPostgres() throws IOException { // starting Postgres setIsEmbedded(true); if (embeddedPostgres == null) { int port = postgreSQLClientConfig.getInteger(PORT); String username = postgreSQLClientConfig.getString(_USERNAME); String password = postgreSQLClientConfig.getString(_PASSWORD); String database = postgreSQLClientConfig.getString(DATABASE); String locale = "en_US.UTF-8"; String operatingSystem = System.getProperty("os.name").toLowerCase(); if (operatingSystem.contains("win")) { locale = "american_usa"; } rememberEmbeddedPostgres(); embeddedPostgres.start("localhost", port, database, username, password, Arrays.asList("-E", "UTF-8", "--locale", locale)); Runtime.getRuntime().addShutdownHook(new Thread(PostgresClient::stopEmbeddedPostgres)); log.info("embedded postgres started on port " + port); } else { log.info("embedded postgres is already running..."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startEmbeddedPostgres File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
startEmbeddedPostgres
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0