instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public void setCertTypeSubEmailCA(String certTypeSubEmailCA) {
this.certTypeSubEmailCA = certTypeSubEmailCA;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCertTypeSubEmailCA
File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setCertTypeSubEmailCA
|
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getApplicationLabel(String packageName, @UserIdInt int userId) {
return mInjector.binderWithCleanCallingIdentity(() -> {
final Context userContext;
try {
UserHandle userHandle = UserHandle.of(userId);
userContext = mContext.createPackageContextAsUser(packageName, /* flags= */ 0,
userHandle);
} catch (PackageManager.NameNotFoundException nnfe) {
Slogf.w(LOG_TAG, nnfe, "%s is not installed for user %d", packageName, userId);
return null;
}
ApplicationInfo appInfo = userContext.getApplicationInfo();
CharSequence result = null;
if (appInfo != null) {
result = appInfo.loadUnsafeLabel(userContext.getPackageManager());
}
return result != null ? result.toString() : null;
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApplicationLabel
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
|
getApplicationLabel
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isIkvmDotNet0() {
String vmName = SystemPropertyUtil.get("java.vm.name", "").toUpperCase(Locale.US);
return vmName.equals("IKVM.NET");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIkvmDotNet0
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
|
isIkvmDotNet0
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int bitMode() {
return BIT_MODE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bitMode
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
|
bitMode
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getInstallerPackageName(String packageName) {
// reader
synchronized (mPackages) {
return mSettings.getInstallerPackageNameLPr(packageName);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstallerPackageName
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
|
getInstallerPackageName
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getViewPage(Class<?> clazz, String pageName, String defaultValue) {
return getViewPage(clazz,Collections.singleton(pageName),defaultValue);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getViewPage
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getViewPage
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private UserManager getUserManager() {
if (mUserManager == null) {
mUserManager = UserManager.get(mContext);
}
return mUserManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserManager
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
|
getUserManager
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public ArrayList<BaseObject> getObjectsToRemove()
{
return (ArrayList<BaseObject>) getXObjectsToRemove();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getObjectsToRemove
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
|
getObjectsToRemove
|
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
|
@Transactional
@Override
public void onDeleteTag(Project project, String tagName) {
for (Iterator<TagProtection> it = project.getTagProtections().iterator(); it.hasNext();) {
TagProtection protection = it.next();
PatternSet patternSet = PatternSet.parse(protection.getTags());
patternSet.getIncludes().remove(tagName);
patternSet.getExcludes().remove(tagName);
protection.setTags(patternSet.toString());
if (protection.getTags().length() == 0)
it.remove();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDeleteTag
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
onDeleteTag
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
public BaseObject addXObjectFromRequest(XWikiContext context) throws XWikiException
{
// Read info in object
ObjectAddForm form = new ObjectAddForm();
form.setRequest(context.getRequest());
form.readRequest();
EntityReference classReference = getXClassEntityReferenceResolver().resolve(form.getClassName(),
EntityType.DOCUMENT, getDocumentReference());
BaseObject object = newXObject(classReference, context);
BaseClass baseclass = object.getXClass(context);
baseclass.fromMap(form.getObject(LOCAL_REFERENCE_SERIALIZER.serialize(resolveClassReference(classReference))),
object);
return object;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addXObjectFromRequest
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
|
addXObjectFromRequest
|
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 static void handleWatchRepositoryResult(
CompletableFuture<com.linecorp.centraldogma.common.Revision> future,
AsyncMethodCallback resultHandler) {
future.handle((res, cause) -> {
if (cause == null) {
final WatchRepositoryResult wrr = new WatchRepositoryResult();
wrr.setRevision(convert(res));
resultHandler.onComplete(wrr);
} else if (cause instanceof CancellationException) {
resultHandler.onComplete(CentralDogmaConstants.EMPTY_WATCH_REPOSITORY_RESULT);
} else if (cause instanceof RequestAlreadyTimedOutException) {
logger.warn("Ignoring the exception raised when a request has already timed out.");
} else {
logAndInvokeOnError("watchRepository", resultHandler, cause);
}
return null;
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleWatchRepositoryResult
File: server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
Repository: line/centraldogma
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2021-38388
|
MEDIUM
| 6.5
|
line/centraldogma
|
handleWatchRepositoryResult
|
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
|
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean hasPendingPaints() {
//if the view is not visible make sure the edt won't wait.
if (myView != null && myView.getAndroidView().getVisibility() != View.VISIBLE) {
return true;
} else {
return super.hasPendingPaints();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasPendingPaints
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
|
hasPendingPaints
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Object connectSocket(String host, int port, int connectTimeout) {
SocketImpl i = new SocketImpl();
if(i.connect(host, port, connectTimeout)) {
return i;
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connectSocket
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
|
connectSocket
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private native boolean nativeOnTouchEvent(
long nativeContentViewCoreImpl, MotionEvent event,
long timeMs, int action, int pointerCount, int historySize, int actionIndex,
float x0, float y0, float x1, float y1,
int pointerId0, int pointerId1,
float touchMajor0, float touchMajor1,
float touchMinor0, float touchMinor1,
float orientation0, float orientation1,
float rawX, float rawY,
int androidToolType0, int androidToolType1,
int androidButtonState, int androidMetaState,
boolean isTouchHandleEvent);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeOnTouchEvent
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
nativeOnTouchEvent
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
ActivityStarter setResultWho(String resultWho) {
mRequest.resultWho = resultWho;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setResultWho
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
|
setResultWho
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
protected PostMethod executePost(String uri, String string, String mediaType, String userName, String password)
throws Exception
{
HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
httpClient.getParams().setAuthenticationPreemptive(true);
PostMethod postMethod = new PostMethod(uri);
postMethod.addRequestHeader("Accept", MediaType.APPLICATION_XML.toString());
RequestEntity entity = new StringRequestEntity(string, mediaType, "UTF-8");
postMethod.setRequestEntity(entity);
httpClient.executeMethod(postMethod);
return postMethod;
}
|
Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2023-37277
- Severity: CRITICAL
- CVSS Score: 9.6
Description: XWIKI-20135: Require a CSRF token for some request types in the REST API
* Require a CSRF token in the XWiki-Form-Token header in content types
allowed in simple requests.
* Add integration tests to check that the check is indeed working.
* Automatically add the CSRF token header in same-origin requests
initiated from JavaScript.
* Add an integration test to check that the form token is correctly
added and fetch requests are still working.
Co-authored-by: Marius Dumitru Florea <marius@xwiki.com>
Function: executePost
File: xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
Repository: xwiki/xwiki-platform
Fixed Code:
protected PostMethod executePost(String uri, String string, String mediaType, String userName, String password)
throws Exception
{
return executePost(uri, string, mediaType, userName, password, getFormToken(userName, password));
}
|
[
"CWE-352"
] |
CVE-2023-37277
|
CRITICAL
| 9.6
|
xwiki/xwiki-platform
|
executePost
|
xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-test/xwiki-platform-rest-test-tests/src/test/it/org/xwiki/rest/test/framework/AbstractHttpIT.java
|
4c175405faa0e62437df397811c7526dfc0fbae7
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void beginQuotation(Map<String, String> parameters)
{
if (getBlockState().isInQuotationLine()) {
getXHTMLWikiPrinter().printXMLEndElement("p");
}
getXHTMLWikiPrinter().printXMLStartElement("blockquote", parameters);
getXHTMLWikiPrinter().setStandalone();
getXHTMLWikiPrinter().printXMLStartElement("p");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: beginQuotation
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
beginQuotation
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public String getSpacePreference(String preference, String space, String defaultValue, XWikiContext context)
{
return getSpacePreference(preference, new SpaceReference(space, context.getWikiReference()), defaultValue,
context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSpacePreference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getSpacePreference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int describeContents() {
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: describeContents
File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3897
|
MEDIUM
| 4.3
|
android
|
describeContents
|
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
|
81be4e3aac55305cbb5c9d523cf5c96c66604b39
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setRunningRemoteAnimation(int pid, boolean runningRemoteAnimation) {
ActivityManagerService.this.setRunningRemoteAnimation(pid, runningRemoteAnimation);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRunningRemoteAnimation
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
|
setRunningRemoteAnimation
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isElementSafe(String elementName)
{
return this.htmlDefinitions.isSafeTag(elementName) || this.svgDefinitions.isSafeTag(elementName)
|| this.mathMLDefinitions.isSafeTag(elementName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isElementSafe
File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/SecureHTMLElementSanitizer.java
Repository: xwiki/xwiki-commons
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-31126
|
CRITICAL
| 9.6
|
xwiki/xwiki-commons
|
isElementSafe
|
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/SecureHTMLElementSanitizer.java
|
0b8e9c45b7e7457043938f35265b2aa5adc76a68
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void appendItemListenerConfigs(XmlGenerator gen, Collection<ItemListenerConfig> configs) {
if (CollectionUtil.isNotEmpty(configs)) {
gen.open("item-listeners");
for (ItemListenerConfig lc : configs) {
gen.node("item-listener", lc.getClassName(), "include-value", lc.isIncludeValue());
}
gen.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendItemListenerConfigs
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
appendItemListenerConfigs
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasVersioning(XWikiContext context)
{
return getStoreConfiguration().isVersioningEnabled();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasVersioning
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
hasVersioning
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getCommandName() {
return this.modelAttribute;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCommandName
File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-1904
|
MEDIUM
| 4.3
|
spring-projects/spring-framework
|
getCommandName
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void destroyConfigDigester() {
configDigester = null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroyConfigDigester
File: src/share/org/apache/struts/action/ActionServlet.java
Repository: kawasima/struts1-forever
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-20"
] |
CVE-2016-1181
|
MEDIUM
| 6.8
|
kawasima/struts1-forever
|
destroyConfigDigester
|
src/share/org/apache/struts/action/ActionServlet.java
|
eda3a79907ed8fcb0387a0496d0cb14332f250e8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isCsrfTokenValid(UI ui, String requestToken) {
if (ui.getSession().getService().getDeploymentConfiguration()
.isXsrfProtectionEnabled()) {
String uiToken = ui.getCsrfToken();
if (uiToken == null || !uiToken.equals(requestToken)) {
return false;
}
}
return true;
}
|
Vulnerability Classification:
- CWE: CWE-203
- CVE: CVE-2021-31404
- Severity: LOW
- CVSS Score: 1.9
Description: Use time-constant comparison for CSRF tokens
This hardens the framework against a theoretical timing attack based on
comparing how quickly a request with an invalid CSRF token is rejected.
Function: isCsrfTokenValid
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
Fixed Code:
public static boolean isCsrfTokenValid(UI ui, String requestToken) {
if (ui.getSession().getService().getDeploymentConfiguration()
.isXsrfProtectionEnabled()) {
String uiToken = ui.getCsrfToken();
if (uiToken == null || !MessageDigest.isEqual(
uiToken.getBytes(StandardCharsets.UTF_8),
requestToken.getBytes(StandardCharsets.UTF_8))) {
return false;
}
}
return true;
}
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
isCsrfTokenValid
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean setTime(@Nullable ComponentName who, String callerPackageName, long millis) {
CallerIdentity caller;
if (isPermissionCheckFlagEnabled()) {
caller = getCallerIdentity(who, callerPackageName);
// This is a global action.
enforcePermission(SET_TIME, caller.getPackageName(), UserHandle.USER_ALL);
} else {
caller = getCallerIdentity(who);
Objects.requireNonNull(who, "ComponentName is null");
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller)
|| isProfileOwnerOfOrganizationOwnedDevice(caller));
}
// Don't allow set time when auto time is on.
if (mInjector.settingsGlobalGetInt(Global.AUTO_TIME, 0) == 1) {
return false;
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_TIME)
.setAdmin(caller.getPackageName())
.write();
mInjector.binderWithCleanCallingIdentity(() -> mInjector.getAlarmManager().setTime(millis));
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTime
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setTime
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@GuardedBy("this")
void grantUriPermissionFromIntentLocked(int callingUid,
String targetPkg, Intent intent, UriPermissionOwner owner, int targetUserId) {
NeededUriGrants needed = checkGrantUriPermissionFromIntentLocked(callingUid, targetPkg,
intent, intent != null ? intent.getFlags() : 0, null, targetUserId);
if (needed == null) {
return;
}
grantUriPermissionUncheckedFromIntentLocked(needed, owner);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: grantUriPermissionFromIntentLocked
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
|
grantUriPermissionFromIntentLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private String findPathConsideringContracts(LibraryInfo library,
String resourceName,
String localePrefix,
ContractInfo [] outContract,
FacesContext ctx) {
UIViewRoot root = ctx.getViewRoot();
List<String> contracts = null;
if (library != null) {
if(library.getContract() == null) {
contracts = Collections.emptyList();
} else {
contracts = new ArrayList<String>(1);
contracts.add(library.getContract());
}
} else if (root == null) {
String contractName = ctx.getExternalContext().getRequestParameterMap()
.get("con");
if (null != contractName && 0 < contractName.length()) {
contracts = new ArrayList<>();
contracts.add(contractName);
} else {
return null;
}
} else {
contracts = ctx.getResourceLibraryContracts();
}
String basePath = null;
for (String curContract : contracts) {
if (library != null) {
// PENDING(fcaputo) no need to iterate over the contracts, if we have a library
basePath = library.getPath(localePrefix) + '/' + resourceName;
} else {
if (localePrefix == null) {
basePath = getBaseContractsPath() + '/' + curContract + '/' + resourceName;
} else {
basePath = getBaseContractsPath()
+ '/' + curContract
+ '/'
+ localePrefix
+ '/'
+ resourceName;
}
}
try {
if (ctx.getExternalContext().getResource(basePath) != null) {
outContract[0] = new ContractInfo(curContract);
break;
} else {
basePath = null;
}
} catch (MalformedURLException e) {
throw new FacesException(e);
}
}
return basePath;
}
|
Vulnerability Classification:
- CWE: CWE-22
- CVE: CVE-2020-6950
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Multiple Path Traversal security issues
Function: findPathConsideringContracts
File: impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
Repository: eclipse-ee4j/mojarra
Fixed Code:
private String findPathConsideringContracts(LibraryInfo library,
String resourceName,
String localePrefix,
ContractInfo [] outContract,
FacesContext ctx) {
UIViewRoot root = ctx.getViewRoot();
List<String> contracts = null;
if (library != null) {
if(library.getContract() == null) {
contracts = Collections.emptyList();
} else {
contracts = new ArrayList<String>(1);
contracts.add(library.getContract());
}
} else if (root == null) {
String contractName = ctx.getExternalContext().getRequestParameterMap()
.get("con");
if (null != contractName && 0 < contractName.length() && !ResourceManager.nameContainsForbiddenSequence(contractName)) {
contracts = new ArrayList<>();
contracts.add(contractName);
} else {
return null;
}
} else {
contracts = ctx.getResourceLibraryContracts();
}
String basePath = null;
for (String curContract : contracts) {
if (library != null) {
// PENDING(fcaputo) no need to iterate over the contracts, if we have a library
basePath = library.getPath(localePrefix) + '/' + resourceName;
} else {
if (localePrefix == null) {
basePath = getBaseContractsPath() + '/' + curContract + '/' + resourceName;
} else {
basePath = getBaseContractsPath()
+ '/' + curContract
+ '/'
+ localePrefix
+ '/'
+ resourceName;
}
}
try {
if (ctx.getExternalContext().getResource(basePath) != null) {
outContract[0] = new ContractInfo(curContract);
break;
} else {
basePath = null;
}
} catch (MalformedURLException e) {
throw new FacesException(e);
}
}
return basePath;
}
|
[
"CWE-22"
] |
CVE-2020-6950
|
MEDIUM
| 4.3
|
eclipse-ee4j/mojarra
|
findPathConsideringContracts
|
impl/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
|
cefbb9447e7be560e59da2da6bd7cb93776f7741
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
@Deprecated
public String getRealPath(String path) {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRealPath
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getRealPath
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
public int update(String table, ContentValues values, String whereClause, String[] whereArgs) {
return updateWithOnConflict(table, values, whereClause, whereArgs, CONFLICT_NONE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
update
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getErrorMessage() {
return errorMessage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getErrorMessage
File: base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getErrorMessage
|
base/common/src/main/java/com/netscape/certsrv/cert/CertRequestInfo.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setMethod(String method) {
this.method = method;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setMethod
File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-1904
|
MEDIUM
| 4.3
|
spring-projects/spring-framework
|
setMethod
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean readExponent() throws IOException {
if (!readIf('e') && !readIf('E')) {
return false;
}
if (!readIf('+')) {
readIf('-');
}
if (!readDigit()) {
throw expected("digit");
}
while (readDigit()) {
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readExponent
File: src/main/org/hjson/JsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
readExponent
|
src/main/org/hjson/JsonParser.java
|
91bef056d56bf968451887421c89a44af1d692ff
| 0
|
Analyze the following code function for security vulnerabilities
|
void updatePreviousProcessLocked(ActivityRecord r) {
// Now that this process has stopped, we may want to consider
// it to be the previous app to try to keep around in case
// the user wants to return to it.
// First, found out what is currently the foreground app, so that
// we don't blow away the previous app if this activity is being
// hosted by the process that is actually still the foreground.
ProcessRecord fgApp = null;
for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
final ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
final ActivityStack stack = stacks.get(stackNdx);
if (isFrontStack(stack)) {
if (stack.mResumedActivity != null) {
fgApp = stack.mResumedActivity.app;
} else if (stack.mPausingActivity != null) {
fgApp = stack.mPausingActivity.app;
}
break;
}
}
}
// Now set this one as the previous process, only if that really
// makes sense to.
if (r.app != null && fgApp != null && r.app != fgApp
&& r.lastVisibleTime > mService.mPreviousProcessVisibleTime
&& r.app != mService.mHomeProcess) {
mService.mPreviousProcess = r.app;
mService.mPreviousProcessVisibleTime = r.lastVisibleTime;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updatePreviousProcessLocked
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
updatePreviousProcessLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static native int nativeGetResourceArraySize(long ptr, @ArrayRes int resId);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeGetResourceArraySize
File: core/java/android/content/res/AssetManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-415"
] |
CVE-2023-40103
|
HIGH
| 7.8
|
android
|
nativeGetResourceArraySize
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find())
filename = matcher.group(1);
}
String prefix;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf('.');
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// File.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return File.createTempFile(prefix, suffix);
else
return File.createTempFile(prefix, suffix, new File(tempFolderPath));
}
|
Vulnerability Classification:
- CWE: CWE-668
- CVE: CVE-2021-21430
- Severity: LOW
- CVSS Score: 2.1
Description: use Files.createTempFile
Function: prepareDownloadFile
File: samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
Fixed Code:
public File prepareDownloadFile(Response response) throws IOException {
String filename = null;
String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition");
if (contentDisposition != null && !"".equals(contentDisposition)) {
// Get filename from the Content-Disposition header.
Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?");
Matcher matcher = pattern.matcher(contentDisposition);
if (matcher.find())
filename = matcher.group(1);
}
String prefix;
String suffix = null;
if (filename == null) {
prefix = "download-";
suffix = "";
} else {
int pos = filename.lastIndexOf('.');
if (pos == -1) {
prefix = filename + "-";
} else {
prefix = filename.substring(0, pos) + "-";
suffix = filename.substring(pos);
}
// Files.createTempFile requires the prefix to be at least three characters long
if (prefix.length() < 3)
prefix = "download-";
}
if (tempFolderPath == null)
return Files.createTempFile(prefix, suffix).toFile();
else
return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();
}
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
prepareDownloadFile
|
samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 1
|
Analyze the following code function for security vulnerabilities
|
private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
int callingUid, int[] users, int[] broadcastAllowList) {
// TODO: come back and remove this assumption to triage all broadcasts
int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
List<ResolveInfo> receivers = null;
HashSet<ComponentName> singleUserReceivers = null;
boolean scannedFirstReceivers = false;
for (int user : users) {
// Skip users that have Shell restrictions
if (callingUid == SHELL_UID
&& mUserController.hasUserRestriction(
UserManager.DISALLOW_DEBUGGING_FEATURES, user)) {
continue;
}
List<ResolveInfo> newReceivers = mPackageManagerInt.queryIntentReceivers(
intent, resolvedType, pmFlags, callingUid, user, true /* forSend */);
if (user != UserHandle.USER_SYSTEM && newReceivers != null) {
// If this is not the system user, we need to check for
// any receivers that should be filtered out.
for (int i = 0; i < newReceivers.size(); i++) {
ResolveInfo ri = newReceivers.get(i);
if ((ri.activityInfo.flags & ActivityInfo.FLAG_SYSTEM_USER_ONLY) != 0) {
newReceivers.remove(i);
i--;
}
}
}
// Replace the alias receivers with their targets.
if (newReceivers != null) {
for (int i = newReceivers.size() - 1; i >= 0; i--) {
final ResolveInfo ri = newReceivers.get(i);
final Resolution<ResolveInfo> resolution =
mComponentAliasResolver.resolveReceiver(intent, ri, resolvedType,
pmFlags, user, callingUid, true /* forSend */);
if (resolution == null) {
// It was an alias, but the target was not found.
newReceivers.remove(i);
continue;
}
if (resolution.isAlias()) {
newReceivers.set(i, resolution.getTarget());
}
}
}
if (newReceivers != null && newReceivers.size() == 0) {
newReceivers = null;
}
if (receivers == null) {
receivers = newReceivers;
} else if (newReceivers != null) {
// We need to concatenate the additional receivers
// found with what we have do far. This would be easy,
// but we also need to de-dup any receivers that are
// singleUser.
if (!scannedFirstReceivers) {
// Collect any single user receivers we had already retrieved.
scannedFirstReceivers = true;
for (int i = 0; i < receivers.size(); i++) {
ResolveInfo ri = receivers.get(i);
if ((ri.activityInfo.flags&ActivityInfo.FLAG_SINGLE_USER) != 0) {
ComponentName cn = new ComponentName(
ri.activityInfo.packageName, ri.activityInfo.name);
if (singleUserReceivers == null) {
singleUserReceivers = new HashSet<ComponentName>();
}
singleUserReceivers.add(cn);
}
}
}
// Add the new results to the existing results, tracking
// and de-dupping single user receivers.
for (int i = 0; i < newReceivers.size(); i++) {
ResolveInfo ri = newReceivers.get(i);
if ((ri.activityInfo.flags & ActivityInfo.FLAG_SINGLE_USER) != 0) {
ComponentName cn = new ComponentName(
ri.activityInfo.packageName, ri.activityInfo.name);
if (singleUserReceivers == null) {
singleUserReceivers = new HashSet<ComponentName>();
}
if (!singleUserReceivers.contains(cn)) {
singleUserReceivers.add(cn);
receivers.add(ri);
}
} else {
receivers.add(ri);
}
}
}
}
if (receivers != null && broadcastAllowList != null) {
for (int i = receivers.size() - 1; i >= 0; i--) {
final int receiverAppId = UserHandle.getAppId(
receivers.get(i).activityInfo.applicationInfo.uid);
if (receiverAppId >= Process.FIRST_APPLICATION_UID
&& Arrays.binarySearch(broadcastAllowList, receiverAppId) < 0) {
receivers.remove(i);
}
}
}
return receivers;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: collectReceiverComponents
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
|
collectReceiverComponents
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean canSilentlyInstallPackage(String callerPackage, int callerUid) {
if (callerPackage == null) {
return false;
}
CallerIdentity caller = new CallerIdentity(callerUid, null, null);
if (isUserAffiliatedWithDevice(UserHandle.getUserId(callerUid))
&& (isActiveProfileOwner(callerUid)
|| isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller))) {
// device owner or a profile owner affiliated with the device owner
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canSilentlyInstallPackage
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
|
canSilentlyInstallPackage
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseMapProperties(final Element root) throws GameParseException, EngineVersionException {
// mandatory fields
// get the name of the map
parseInfo(getSingleChild("info", root));
// test minimum engine version FIRST
parseMinimumEngineVersionNumber(getSingleChild("triplea", root, true));
parseGameLoader(getSingleChild("loader", root, true));
// if we manage to get this far, past the minimum engine version number test, AND we are still good, then check and
// see if we have any SAX errors we need to show
if (!errorsSax.isEmpty()) {
for (final SAXParseException error : errorsSax) {
log.severe("SAXParseException: game: " + (data.getGameName() == null ? "?" : data.getGameName()) + ", line: "
+ error.getLineNumber() + ", column: " + error.getColumnNumber() + ", error: " + error.getMessage());
}
}
parseDiceSides(getSingleChild("diceSides", root, true));
final Element playerListNode = getSingleChild("playerList", root);
parsePlayerList(playerListNode);
parseAlliances(playerListNode);
final Node properties = getSingleChild("propertyList", root, true);
if (properties != null) {
parseProperties(properties);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseMapProperties
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
|
parseMapProperties
|
game-core/src/main/java/games/strategy/engine/data/GameParser.java
|
0f23875a4c6e166218859a63c884995f15c53895
| 0
|
Analyze the following code function for security vulnerabilities
|
static private void addFileToZip(ZipOutputStream out, Path root, Path file) throws IOException {
Path entry = buildPath(root, file.getFileName());
out.putNextEntry(new ZipEntry(entry.toString().replace("\\", ZIP_FILE_SEPARATOR)));
Files.copy(file, out);
out.closeEntry();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addFileToZip
File: modules/common/app/utils/common/ZipUtil.java
Repository: JATOS
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4878
|
MEDIUM
| 5.2
|
JATOS
|
addFileToZip
|
modules/common/app/utils/common/ZipUtil.java
|
2b42519f309d8164e8811392770ce604cdabb5da
| 0
|
Analyze the following code function for security vulnerabilities
|
private void verifyManifestIndividualSectionDigest(
ManifestParser.Section sfIndividualSection,
boolean createdBySigntool,
ManifestParser.Section manifestIndividualSection,
byte[] manifestBytes,
int minSdkVersion,
int maxSdkVersion) throws NoSuchAlgorithmException {
String entryName = sfIndividualSection.getName();
Collection<NamedDigest> expectedDigests =
getDigestsToVerify(
sfIndividualSection, "-Digest", minSdkVersion, maxSdkVersion);
if (expectedDigests.isEmpty()) {
mResult.addError(
Issue.JAR_SIG_NO_ZIP_ENTRY_DIGEST_IN_SIG_FILE,
entryName,
mSignatureFileEntry.getName());
return;
}
int sectionStartIndex = manifestIndividualSection.getStartOffset();
int sectionSizeBytes = manifestIndividualSection.getSizeBytes();
if (createdBySigntool) {
int sectionEndIndex = sectionStartIndex + sectionSizeBytes;
if ((manifestBytes[sectionEndIndex - 1] == '\n')
&& (manifestBytes[sectionEndIndex - 2] == '\n')) {
sectionSizeBytes--;
}
}
for (NamedDigest expectedDigest : expectedDigests) {
String jcaDigestAlgorithm = expectedDigest.jcaDigestAlgorithm;
byte[] actual =
digest(
jcaDigestAlgorithm,
manifestBytes,
sectionStartIndex,
sectionSizeBytes);
byte[] expected = expectedDigest.digest;
if (!Arrays.equals(expected, actual)) {
mResult.addError(
Issue.JAR_SIG_MANIFEST_SECTION_DIGEST_DID_NOT_VERIFY,
entryName,
jcaDigestAlgorithm,
mSignatureFileEntry.getName(),
Base64.getEncoder().encodeToString(actual),
Base64.getEncoder().encodeToString(expected));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyManifestIndividualSectionDigest
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
verifyManifestIndividualSectionDigest
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isAdb(CallerIdentity caller) {
return isShellUid(caller) || isRootUid(caller);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAdb
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
|
isAdb
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<PersistencePolicies> internalGetPersistence(boolean applied) {
return getTopicPoliciesAsyncWithRetry(topicName)
.thenApply(op -> op.map(TopicPolicies::getPersistence)
.orElseGet(() -> {
if (applied) {
PersistencePolicies namespacePolicy = getNamespacePolicies(namespaceName)
.persistence;
return namespacePolicy == null
? new PersistencePolicies(
pulsar().getConfiguration().getManagedLedgerDefaultEnsembleSize(),
pulsar().getConfiguration().getManagedLedgerDefaultWriteQuorum(),
pulsar().getConfiguration().getManagedLedgerDefaultAckQuorum(),
pulsar().getConfiguration().getManagedLedgerDefaultMarkDeleteRateLimit())
: namespacePolicy;
}
return null;
}));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalGetPersistence
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalGetPersistence
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
protected final double _parseDoublePrimitive(DeserializationContext ctxt, String text)
throws IOException
{
try {
return _parseDouble(text);
} catch (IllegalArgumentException iae) { }
Number v = (Number) ctxt.handleWeirdStringValue(Double.TYPE, text,
"not a valid `double` value (as String to convert)");
return _nonNullNumber(v).doubleValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _parseDoublePrimitive
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2022-42003
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_parseDoublePrimitive
|
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
|
d78d00ee7b5245b93103fef3187f70543d67ca33
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public PacketCollector createPacketCollector(StanzaFilter packetFilter) {
PacketCollector.Configuration configuration = PacketCollector.newConfiguration().setStanzaFilter(packetFilter);
return createPacketCollector(configuration);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPacketCollector
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2016-10027
|
MEDIUM
| 4.3
|
igniterealtime/Smack
|
createPacketCollector
|
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
|
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
| 0
|
Analyze the following code function for security vulnerabilities
|
void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) {
RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
if (sInstanceLoadPlan == null) {
// Create a new load plan if onPreloadRecents() was never triggered
sInstanceLoadPlan = loader.createLoadPlan(mContext);
}
loader.preloadTasks(sInstanceLoadPlan, isTopTaskHome);
TaskStack stack = sInstanceLoadPlan.getTaskStack();
// Prepare the dummy stack for the transition
mDummyStackView.updateMinMaxScrollForStack(stack, mTriggeredFromAltTab, isTopTaskHome);
TaskStackViewLayoutAlgorithm.VisibilityReport stackVr =
mDummyStackView.computeStackVisibilityReport();
boolean hasRecentTasks = stack.getTaskCount() > 0;
boolean useThumbnailTransition = (topTask != null) && !isTopTaskHome && hasRecentTasks;
if (useThumbnailTransition) {
// Ensure that we load the running task's icon
RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
launchOpts.runningTaskId = topTask.id;
launchOpts.loadThumbnails = false;
launchOpts.onlyLoadForCache = true;
loader.loadTasks(mContext, sInstanceLoadPlan, launchOpts);
// Try starting with a thumbnail transition
ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, stack,
mDummyStackView);
if (opts != null) {
startAlternateRecentsActivity(topTask, opts, false /* fromHome */,
false /* fromSearchHome */, true /* fromThumbnail */, stackVr);
} else {
// Fall through below to the non-thumbnail transition
useThumbnailTransition = false;
}
}
if (!useThumbnailTransition) {
// If there is no thumbnail transition, but is launching from home into recents, then
// use a quick home transition and do the animation from home
if (hasRecentTasks) {
// Get the home activity info
String homeActivityPackage = mSystemServicesProxy.getHomeActivityPackageName();
// Get the search widget info
AppWidgetProviderInfo searchWidget = null;
String searchWidgetPackage = null;
if (mConfig.hasSearchBarAppWidget()) {
searchWidget = mSystemServicesProxy.getAppWidgetInfo(
mConfig.searchBarAppWidgetId);
} else {
searchWidget = mSystemServicesProxy.resolveSearchAppWidget();
}
if (searchWidget != null && searchWidget.provider != null) {
searchWidgetPackage = searchWidget.provider.getPackageName();
}
// Determine whether we are coming from a search owned home activity
boolean fromSearchHome = false;
if (homeActivityPackage != null && searchWidgetPackage != null &&
homeActivityPackage.equals(searchWidgetPackage)) {
fromSearchHome = true;
}
ActivityOptions opts = getHomeTransitionActivityOptions(fromSearchHome);
startAlternateRecentsActivity(topTask, opts, true /* fromHome */, fromSearchHome,
false /* fromThumbnail */, stackVr);
} else {
// Otherwise we do the normal fade from an unknown source
ActivityOptions opts = getUnknownTransitionActivityOptions();
startAlternateRecentsActivity(topTask, opts, true /* fromHome */,
false /* fromSearchHome */, false /* fromThumbnail */, stackVr);
}
}
mLastToggleTime = SystemClock.elapsedRealtime();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startRecentsActivity
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
startRecentsActivity
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
public LineCursor copy() {
return new LineCursor(uri, lineNumber, line, failure);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copy
File: server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
Repository: crate
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2024-24565
|
MEDIUM
| 6.5
|
crate
|
copy
|
server/src/main/java/io/crate/execution/engine/collect/files/FileReadingIterator.java
|
4e857d675683095945dd524d6ba03e692c70ecd6
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<String> getLines() {
return Collections.unmodifiableList(strings);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLines
File: src/net/sourceforge/plantuml/version/PSystemVersion.java
Repository: plantuml
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2023-3431
|
MEDIUM
| 5.3
|
plantuml
|
getLines
|
src/net/sourceforge/plantuml/version/PSystemVersion.java
|
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getFailedOutput() {
return failedOutput;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFailedOutput
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
getFailedOutput
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerHttpResponse setChunked(boolean chunked) {
response.setChunked(chunked);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setChunked
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
setChunked
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean showPastePopup(int x, int y) {
if (!mHasInsertion || !canPaste()) return false;
final float contentOffsetYPix = mRenderCoordinates.getContentOffsetYPix();
getPastePopup().showAt(x, (int) (y + contentOffsetYPix));
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showPastePopup
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
showPastePopup
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
private String migrate104_markdown(String content) {
StringBuffer buffer = new StringBuffer();
Matcher matcher = migrate104_pattern.matcher(content);
while (matcher.find()) {
matcher.appendReplacement(buffer,
Matcher.quoteReplacement("(/~downloads/projects/" + matcher.group(1) + "/attachments/" + matcher.group(2) + ")"));
}
matcher.appendTail(buffer);
return buffer.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate104_markdown
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
migrate104_markdown
|
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
void sendWaitingVisibleReportLocked(ActivityRecord r) {
boolean changed = false;
for (int i = mWaitingActivityVisible.size()-1; i >= 0; i--) {
WaitResult w = mWaitingActivityVisible.get(i);
if (w.who == null) {
changed = true;
w.timeout = false;
if (r != null) {
w.who = new ComponentName(r.info.packageName, r.info.name);
}
w.totalTime = SystemClock.uptimeMillis() - w.thisTime;
w.thisTime = w.totalTime;
}
}
if (changed) {
mService.notifyAll();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendWaitingVisibleReportLocked
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
sendWaitingVisibleReportLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
public float getPrimaryHorizontal(int offset) {
return getPrimaryHorizontal(offset, false /* not clamped */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrimaryHorizontal
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getPrimaryHorizontal
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
public DescriptionGenerator<T> getDescriptionGenerator() {
return descriptionGenerator;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDescriptionGenerator
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getDescriptionGenerator
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean addCrossProfileWidgetProvider(ComponentName admin, String packageName) {
Objects.requireNonNull(admin, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(isProfileOwner(caller));
List<String> changedProviders = null;
synchronized (getLockObject()) {
ActiveAdmin activeAdmin = getProfileOwnerLocked(caller);
if (activeAdmin.crossProfileWidgetProviders == null) {
activeAdmin.crossProfileWidgetProviders = new ArrayList<>();
}
List<String> providers = activeAdmin.crossProfileWidgetProviders;
if (!providers.contains(packageName)) {
providers.add(packageName);
changedProviders = new ArrayList<>(providers);
saveSettingsLocked(caller.getUserId());
}
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.ADD_CROSS_PROFILE_WIDGET_PROVIDER)
.setAdmin(admin)
.write();
if (changedProviders != null) {
mLocalService.notifyCrossProfileProvidersChanged(caller.getUserId(),
changedProviders);
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCrossProfileWidgetProvider
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
|
addCrossProfileWidgetProvider
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@ManagedAttribute(value = "The unique ID of this Oort", readonly = true)
public String getId() {
return _id;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getId
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
|
getId
|
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
|
bb445a143fbf320f17c62e340455cd74acfb5929
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void internalInit() {
CommonHelper.assertNotNull("configuration", configuration);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalInit
File: pac4j-oidc/src/main/java/org/pac4j/oidc/credentials/authenticator/UserInfoOidcAuthenticator.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/credentials/authenticator/UserInfoOidcAuthenticator.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void saveDocument(String comment, boolean minorEdit) throws XWikiException
{
saveDocument(comment, minorEdit, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveDocument
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
saveDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
protected EntityNameValidationManager getEntityNameValidationManager()
{
if (this.entityNameValidationManager == null) {
this.entityNameValidationManager = Utils.getComponent(EntityNameValidationManager.class);
}
return this.entityNameValidationManager;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEntityNameValidationManager
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2022-23617
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getEntityNameValidationManager
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/XWikiAction.java
|
b35ef0edd4f2ff2c974cbeef6b80fcf9b5a44554
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean saveAuthTokenToDatabase(UserAccounts accounts, Account account, String type,
String authToken) {
if (account == null || type == null) {
return false;
}
cancelNotification(getSigninRequiredNotificationId(accounts, account),
UserHandle.of(accounts.userId));
synchronized (accounts.dbLock) {
accounts.accountsDb.beginTransaction();
boolean updateCache = false;
try {
long accountId = accounts.accountsDb.findDeAccountId(account);
if (accountId < 0) {
return false;
}
accounts.accountsDb.deleteAuthtokensByAccountIdAndType(accountId, type);
if (accounts.accountsDb.insertAuthToken(accountId, type, authToken) >= 0) {
accounts.accountsDb.setTransactionSuccessful();
updateCache = true;
return true;
}
return false;
} finally {
accounts.accountsDb.endTransaction();
if (updateCache) {
synchronized (accounts.cacheLock) {
writeAuthTokenIntoCacheLocked(accounts, account, type, authToken);
}
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveAuthTokenToDatabase
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
|
saveAuthTokenToDatabase
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setInputs(Collection<ProfileInput> inputs) {
this.inputs.clear();
this.inputs.addAll(inputs);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInputs
File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setInputs
|
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private SingleValueConverter getSingleValueConverter(Class type, String part) {
SingleValueConverter conv = UseAttributeForEnumMapper.isEnum(type) ? enumMapper
.getConverterFromItemType(null, type, null) : mapper().getConverterFromItemType(
null, type, null);
if (conv == null) {
Converter converter = lookup.lookupConverterForType(type);
if (converter instanceof SingleValueConverter) {
conv = (SingleValueConverter)converter;
} else {
throw new ConversionException("No SingleValueConverter for " + part + " available");
}
}
return conv;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSingleValueConverter
File: xstream/src/java/com/thoughtworks/xstream/converters/extended/NamedMapConverter.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
getSingleValueConverter
|
xstream/src/java/com/thoughtworks/xstream/converters/extended/NamedMapConverter.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
void onIsConferencedChanged(Call call);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onIsConferencedChanged
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
onIsConferencedChanged
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return target + ", enabled=" + enabled + ", syncable=" + syncable + ", backoff="
+ backoffTime + ", delay=" + delayUntil;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
toString
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("checkstyle:NPathComplexity")
public static String format(@Nullable String input, int indent) throws IllegalArgumentException {
if (input == null || indent < 0) {
return input;
}
if (indent == 0) {
throw new IllegalArgumentException("Indentation must not be 0.");
}
StreamResult xmlOutput = null;
try {
Source xmlInput = new StreamSource(new StringReader(input));
xmlOutput = new StreamResult(new StringWriter());
TransformerFactory transformerFactory = getTransformerFactory();
/*
* Older versions of Xalan still use this method of setting indent values.
* Attempt to make this work but don't completely fail if it's a problem.
*/
try {
transformerFactory.setAttribute("indent-number", indent);
} catch (IllegalArgumentException e) {
if (LOGGER.isFinestEnabled()) {
LOGGER.finest("Failed to set indent-number attribute; cause: " + e.getMessage());
}
}
Transformer transformer = transformerFactory.newTransformer();
// workaround IBM Java behavior - the silent ignorance of issues during the transformation.
transformer.setErrorListener(ThrowingErrorListener.INSTANCE);
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
/*
* Newer versions of Xalan will look for a fully-qualified output property in order to specify amount of
* indentation to use. Attempt to make this work as well but again don't completely fail if it's a problem.
*/
try {
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", Integer.toString(indent));
} catch (IllegalArgumentException e) {
if (LOGGER.isFinestEnabled()) {
LOGGER.finest("Failed to set indent-amount property; cause: " + e.getMessage());
}
}
transformer.transform(xmlInput, xmlOutput);
return xmlOutput.getWriter().toString();
} catch (Exception e) {
LOGGER.warning(e);
return input;
} finally {
if (xmlOutput != null) {
closeResource(xmlOutput.getWriter());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: format
File: hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0265
|
HIGH
| 7.5
|
hazelcast
|
format
|
hazelcast/src/main/java/com/hazelcast/internal/util/XmlUtil.java
|
4d6b666cd0291abd618c3b95cdbb51aa4208e748
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getUsersSearchQuery(String qs, String spaceFilter) {
qs = Utils.stripAndTrim(qs).toLowerCase();
if (!StringUtils.isBlank(qs)) {
String wildcardLower = qs.matches("[\\p{IsAlphabetic}]*") ? qs + "*" : qs;
String wildcardUpper = StringUtils.capitalize(wildcardLower);
String template = "(name:({1}) OR name:({2} OR {3}) OR properties.location:({0}) OR "
+ "properties.aboutme:({0}) OR properties.groups:({0}))";
qs = (StringUtils.isBlank(spaceFilter) ? "" : spaceFilter + " AND ") +
Utils.formatMessage(template, qs, StringUtils.capitalize(qs), wildcardLower, wildcardUpper);
} else {
qs = StringUtils.isBlank(spaceFilter) ? "*" : spaceFilter;
}
return qs;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUsersSearchQuery
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
|
getUsersSearchQuery
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean wasPurchased(String item) {
if (billingSupport != null) {
return billingSupport.wasPurchased(item);
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wasPurchased
File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
wasPurchased
|
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<FileAsset> findFileAssetsByHost(Host parentHost, User user, boolean respectFrontendRoles) throws DotDataException,
DotSecurityException {
List<FileAsset> assets = null;
try{
Folder parentFolder = APILocator.getFolderAPI().find(FolderAPI.SYSTEM_FOLDER, user, false);
assets = fromContentlets(perAPI.filterCollection(contAPI.search("+conHost:" +parentHost.getIdentifier() +" +structureType:" + Structure.STRUCTURE_TYPE_FILEASSET+" +conFolder:" + parentFolder.getInode(), -1, 0, null , user, respectFrontendRoles),
PermissionAPI.PERMISSION_READ, respectFrontendRoles, user));
} catch (Exception e) {
Logger.error(this.getClass(), e.getMessage(), e);
throw new DotRuntimeException(e.getMessage(), e);
}
return assets;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findFileAssetsByHost
File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-434"
] |
CVE-2017-11466
|
HIGH
| 9
|
dotCMS/core
|
findFileAssetsByHost
|
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
|
ab2bb2e00b841d131b8734227f9106e3ac31bb99
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST})
public ModelAndView recover(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String usernameOrEmail = StringUtils.trimToNull(request.getParameter("usernameOrEmail"));
if (usernameOrEmail != null) {
map.put("usernameOrEmail", usernameOrEmail);
User user = getUserByUsernameOrEmail(usernameOrEmail);
boolean captchaOk;
if (settingsService.isCaptchaEnabled()) {
String recaptchaResponse = request.getParameter("g-recaptcha-response");
ReCaptcha captcha = new ReCaptcha(settingsService.getRecaptchaSecretKey());
captchaOk = recaptchaResponse != null && captcha.isValid(recaptchaResponse);
} else {
captchaOk = true;
}
if (!captchaOk) {
map.put("error", "recover.error.invalidcaptcha");
} else if (user == null) {
map.put("error", "recover.error.usernotfound");
} else if (user.getEmail() == null) {
map.put("error", "recover.error.noemail");
} else {
String password = RandomStringUtils.randomAlphanumeric(8);
if (emailPassword(password, user.getUsername(), user.getEmail())) {
map.put("sentTo", user.getEmail());
user.setLdapAuthenticated(false);
user.setPassword(password);
securityService.updateUser(user);
} else {
map.put("error", "recover.error.sendfailed");
}
}
}
if (settingsService.isCaptchaEnabled()) {
map.put("recaptchaSiteKey", settingsService.getRecaptchaSiteKey());
}
return new ModelAndView("recover", "model", map);
}
|
Vulnerability Classification:
- CWE: CWE-335
- CVE: CVE-2019-10908
- Severity: HIGH
- CVSS Score: 7.5
Description: Generate new passwords in a secure way
Previously, lost passwords were generated via
org.apache.commons.lang.RandomStringUtils,
which is using java.util.Random internally.
This PRNG is has a 48-bit seed, that can easily be bruteforced
if an attacker is able to get the PRNG's output, for example
but resetting their own account multiple times,
leading to trivial privileges escalation attacks.
This commit makes use of java.security.SecureRandom
instead.
Function: recover
File: airsonic-main/src/main/java/org/airsonic/player/controller/RecoverController.java
Repository: airsonic
Fixed Code:
@RequestMapping(method = {RequestMethod.GET, RequestMethod.POST})
public ModelAndView recover(HttpServletRequest request, HttpServletResponse response) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String usernameOrEmail = StringUtils.trimToNull(request.getParameter("usernameOrEmail"));
if (usernameOrEmail != null) {
map.put("usernameOrEmail", usernameOrEmail);
User user = getUserByUsernameOrEmail(usernameOrEmail);
boolean captchaOk;
if (settingsService.isCaptchaEnabled()) {
String recaptchaResponse = request.getParameter("g-recaptcha-response");
ReCaptcha captcha = new ReCaptcha(settingsService.getRecaptchaSecretKey());
captchaOk = recaptchaResponse != null && captcha.isValid(recaptchaResponse);
} else {
captchaOk = true;
}
if (!captchaOk) {
map.put("error", "recover.error.invalidcaptcha");
} else if (user == null) {
map.put("error", "recover.error.usernotfound");
} else if (user.getEmail() == null) {
map.put("error", "recover.error.noemail");
} else {
StringBuilder sb = new StringBuilder(PASSWORD_LENGTH);
for(int i=0; i<PASSWORD_LENGTH; i++) {
int index = random.nextInt(SYMBOLS.length());
sb.append(SYMBOLS.charAt(index));
}
String password = sb.toString();
if (emailPassword(password, user.getUsername(), user.getEmail())) {
map.put("sentTo", user.getEmail());
user.setLdapAuthenticated(false);
user.setPassword(password);
securityService.updateUser(user);
} else {
map.put("error", "recover.error.sendfailed");
}
}
}
if (settingsService.isCaptchaEnabled()) {
map.put("recaptchaSiteKey", settingsService.getRecaptchaSiteKey());
}
return new ModelAndView("recover", "model", map);
}
|
[
"CWE-335"
] |
CVE-2019-10908
|
HIGH
| 7.5
|
airsonic
|
recover
|
airsonic-main/src/main/java/org/airsonic/player/controller/RecoverController.java
|
61c842923a6d60d4aedd126445a8437b53b752c8
| 1
|
Analyze the following code function for security vulnerabilities
|
public void setRequestedOrientation(IBinder token,
int requestedOrientation) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequestedOrientation
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
setRequestedOrientation
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private void uploadFiles(SaveApiScenarioRequest request, List<MultipartFile> bodyFiles, List<MultipartFile> scenarioFiles) {
FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles);
List<String> bodyFileRequestIds = request.getBodyFileRequestIds();
if (CollectionUtils.isNotEmpty(bodyFileRequestIds)) {
bodyFileRequestIds.forEach(requestId -> {
FileUtils.createBodyFiles(requestId, bodyFiles);
});
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uploadFiles
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
|
uploadFiles
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
public void pullPluginArtifact(PluginArtifactPullContext ctx) throws Exception {
PluginArtifactPullReq reqEntity = getPluginArtifactPullRequestEntity(ctx);
if (PluginArtifactPullReq.STATE_COMPLETED.equals(reqEntity.getState())) {
return;
}
String pluginPackageFileName = calculatePluginPackageFileName(ctx);
// 1. save package file to local
String tmpFileName = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
File localFilePath = new File(SystemUtils.getTempFolderPath() + tmpFileName + "/");
log.info("tmpFilePath= {}", localFilePath.getName());
checkLocalFilePath(localFilePath);
File dest = new File(localFilePath + "/" + pluginPackageFileName);
log.info("new file location: {}, filename: {}, canonicalpath: {}, canonicalfilename: {}",
dest.getAbsoluteFile(), dest.getName(), dest.getCanonicalPath(), dest.getCanonicalFile().getName());
String releaseFileUrl = getGlobalSystemVariableByName(SYS_VAR_PUBLIC_PLUGIN_ARTIFACTS_RELEASE_URL);
String artifactFileUrl = buildArtifactUrl(releaseFileUrl, ctx.getKeyName());
log.info("start to download {}", artifactFileUrl);
File downloadedFile = restTemplate.execute(artifactFileUrl, HttpMethod.GET, null, clientHttpResponse -> {
log.info("");
File ret = dest;
StreamUtils.copy(clientHttpResponse.getBody(), new FileOutputStream(ret));
return ret;
});
log.info("downloaded file:{}, size:{}", downloadedFile.getAbsoluteFile(), downloadedFile.length());
UploadPackageResultDto uploadResult = parsePackageFile(dest, localFilePath);
reqEntity.setUpdatedBy(DEFAULT_USER);
reqEntity.setUpdatedTime(new Date());
reqEntity.setTotalSize(downloadedFile.length());
reqEntity.setPkgId(uploadResult.getId());
reqEntity.setState(PluginArtifactPullReq.STATE_COMPLETED);
pluginArtifactPullReqMapper.updateByPrimaryKeySelective(reqEntity);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pullPluginArtifact
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
|
pullPluginArtifact
|
platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
|
1164dae43c505f8a0233cc049b2689d6ca6d0c37
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected String getTitle() {
return "Forgotten Password?";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTitle
File: server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-338"
] |
CVE-2023-24828
|
HIGH
| 8.8
|
theonedev/onedev
|
getTitle
|
server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java
|
d67dd9686897fe5e4ab881d749464aa7c06a68e5
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setFullAppId(String fullAppId) {
this.fullAppId = fullAppId;
this.appId = APP_ID_REPLACE_PATTERN.matcher(fullAppId).replaceAll("");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFullAppId
File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2023-25499
|
MEDIUM
| 6.5
|
vaadin/flow
|
setFullAppId
|
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
|
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
| 0
|
Analyze the following code function for security vulnerabilities
|
void setColumnId(String id) {
cellState.columnId = id;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setColumnId
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
setColumnId
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean dispatchKeyEventPreIme(KeyEvent event) {
try {
TraceEvent.begin("ContentViewCore.dispatchKeyEventPreIme");
return mContainerViewInternals.super_dispatchKeyEventPreIme(event);
} finally {
TraceEvent.end("ContentViewCore.dispatchKeyEventPreIme");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispatchKeyEventPreIme
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
dispatchKeyEventPreIme
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
static Bundle[] getBundleArrayForMessages(List<Message> messages) {
Bundle[] bundles = new Bundle[messages.size()];
final int N = messages.size();
for (int i = 0; i < N; i++) {
bundles[i] = messages.get(i).toBundle();
}
return bundles;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBundleArrayForMessages
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getBundleArrayForMessages
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isNativePickerTypeSupported(int pickerType) {
if(android.os.Build.VERSION.SDK_INT >= 11) {
return pickerType == Display.PICKER_TYPE_DATE || pickerType == Display.PICKER_TYPE_TIME || pickerType == Display.PICKER_TYPE_STRINGS;
}
return pickerType == Display.PICKER_TYPE_DATE || pickerType == Display.PICKER_TYPE_TIME;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isNativePickerTypeSupported
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
|
isNativePickerTypeSupported
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
ProcessRecord get(int pid) {
return mPidMap.get(pid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
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
|
get
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setQueueTitle(CharSequence title) throws RemoteException {
mQueueTitle = title;
mHandler.post(MessageHandler.MSG_UPDATE_QUEUE_TITLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setQueueTitle
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21280
|
MEDIUM
| 5.5
|
android
|
setQueueTitle
|
services/core/java/com/android/server/media/MediaSessionRecord.java
|
06e772e05514af4aa427641784c5eec39a892ed3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void startReadPacketFilter() {
sendMessage(CMD_READ_PACKET_FILTER);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startReadPacketFilter
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
|
startReadPacketFilter
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getHeader(String name) {
return request.getHeaders().getFirst(name);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHeader
File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
getHeader
|
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static CharSequence
applyEncoding(final String input, final String enc)
{
int start_pos = 0;
int end_pos = 0;
if (containsIgnoreCase(input, "charset")) {
Matcher m = CHARSET_PATTERN.matcher(input);
while (m.find()) {
start_pos = m.start();
end_pos = m.end();
}
}
if (start_pos != end_pos) {
return new StringBuilder(input).replace(start_pos, end_pos, "charset=" + enc);
}
return input;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyEncoding
File: ext/java/nokogiri/Html4SaxParserContext.java
Repository: sparklemotion/nokogiri
The code follows secure coding practices.
|
[
"CWE-241"
] |
CVE-2022-29181
|
MEDIUM
| 6.4
|
sparklemotion/nokogiri
|
applyEncoding
|
ext/java/nokogiri/Html4SaxParserContext.java
|
db05ba9a1bd4b90aa6c76742cf6102a7c7297267
| 0
|
Analyze the following code function for security vulnerabilities
|
private void initializeManifestAttributesChecker() throws LaunchException {
if (mac == null) {
file.getManifestAttributesReader().setLoader(this);
mac = new ManifestAttributesChecker(security, file, signing, securityDelegate);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initializeManifestAttributesChecker
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.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
|
initializeManifestAttributesChecker
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
protected B autoAckSettingsFrame(boolean autoAckSettings) {
enforceNonCodecConstraints("autoAckSettingsFrame");
autoAckSettingsFrame = autoAckSettings;
return self();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: autoAckSettingsFrame
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
netty
|
autoAckSettingsFrame
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
private void parseListenForTickles(XmlPullParser parser) {
String user = parser.getAttributeValue(null, XML_ATTR_USER);
int userId = 0;
try {
userId = Integer.parseInt(user);
} catch (NumberFormatException e) {
Log.e(TAG, "error parsing the user for listen-for-tickles", e);
} catch (NullPointerException e) {
Log.e(TAG, "the user in listen-for-tickles is null", e);
}
String enabled = parser.getAttributeValue(null, XML_ATTR_ENABLED);
boolean listen = enabled == null || Boolean.parseBoolean(enabled);
mMasterSyncAutomatically.put(userId, listen);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseListenForTickles
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-2424
|
HIGH
| 7.1
|
android
|
parseListenForTickles
|
services/core/java/com/android/server/content/SyncStorageEngine.java
|
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
| 0
|
Analyze the following code function for security vulnerabilities
|
private void checkSanity(Project project) {
File gitDir = project.getGitDir();
if (gitDir.listFiles().length == 0) {
logger.info("Initializing git repository in '" + gitDir + "'...");
try (Git git = Git.init().setDirectory(gitDir).setBare(true).call()) {
} catch (Exception e) {
throw ExceptionUtils.unchecked(e);
}
} else if (!GitUtils.isValid(gitDir)) {
logger.warn("Directory '" + gitDir + "' is not a valid git repository, reinitializing...");
FileUtils.cleanDir(gitDir);
try (Git git = Git.init().setDirectory(gitDir).setBare(true).call()) {
} catch (Exception e) {
throw ExceptionUtils.unchecked(e);
}
}
if (!isGitHookValid(gitDir, "pre-receive") || !isGitHookValid(gitDir, "post-receive")) {
File hooksDir = new File(gitDir, "hooks");
File gitPreReceiveHookFile = new File(hooksDir, "pre-receive");
FileUtils.writeFile(gitPreReceiveHookFile, String.format(gitReceiveHook, "git-prereceive-callback"));
gitPreReceiveHookFile.setExecutable(true);
File gitPostReceiveHookFile = new File(hooksDir, "post-receive");
FileUtils.writeFile(gitPostReceiveHookFile, String.format(gitReceiveHook, "git-postreceive-callback"));
gitPostReceiveHookFile.setExecutable(true);
}
try {
StoredConfig config = project.getRepository().getConfig();
boolean changed = false;
if (config.getEnum(ConfigConstants.CONFIG_DIFF_SECTION, null, ConfigConstants.CONFIG_KEY_ALGORITHM,
SupportedAlgorithm.MYERS) != SupportedAlgorithm.HISTOGRAM) {
config.setEnum(ConfigConstants.CONFIG_DIFF_SECTION, null, ConfigConstants.CONFIG_KEY_ALGORITHM,
SupportedAlgorithm.HISTOGRAM);
changed = true;
}
if (!config.getBoolean("uploadpack", "allowAnySHA1InWant", false)) {
config.setBoolean("uploadpack", null, "allowAnySHA1InWant", true);
changed = true;
}
if (changed)
config.save();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkSanity
File: server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-39205
|
CRITICAL
| 9.8
|
theonedev/onedev
|
checkSanity
|
server-core/src/main/java/io/onedev/server/entitymanager/impl/DefaultProjectManager.java
|
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
| 0
|
Analyze the following code function for security vulnerabilities
|
public ApiClient addDefaultHeader(String key, String value) {
defaultHeaderMap.put(key, value);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addDefaultHeader
File: samples/openapi3/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
|
addDefaultHeader
|
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getAttributeCount(){
return parser.getAttributeCount();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributeCount
File: main/src/com/google/refine/importers/XmlImporter.java
Repository: OpenRefine
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-20157
|
MEDIUM
| 5
|
OpenRefine
|
getAttributeCount
|
main/src/com/google/refine/importers/XmlImporter.java
|
6a0d7d56e4ffb420316ce7849fde881344fbf881
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unused")
@CalledByNative
private void onPinchEndEventAck() {
updateGestureStateListener(GestureEventType.PINCH_END);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPinchEndEventAck
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
onPinchEndEventAck
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean getAutoTimeZone() {
try {
return Settings.Global.getInt(mPhone.getContext().getContentResolver(),
Settings.Global.AUTO_TIME_ZONE) > 0;
} catch (SettingNotFoundException snfe) {
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoTimeZone
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
getAutoTimeZone
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiDocument copyDocument(DocumentReference newDocumentReference, XWikiContext context)
throws XWikiException
{
loadAttachments(context);
loadArchive(context);
XWikiDocument newdoc = cloneInternal(newDocumentReference, false, true);
// If the copied document has a title set to the original page name then set the new title to be the new page
// name.
if (StringUtils.equals(newdoc.getTitle(), getPrettyName(this.getDocumentReference()))) {
newdoc.setTitle(getPrettyName(newDocumentReference));
}
newdoc.setOriginalDocument(null);
newdoc.setContentDirty(true);
newdoc.getXClass().setOwnerDocument(newdoc);
return newdoc;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyDocument
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
|
copyDocument
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
public static <T> T unmarshal(final Class<T> clazz, final String xml) {
return unmarshal(clazz, xml, VALIDATE_IF_POSSIBLE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unmarshal
File: core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2023-0871
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
unmarshal
|
core/xml/src/main/java/org/opennms/core/xml/JaxbUtils.java
|
3c17231714e3d55809efc580a05734ed530f9ad4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setLongProperty(String name, long value) throws JMSException {
this.setObjectProperty(name, value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLongProperty
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
|
setLongProperty
|
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
|
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
| 0
|
Analyze the following code function for security vulnerabilities
|
public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(id);
mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
reply.readException();
ActivityManager.TaskThumbnail taskThumbnail = null;
if (reply.readInt() != 0) {
taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
}
data.recycle();
reply.recycle();
return taskThumbnail;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTaskThumbnail
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getTaskThumbnail
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setFocusedTask(int taskId) {
enforceTaskPermission("setFocusedTask()");
final long callingId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
setFocusedTask(taskId, null /* touchedActivity */);
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFocusedTask
File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40094
|
HIGH
| 7.8
|
android
|
setFocusedTask
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
private AttributedString highlightValue(Map<String, Object> options, String column, Object obj) {
AttributedString out = null;
Object raw = options.containsKey(Printer.TO_STRING) && obj != null ? objectToString(options, obj) : obj;
Map<String, Object> hv = options.containsKey(Printer.HIGHLIGHT_VALUE)
? (Map<String, Object>) options.get(Printer.HIGHLIGHT_VALUE)
: new HashMap<>();
if (column != null && simpleObject(raw)) {
for (Map.Entry<String, Object> entry : hv.entrySet()) {
if (!entry.getKey().equals("*") && column.matches(entry.getKey())) {
out = (AttributedString) engine.execute(hv.get(entry.getKey()), raw);
break;
}
}
if (out == null) {
for (Map.Entry<String, Function<Object, AttributedString>> entry : highlightValue.entrySet()) {
if (!entry.getKey().equals("*") && column.matches(entry.getKey())) {
out = highlightValue.get(entry.getKey()).apply(raw);
break;
}
}
}
}
if (out == null) {
if (raw instanceof String) {
out = new AttributedString(columnValue((String) raw));
} else {
out = new AttributedString(columnValue(objectToString(options, raw)));
}
}
if ((simpleObject(raw) || raw == null)
&& (hv.containsKey("*") || highlightValue.containsKey("*"))
&& !isHighlighted(out)) {
if (hv.containsKey("*")) {
out = (AttributedString) engine.execute(hv.get("*"), out);
}
Function<Object, AttributedString> func = highlightValue.get("*");
if (func != null) {
out = func.apply(out);
}
}
if (options.containsKey(Printer.VALUE_STYLE) && !isHighlighted(out)) {
out = highlight(
null,
(SyntaxHighlighter) options.get(Printer.VALUE_STYLE),
out.toString(),
doValueHighlight(options, out.toString()));
}
return truncateValue(options, out);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: highlightValue
File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java
Repository: jline/jline3
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-50572
|
MEDIUM
| 5.5
|
jline/jline3
|
highlightValue
|
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
|
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isAccessibilityServicePermittedByAdmin(@NonNull ComponentName admin,
@NonNull String packageName, int userHandle) {
if (mService != null) {
try {
return mService.isAccessibilityServicePermittedByAdmin(admin, packageName,
userHandle);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAccessibilityServicePermittedByAdmin
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
isAccessibilityServicePermittedByAdmin
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.