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
@Nullable Task getRootTask() { final Task task = getTask(); if (task != null) { return task.getRootTask(); } // Some system windows (e.g. "Power off" dialog) don't have a task, but we would still // associate them with some root task to enable dimming. final DisplayContent dc = getDisplayContent(); return mAttrs.type >= FIRST_SYSTEM_WINDOW && dc != null ? dc.getDefaultTaskDisplayArea().getRootHomeTask() : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRootTask 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
getRootTask
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
public abstract User login(String userId, String password, String extra);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: login File: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/impl/AbstractAuthenticator.java Repository: apache/dolphinscheduler The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-49068
HIGH
7.5
apache/dolphinscheduler
login
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/impl/AbstractAuthenticator.java
359b1a7e5bb72790d2583971dc2d44a8481e3a10
0
Analyze the following code function for security vulnerabilities
public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderAccept File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
selectHeaderAccept
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) { switch(hiByte) { case 0: return ((jjbitVec4[i2] & l2) != 0L); case 48: return ((jjbitVec5[i2] & l2) != 0L); case 49: return ((jjbitVec6[i2] & l2) != 0L); case 51: return ((jjbitVec7[i2] & l2) != 0L); case 61: return ((jjbitVec8[i2] & l2) != 0L); default : if ((jjbitVec3[i1] & l1) != 0L) return true; return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: jjCanMove_1 File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java Repository: jakartaee/expression-language The code follows secure coding practices.
[ "CWE-917" ]
CVE-2021-28170
MEDIUM
5
jakartaee/expression-language
jjCanMove_1
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
b6a3943ac5fba71cbc6719f092e319caa747855b
0
Analyze the following code function for security vulnerabilities
private void registerConfig(URL resourceConfig) { try { if (log.isDebugEnabled()) { log.debug("Process resources configuration file " + resourceConfig.toExternalForm()); } InputStream in = URLToStreamHelper.urlToStream(resourceConfig); try { Digester digester = new Digester(); digester.setValidating(false); digester.setEntityResolver(new EntityResolver() { // Dummi resolver - alvays do nothing public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { return new InputSource(new StringReader("")); } }); digester.setNamespaceAware(false); digester.setUseContextClassLoader(true); digester.push(this); digester.addObjectCreate("resource-config/resource", "class", JarResource.class); digester.addObjectCreate("resource-config/resource/renderer", "class", HTMLRenderer.class); digester.addCallMethod( "resource-config/resource/renderer/content-type", "setContentType", 0); digester.addSetNext("resource-config/resource/renderer", "setRenderer", ResourceRenderer.class.getName()); digester.addCallMethod("resource-config/resource/name", "setKey", 0); digester.addCallMethod("resource-config/resource/path", "setPath", 0); digester.addCallMethod("resource-config/resource/cacheable", "setCacheable", 0); digester.addCallMethod( "resource-config/resource/session-aware", "setSessionAware", 0); digester.addCallMethod("resource-config/resource/property", "setProperty", 2); digester.addCallParam("resource-config/resource/property/name", 0); digester.addCallParam( "resource-config/resource/property/value", 1); digester.addCallMethod("resource-config/resource/content-type", "setContentType", 0); digester.addSetNext("resource-config/resource", "addResource", InternetResource.class.getName()); digester.parse(in); } finally { in.close(); } } catch (IOException e) { throw new FacesException(e); } catch (SAXException e) { throw new FacesException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerConfig File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
registerConfig
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("tag:async") @GetMapping("/async") @ResponseBody public Result async() { tagService.async(); return success(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: async File: src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java Repository: atjiu/pybbs The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
async
src/main/java/co/yiiu/pybbs/controller/admin/TagAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
0
Analyze the following code function for security vulnerabilities
boolean canSeeAnyPinnedShortcut(@NonNull String callingPackage, int userId, int callingPid, int callingUid) { if (injectHasAccessShortcutsPermission(callingPid, callingUid)) { return true; } synchronized (mNonPersistentUsersLock) { return getNonPersistentUserLocked(userId).hasHostPackage(callingPackage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canSeeAnyPinnedShortcut File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
canSeeAnyPinnedShortcut
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
private String buildKey(Object base, String path) { if (path.startsWith("/")) { return path.substring(1); } if (null == base) { return path; } StringBuffer packageName = new StringBuffer(base.getClass() .getPackage().getName().replace('.', '/')); return packageName.append("/").append(path).toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildKey File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
buildKey
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
public void setStandalone() { this.isStandalone = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStandalone File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
setStandalone
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
protected String getAccessToken(JsonObject json) { return json.get("access_token").getAsString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAccessToken File: src/main/java/com/mxgraph/online/AbsAuthServlet.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-601", "CWE-918" ]
CVE-2022-1767
MEDIUM
5
jgraph/drawio
getAccessToken
src/main/java/com/mxgraph/online/AbsAuthServlet.java
c63f3a04450f30798df47f9badbc74eb8a69fbdf
0
Analyze the following code function for security vulnerabilities
private void setRandomizedMacAddress(WifiConfiguration config, MacAddress mac) { config.setRandomizedMacAddress(mac); config.randomizedMacLastModifiedTimeMs = mClock.getWallClockMillis(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRandomizedMacAddress File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
setRandomizedMacAddress
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public LBMonitor updateMonitor(LBMonitor monitor) { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateMonitor 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
updateMonitor
src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java
7f5bedb625eec3ff4d29987c31cef2553a962b36
0
Analyze the following code function for security vulnerabilities
public static String stripNonValidXMLCharacters(String in) { StringBuffer out = new StringBuffer(); // Used to hold the output. char current; // Used to reference the current character. if (in == null || "".equals(in)) return ""; // vacancy test. for (int i = 0; i < in.length(); i++) { current = in.charAt(i); // NOTE: No IndexOutOfBoundsException caught here; it should not happen. if ((current == 0x9) || (current == 0xA) || (current == 0xD) || ((current >= 0x20) && (current <= 0xD7FF)) || ((current >= 0xE000) && (current <= 0xFFFD)) || ((current >= 0x10000) && (current <= 0x10FFFF))) out.append(current); } return out.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stripNonValidXMLCharacters File: src/main/java/com/openkm/util/FormatUtil.java Repository: openkm/document-management-system The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-40317
MEDIUM
5.4
openkm/document-management-system
stripNonValidXMLCharacters
src/main/java/com/openkm/util/FormatUtil.java
870d518f7de349c3fa4c7b9883789fdca4590c4e
0
Analyze the following code function for security vulnerabilities
public KeyId getKeyId() { if (keyURL == null) return null; String id = keyURL.substring(keyURL.lastIndexOf("/") + 1); return new KeyId(id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKeyId File: base/common/src/main/java/com/netscape/certsrv/key/KeyRequestInfo.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getKeyId
base/common/src/main/java/com/netscape/certsrv/key/KeyRequestInfo.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public int getIntValue(DocumentReference classReference, String fieldName) { return getIntValue(classReference, fieldName, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntValue 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
getIntValue
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 deleteHostLocked(Host host) { final int N = host.widgets.size(); for (int i = N - 1; i >= 0; i--) { Widget widget = host.widgets.remove(i); deleteAppWidgetLocked(widget); } mHosts.remove(host); // it's gone or going away, abruptly drop the callback connection host.callbacks = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteHostLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
deleteHostLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void postApplyAnimation(boolean visible, boolean fromTransition) { final boolean usingShellTransitions = mTransitionController.isShellTransitionsEnabled(); final boolean delayed = isAnimating(PARENTS | CHILDREN, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION | ANIMATION_TYPE_RECENTS); if (!delayed && !usingShellTransitions) { // We aren't delayed anything, but exiting windows rely on the animation finished // callback being called in case the ActivityRecord was pretending to be delayed, // which we might have done because we were in closing/opening apps list. onAnimationFinished(ANIMATION_TYPE_APP_TRANSITION, null /* AnimationAdapter */); if (visible) { // The token was made immediately visible, there will be no entrance animation. // We need to inform the client the enter animation was finished. mEnteringAnimation = true; mWmService.mActivityManagerAppTransitionNotifier.onAppTransitionFinishedLocked( token); } } // If we're becoming visible, immediately change client visibility as well. there seem // to be some edge cases where we change our visibility but client visibility never gets // updated. // If we're becoming invisible, update the client visibility if we are not running an // animation. Otherwise, we'll update client visibility in onAnimationFinished. if (visible || !isAnimating(PARENTS, ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_RECENTS) || usingShellTransitions) { setClientVisible(visible); } if (!visible) { final InputTarget imeInputTarget = mDisplayContent.getImeInputTarget(); mLastImeShown = imeInputTarget != null && imeInputTarget.getWindowState() != null && imeInputTarget.getWindowState().mActivityRecord == this && mDisplayContent.mInputMethodWindow != null && mDisplayContent.mInputMethodWindow.isVisible(); mImeInsetsFrozenUntilStartInput = true; } final DisplayContent displayContent = getDisplayContent(); if (!displayContent.mClosingApps.contains(this) && !displayContent.mOpeningApps.contains(this) && !fromTransition) { // Take the screenshot before possibly hiding the WSA, otherwise the screenshot // will not be taken. mWmService.mTaskSnapshotController.notifyAppVisibilityChanged(this, visible); } // If we are hidden but there is no delay needed we immediately // apply the Surface transaction so that the ActivityManager // can have some guarantee on the Surface state following // setting the visibility. This captures cases like dismissing // the docked or root pinned task where there is no app transition. // // In the case of a "Null" animation, there will be // no animation but there will still be a transition set. // We still need to delay hiding the surface such that it // can be synchronized with showing the next surface in the transition. if (!isVisible() && !delayed && !displayContent.mAppTransition.isTransitionSet()) { SurfaceControl.openTransaction(); try { forAllWindows(win -> { win.mWinAnimator.hide(getGlobalTransaction(), "immediately hidden"); }, true); } finally { SurfaceControl.closeTransaction(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: postApplyAnimation 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
postApplyAnimation
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public static void listCacheIds(String filter, boolean jnlpPath, boolean domain) { List<CacheId> items = getCacheIds(filter, jnlpPath, domain); if (JNLPRuntime.isDebug()) { for (CacheId id : items) { LOG.info("{} ({}) [{}]", id.getId(), id.getType(), id.files.size()); for (Object[] o : id.getFiles()) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < o.length; i++) { Object object = o[i]; if (object == null) { object = "??"; } sb.append(object.toString()).append(" ; "); } LOG.info(" * {}", sb); } } } else { for (CacheId id : items) { LOG.info(id.getId()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: listCacheIds File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
listCacheIds
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
public int getWeight() { return weight; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWeight File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
getWeight
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@Override @CacheEvict(value= {CacheConstant.SYS_USERS_CACHE}, allEntries=true) @Transactional(rollbackFor = Exception.class) public void editUserWithRole(SysUser user, String roles) { this.updateById(user); //先删后加 sysUserRoleMapper.delete(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, user.getId())); if(oConvertUtils.isNotEmpty(roles)) { String[] arr = roles.split(","); for (String roleId : arr) { SysUserRole userRole = new SysUserRole(user.getId(), roleId); sysUserRoleMapper.insert(userRole); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: editUserWithRole File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45208
MEDIUM
4.3
jeecgboot/jeecg-boot
editUserWithRole
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
51e2227bfe54f5d67b09411ee9a336750164e73d
0
Analyze the following code function for security vulnerabilities
@Override void removeImmediately() { if (mState != DESTROYED) { Slog.w(TAG, "Force remove immediately " + this + " state=" + mState); // If Task#removeImmediately is called directly with alive activities, ensure that the // activities are destroyed and detached from process. destroyImmediately("removeImmediately"); // Complete the destruction immediately because this activity will not be found in // hierarchy, it is unable to report completion. destroyed("removeImmediately"); } else { onRemovedFromDisplay(); } mActivityRecordInputSink.releaseSurfaceControl(); super.removeImmediately(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeImmediately 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
removeImmediately
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static File getSettingsProblemFile() { File dataDir = Environment.getDataDirectory(); File systemDir = new File(dataDir, "system"); File fname = new File(systemDir, "uiderrors.txt"); return fname; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingsProblemFile 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
getSettingsProblemFile
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public static String pojo2json(Object entity) throws Exception { // SimpleModule module = new SimpleModule(); // module.addSerializer(entity.getClass(), new PoJoJsonSerializer()); // mapper.registerModule(module); if (entity != null) { if (entity instanceof JsonObject) { return ((JsonObject) entity).encode(); } else { try { return mapper.writeValueAsString(entity); } catch (JsonProcessingException e) { log.error(e.getMessage(), e); throw e; } } } throw new Exception("Entity can not be null"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pojo2json 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
pojo2json
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private void parsePlot(Element e, boolean inRightOfPrevious, XmlSerializer serializer) throws Exception { if (!XmlUtils.ensureAttribute(e, "type", "2d")) { return; } final Element input = XmlUtils.getElement(XmlUtils.getElements(e), "input"); if (input == null) { return; } final String term = FormulaBase.BaseType.PLOT_FUNCTION.toString().toLowerCase(Locale.ENGLISH); serializer.startTag(FormulaList.XML_NS, term); plotProp.writeToXml(serializer); serializer.attribute(FormulaList.XML_NS, FormulaList.XML_PROP_INRIGHTOFPREVIOUS, Boolean.toString(inRightOfPrevious)); final List<Element> elements = XmlUtils.getElements(input, SM_TAG_MATH_EXPRESSION); if (!elements.isEmpty()) { parsePlotFunctions(elements, serializer); } serializer.endTag(FormulaList.XML_NS, term); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parsePlot File: app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java Repository: mkulesh/microMathematics The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000821
HIGH
7.5
mkulesh/microMathematics
parsePlot
app/src/main/java/com/mkulesh/micromath/io/ImportFromSMathStudio.java
5c05ac8de16c569ff0a1816f20be235090d3dd9d
0
Analyze the following code function for security vulnerabilities
@NotNull public static Collection<Element> getChildElementList( Element parent, String[] nodeNameList) { List<Element> list = new ArrayList<>(); for (org.w3c.dom.Node node = parent.getFirstChild(); node != null; node = node.getNextSibling()) { if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) { for (int i = 0; i < nodeNameList.length; i++) { if (node.getNodeName().equals(nodeNameList[i])) { list.add((Element) node); } } } } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChildElementList File: bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java Repository: dbeaver The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3836
MEDIUM
4.3
dbeaver
getChildElementList
bundles/org.jkiss.utils/src/org/jkiss/utils/xml/XMLUtils.java
4debf8f25184b7283681ed3fb5e9e887d9d4fe22
0
Analyze the following code function for security vulnerabilities
public static String gravatarPattern() { return CONF.gravatarsPattern(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: gravatarPattern 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
gravatarPattern
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private void parseGamePlay(final Element root) throws GameParseException { parseDelegates(getChildren("delegate", root)); parseSequence(getSingleChild("sequence", root)); parseOffset(getSingleChild("offset", root, true)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGamePlay File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseGamePlay
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private void setLockPatternInternal(String pattern, String savedCredential, int userId) throws RemoteException { byte[] currentHandle = getCurrentHandle(userId); if (pattern == null) { clearUserKeyProtection(userId); getGateKeeperService().clearSecureUserId(userId); mStorage.writePatternHash(null, userId); setKeystorePassword(null, userId); fixateNewestUserKeyAuth(userId); onUserLockChanged(userId); return; } if (isManagedProfileWithUnifiedLock(userId)) { // get credential from keystore when managed profile has unified lock try { savedCredential = getDecryptedPasswordForTiedProfile(userId); } catch (UnrecoverableKeyException | InvalidKeyException | KeyStoreException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | CertificateException | IOException e) { if (e instanceof FileNotFoundException) { Slog.i(TAG, "Child profile key not found"); } else { Slog.e(TAG, "Failed to decrypt child profile key", e); } } } else { if (currentHandle == null) { if (savedCredential != null) { Slog.w(TAG, "Saved credential provided, but none stored"); } savedCredential = null; } } byte[] enrolledHandle = enrollCredential(currentHandle, savedCredential, pattern, userId); if (enrolledHandle != null) { CredentialHash willStore = new CredentialHash(enrolledHandle, CredentialHash.VERSION_GATEKEEPER); setUserKeyProtection(userId, pattern, doVerifyPattern(pattern, willStore, true, 0, userId)); mStorage.writePatternHash(enrolledHandle, userId); fixateNewestUserKeyAuth(userId); onUserLockChanged(userId); } else { throw new RemoteException("Failed to enroll pattern"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLockPatternInternal File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
setLockPatternInternal
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
public AlgorithmParameters engineGetParameters() { if (engineParam == null && engineSpec != null) { try { engineParam = helper.createAlgorithmParameters("IES"); engineParam.init(engineSpec); } catch (Exception e) { throw new RuntimeException(e.toString()); } } return engineParam; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineGetParameters File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineGetParameters
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public final boolean containsDouble(CharSequence name, double value) { return contains(name, String.valueOf(value)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: containsDouble File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
containsDouble
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
private S3PluginActifactPullRequestDto buildS3PluginActifactPullRequestDto(PluginArtifactPullReq req) { S3PluginActifactPullRequestDto dto = new S3PluginActifactPullRequestDto(); dto.setBucketName(req.getBucketName()); dto.setKeyName(req.getKeyName()); dto.setState(req.getState()); dto.setRequestId(req.getId()); dto.setTotalSize(req.getTotalSize()); dto.setErrorMessage(req.getErrMsg()); dto.setPackageId(req.getPkgId()); return dto; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildS3PluginActifactPullRequestDto File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java Repository: WeBankPartners/wecube-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-45746
MEDIUM
5
WeBankPartners/wecube-platform
buildS3PluginActifactPullRequestDto
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
1164dae43c505f8a0233cc049b2689d6ca6d0c37
0
Analyze the following code function for security vulnerabilities
public static boolean isPathUnsafe(String path) { // Check that the path does not have '/../', '\..\', %5C..%5C, or // %2F..%2F try { path = URLDecoder.decode(path, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException("An error occurred during decoding URL.", e); } return PARENT_DIRECTORY_REGEX.matcher(path).find(); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2020-36321 - Severity: MEDIUM - CVSS Score: 5.0 Description: Update the path pattern to block slash-dot-dot either Function: isPathUnsafe File: flow-server/src/main/java/com/vaadin/flow/server/HandlerHelper.java Repository: vaadin/flow Fixed Code: public static boolean isPathUnsafe(String path) { // Check that the path does not have '/../', '\..\', %5C..%5C, // %2F..%2F, nor '/..', '\..', %5C.., %2F.. try { path = URLDecoder.decode(path, StandardCharsets.UTF_8.name()); } catch (UnsupportedEncodingException e) { throw new RuntimeException("An error occurred during decoding URL.", e); } return PARENT_DIRECTORY_REGEX.matcher(path).find(); }
[ "CWE-22" ]
CVE-2020-36321
MEDIUM
5
vaadin/flow
isPathUnsafe
flow-server/src/main/java/com/vaadin/flow/server/HandlerHelper.java
e0dcaf86b63dbcab3adbbe107d1c49d490ead8eb
1
Analyze the following code function for security vulnerabilities
@Override String getName() { return Integer.toHexString(System.identityHashCode(this)) + " " + getWindowTag(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getName 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
getName
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
BackgroundFetch getBackgroundFetchListener() { if (getActivity() != null && getActivity().getApp() instanceof BackgroundFetch) { return (BackgroundFetch)getActivity().getApp(); } else if (backgroundFetchListener != null) { return backgroundFetchListener; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBackgroundFetchListener 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
getBackgroundFetchListener
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public IBinder newUriPermissionOwner(String name) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeString(name); mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); reply.readException(); IBinder res = reply.readStrongBinder(); data.recycle(); reply.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newUriPermissionOwner File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
newUriPermissionOwner
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public String getDescription() { return description; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getDescription
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void keyguardDone(boolean strongAuth, int targetUserId) { if (targetUserId != ActivityManager.getCurrentUser()) { return; } if (DEBUG) Log.d(TAG, "keyguardDone"); tryKeyguardDone(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyguardDone File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
keyguardDone
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
@Override protected void internalInit() { // checks assertNotBlank("clientId", getClientId()); if (!AUTHORIZATION_CODE_FLOWS.contains(responseType) && !IMPLICIT_FLOWS.contains(responseType) && !HYBRID_CODE_FLOWS.contains(responseType)) { throw new TechnicalException("Unsupported responseType: " + responseType); } // except for the implicit flow and when PKCE is disabled, the secret is mandatory if (!IMPLICIT_FLOWS.contains(responseType) && isDisablePkce()) { assertNotBlank("secret", getSecret()); } if (this.getDiscoveryURI() == null && this.getProviderMetadata() == null) { throw new TechnicalException("You must define either the discovery URL or directly the provider metadata"); } // default value if (getResourceRetriever() == null) { setResourceRetriever(new DefaultResourceRetriever(getConnectTimeout(),getReadTimeout())); } if (this.getProviderMetadata() == null) { assertNotBlank("discoveryURI", getDiscoveryURI()); try { // Download OIDC metadata this.setProviderMetadata(OIDCProviderMetadata.parse(getResourceRetriever().retrieveResource( new URL(this.getDiscoveryURI())).getContent())); } catch (final IOException | ParseException e) { throw new TechnicalException(e); } } if (this.logoutHandler == null) { this.logoutHandler = new DefaultLogoutHandler(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalInit File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
internalInit
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
private void cancelNotification(NotificationId id, UserHandle user) { cancelNotification(id, mContext.getPackageName(), user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelNotification 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
cancelNotification
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public Response processControlCommand(ControlCommand command) throws Exception { String control = command.getCommand(); if (control != null && control.equals("shutdown")) { System.exit(0); } return null; }
Vulnerability Classification: - CWE: CWE-264 - CVE: CVE-2014-3576 - Severity: MEDIUM - CVSS Score: 5.0 Description: Remove unused ConnectionControl handling. Function: processControlCommand File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq Fixed Code: @Override public Response processControlCommand(ControlCommand command) throws Exception { return null; }
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
processControlCommand
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
1
Analyze the following code function for security vulnerabilities
public WikiMainController createWikiMainController(UserRequest ureq, WindowControl wControl, OLATResourceable ores, WikiSecurityCallback securityCallback, WikiAssessmentProvider assessmentProvider, String initialPageName) { return new WikiMainController(ureq, wControl, ores, securityCallback, assessmentProvider, initialPageName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createWikiMainController File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
createWikiMainController
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override protected int engineUpdate(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) throws ShortBufferException { final int maximumLen = getOutputSizeForUpdate(inputLen); return updateInternal(input, inputOffset, inputLen, output, outputOffset, maximumLen); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineUpdate File: src/main/java/org/conscrypt/OpenSSLCipher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2461
HIGH
7.6
android
engineUpdate
src/main/java/org/conscrypt/OpenSSLCipher.java
1638945d4ed9403790962ec7abed1b7a232a9ff8
0
Analyze the following code function for security vulnerabilities
@Override public boolean setDefaultBrowserPackageName(String packageName, int userId) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.SET_PREFERRED_APPLICATIONS, null); synchronized (mPackages) { boolean result = mSettings.setDefaultBrowserPackageNameLPw(packageName, userId); if (packageName != null) { result |= updateIntentVerificationStatus(packageName, PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS, userId); mDefaultPermissionPolicy.grantDefaultPermissionsToDefaultBrowserLPr( packageName, userId); } return result; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDefaultBrowserPackageName 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
setDefaultBrowserPackageName
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public String getServiceFriendlyName() { if (mServiceFriendlyNames == null || mServiceFriendlyNames.isEmpty()) return null; String lang = Locale.getDefault().getLanguage(); String friendlyName = mServiceFriendlyNames.get(lang); if (friendlyName != null) { return friendlyName; } friendlyName = mServiceFriendlyNames.get("en"); if (friendlyName != null) { return friendlyName; } return mServiceFriendlyNames.get(mServiceFriendlyNames.keySet().stream().findFirst().get()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServiceFriendlyName File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
getServiceFriendlyName
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public TransactionTemplate txTemplate() { return transactionTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: txTemplate File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
txTemplate
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; KeycloakPrincipal that = (KeycloakPrincipal) o; if (!name.equals(that.name)) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: core/src/main/java/org/keycloak/KeycloakPrincipal.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
equals
core/src/main/java/org/keycloak/KeycloakPrincipal.java
5821e37eb63ff3ef45c0c0cd2ae2b54a8a242724
0
Analyze the following code function for security vulnerabilities
@RequestMapping("related/redirect") public String relatedRedirect(@RequestAttribute SysSite site, Long id, HttpServletRequest request) { ClickStatistics clickStatistics = statisticsComponent.relatedClicks(id); if (null != clickStatistics && CommonUtils.notEmpty(clickStatistics.getUrl())) { return UrlBasedViewResolver.REDIRECT_URL_PREFIX + clickStatistics.getUrl(); } else { return UrlBasedViewResolver.REDIRECT_URL_PREFIX + site.getDynamicPath(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: relatedRedirect File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/web/cms/ContentController.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
relatedRedirect
publiccms-parent/publiccms-core/src/main/java/com/publiccms/controller/web/cms/ContentController.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasOneof(Descriptors.OneofDescriptor oneof) { return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasOneof File: java/core/src/main/java/com/google/protobuf/MessageReflection.java Repository: protocolbuffers/protobuf The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-3509
HIGH
7.5
protocolbuffers/protobuf
hasOneof
java/core/src/main/java/com/google/protobuf/MessageReflection.java
a3888f53317a8018e7a439bac4abeb8f3425d5e9
0
Analyze the following code function for security vulnerabilities
protected abstract BeanSerializerBase asArraySerializer();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asArraySerializer 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
asArraySerializer
src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public boolean savePresentation(final String meetingId, final String filename, final String urlString) { String finalUrl = followRedirect(meetingId, urlString, 0, urlString); if (finalUrl == null) return false; boolean success = false; CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault(); try { httpclient.start(); File download = new File(filename); ZeroCopyConsumer<File> consumer = new ZeroCopyConsumer<File>(download) { @Override protected File process( final HttpResponse response, final File file, final ContentType contentType) throws Exception { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new ClientProtocolException("Upload failed: " + response.getStatusLine()); } return file; } }; Future<File> future = httpclient.execute(HttpAsyncMethods.createGet(finalUrl), consumer, null); File result = future.get(); success = result.exists(); } catch (java.lang.InterruptedException ex) { log.error("InterruptedException while saving presentation", meetingId, ex); } catch (java.util.concurrent.ExecutionException ex) { log.error("ExecutionException while saving presentation", meetingId, ex); } catch (java.io.FileNotFoundException ex) { log.error("FileNotFoundException while saving presentation", meetingId, ex); } finally { try { httpclient.close(); } catch (java.io.IOException ex) { log.error("IOException while saving presentation", meetingId, ex); } } return success; }
Vulnerability Classification: - CWE: CWE-918 - CVE: CVE-2023-43798 - Severity: MEDIUM - CVSS Score: 5.4 Description: Fix: Getting final Url (from redirect) on presentation upload Function: savePresentation File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton Fixed Code: public boolean savePresentation(final String meetingId, final String filename, final String urlString) { String finalUrl = followRedirect(meetingId, urlString, 0, urlString); if (finalUrl == null) return false; if(!finalUrl.equals(urlString)) { log.info("Redirected to Final URL [{}]", finalUrl); } boolean success = false; //Disable follow redirect since finalUrl already did it RequestConfig requestConfig = RequestConfig.custom() .setRedirectsEnabled(false) .build(); CloseableHttpAsyncClient httpclient = HttpAsyncClients.custom() .setDefaultRequestConfig(requestConfig) .build(); try { httpclient.start(); File download = new File(filename); ZeroCopyConsumer<File> consumer = new ZeroCopyConsumer<File>(download) { @Override protected File process( final HttpResponse response, final File file, final ContentType contentType) throws Exception { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { throw new ClientProtocolException("Upload failed: " + response.getStatusLine()); } return file; } }; Future<File> future = httpclient.execute(HttpAsyncMethods.createGet(finalUrl), consumer, null); File result = future.get(); success = result.exists(); } catch (java.lang.InterruptedException ex) { log.error("InterruptedException while saving presentation", meetingId, ex); } catch (java.util.concurrent.ExecutionException ex) { log.error("ExecutionException while saving presentation", meetingId, ex); } catch (java.io.FileNotFoundException ex) { log.error("FileNotFoundException while saving presentation", meetingId, ex); } finally { try { httpclient.close(); } catch (java.io.IOException ex) { log.error("IOException while saving presentation", meetingId, ex); } } return success; }
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
savePresentation
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
1
Analyze the following code function for security vulnerabilities
public String[] getArguments() { Vector result = new Vector( arguments.size() * 2 ); for ( int i = 0; i < arguments.size(); i++ ) { Argument arg = (Argument) arguments.elementAt( i ); String[] s = arg.getParts(); if ( s != null ) { for ( int j = 0; j < s.length; j++ ) { result.addElement( s[j] ); } } } String[] res = new String[result.size()]; result.copyInto( res ); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getArguments File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java Repository: codehaus-plexus/plexus-utils The code follows secure coding practices.
[ "CWE-78" ]
CVE-2017-1000487
HIGH
7.5
codehaus-plexus/plexus-utils
getArguments
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
0
Analyze the following code function for security vulnerabilities
private void parseAndLoginFromWebView(String dataString) { String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/"; LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, dataString); try { if (mHostUrlInput != null) { mHostUrlInput.setText(""); } mServerInfo.mBaseUrl = AuthenticatorUrlUtils.normalizeUrlSuffix(loginUrlInfo.serverAddress); webViewUser = loginUrlInfo.username; webViewPassword = loginUrlInfo.password; } catch (Exception e) { mServerStatusIcon = R.drawable.ic_alert; mServerStatusText = getString(R.string.qr_could_not_be_read); showServerStatus(); } checkOcServer(); }
Vulnerability Classification: - CWE: CWE-248 - CVE: CVE-2021-32694 - Severity: MEDIUM - CVSS Score: 4.3 Description: Do not crash if wrong deep login url is used Signed-off-by: tobiasKaminsky <tobias@kaminsky.me> Function: parseAndLoginFromWebView File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android Fixed Code: private void parseAndLoginFromWebView(String dataString) { try { String prefix = getString(R.string.login_data_own_scheme) + PROTOCOL_SUFFIX + "login/"; LoginUrlInfo loginUrlInfo = parseLoginDataUrl(prefix, dataString); if (mHostUrlInput != null) { mHostUrlInput.setText(""); } mServerInfo.mBaseUrl = AuthenticatorUrlUtils.normalizeUrlSuffix(loginUrlInfo.serverAddress); webViewUser = loginUrlInfo.username; webViewPassword = loginUrlInfo.password; } catch (Exception e) { mServerStatusIcon = R.drawable.ic_alert; mServerStatusText = getString(R.string.qr_could_not_be_read); showServerStatus(); } checkOcServer(); }
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
parseAndLoginFromWebView
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
1
Analyze the following code function for security vulnerabilities
@Override protected void endGroup(WikiParameters parameters) { if (isMetaDataElement(parameters)) { MetaData metaData = createMetaData(parameters); getListener().endMetaData(metaData); WikiParameters cleanParameters = cleanParametersFromMetadata(parameters); if (cleanParameters.getSize() > 0) { super.endGroup(cleanParameters); } } else { super.endGroup(parameters); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endGroup File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
endGroup
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XHTMLXWikiGeneratorListener.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
@Override public void setDisconnected(String callId, DisconnectCause disconnectCause, Session.Info sessionInfo) { Log.startSession(sessionInfo, LogUtils.Sessions.CSW_SET_DISCONNECTED, mPackageAbbreviation); long token = Binder.clearCallingIdentity(); try { synchronized (mLock) { logIncoming("setDisconnected %s %s", callId, disconnectCause); Call call = mCallIdMapper.getCall(callId); Log.d(this, "disconnect call %s %s", disconnectCause, call); if (call != null) { mCallsManager.markCallAsDisconnected(call, disconnectCause); } else { // Log.w(this, "setDisconnected, unknown call id: %s", args.arg1); } } } catch (Throwable t) { Log.e(ConnectionServiceWrapper.this, t, ""); throw t; } finally { Binder.restoreCallingIdentity(token); Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDisconnected File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
setDisconnected
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@RequestMapping(value = "/repository/restful/artifact/GET/html", method = RequestMethod.GET) public ModelAndView getArtifactAsHtml(@RequestParam("pipelineName") String pipelineName, @RequestParam("pipelineCounter") String pipelineCounter, @RequestParam("stageName") String stageName, @RequestParam(value = "stageCounter", required = false) String stageCounter, @RequestParam("buildName") String buildName, @RequestParam("filePath") String filePath, @RequestParam(value = "sha1", required = false) String sha, @RequestParam(value = "serverAlias", required = false) String serverAlias) throws Exception { return getArtifact(filePath, folderViewFactory, pipelineName, pipelineCounter, stageName, stageCounter, buildName, sha, serverAlias); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getArtifactAsHtml File: server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java Repository: gocd The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-43289
MEDIUM
5
gocd
getArtifactAsHtml
server/src/main/java/com/thoughtworks/go/server/controller/ArtifactsController.java
4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
0
Analyze the following code function for security vulnerabilities
private void bindConversationDetails() { final TextView channelName = findViewById(R.id.parent_channel_name); channelName.setText(mNotificationChannel.getName()); bindGroup(); // TODO: bring back when channel name does not include name // bindName(); bindPackage(); bindIcon(mNotificationChannel.isImportantConversation()); mPriorityDescriptionView = findViewById(R.id.priority_summary); if (willShowAsBubble() && willBypassDnd()) { mPriorityDescriptionView.setText(R.string.notification_channel_summary_priority_all); } else if (willShowAsBubble()) { mPriorityDescriptionView.setText(R.string.notification_channel_summary_priority_bubble); } else if (willBypassDnd()) { mPriorityDescriptionView.setText(R.string.notification_channel_summary_priority_dnd); } else { mPriorityDescriptionView.setText( R.string.notification_channel_summary_priority_baseline); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindConversationDetails File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40098
MEDIUM
5.5
android
bindConversationDetails
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
0
Analyze the following code function for security vulnerabilities
private Session retrieveOrCreateSession(Subject subject) { final Session potentialSession = subject.getSession(false); if (needToCreateNewSession(potentialSession)) { // There's no valid session, but the authenticator would like us to create one. // This is the "Trusted Header Authentication" scenario, where the browser performs this request to check if a // session exists, with a trusted header identifying the user. The authentication filter will authenticate the // user based on the trusted header and request a session to be created transparently. The UI will take the // session information from the response to perform subsequent requests to the backend using this session. final String host = RestTools.getRemoteAddrFromRequest(grizzlyRequest, trustedSubnets); return sessionCreator.create(subject, host) .orElseThrow(() -> new NotAuthorizedException("Invalid credentials.", "Basic realm=\"Graylog Server session\"")); } return potentialSession; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retrieveOrCreateSession File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-384" ]
CVE-2024-24823
MEDIUM
4.4
Graylog2/graylog2-server
retrieveOrCreateSession
graylog2-server/src/main/java/org/graylog2/rest/resources/system/SessionsResource.java
1596b749db86368ba476662f23a0f0c5ec2b5097
0
Analyze the following code function for security vulnerabilities
public ApiClient setBearerToken(String bearerToken) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBearerAuth) { ((HttpBearerAuth) auth).setBearerToken(bearerToken); return this; } } throw new RuntimeException("No Bearer authentication configured!"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setBearerToken File: samples/client/petstore/java/resteasy/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
setBearerToken
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void initDatabaseVersion() { SYSTEM_PROP.put("dbServer.version", ZrLogUtil.getDatabaseServerVersion(dbProperties.getProperty("jdbcUrl"), dbProperties.getProperty("user"), dbProperties.getProperty("password"), dbProperties.getProperty("driverClass"))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initDatabaseVersion File: web/src/main/java/com/zrlog/web/config/ZrLogConfig.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-16643
LOW
3.5
94fzb/zrlog
initDatabaseVersion
web/src/main/java/com/zrlog/web/config/ZrLogConfig.java
4a91c83af669e31a22297c14f089d8911d353fa1
0
Analyze the following code function for security vulnerabilities
public static String toCCStatus(Item i) { if (i instanceof Job) { Job j = (Job) i; switch (j.getIconColor().noAnime()) { case ABORTED: case RED: case YELLOW: return "Failure"; case BLUE: return "Success"; case DISABLED: case GREY: return "Unknown"; } } return "Unknown"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toCCStatus File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
toCCStatus
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
@Override protected void onInitialize() { super.onInitialize(); add(new ExternalImage("custom", "/site/logo.png?v=" + getCustomLogoFile().lastModified()) { @Override protected void onConfigure() { super.onConfigure(); setVisible(getCustomLogoFile().exists()); } }); add(new SpriteImage("onedev", "logo") { @Override protected void onConfigure() { super.onConfigure(); setVisible(!getCustomLogoFile().exists()); } }); setRenderBodyOnly(true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onInitialize File: server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-552" ]
CVE-2022-39208
HIGH
7.5
theonedev/onedev
onInitialize
server-core/src/main/java/io/onedev/server/web/component/brandlogo/BrandLogoPanel.java
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
0
Analyze the following code function for security vulnerabilities
@Override @NonNull public List<String> getDelegatedShellPermissions() { return getDelegatedShellPermissionsInternal(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDelegatedShellPermissions File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
getDelegatedShellPermissions
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void verifyIntentFilter(int id, int verificationCode, List<String> failedDomains) throws RemoteException { mContext.enforceCallingOrSelfPermission( Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT, "Only intentfilter verification agents can verify applications"); final Message msg = mHandler.obtainMessage(INTENT_FILTER_VERIFIED); final IntentFilterVerificationResponse response = new IntentFilterVerificationResponse( Binder.getCallingUid(), verificationCode, failedDomains); msg.arg1 = id; msg.obj = response; mHandler.sendMessage(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifyIntentFilter 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
verifyIntentFilter
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private void checkScenarioNum(SaveApiScenarioRequest request) { String projectId = request.getProjectId(); Project project = projectMapper.selectByPrimaryKey(projectId); if (project == null) { MSException.throwException("add scenario fail, project is not find."); } Boolean openCustomNum = project.getScenarioCustomNum(); if (BooleanUtils.isTrue(openCustomNum)) { checkCustomNumExist(request); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkScenarioNum 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
checkScenarioNum
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public Boolean getDeleteRecordKeepTrace() { return deleteRecordKeepTrace; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeleteRecordKeepTrace File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
getDeleteRecordKeepTrace
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
ActivityStarter setCallingPackage(String callingPackage) { mRequest.callingPackage = callingPackage; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCallingPackage File: services/core/java/com/android/server/wm/ActivityStarter.java Repository: android The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-21269
HIGH
7.8
android
setCallingPackage
services/core/java/com/android/server/wm/ActivityStarter.java
70ec64dc5a2a816d6aa324190a726a85fd749b30
0
Analyze the following code function for security vulnerabilities
@Override public void onUserRemoved(@UserIdInt int userId) { mPermissionManagerServiceImpl.onUserRemoved(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserRemoved File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
onUserRemoved
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
void moveUserToForeground(UserState uss, int oldUserId, int newUserId) { boolean homeInFront = mStackSupervisor.switchUserLocked(newUserId, uss); if (homeInFront) { startHomeActivityLocked(newUserId, "moveUserToFroreground"); } else { mStackSupervisor.resumeTopActivitiesLocked(); } EventLogTags.writeAmSwitchUser(newUserId); getUserManagerLocked().onUserForeground(newUserId); sendUserSwitchBroadcastsLocked(oldUserId, newUserId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveUserToForeground File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
moveUserToForeground
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
public static void copyMemory(byte[] src, int srcIndex, long dstAddr, long length) { PlatformDependent0.copyMemory(src, BYTE_ARRAY_BASE_OFFSET + srcIndex, null, dstAddr, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyMemory File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
copyMemory
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private JAXBContext createJaxbContextFromPackages() throws JAXBException { if (logger.isInfoEnabled()) { logger.info("Creating JAXBContext by scanning packages [" + StringUtils.arrayToCommaDelimitedString(this.packagesToScan) + "]"); } ClassPathJaxb2TypeScanner scanner = new ClassPathJaxb2TypeScanner(this.beanClassLoader, this.packagesToScan); Class<?>[] jaxb2Classes = scanner.scanPackages(); if (logger.isDebugEnabled()) { logger.debug("Found JAXB2 classes: [" + StringUtils.arrayToCommaDelimitedString(jaxb2Classes) + "]"); } this.classesToBeBound = jaxb2Classes; if (this.jaxbContextProperties != null) { return JAXBContext.newInstance(jaxb2Classes, this.jaxbContextProperties); } else { return JAXBContext.newInstance(jaxb2Classes); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createJaxbContextFromPackages File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
createJaxbContextFromPackages
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
public static boolean hasNamedParameter(Query query) { for (Parameter<?> parameter : query.getParameters()) { String name = parameter.getName(); // Hibernate 3 specific hack as it returns the index as String for the name. if (name != null && NO_DIGITS.matcher(name).find()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasNamedParameter File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java Repository: spring-projects/spring-data-jpa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-6652
MEDIUM
6.8
spring-projects/spring-data-jpa
hasNamedParameter
src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
b8e7fe
0
Analyze the following code function for security vulnerabilities
protected abstract void buildDependencyGraph(DependencyGraph graph);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildDependencyGraph File: core/src/main/java/hudson/model/AbstractProject.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
buildDependencyGraph
core/src/main/java/hudson/model/AbstractProject.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public String extractCorsOrigin(String pOrigin) { if (pOrigin != null) { // Prevent HTTP response splitting attacks String origin = pOrigin.replaceAll("[\\n\\r]*",""); if (backendManager.isCorsAccessAllowed(origin)) { return "null".equals(origin) ? "*" : origin; } else { return null; } } return null; }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2014-0168 - Severity: MEDIUM - CVSS Score: 6.8 Description: Enchanced policy wr to origin handling. The Origin: can now be checked on the server side, too. Function: extractCorsOrigin File: agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java Repository: jolokia Fixed Code: public String extractCorsOrigin(String pOrigin) { if (pOrigin != null) { // Prevent HTTP response splitting attacks String origin = pOrigin.replaceAll("[\\n\\r]*",""); if (backendManager.isOriginAllowed(origin,false)) { return "null".equals(origin) ? "*" : origin; } else { return null; } } return null; }
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
extractCorsOrigin
agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
1
Analyze the following code function for security vulnerabilities
public Configuration getWebConfiguration() { return webConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWebConfiguration File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
getWebConfiguration
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
private void configRemoveSection(String section) { String[] args = new String[]{"config", "--remove-section", section}; CommandLine gitCmd = gitWd().withArgs(args); runOrBomb(gitCmd, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configRemoveSection File: domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
configRemoveSection
domain/src/main/java/com/thoughtworks/go/domain/materials/git/GitCommand.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public double optDouble(String key, double defaultValue) { Object o = opt(key); if (o == null) { return defaultValue; } else { try { return doGetDouble(key, o); } catch (JSONException ex) { throw new RuntimeException(ex); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optDouble 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
optDouble
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public int getPageRotation(PdfDictionary page) { PdfNumber rotate = page.getAsNumber(PdfName.ROTATE); if (rotate == null) return 0; else { int n = rotate.intValue(); n %= 360; return n < 0 ? n + 360 : n; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageRotation File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getPageRotation
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
private void executeIgnore(TestContext context, String sql) { Async async = context.async(); Level oldLevel = getRootLevel(); setRootLevel(Level.FATAL); PostgresClient c = PostgresClient.getInstance(vertx); c.getClient().update(sql, reply -> { c.closeClient(close -> { setRootLevel(oldLevel); assertSuccess(context, close); async.complete(); }); }); async.awaitSuccess(5000); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeIgnore File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
executeIgnore
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public IndexerJob startIndex(IndexerRequest request) throws SolrIndexerException { try { return (IndexerJob) this.jobs.execute(IndexerJob.JOBTYPE, request); } catch (JobException e) { throw new SolrIndexerException("Failed to start index job", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startIndex 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
startIndex
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
protected void deactivateConversationContext(HttpServletRequest request) { ConversationContext conversationContext = httpConversationContext(); if (conversationContext.isActive()) { // Only deactivate the context if one is already active, otherwise we get Exceptions if (conversationContext instanceof LazyHttpConversationContextImpl) { LazyHttpConversationContextImpl lazyConversationContext = (LazyHttpConversationContextImpl) conversationContext; if (!lazyConversationContext.isInitialized()) { // if this lazy conversation has not been touched yet, just deactivate it lazyConversationContext.deactivate(); return; } } boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId()); } } conversationContext.invalidate(); conversationContext.deactivate(); if (isTransient) { conversationDestroyedEvent.fire(request); } } }
Vulnerability Classification: - CWE: CWE-362 - CVE: CVE-2014-8122 - Severity: MEDIUM - CVSS Score: 4.3 Description: WELD-1802 An exception during context deactivation/dissociation should not abort further procesing Function: deactivateConversationContext File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java Repository: weld/core Fixed Code: protected void deactivateConversationContext(HttpServletRequest request) { try { ConversationContext conversationContext = httpConversationContext(); if (conversationContext.isActive()) { // Only deactivate the context if one is already active, otherwise we get Exceptions if (conversationContext instanceof LazyHttpConversationContextImpl) { LazyHttpConversationContextImpl lazyConversationContext = (LazyHttpConversationContextImpl) conversationContext; if (!lazyConversationContext.isInitialized()) { // if this lazy conversation has not been touched yet, just deactivate it lazyConversationContext.deactivate(); return; } } boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId()); } } conversationContext.invalidate(); conversationContext.deactivate(); if (isTransient) { conversationDestroyedEvent.fire(request); } } } catch (Exception e) { ServletLogger.LOG.unableToDeactivateContext(httpConversationContext(), request); ServletLogger.LOG.catchingDebug(e); } }
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
deactivateConversationContext
impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
8e413202fa1af08c09c580f444e4fd16874f9c65
1
Analyze the following code function for security vulnerabilities
public int getOffsetToRightOf(int offset) { return getOffsetToLeftRightOf(offset, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOffsetToRightOf File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getOffsetToRightOf
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
private V fromDouble(K name, double value) { try { return valueConverter.convertDouble(value); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Failed to convert double value for header '" + name + '\'', e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDouble File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
fromDouble
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
boolean dumpOomLocked(FileDescriptor fd, PrintWriter pw, String[] args, int opti, boolean dumpAll) { boolean needSep = false; if (mLruProcesses.size() > 0) { if (needSep) pw.println(); needSep = true; pw.println(" OOM levels:"); printOomLevel(pw, "SYSTEM_ADJ", ProcessList.SYSTEM_ADJ); printOomLevel(pw, "PERSISTENT_PROC_ADJ", ProcessList.PERSISTENT_PROC_ADJ); printOomLevel(pw, "PERSISTENT_SERVICE_ADJ", ProcessList.PERSISTENT_SERVICE_ADJ); printOomLevel(pw, "FOREGROUND_APP_ADJ", ProcessList.FOREGROUND_APP_ADJ); printOomLevel(pw, "VISIBLE_APP_ADJ", ProcessList.VISIBLE_APP_ADJ); printOomLevel(pw, "PERCEPTIBLE_APP_ADJ", ProcessList.PERCEPTIBLE_APP_ADJ); printOomLevel(pw, "BACKUP_APP_ADJ", ProcessList.BACKUP_APP_ADJ); printOomLevel(pw, "HEAVY_WEIGHT_APP_ADJ", ProcessList.HEAVY_WEIGHT_APP_ADJ); printOomLevel(pw, "SERVICE_ADJ", ProcessList.SERVICE_ADJ); printOomLevel(pw, "HOME_APP_ADJ", ProcessList.HOME_APP_ADJ); printOomLevel(pw, "PREVIOUS_APP_ADJ", ProcessList.PREVIOUS_APP_ADJ); printOomLevel(pw, "SERVICE_B_ADJ", ProcessList.SERVICE_B_ADJ); printOomLevel(pw, "CACHED_APP_MIN_ADJ", ProcessList.CACHED_APP_MIN_ADJ); printOomLevel(pw, "CACHED_APP_MAX_ADJ", ProcessList.CACHED_APP_MAX_ADJ); if (needSep) pw.println(); pw.print(" Process OOM control ("); pw.print(mLruProcesses.size()); pw.print(" total, non-act at "); pw.print(mLruProcesses.size()-mLruProcessActivityStart); pw.print(", non-svc at "); pw.print(mLruProcesses.size()-mLruProcessServiceStart); pw.println("):"); dumpProcessOomList(pw, this, mLruProcesses, " ", "Proc", "PERS", true, null); needSep = true; } dumpProcessesToGc(pw, needSep, null); pw.println(); pw.println(" mHomeProcess: " + mHomeProcess); pw.println(" mPreviousProcess: " + mPreviousProcess); if (mHeavyWeightProcess != null) { pw.println(" mHeavyWeightProcess: " + mHeavyWeightProcess); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpOomLocked 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
dumpOomLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override protected PodcastSlidingUpPanelLayout getPodcastSlidingUpPanelLayout() { return binding.slidingLayout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPodcastSlidingUpPanelLayout File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java Repository: nextcloud/news-android The code follows secure coding practices.
[ "CWE-829" ]
CVE-2021-41256
MEDIUM
5.8
nextcloud/news-android
getPodcastSlidingUpPanelLayout
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
05449cb666059af7de2302df9d5c02997a23df85
0
Analyze the following code function for security vulnerabilities
private Map < String , Property<?>> parsePropertiesTag(Element propertiesTag) { Map< String , Property<?>> properties = new HashMap<String, Property<?>>(); // <properties> NodeList lisOfProperties = propertiesTag.getElementsByTagName(PROPERTY_TAG); for (int k = 0; k < lisOfProperties.getLength(); k++) { // <property name='' value='' (type='') > Element propertyTag = (Element) lisOfProperties.item(k); NamedNodeMap attMap = propertyTag.getAttributes(); if (attMap.getNamedItem(PROPERTY_PARAMNAME) == null) { throw new IllegalArgumentException("Invalid XML Syntax, " + "'name' is a required attribute of 'property' TAG"); } if (attMap.getNamedItem(PROPERTY_PARAMVALUE) == null) { throw new IllegalArgumentException("Invalid XML Syntax, " + "'value' is a required attribute of 'property' TAG"); } String name = attMap.getNamedItem(PROPERTY_PARAMNAME).getNodeValue(); String value = unEscapeXML(attMap.getNamedItem(PROPERTY_PARAMVALUE).getNodeValue()); Property<?> ap = new PropertyString(name, value); // If specific type defined ? if (null != attMap.getNamedItem(PROPERTY_PARAMTYPE)) { String optionalType = attMap.getNamedItem(PROPERTY_PARAMTYPE).getNodeValue(); // Substitution if relevant (e.g. 'int' -> 'org.ff4j.property.PropertyInt') optionalType = MappingUtil.mapPropertyType(optionalType); try { // Constructor (String, String) is mandatory in Property interface Constructor<?> constr = Class.forName(optionalType).getConstructor(String.class, String.class); ap = (Property<?>) constr.newInstance(name, value); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate '" + optionalType + "' check default constructor", e); } } if (null != attMap.getNamedItem(PROPERTY_PARAMDESCRIPTION)) { ap.setDescription(unEscapeXML( attMap.getNamedItem(PROPERTY_PARAMDESCRIPTION) .getNodeValue())); } // Is there any fixed Value ? NodeList listOfFixedValue = propertyTag.getElementsByTagName(PROPERTY_PARAMFIXED_VALUES); if (listOfFixedValue.getLength() != 0) { Element fixedValueTag = (Element) listOfFixedValue.item(0); NodeList listOfValues = fixedValueTag.getElementsByTagName(PROPERTY_PARAMVALUE); for (int l = 0; l < listOfValues.getLength(); l++) { Element valueTag = (Element) listOfValues.item(l); ap.add2FixedValueFromString(unEscapeXML(valueTag.getTextContent())); } } // Check fixed value if (ap.getFixedValues() != null && !ap.getFixedValues().contains(ap.getValue())) { throw new IllegalArgumentException("Cannot create property <" + ap.getName() + "> invalid value <" + ap.getValue() + "> expected one of " + ap.getFixedValues()); } properties.put(name, ap); } return properties; }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2022-44262 - Severity: CRITICAL - CVSS Score: 9.8 Description: fix: Add assignable check to PropertiesParser, YamlParser and XmlParser (#624) Function: parsePropertiesTag File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java Repository: ff4j Fixed Code: private Map < String , Property<?>> parsePropertiesTag(Element propertiesTag) { Map< String , Property<?>> properties = new HashMap<String, Property<?>>(); // <properties> NodeList lisOfProperties = propertiesTag.getElementsByTagName(PROPERTY_TAG); for (int k = 0; k < lisOfProperties.getLength(); k++) { // <property name='' value='' (type='') > Element propertyTag = (Element) lisOfProperties.item(k); NamedNodeMap attMap = propertyTag.getAttributes(); if (attMap.getNamedItem(PROPERTY_PARAMNAME) == null) { throw new IllegalArgumentException("Invalid XML Syntax, " + "'name' is a required attribute of 'property' TAG"); } if (attMap.getNamedItem(PROPERTY_PARAMVALUE) == null) { throw new IllegalArgumentException("Invalid XML Syntax, " + "'value' is a required attribute of 'property' TAG"); } String name = attMap.getNamedItem(PROPERTY_PARAMNAME).getNodeValue(); String value = unEscapeXML(attMap.getNamedItem(PROPERTY_PARAMVALUE).getNodeValue()); Property<?> ap = new PropertyString(name, value); // If specific type defined ? if (null != attMap.getNamedItem(PROPERTY_PARAMTYPE)) { String optionalType = attMap.getNamedItem(PROPERTY_PARAMTYPE).getNodeValue(); // Substitution if relevant (e.g. 'int' -> 'org.ff4j.property.PropertyInt') optionalType = MappingUtil.mapPropertyType(optionalType); try { // Constructor (String, String) is mandatory in Property interface Class<?> typeClass = Class.forName(optionalType); if (!Property.class.isAssignableFrom(typeClass)) { throw new IllegalArgumentException("Cannot create property <" + name + "> invalid type <" + optionalType + ">"); } Constructor<?> constr = typeClass.getConstructor(String.class, String.class); ap = (Property<?>) constr.newInstance(name, value); } catch (Exception e) { throw new IllegalArgumentException("Cannot instantiate '" + optionalType + "' check default constructor", e); } } if (null != attMap.getNamedItem(PROPERTY_PARAMDESCRIPTION)) { ap.setDescription(unEscapeXML( attMap.getNamedItem(PROPERTY_PARAMDESCRIPTION) .getNodeValue())); } // Is there any fixed Value ? NodeList listOfFixedValue = propertyTag.getElementsByTagName(PROPERTY_PARAMFIXED_VALUES); if (listOfFixedValue.getLength() != 0) { Element fixedValueTag = (Element) listOfFixedValue.item(0); NodeList listOfValues = fixedValueTag.getElementsByTagName(PROPERTY_PARAMVALUE); for (int l = 0; l < listOfValues.getLength(); l++) { Element valueTag = (Element) listOfValues.item(l); ap.add2FixedValueFromString(unEscapeXML(valueTag.getTextContent())); } } // Check fixed value if (ap.getFixedValues() != null && !ap.getFixedValues().contains(ap.getValue())) { throw new IllegalArgumentException("Cannot create property <" + ap.getName() + "> invalid value <" + ap.getValue() + "> expected one of " + ap.getFixedValues()); } properties.put(name, ap); } return properties; }
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
parsePropertiesTag
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
e915c026aef46b502934cb05a825ea2ea15eb9e6
1
Analyze the following code function for security vulnerabilities
public void sendAddExistingConnection(String id) throws Exception { for (IConnectionServiceAdapter a : mConnectionServiceAdapters) { a.addExistingConnection(id, parcelable(mConnectionById.get(id)), null /*Session.Info*/); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendAddExistingConnection File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
sendAddExistingConnection
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public static String documentToString(Document document) throws Exception { //set up a transformer Transformer trans = null; TransformerFactory transfac = TransformerFactory.newInstance(); try { trans = transfac.newTransformer(); } catch (TransformerException te) { System.out.println(HtmlFormEntryConstants.ERROR_TRANSFORMER_1 + te); } trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, HtmlFormEntryConstants.CONSTANT_YES); trans.setOutputProperty(OutputKeys.INDENT, HtmlFormEntryConstants.CONSTANT_YES); trans.setOutputProperty(OutputKeys.METHOD, HtmlFormEntryConstants.CONSTANT_XML); trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //create string from xml tree StringWriter sw = new StringWriter(); StreamResult result = new StreamResult(sw); DOMSource source = new DOMSource(document); try { trans.transform(source, result); } catch (TransformerException te) { System.out.println(HtmlFormEntryConstants.ERROR_TRANSFORMER_2 + te); } String xmlString = sw.toString(); return xmlString; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: documentToString File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java Repository: openmrs/openmrs-module-htmlformentry The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-16521
HIGH
7.5
openmrs/openmrs-module-htmlformentry
documentToString
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
9dcd304688e65c31cac5532fe501b9816ed975ae
0
Analyze the following code function for security vulnerabilities
private Mapper buildMapper() { Mapper mapper = new DefaultMapper(classLoaderReference); if (useXStream11XmlFriendlyMapper()) { mapper = new XStream11XmlFriendlyMapper(mapper); } mapper = new DynamicProxyMapper(mapper); mapper = new PackageAliasingMapper(mapper); mapper = new ClassAliasingMapper(mapper); mapper = new ElementIgnoringMapper(mapper); mapper = new FieldAliasingMapper(mapper); mapper = new AttributeAliasingMapper(mapper); mapper = new SystemAttributeAliasingMapper(mapper); mapper = new ImplicitCollectionMapper(mapper, reflectionProvider); mapper = new OuterClassMapper(mapper); mapper = new ArrayMapper(mapper); mapper = new DefaultImplementationsMapper(mapper); mapper = new AttributeMapper(mapper, converterLookup, reflectionProvider); if (JVM.isVersion(5)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.EnumMapper", new Class[]{Mapper.class}, new Object[]{mapper}); } mapper = new LocalConversionMapper(mapper); mapper = new ImmutableTypesMapper(mapper); if (JVM.isVersion(8)) { mapper = buildMapperDynamically("com.thoughtworks.xstream.mapper.LambdaMapper", new Class[]{Mapper.class}, new Object[]{mapper}); } mapper = new SecurityMapper(mapper); if (JVM.isVersion(5)) { mapper = buildMapperDynamically(ANNOTATION_MAPPER_TYPE, new Class[]{ Mapper.class, ConverterRegistry.class, ConverterLookup.class, ClassLoaderReference.class, ReflectionProvider.class}, new Object[]{ mapper, converterRegistry, converterLookup, classLoaderReference, reflectionProvider}); } mapper = wrapMapper((MapperWrapper)mapper); mapper = new CachingMapper(mapper); return mapper; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildMapper File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
buildMapper
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public String getInternalID() { return this.internalMessageID; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInternalID 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
getInternalID
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
protected void onAddedToPage() { if (firstChild_ != null) { for (final DomNode child : getChildren()) { child.onAddedToPage(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onAddedToPage 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
onAddedToPage
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
boolean viewServerWindowCommand(Socket client, String command, String parameters) { if (isSystemSecure()) { return false; } boolean success = true; Parcel data = null; Parcel reply = null; BufferedWriter out = null; // Any uncaught exception will crash the system process try { // Find the hashcode of the window int index = parameters.indexOf(' '); if (index == -1) { index = parameters.length(); } final String code = parameters.substring(0, index); int hashCode = (int) Long.parseLong(code, 16); // Extract the command's parameter after the window description if (index < parameters.length()) { parameters = parameters.substring(index + 1); } else { parameters = ""; } final WindowState window = findWindow(hashCode); if (window == null) { return false; } data = Parcel.obtain(); data.writeInterfaceToken("android.view.IWindow"); data.writeString(command); data.writeString(parameters); data.writeInt(1); ParcelFileDescriptor.fromSocket(client).writeToParcel(data, 0); reply = Parcel.obtain(); final IBinder binder = window.mClient.asBinder(); // TODO: GET THE TRANSACTION CODE IN A SAFER MANNER binder.transact(IBinder.FIRST_CALL_TRANSACTION, data, reply, 0); reply.readException(); if (!client.isOutputShutdown()) { out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream())); out.write("DONE\n"); out.flush(); } } catch (Exception e) { Slog.w(TAG, "Could not send command " + command + " with parameters " + parameters, e); success = false; } finally { if (data != null) { data.recycle(); } if (reply != null) { reply.recycle(); } if (out != null) { try { out.close(); } catch (IOException e) { } } } return success; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: viewServerWindowCommand File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
viewServerWindowCommand
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public default void cometJoined(Event event) { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cometJoined File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
cometJoined
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
private boolean canModifyProxySettings(int uid, String packageName) { final boolean isAdmin = mWifiPermissionsUtil.isAdmin(uid, packageName); final boolean hasNetworkSettingsPermission = mWifiPermissionsUtil.checkNetworkSettingsPermission(uid); final boolean hasNetworkSetupWizardPermission = mWifiPermissionsUtil.checkNetworkSetupWizardPermission(uid); final boolean hasNetworkManagedProvisioningPermission = mWifiPermissionsUtil.checkNetworkManagedProvisioningPermission(uid); // If |uid| corresponds to the admin, allow all modifications. if (isAdmin || hasNetworkSettingsPermission || hasNetworkSetupWizardPermission || hasNetworkManagedProvisioningPermission) { return true; } if (mVerboseLoggingEnabled) { Log.v(TAG, "UID: " + uid + " cannot modify WifiConfiguration proxy settings." + " hasNetworkSettings=" + hasNetworkSettingsPermission + " hasNetworkSetupWizard=" + hasNetworkSetupWizardPermission + " Admin=" + isAdmin); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: canModifyProxySettings File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
canModifyProxySettings
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override void handleUnlockUser(int userId) { startOwnerService(userId, "unlock-user"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUnlockUser 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
handleUnlockUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private boolean supportsInternal(Class<?> clazz, boolean checkForXmlRootElement) { if (checkForXmlRootElement && AnnotationUtils.findAnnotation(clazz, XmlRootElement.class) == null) { return false; } if (StringUtils.hasLength(this.contextPath)) { String packageName = ClassUtils.getPackageName(clazz); String[] contextPaths = StringUtils.tokenizeToStringArray(this.contextPath, ":"); for (String contextPath : contextPaths) { if (contextPath.equals(packageName)) { return true; } } return false; } else if (!ObjectUtils.isEmpty(this.classesToBeBound)) { return Arrays.asList(this.classesToBeBound).contains(clazz); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supportsInternal File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
supportsInternal
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
@PUT @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Path("{userCriteria}") public Response updateUser(@Context final SecurityContext securityContext, @PathParam("userCriteria") final String userCriteria, final MultivaluedMapImpl params) { writeLock(); try { if (!hasEditRights(securityContext)) { throw getException(Status.BAD_REQUEST, "User {} does not have write access to users!", securityContext.getUserPrincipal().getName()); } final OnmsUser user = getOnmsUser(userCriteria); LOG.debug("updateUser: updating user {}", user); boolean modified = false; boolean passwordModified = false; boolean hashPassword = false; final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(user); for(final String key : params.keySet()) { if (wrapper.isWritableProperty(key)) { final String stringValue = params.getFirst(key); final Object value = wrapper.convertIfNecessary(stringValue, wrapper.getPropertyType(key)); wrapper.setPropertyValue(key, value); modified = true; } if (key.equals("password")) { passwordModified = true; } else if (key.equals("hashPassword")) { hashPassword = Boolean.valueOf(params.getFirst("hashPassword")); } } if (modified) { LOG.debug("updateUser: user {} updated", user); try { if (passwordModified && hashPassword) hashPassword(user); m_userManager.save(user); } catch (final Throwable t) { throw getException(Status.INTERNAL_SERVER_ERROR, t); } return Response.noContent().build(); } return Response.notModified().build(); } finally { writeUnlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateUser File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-269" ]
CVE-2023-0872
HIGH
8
OpenNMS/opennms
updateUser
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/UserRestService.java
34ab169a74b2bc489ab06d0dbf33fee1ed94c93c
0
Analyze the following code function for security vulnerabilities
@Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_ON_STRONG_AUTH_REQUIRED_CHANGED: handleStrongAuthRequiredChanged(msg.arg1, msg.arg2); break; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleMessage File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
handleMessage
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public void forceStopPackage(final String packageName, int userId) { if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: forceStopPackage() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES; Slog.w(TAG, msg); throw new SecurityException(msg); } final int callingPid = Binder.getCallingPid(); userId = mUserController.handleIncomingUser(callingPid, Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, "forceStopPackage", null); final long callingId = Binder.clearCallingIdentity(); try { IPackageManager pm = AppGlobals.getPackageManager(); synchronized(this) { int[] users = userId == UserHandle.USER_ALL ? mUserController.getUsers() : new int[] { userId }; for (int user : users) { if (getPackageManagerInternal().isPackageStateProtected( packageName, user)) { Slog.w(TAG, "Ignoring request to force stop protected package " + packageName + " u" + user); return; } int pkgUid = -1; try { pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, user); } catch (RemoteException e) { } if (pkgUid == -1) { Slog.w(TAG, "Invalid packageName: " + packageName); continue; } try { pm.setPackageStoppedState(packageName, true, user); } catch (RemoteException e) { } catch (IllegalArgumentException e) { Slog.w(TAG, "Failed trying to unstop package " + packageName + ": " + e); } if (mUserController.isUserRunning(user, 0)) { forceStopPackageLocked(packageName, pkgUid, "from pid " + callingPid); finishForceStopPackageLocked(packageName, pkgUid); } } } } finally { Binder.restoreCallingIdentity(callingId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceStopPackage 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
forceStopPackage
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public void stopLockTaskMode() { final TaskRecord lockTask = mStackSupervisor.getLockedTaskLocked(); if (lockTask == null) { // Our work here is done. return; } final int callingUid = Binder.getCallingUid(); final int lockTaskUid = lockTask.mLockTaskUid; // Ensure the same caller for startLockTaskMode and stopLockTaskMode. // It is possible lockTaskMode was started by the system process because // android:lockTaskMode is set to a locking value in the application manifest instead of // the app calling startLockTaskMode. In this case {@link TaskRecord.mLockTaskUid} will // be 0, so we compare the callingUid to the {@link TaskRecord.effectiveUid} instead. if (getLockTaskModeState() == ActivityManager.LOCK_TASK_MODE_LOCKED && callingUid != lockTaskUid && (lockTaskUid != 0 || (lockTaskUid == 0 && callingUid != lockTask.effectiveUid))) { throw new SecurityException("Invalid uid, expected " + lockTaskUid + " callingUid=" + callingUid + " effectiveUid=" + lockTask.effectiveUid); } long ident = Binder.clearCallingIdentity(); try { Log.d(TAG, "stopLockTaskMode"); // Stop lock task synchronized (this) { mStackSupervisor.setLockTaskModeLocked(null, ActivityManager.LOCK_TASK_MODE_NONE, "stopLockTask", true); } } finally { Binder.restoreCallingIdentity(ident); } }
Vulnerability Classification: - CWE: CWE-284 - CVE: CVE-2016-3838 - Severity: MEDIUM - CVSS Score: 4.3 Description: DO NOT MERGE Disable app pinning when emergency call button pressed Also disables app pinning when the "return to call" button is pressed and brings up the in-call screen when app pinning is stopped if there is an existing call. Combination of ag/1091397 and ag/1085584 adapted for MNC. Bug: 28558307 Bug: 28761672 Change-Id: I82ec4042bff387c845ce571b197a4a86e1dd5ec8 Function: stopLockTaskMode File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android Fixed Code: @Override public void stopLockTaskMode() { final TaskRecord lockTask = mStackSupervisor.getLockedTaskLocked(); if (lockTask == null) { // Our work here is done. return; } final int callingUid = Binder.getCallingUid(); final int lockTaskUid = lockTask.mLockTaskUid; // Ensure the same caller for startLockTaskMode and stopLockTaskMode. // It is possible lockTaskMode was started by the system process because // android:lockTaskMode is set to a locking value in the application manifest instead of // the app calling startLockTaskMode. In this case {@link TaskRecord.mLockTaskUid} will // be 0, so we compare the callingUid to the {@link TaskRecord.effectiveUid} instead. if (getLockTaskModeState() == ActivityManager.LOCK_TASK_MODE_LOCKED && callingUid != lockTaskUid && (lockTaskUid != 0 || (lockTaskUid == 0 && callingUid != lockTask.effectiveUid))) { throw new SecurityException("Invalid uid, expected " + lockTaskUid + " callingUid=" + callingUid + " effectiveUid=" + lockTask.effectiveUid); } long ident = Binder.clearCallingIdentity(); try { Log.d(TAG, "stopLockTaskMode"); // Stop lock task synchronized (this) { mStackSupervisor.setLockTaskModeLocked(null, ActivityManager.LOCK_TASK_MODE_NONE, "stopLockTask", true); } TelecomManager tm = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); if (tm != null) { tm.showInCallScreen(false); } } finally { Binder.restoreCallingIdentity(ident); } }
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
stopLockTaskMode
services/core/java/com/android/server/am/ActivityManagerService.java
468651c86a8adb7aa56c708d2348e99022088af3
1
Analyze the following code function for security vulnerabilities
private void handleScreenStateChanged(boolean screenOn) { mScreenOn = screenOn; if (mVerboseLoggingEnabled) { logd(" handleScreenStateChanged Enter: screenOn=" + screenOn + " mSuspendOptimizationsEnabled=" + mContext.getResources().getBoolean( R.bool.config_wifiSuspendOptimizationsEnabled) + " state " + getCurrentState().getName()); } if (isPrimary() || isSecondaryInternet()) { // Only enable RSSI polling on primary STA, none of the secondary STA use-cases // can become the default route when other networks types that provide internet // connectivity (e.g. cellular) are available. So, no point in scoring // these connections for the purpose of switching between wifi and other network // types. // TODO(b/179518316): Enable this for secondary transient STA also if external scorer // is in charge of MBB. enableRssiPolling(screenOn); } if (mContext.getResources().getBoolean(R.bool.config_wifiSuspendOptimizationsEnabled)) { int shouldReleaseWakeLock = 0; if (screenOn) { sendMessage(CMD_SET_SUSPEND_OPT_ENABLED, 0, shouldReleaseWakeLock); } else { if (isConnected()) { // Allow 2s for suspend optimizations to be set mSuspendWakeLock.acquire(2000); shouldReleaseWakeLock = 1; } sendMessage(CMD_SET_SUSPEND_OPT_ENABLED, 1, shouldReleaseWakeLock); } } if (isConnected()) { getWifiLinkLayerStats(); } mOnTimeScreenStateChange = mOnTime; mLastScreenStateChangeTimeStamp = mLastLinkLayerStatsUpdate; if (mVerboseLoggingEnabled) log("handleScreenStateChanged Exit: " + screenOn); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleScreenStateChanged File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handleScreenStateChanged
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0