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
private void notifyChange(final Uri uri) { final Context context = getContext(); context.getContentResolver().notifyChange( MmsSms.CONTENT_URI, null, true, UserHandle.USER_ALL); ProviderUtil.notifyIfNotDefaultSmsApp(uri, getCallingPackage(), context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyChange File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-3914
HIGH
9.3
android
notifyChange
src/com/android/providers/telephony/MmsProvider.java
3a3a5d145d380deef2d5b7c3150864cd04be397f
0
Analyze the following code function for security vulnerabilities
public boolean removeObjects(String className) { return getDoc().removeObjects(className); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeObjects 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
removeObjects
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
public boolean insertSettingLocked(int type, int userId, String name, String value, String tag, boolean makeDefault, String packageName, boolean forceNotify, Set<String> criticalSettings, boolean overrideableByRestore) { return insertSettingLocked(type, userId, name, value, tag, makeDefault, false, packageName, forceNotify, criticalSettings, overrideableByRestore); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertSettingLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
insertSettingLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Override protected String resolveCssClass() throws JspException { return ObjectUtils.getDisplayString(evaluate("cssClass", getCssClass())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resolveCssClass 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
resolveCssClass
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
741b4b229ae032bd17175b46f98673ce0bd2d485
0
Analyze the following code function for security vulnerabilities
public String getPreviousVersion() { return this.doc.getPreviousVersion(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreviousVersion 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
getPreviousVersion
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
@SuppressWarnings("unchecked") public List<Question> getAllQuestions(Pager pager) { if (getId() == null) { return new ArrayList<Question>(); } return (List<Question>) getPostsForUser(Utils.type(Question.class), pager); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllQuestions File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
getAllQuestions
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public int getUserProvisioningState(int userHandle) { if (!mHasFeature) { return DevicePolicyManager.STATE_USER_UNMANAGED; } final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(canManageUsers(caller) || hasCallingOrSelfPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS)); if (userHandle != caller.getUserId()) { Preconditions.checkCallAuthorization(canManageUsers(caller) || hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS)); } return getUserData(userHandle).mUserProvisioningState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserProvisioningState 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
getUserProvisioningState
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean startDiscovery() { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); return startDiscoveryNative(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startDiscovery File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
startDiscovery
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
private static native long nativeOpenXmlAssetFd(long ptr, int cookie, @NonNull FileDescriptor fileDescriptor);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeOpenXmlAssetFd 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
nativeOpenXmlAssetFd
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Editable(order=200, description="Specify login information of docker registries if necessary. " + "These logins will be used to create image pull secrets of the job pods") public List<RegistryLogin> getRegistryLogins() { return registryLogins; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRegistryLogins File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-610" ]
CVE-2022-39206
CRITICAL
9.9
theonedev/onedev
getRegistryLogins
server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
0052047a5b5095ac6a6b4a73a522d0272fec3a22
0
Analyze the following code function for security vulnerabilities
private KieServerHttpRequest newRequest(String uri, String userName, String password, String token) { KieServerHttpRequest httpRequest = KieServerHttpRequest.newRequest(uri).followRedirects(true).timeout(5000); httpRequest.accept(MediaType.APPLICATION_JSON); if (token != null && !token.isEmpty()) { httpRequest.tokenAuthorization(token); } else { httpRequest.basicAuthorization(userName, password); } return httpRequest; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newRequest File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
newRequest
kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
@Override public boolean handlePinMmiForPhoneAccount(PhoneAccountHandle accountHandle, String dialString, String callingPackage) { try { Log.startSession("TSI.hPMFPA", Log.getPackageAbbreviation(callingPackage)); enforcePermissionOrPrivilegedDialer(MODIFY_PHONE_STATE, callingPackage); UserHandle callingUserHandle = Binder.getCallingUserHandle(); synchronized (mLock) { if (!isPhoneAccountHandleVisibleToCallingUser(accountHandle, callingUserHandle)) { Log.d(this, "%s is not visible for the calling user [hMMI]", accountHandle); return false; } } // Switch identity so that TelephonyManager checks Telecom's permissions // instead. long token = Binder.clearCallingIdentity(); boolean retval = false; int subId; try { synchronized (mLock) { subId = mPhoneAccountRegistrar.getSubscriptionIdForPhoneAccount( accountHandle); } retval = getTelephonyManager(subId) .handlePinMmiForSubscriber(subId, dialString); } finally { Binder.restoreCallingIdentity(token); } return retval; }finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePinMmiForPhoneAccount File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
handlePinMmiForPhoneAccount
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
private void forceStopUserLocked(int userId, String reason) { forceStopPackageLocked(null, -1, false, false, true, false, false, userId, reason); Intent intent = new Intent(Intent.ACTION_USER_STOPPED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, userId); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, MY_PID, Process.SYSTEM_UID, UserHandle.USER_ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceStopUserLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
forceStopUserLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private static Map<String,String> splitQuery(String urlencodeQueryString) { String[] parts = urlencodeQueryString.split("&"); Map<String,String> out = new HashMap<String,String>(); for (String part : parts) { int pos = part.indexOf("="); String k,v; if (pos > 0) { k = part.substring(0, pos); v = part.substring(pos+1); } else { k = part; v = ""; } try { k = java.net.URLDecoder.decode(k, "UTF-8");} catch (Exception ex){} try {v = java.net.URLDecoder.decode(v, "UTF-8");} catch (Exception ex){} out.put(k, v); } return out; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: splitQuery 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
splitQuery
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void stopLoading() { if (mWebContents != null) mWebContents.stop(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopLoading 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
stopLoading
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void updateNCharacterStream(@Positive int columnIndex, @Nullable Reader x, int length) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNCharacterStream(int, Reader, int)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNCharacterStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateNCharacterStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
public DifferenceService getDiffService() { return new CookbookDifferenceService(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDiffService File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
getDiffService
src/main/java/org/olat/modules/wiki/WikiManager.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
public void join(JoinBy from, JoinBy to, String operation, String joinType, Criterion cr, Handler<AsyncResult<ResultSet>> replyHandler){ String filter = ""; if(cr != null){ filter = cr.toString(); } join(from, to, operation, joinType, filter, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: join File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
join
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
private SpTemplate getSpTemplateFromCache(ServiceProviderTemplateCacheKey templateCacheKey) { SpTemplate spTemplate = ServiceProviderTemplateCache.getInstance().getValueFromCache(templateCacheKey); if (spTemplate != null) { if (log.isDebugEnabled()) { log.debug(String.format("Template with name: %s is taken from cache of tenant: %s ", templateCacheKey.getTemplateName(), templateCacheKey.getTenantDomain())); } return spTemplate; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpTemplateFromCache File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getSpTemplateFromCache
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
private native void cleanupNative();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupNative File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
cleanupNative
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public Intent build() { return mIntent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: build File: src/com/android/settings/password/ChooseLockPattern.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
build
src/com/android/settings/password/ChooseLockPattern.java
11815817de2f2d70fe842b108356a1bc75d44ffb
0
Analyze the following code function for security vulnerabilities
public ExecutionResults getExecutionResults() { return results ; }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2018-17228 - Severity: HIGH - CVSS Score: 7.5 Description: Adding hosts validation fixing https://github.com/narkisr/nmap4j/issues/9 Function: getExecutionResults File: src/main/java/org/nmap4j/Nmap4j.java Repository: narkisr/nmap4j Fixed Code: public ExecutionResults getExecutionResults() { return results; }
[ "CWE-78" ]
CVE-2018-17228
HIGH
7.5
narkisr/nmap4j
getExecutionResults
src/main/java/org/nmap4j/Nmap4j.java
06b58aa3345d2f977553685a026b93e61f0c491e
1
Analyze the following code function for security vulnerabilities
@Deprecated IPage<DictModel> queryTableDictWithFilter(Page<DictModel> page, @Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryTableDictWithFilter File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-45207
CRITICAL
9.8
jeecgboot/jeecg-boot
queryTableDictWithFilter
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/SysDictMapper.java
8632a835c23f558dfee3584d7658cc6a13ccec6f
0
Analyze the following code function for security vulnerabilities
private boolean isProfileOwner(int uid) { final DevicePolicyManagerInternal dpmi = LocalServices.getService(DevicePolicyManagerInternal.class); //TODO(b/169395065) Figure out if this flow makes sense in Device Owner mode. return (dpmi != null) && (dpmi.isActiveProfileOwner(uid) || dpmi.isActiveDeviceOwner(uid)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isProfileOwner 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
isProfileOwner
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public DynamicForm withError(final ValidationError error) { final Form<Dynamic> form = super.withError( new ValidationError(asDynamicKey(error.key()), error.messages(), error.arguments())); return new DynamicForm( super.rawData(), super.files(), form.errors(), form.value(), this.messagesApi, this.formatters, this.validatorFactory, this.config, lang().orElse(null)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withError File: web/play-java-forms/src/main/java/play/data/DynamicForm.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
withError
web/play-java-forms/src/main/java/play/data/DynamicForm.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
@Override public int startActivity(IBinder whoThread, String callingPackage, Intent intent, String resolvedType, Bundle options) { checkCaller(); int callingUser = UserHandle.getCallingUserId(); TaskRecord tr; IApplicationThread appThread; synchronized (ActivityManagerService.this) { tr = recentTaskForIdLocked(mTaskId); if (tr == null) { throw new IllegalArgumentException("Unable to find task ID " + mTaskId); } appThread = ApplicationThreadNative.asInterface(whoThread); if (appThread == null) { throw new IllegalArgumentException("Bad app thread " + appThread); } } return mStackSupervisor.startActivityMayWait(appThread, -1, callingPackage, intent, resolvedType, null, null, null, null, 0, 0, null, null, null, options, callingUser, null, tr); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivity File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
startActivity
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public String getRpcType() { return JsonConstants.RPC_PUBLISHED_SERVER_EVENT_HANDLER; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRpcType File: flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25500
MEDIUM
4.3
vaadin/flow
getRpcType
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
public boolean navigateUpTo(IBinder token, Intent destIntent, int resultCode, Intent resultData) { synchronized (this) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r != null) { return r.getStack().navigateUpToLocked(r, destIntent, resultCode, resultData); } return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: navigateUpTo 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
navigateUpTo
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private ModelAndView deleteGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String groupName = request.getParameter("groupName"); if (StringUtils.hasText(groupName)) { m_groupRepository.deleteGroup(groupName); } return listGroups(request, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteGroup File: opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352", "CWE-79" ]
CVE-2021-25929
LOW
3.5
OpenNMS/opennms
deleteGroup
opennms-webapp/src/main/java/org/opennms/web/controller/admin/group/GroupController.java
eb08b5ed4c5548f3e941a1f0d0363ae4439fa98c
0
Analyze the following code function for security vulnerabilities
boolean checkCallingPermission(String permission, String func) { // Quick check: if the calling permission is me, it's all okay. if (Binder.getCallingPid() == Process.myPid()) { return true; } if (mContext.checkCallingPermission(permission) == PackageManager.PERMISSION_GRANTED) { return true; } String msg = "Permission Denial: " + func + " from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + permission; Slog.w(TAG, msg); return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkCallingPermission File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
checkCallingPermission
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private boolean match(final XPathFilter xPathFilter, final SAXEventRecorder steppingFilter) throws Exception { final Configuration configuration = steppingFilter.getConfiguration(); final NodeInfo nodeInfo = steppingFilter.getEvents(); final NamespaceContext namespaceContext = steppingFilter.getNamespaceContext(); final SAXEventRecorder.CompiledXPathFilter compiledXPathFilter = new SAXEventRecorder.CompiledXPathFilter( xPathFilter, configuration, namespaceContext); final Object result = compiledXPathFilter.getXPathExpression().evaluate(nodeInfo, XPathConstants.NODESET); final List<NodeInfo> nodes = (List<NodeInfo>) result; if (nodes.size() > 0) { switch (xPathFilter.getMatchType()) { case EXISTS: return true; case CONTAINS: for (int i = 0; i < nodes.size(); i++) { final NodeInfo node = nodes.get(i); if (contains(node.getStringValue(), xPathFilter.getValue(), xPathFilter.isIgnoreCase())) { return true; } } break; case EQUALS: for (int i = 0; i < nodes.size(); i++) { final NodeInfo node = nodes.get(i); if (equals(node.getStringValue(), xPathFilter.getValue(), xPathFilter.isIgnoreCase())) { return true; } } break; case UNIQUE: return true; } } return false; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2018-1000651 - Severity: HIGH - CVSS Score: 7.5 Description: gh-813 Turn on secure processing feature for XML parsers etc Function: match File: stroom-pipeline/src/test/java/stroom/pipeline/server/filter/TestXPathFilter.java Repository: gchq/stroom Fixed Code: @SuppressWarnings("unchecked") private boolean match(final XPathFilter xPathFilter, final SAXEventRecorder steppingFilter) throws Exception { final Configuration configuration = steppingFilter.getConfiguration(); final NodeInfo nodeInfo = steppingFilter.getEvents(); final NamespaceContext namespaceContext = steppingFilter.getNamespaceContext(); final SAXEventRecorder.CompiledXPathFilter compiledXPathFilter = new SAXEventRecorder.CompiledXPathFilter( xPathFilter, configuration, namespaceContext); final Object result = compiledXPathFilter.getXPathExpression().evaluate(nodeInfo, XPathConstants.NODESET); final List<NodeInfo> nodes = (List<NodeInfo>) result; if (nodes.size() > 0) { switch (xPathFilter.getMatchType()) { case EXISTS: return true; case CONTAINS: for (final NodeInfo node : nodes) { if (contains(node.getStringValue(), xPathFilter.getValue(), xPathFilter.isIgnoreCase())) { return true; } } break; case EQUALS: for (final NodeInfo node : nodes) { if (equals(node.getStringValue(), xPathFilter.getValue(), xPathFilter.isIgnoreCase())) { return true; } } break; case UNIQUE: return true; } } return false; }
[ "CWE-611" ]
CVE-2018-1000651
HIGH
7.5
gchq/stroom
match
stroom-pipeline/src/test/java/stroom/pipeline/server/filter/TestXPathFilter.java
ba30ffd415bd7d32ee40ba4b04035267ce80b499
1
Analyze the following code function for security vulnerabilities
private void resetTuning() { // Reset nextAvgCheck = NUM_SERVES_TUNING_FS_ACCESS; totalTime = 0; numServesBlocking = 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetTuning File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java Repository: vert-x3/vertx-web The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-12542
HIGH
7.5
vert-x3/vertx-web
resetTuning
vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b
0
Analyze the following code function for security vulnerabilities
public void addErrorToDropBox(String eventType, ProcessRecord process, String processName, ActivityRecord activity, ActivityRecord parent, String subject, final String report, final File dataFile, final ApplicationErrorReport.CrashInfo crashInfo) { // NOTE -- this must never acquire the ActivityManagerService lock, // otherwise the watchdog may be prevented from resetting the system. final String dropboxTag = processClass(process) + "_" + eventType; final DropBoxManager dbox = (DropBoxManager) mContext.getSystemService(Context.DROPBOX_SERVICE); // Exit early if the dropbox isn't configured to accept this report type. if (dbox == null || !dbox.isTagEnabled(dropboxTag)) return; // Rate-limit how often we're willing to do the heavy lifting below to // collect and record logs; currently 5 logs per 10 second period. final long now = SystemClock.elapsedRealtime(); if (now - mWtfClusterStart > 10 * DateUtils.SECOND_IN_MILLIS) { mWtfClusterStart = now; mWtfClusterCount = 1; } else { if (mWtfClusterCount++ >= 5) return; } final StringBuilder sb = new StringBuilder(1024); appendDropBoxProcessHeaders(process, processName, sb); if (process != null) { sb.append("Foreground: ") .append(process.isInterestingToUserLocked() ? "Yes" : "No") .append("\n"); } if (activity != null) { sb.append("Activity: ").append(activity.shortComponentName).append("\n"); } if (parent != null && parent.app != null && parent.app.pid != process.pid) { sb.append("Parent-Process: ").append(parent.app.processName).append("\n"); } if (parent != null && parent != activity) { sb.append("Parent-Activity: ").append(parent.shortComponentName).append("\n"); } if (subject != null) { sb.append("Subject: ").append(subject).append("\n"); } sb.append("Build: ").append(Build.FINGERPRINT).append("\n"); if (Debug.isDebuggerConnected()) { sb.append("Debugger: Connected\n"); } sb.append("\n"); // Do the rest in a worker thread to avoid blocking the caller on I/O // (After this point, we shouldn't access AMS internal data structures.) Thread worker = new Thread("Error dump: " + dropboxTag) { @Override public void run() { if (report != null) { sb.append(report); } String setting = Settings.Global.ERROR_LOGCAT_PREFIX + dropboxTag; int lines = Settings.Global.getInt(mContext.getContentResolver(), setting, 0); int maxDataFileSize = DROPBOX_MAX_SIZE - sb.length() - lines * RESERVED_BYTES_PER_LOGCAT_LINE; if (dataFile != null && maxDataFileSize > 0) { try { sb.append(FileUtils.readTextFile(dataFile, maxDataFileSize, "\n\n[[TRUNCATED]]")); } catch (IOException e) { Slog.e(TAG, "Error reading " + dataFile, e); } } if (crashInfo != null && crashInfo.stackTrace != null) { sb.append(crashInfo.stackTrace); } if (lines > 0) { sb.append("\n"); // Merge several logcat streams, and take the last N lines InputStreamReader input = null; try { java.lang.Process logcat = new ProcessBuilder( "/system/bin/timeout", "-k", "15s", "10s", "/system/bin/logcat", "-v", "time", "-b", "events", "-b", "system", "-b", "main", "-b", "crash", "-t", String.valueOf(lines)) .redirectErrorStream(true).start(); try { logcat.getOutputStream().close(); } catch (IOException e) {} try { logcat.getErrorStream().close(); } catch (IOException e) {} input = new InputStreamReader(logcat.getInputStream()); int num; char[] buf = new char[8192]; while ((num = input.read(buf)) > 0) sb.append(buf, 0, num); } catch (IOException e) { Slog.e(TAG, "Error running logcat", e); } finally { if (input != null) try { input.close(); } catch (IOException e) {} } } dbox.addText(dropboxTag, sb.toString()); } }; if (process == null) { // If process is null, we are being called from some internal code // and may be about to die -- run this synchronously. worker.run(); } else { worker.start(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addErrorToDropBox File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
addErrorToDropBox
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public static boolean isNumeric (String str) { try { Double.parseDouble(str); return true; } catch(NumberFormatException e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isNumeric File: src/main/java/com/mxgraph/online/Utils.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-3398
HIGH
7.5
jgraph/drawio
isNumeric
src/main/java/com/mxgraph/online/Utils.java
064729fec4262f9373d9fdcafda0be47cd18dd50
0
Analyze the following code function for security vulnerabilities
private boolean isForegroundActivity(int uid, int pid) { try { List<RunningAppProcessInfo> procs = ActivityManagerNative.getDefault().getRunningAppProcesses(); int N = procs.size(); for (int i = 0; i < N; i++) { RunningAppProcessInfo proc = procs.get(i); if (proc.pid == pid && proc.uid == uid && proc.importance == IMPORTANCE_FOREGROUND) { return true; } } } catch (RemoteException e) { Slog.w(TAG, "am.getRunningAppProcesses() failed"); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isForegroundActivity File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
isForegroundActivity
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public void registerStrongAuthTracker(final StrongAuthTracker strongAuthTracker) { try { getLockSettings().registerStrongAuthTracker(strongAuthTracker.mStub); } catch (RemoteException e) { throw new RuntimeException("Could not register StrongAuthTracker"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerStrongAuthTracker 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
registerStrongAuthTracker
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override // Binder call public void enroll(final IBinder token, final byte[] cryptoToken, final int userId, final IFingerprintServiceReceiver receiver, final int flags, final String opPackageName) { checkPermission(MANAGE_FINGERPRINT); final int limit = mContext.getResources().getInteger( com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser); final int enrolled = FingerprintService.this.getEnrolledFingerprints(userId).size(); if (enrolled >= limit) { Slog.w(TAG, "Too many fingerprints registered"); return; } // Group ID is arbitrarily set to parent profile user ID. It just represents // the default fingerprints for the user. if (!isCurrentUserOrProfile(userId)) { return; } final boolean restricted = isRestricted(); mHandler.post(new Runnable() { @Override public void run() { startEnrollment(token, cryptoToken, userId, receiver, flags, restricted, opPackageName); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enroll File: services/core/java/com/android/server/fingerprint/FingerprintService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
enroll
services/core/java/com/android/server/fingerprint/FingerprintService.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
private IdProviders getSortedIdProviders() { IdProviders idProviders = securityService.get().getIdProviders(); return IdProviders.from( idProviders.stream(). sorted( Comparator.comparing( u -> u.getKey().toString() ) ). collect( Collectors.toList() ) ); }
Vulnerability Classification: - CWE: CWE-384 - CVE: CVE-2024-23679 - Severity: CRITICAL - CVSS Score: 9.8 Description: Invalidate old session after login #9253 Function: getSortedIdProviders File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java Repository: enonic/xp Fixed Code: private IdProviders getSortedIdProviders() { IdProviders idProviders = securityService.get().getIdProviders(); return IdProviders.from( idProviders.stream().sorted( Comparator.comparing( u -> u.getKey().toString() ) ).collect( Collectors.toList() ) ); }
[ "CWE-384" ]
CVE-2024-23679
CRITICAL
9.8
enonic/xp
getSortedIdProviders
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
0189975691e9e6407a9fee87006f730e84f734ff
1
Analyze the following code function for security vulnerabilities
public static Property<?> createProperty(PropertyJsonBean pgb) { if (pgb == null) return null; return PropertyFactory.createProperty( pgb.getName(), pgb.getType(), pgb.getValue(), pgb.getDescription(), pgb.getFixedValues()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createProperty File: ff4j-core/src/main/java/org/ff4j/property/util/PropertyFactory.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
createProperty
ff4j-core/src/main/java/org/ff4j/property/util/PropertyFactory.java
481ca723a57f87eca931196ec9a772967ab70b3b
0
Analyze the following code function for security vulnerabilities
public String getDatabase(ClickHouseConfig config) { return !ClickHouseChecker.nonNull(config, ClickHouseConfig.TYPE_NAME).hasOption(ClickHouseClientOption.DATABASE) && hasPreferredDatabase() ? this.config.getDatabase() : config.getDatabase(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDatabase File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
getDatabase
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
private native void nativeSetAllowJavascriptInterfacesInspection( long nativeContentViewCoreImpl, boolean allow);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeSetAllowJavascriptInterfacesInspection 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
nativeSetAllowJavascriptInterfacesInspection
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void requestSync(AuthorityInfo authorityInfo, int reason, Bundle extras) { if (android.os.Process.myUid() == android.os.Process.SYSTEM_UID && mSyncRequestListener != null) { mSyncRequestListener.onSyncRequest(authorityInfo.target, reason, extras); } else { SyncRequest.Builder req = new SyncRequest.Builder() .syncOnce() .setExtras(extras); if (authorityInfo.target.target_provider) { req.setSyncAdapter(authorityInfo.target.account, authorityInfo.target.provider); } else { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Unknown target, skipping sync request."); } return; } ContentResolver.requestSync(req.build()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestSync 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
requestSync
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
@GetMapping("/state") @ResponseBody @ApiOperation("申请一个state") public ResponseMessage<String> requestState(HttpSession session) { String state = IDGenerator.RANDOM.generate(); session.setAttribute(STATE_SESSION_KEY, state); return ResponseMessage.ok(state); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestState File: hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2ClientController.java Repository: hs-web/hsweb-framework The code follows secure coding practices.
[ "CWE-352" ]
CVE-2018-20595
MEDIUM
6.8
hs-web/hsweb-framework
requestState
hsweb-system/hsweb-system-oauth2-client/hsweb-system-oauth2-client-web/src/main/java/org/hswebframework/web/authorization/oauth2/controller/OAuth2ClientController.java
40929e9b0d336a26281a5ed2e0e721d54dd8d2f2
0
Analyze the following code function for security vulnerabilities
private Optional<String> prefixPath(@Nullable String tail) { return path.size() == 0 ? tail == null ? Optional.empty() : Optional.of(Route.normalize(tail)) : Optional.of(path.stream() .collect(Collectors.joining("", "", tail == null ? "" : Route.normalize(tail)))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prefixPath File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
prefixPath
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@XmlElement public String getSubject() { return subject; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSubject File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java Repository: Silverpeas/Silverpeas-Core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-47324
MEDIUM
5.4
Silverpeas/Silverpeas-Core
getSubject
core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
9a55728729a3b431847045c674b3e883507d1e1a
0
Analyze the following code function for security vulnerabilities
public boolean getBoolean(int index) throws JSONException { Object o = get(index); if (o.equals(Boolean.FALSE) || (o instanceof String && ((String)o).equalsIgnoreCase("false"))) { return false; } else if (o.equals(Boolean.TRUE) || (o instanceof String && ((String)o).equalsIgnoreCase("true"))) { return true; } throw new JSONException("JSONArray[" + index + "] is not a Boolean."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBoolean File: src/main/java/org/codehaus/jettison/json/JSONArray.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
getBoolean
src/main/java/org/codehaus/jettison/json/JSONArray.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
public String getPayloadRequestType() { return requestType; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPayloadRequestType File: javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java Repository: javamelody The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-15531
HIGH
7.5
javamelody
getPayloadRequestType
javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java
ef111822562d0b9365bd3e671a75b65bd0613353
0
Analyze the following code function for security vulnerabilities
public void setPresentationDir(String presDir) { presentationDir = presDir; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPresentationDir File: bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-918" ]
CVE-2023-43798
MEDIUM
5.4
bigbluebutton
setPresentationDir
bbb-common-web/src/main/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
02ba4c6ff8e78a0f4384ad1b7c7367c5a90376e8
0
Analyze the following code function for security vulnerabilities
private static void parseGameLoader(final Node loader) { if (loader != null) { log.fine("Loader tag is being ignored"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseGameLoader 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
parseGameLoader
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public void addPropertyCreator(AnnotatedWithParams creator, boolean explicit, SettableBeanProperty[] properties) { if (verifyNonDup(creator, C_PROPS, explicit)) { // Better ensure we have no duplicate names either... if (properties.length > 1) { HashMap<String, Integer> names = new HashMap<String, Integer>(); for (int i = 0, len = properties.length; i < len; ++i) { String name = properties[i].getName(); // Need to consider Injectables, which may not have // a name at all, and need to be skipped if (name.isEmpty() && (properties[i].getInjectableValueId() != null)) { continue; } Integer old = names.put(name, Integer.valueOf(i)); if (old != null) { throw new IllegalArgumentException(String.format( "Duplicate creator property \"%s\" (index %s vs %d) for type %s ", name, old, i, ClassUtil.nameOf(_beanDesc.getBeanClass()))); } } } _propertyBasedArgs = properties; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPropertyCreator File: src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
addPropertyCreator
src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
@Override protected void doStart() throws Exception { ScheduledThreadPoolExecutor scheduler = new ScheduledThreadPoolExecutor(1); scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); scheduler.setRemoveOnCancelPolicy(true); _scheduler = scheduler; if (_transportFactories.isEmpty()) { _transportFactories.add(new WebSocketTransport.Factory()); _transportFactories.add(new JettyHttpClientTransport.Factory(new HttpClient())); } for (ClientTransport.Factory factory : _transportFactories) { addBean(factory); } if (isAckExtensionEnabled()) { boolean present = false; for (Extension extension : _bayeux.getExtensions()) { if (extension instanceof AcknowledgedMessagesExtension) { present = true; break; } } if (!present) { _bayeux.addExtension(_ackExtension = new AcknowledgedMessagesExtension()); } } if (isBinaryExtensionEnabled()) { _oortSession.addExtension(_binaryExtension = new org.cometd.client.ext.BinaryExtension()); boolean present = false; for (Extension extension : _bayeux.getExtensions()) { if (extension instanceof BinaryExtension) { present = true; break; } } if (!present) { _bayeux.addExtension(_serverBinaryExtension = new BinaryExtension()); } } ServerChannel oortCloudChannel = _bayeux.createChannelIfAbsent(OORT_CLOUD_CHANNEL).getReference(); oortCloudChannel.addAuthorizer(GrantAuthorizer.GRANT_ALL); oortCloudChannel.addListener(_cloudListener); _oortSession.handshake(); super.doStart(); }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2022-24721 - Severity: MEDIUM - CVSS Score: 5.5 Description: Fixes #1146 - Review Oort/Seti channel usage Signed-off-by: Simone Bordet <simone.bordet@gmail.com> Function: doStart File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java Repository: cometd Fixed Code: @Override protected void doStart() throws Exception { ScheduledThreadPoolExecutor scheduler = new ScheduledThreadPoolExecutor(1); scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); scheduler.setRemoveOnCancelPolicy(true); _scheduler = scheduler; if (_transportFactories.isEmpty()) { _transportFactories.add(new WebSocketTransport.Factory()); _transportFactories.add(new JettyHttpClientTransport.Factory(new HttpClient())); } for (ClientTransport.Factory factory : _transportFactories) { addBean(factory); } if (isAckExtensionEnabled()) { boolean present = false; for (Extension extension : _bayeux.getExtensions()) { if (extension instanceof AcknowledgedMessagesExtension) { present = true; break; } } if (!present) { _bayeux.addExtension(_ackExtension = new AcknowledgedMessagesExtension()); } } if (isBinaryExtensionEnabled()) { _oortSession.addExtension(_binaryExtension = new org.cometd.client.ext.BinaryExtension()); boolean present = false; for (Extension extension : _bayeux.getExtensions()) { if (extension instanceof BinaryExtension) { present = true; break; } } if (!present) { _bayeux.addExtension(_serverBinaryExtension = new BinaryExtension()); } } _bayeux.addListener(_allChannelsFilter); ServerChannel oortCloudChannel = _bayeux.createChannelIfAbsent(OORT_CLOUD_CHANNEL).getReference(); oortCloudChannel.addListener(_cloudListener); _oortSession.handshake(); protectOortChannels(_bayeux); super.doStart(); }
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
doStart
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
bb445a143fbf320f17c62e340455cd74acfb5929
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") public Credential loadCredential(String userId) throws IOException { // No requests need to be performed when userId is not specified. if (isNullOrEmpty(userId)) { return null; } if (credentialDataStore == null && credentialStore == null) { return null; } Credential credential = newCredential(userId); if (credentialDataStore != null) { StoredCredential stored = credentialDataStore.get(userId); if (stored == null) { return null; } credential.setAccessToken(stored.getAccessToken()); credential.setRefreshToken(stored.getRefreshToken()); credential.setExpirationTimeMilliseconds(stored.getExpirationTimeMilliseconds()); } else if (!credentialStore.load(userId, credential)) { return null; } return credential; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadCredential File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
loadCredential
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
public ApiClient setHttpClient(Client httpClient) { this.httpClient = httpClient; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setHttpClient File: samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
setHttpClient
samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public String getPrimaryGroup() { return primaryGroup; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrimaryGroup File: src/com/dotmarketing/cache/ContentTypeCacheImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
getPrimaryGroup
src/com/dotmarketing/cache/ContentTypeCacheImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
public void setValidNotBeforeFrom(String validNotBeforeFrom) { this.validNotBeforeFrom = validNotBeforeFrom; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidNotBeforeFrom 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
setValidNotBeforeFrom
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
SecretKey getPSKKey(PSKKeyManager keyManager, String identityHint, String identity);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPSKKey File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
getPSKKey
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
@Override public void setRatingType(int type) throws RemoteException { mRatingType = type; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRatingType 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
setRatingType
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
public static void removeWindowsShortcuts(String jnlpApp) throws IOException { LOG.debug("Clearing Windows shortcuts"); if (CacheLRUWrapper.getInstance().getWindowsShortcutList().exists()) { List<String> lines = Files.readAllLines(CacheLRUWrapper.getInstance().getWindowsShortcutList().toPath(), UTF_8); Iterator it = lines.iterator(); Boolean fDelete; while (it.hasNext()) { String sItem = it.next().toString(); String[] sArray = sItem.split(","); String application = sArray[0]; String sPath = sArray[1]; // if application is codebase then delete files if (application.equalsIgnoreCase(jnlpApp)) { fDelete = true; it.remove(); } else { fDelete = false; } if (jnlpApp.equals("ALL")) { fDelete = true; } if (fDelete) { LOG.info("Deleting item = {}", sPath); File scList = new File(sPath); try { FileUtils.recursiveDelete(scList, scList); } catch (Exception e) { LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e); } } } if (jnlpApp.equals("ALL")) { //delete shortcut list file Files.deleteIfExists(CacheLRUWrapper.getInstance().getWindowsShortcutList().toPath()); } else { //write file after application shortcuts have been removed Files.write(CacheLRUWrapper.getInstance().getWindowsShortcutList().toPath(), lines, UTF_8); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeWindowsShortcuts File: core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
removeWindowsShortcuts
core/src/main/java/net/sourceforge/jnlp/cache/CacheUtil.java
2ab070cdac087bd208f64fa8138bb709f8d7680c
0
Analyze the following code function for security vulnerabilities
@Override public String getModalTitle() { return translate("send.mail.title"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getModalTitle File: src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
getModalTitle
src/main/java/org/olat/core/util/mail/ui/SendDocumentsByEMailController.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
0
Analyze the following code function for security vulnerabilities
public XMLFilter getXMLFilter() { return saxXMLFilter; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getXMLFilter File: core/src/java/org/jdom2/input/SAXBuilder.java Repository: hunterhacker/jdom The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-33813
MEDIUM
5
hunterhacker/jdom
getXMLFilter
core/src/java/org/jdom2/input/SAXBuilder.java
bd3ab78370098491911d7fe9d7a43b97144a234e
0
Analyze the following code function for security vulnerabilities
public OnmsUserList getOnmsUserList() throws IOException { update(); final OnmsUserList list = new OnmsUserList(); m_readLock.lock(); try { for (final String username : _getUserNames()) { list.add(_getOnmsUser(username)); } list.setTotalCount(list.getCount()); return list; } finally { m_readLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOnmsUserList File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
getOnmsUserList
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
@Override public void createRepository(String projectName, String repositoryName, AsyncMethodCallback resultHandler) { // HTTP v1 API will return '403 forbidden' in this case, but we deal it as '400 bad request' here. if (isReservedRepoName(repositoryName)) { resultHandler.onError(convert(RESERVED_REPOSITORY_EXCEPTION)); return; } handleAsVoidResult(executor.execute(Command.createRepository(SYSTEM, projectName, repositoryName)) .thenCompose(unused -> mds.addRepo(SYSTEM, projectName, repositoryName)), resultHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRepository 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
createRepository
server/src/main/java/com/linecorp/centraldogma/server/internal/thrift/CentralDogmaServiceImpl.java
e83b558ef9eaa44f71b7d9236bdec9f68c85b8bd
0
Analyze the following code function for security vulnerabilities
@Override public String getParameter(String parameter) { String value = super.getParameter(parameter); if (value == null) { return null; } return cleanXSS(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParameter File: sm-shop/src/main/java/com/salesmanager/shop/filter/XssHttpServletRequestWrapper.java Repository: shopizer-ecommerce/shopizer The code follows secure coding practices.
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
getParameter
sm-shop/src/main/java/com/salesmanager/shop/filter/XssHttpServletRequestWrapper.java
197f8c78c8f673b957e41ca2c823afc654c19271
0
Analyze the following code function for security vulnerabilities
public static void validate(InputStream doc, InputStream sch) throws ParsingException { try { XMLEventReader xmlEventReader = StaxParserUtil.getXMLEventReader(doc); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new StreamSource(sch)); Validator validator = schema.newValidator(); validator.validate(new StAXSource(xmlEventReader)); } catch (Exception e) { throw logger.parserException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
validate
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
private void writeByteDirect(byte b) throws TException { buffer[0] = b; trans_.write(buffer, 0, 1); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeByteDirect File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
writeByteDirect
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public SerializationConfig setDataSerializableFactories(Map<Integer, DataSerializableFactory> dataSerializableFactories) { this.dataSerializableFactories = dataSerializableFactories; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDataSerializableFactories File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
setDataSerializableFactories
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public void print(TaskListener listener) { listener.getLogger().println(Messages.Cause_UserIdCause_ShortDescription( ModelHyperlinkNote.encodeTo("/user/"+getUserId(), getUserName()))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: print File: core/src/main/java/hudson/model/Cause.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2067
LOW
3.5
jenkinsci/jenkins
print
core/src/main/java/hudson/model/Cause.java
5d57c855f3147bfc5e7fda9252317b428a700014
0
Analyze the following code function for security vulnerabilities
@Nullable UByte getEventNotifier() throws UaException { Object value = getValue(eventNotifierValue); if (value instanceof UByte) { return (UByte) value; } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEventNotifier File: opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java Repository: eclipse/milo The code follows secure coding practices.
[ "CWE-770" ]
CVE-2022-25897
HIGH
7.5
eclipse/milo
getEventNotifier
opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/subscriptions/SubscriptionManager.java
4534381760d7d9f0bf00cbf6a8449bb0d13c6ce5
0
Analyze the following code function for security vulnerabilities
@Override public void updated(Dictionary<String, ?> properties) throws ConfigurationException { if (properties == null) { logger.info("No configuration available, using defaults"); return; } downloadPassword = StringUtils.trimToEmpty((String)properties.get(DOWNLOAD_PASSWORD)); downloadUser = StringUtils.trimToEmpty(((String) properties.get(DOWNLOAD_USER))); downloadSource = StringUtils.trimToEmpty(((String) properties.get(DOWNLOAD_SOURCE))); skipAttachments = BooleanUtils.toBoolean(Objects.toString(properties.get(SKIP_ATTACHMENTS_KEY), BooleanUtils.toStringTrueFalse(DEFAULT_SKIP))); skipCatalogs = BooleanUtils.toBoolean(Objects.toString(properties.get(SKIP_CATALOGS_KEY), BooleanUtils.toStringTrueFalse(DEFAULT_SKIP))); logger.debug("Skip attachments sent by agents for scheduled events: {}", skipAttachments); logger.debug("Skip metadata catalogs sent by agents for scheduled events: {}", skipCatalogs); ingestFileJobLoad = LoadUtil.getConfiguredLoadValue(properties, FILE_JOB_LOAD_KEY, DEFAULT_INGEST_FILE_JOB_LOAD, serviceRegistry); ingestZipJobLoad = LoadUtil.getConfiguredLoadValue(properties, ZIP_JOB_LOAD_KEY, DEFAULT_INGEST_ZIP_JOB_LOAD, serviceRegistry); isAllowModifySeries = BooleanUtils.toBoolean(Objects.toString(properties.get(MODIFY_OPENCAST_SERIES_KEY), BooleanUtils.toStringTrueFalse(DEFAULT_ALLOW_SERIES_MODIFICATIONS))); isAddOnlyNew = BooleanUtils.toBoolean(Objects.toString(properties.get(ADD_ONLY_NEW_FLAVORS_KEY), BooleanUtils.toStringTrueFalse(DEFAULT_ALLOW_ONLY_NEW_FLAVORS))); logger.info("Only allow new flavored catalogs and attachments on ingest:'{}'", isAddOnlyNew); logger.info("Allowing series modification:'{}'", isAllowModifySeries); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updated File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
updated
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
private static RuntimeException wrapExceptionAsRuntimeException(Exception e) { // Don't wrap (or re-wrap) runtime exceptions. if (e instanceof RuntimeException) { return (RuntimeException) e; } else { return new XMLBuilderRuntimeException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: wrapExceptionAsRuntimeException File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
wrapExceptionAsRuntimeException
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
private JsonArray readArray(int depth) throws IOException { read(); JsonArray array=new JsonArray(); skipWhiteSpace(); if (readIf(']')) { return array; } while (true) { skipWhiteSpace(); array.add(readValue(depth)); skipWhiteSpace(); if (readIf(',')) skipWhiteSpace(); // , is optional if (readIf(']')) break; else if (isEndOfText()) throw error("End of input while parsing an array (did you forget a closing ']'?)"); } return array; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readArray File: src/main/org/hjson/HjsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readArray
src/main/org/hjson/HjsonParser.java
00e3b1325cb6c2b80b347dbec9181fd17ce0a599
0
Analyze the following code function for security vulnerabilities
public FormValidation doViewExistsCheck(@QueryParameter String value) { checkPermission(View.CREATE); String view = fixEmpty(value); if(view==null) return FormValidation.ok(); if(getView(view)==null) return FormValidation.ok(); else return FormValidation.error(Messages.Hudson_ViewAlreadyExists(view)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doViewExistsCheck File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
doViewExistsCheck
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
private static List<Node> migrateParamSupplies(List<Element> paramSupplyElements) { List<Node> paramSupplyNodes = new ArrayList<>(); for (Element paramSupplyElement: paramSupplyElements) { List<NodeTuple> tuples = new ArrayList<>(); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "name"), new ScalarNode(Tag.STR, paramSupplyElement.elementText("name").trim()))); tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "secret"), new ScalarNode(Tag.STR, paramSupplyElement.elementText("secret").trim()))); Element valuesProviderElement = paramSupplyElement.element("valuesProvider"); String classTag = getClassTag(valuesProviderElement.attributeValue("class")); List<NodeTuple> valuesProviderTuples = new ArrayList<>(); Element scriptNameElement = valuesProviderElement.element("scriptName"); if (scriptNameElement != null) { valuesProviderTuples.add(new NodeTuple( new ScalarNode(Tag.STR, "scriptName"), new ScalarNode(Tag.STR, scriptNameElement.getText().trim()))); } Element valuesElement = valuesProviderElement.element("values"); if (valuesElement != null) { List<Node> listNodes = new ArrayList<>(); for (Element listElement: valuesElement.elements()) { List<Node> listItemNodes = new ArrayList<>(); for (Element listItemElement: listElement.elements()) listItemNodes.add(new ScalarNode(Tag.STR, listItemElement.getText().trim())); listNodes.add(new SequenceNode(Tag.SEQ, listItemNodes, FlowStyle.BLOCK)); } valuesProviderTuples.add(new NodeTuple( new ScalarNode(Tag.STR, "values"), new SequenceNode(Tag.SEQ, listNodes, FlowStyle.BLOCK))); } tuples.add(new NodeTuple( new ScalarNode(Tag.STR, "valuesProvider"), new MappingNode(new Tag(classTag), valuesProviderTuples, FlowStyle.BLOCK))); paramSupplyNodes.add(new MappingNode(Tag.MAP, tuples, FlowStyle.BLOCK)); } return paramSupplyNodes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrateParamSupplies File: server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-538" ]
CVE-2021-21250
MEDIUM
4
theonedev/onedev
migrateParamSupplies
server-core/src/main/java/io/onedev/server/migration/XmlBuildSpecMigrator.java
9196fd795e87dab069b4260a3590a0ea886e770f
0
Analyze the following code function for security vulnerabilities
private boolean isCompatible(WanConsumerConfig c1, WanConsumerConfig c2) { return c1 == c2 || !(c1 == null || c2 == null) && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getImplementation(), c2.getImplementation()) && nullSafeEqual(c1.getProperties(), c2.getProperties()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private boolean hasMamSupport(final Conversation c) { if (c.getMode() == Conversation.MODE_SINGLE) { final XmppConnection connection = c.getAccount().getXmppConnection(); return connection != null && connection.getFeatures().mam(); } else { return c.getMucOptions().mamSupport(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasMamSupport File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
hasMamSupport
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
void clearOptionsAnimation() { mPendingOptions = null; mPendingRemoteAnimation = null; mPendingRemoteTransition = null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearOptionsAnimation File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
clearOptionsAnimation
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public List<Voter> getAllVoterInfo() { List<Voter> voterList = new ArrayList<>(); String sql = "select * from voter_table"; try { ps = DbUtil.getConnection().prepareStatement(sql); ResultSet rs = ps.executeQuery(); while (rs.next()) { Voter voter = new Voter(); voter.setId(rs.getInt("id")); voter.setVoterName(rs.getString("voter_name")); voter.setPassword(rs.getString("password")); voter.setStateNo(rs.getInt("state_no")); voter.setDistrictName(rs.getString("district")); voter.setGender(rs.getString("gender")); voter.setImgUrl(rs.getString("imageurl")); voter.setEmail(rs.getString("email")); voter.setDob(rs.getDate("dob")); voterList.add(voter); } } catch (ClassNotFoundException | SQLException e) { e.printStackTrace(); } return voterList; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllVoterInfo File: src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java Repository: bijaythapaa/OnlineVotingSystem The code follows secure coding practices.
[ "CWE-916" ]
CVE-2021-21253
MEDIUM
5
bijaythapaa/OnlineVotingSystem
getAllVoterInfo
src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
0181cb0272857696c8eb3e44fcf6cb014ff90f09
0
Analyze the following code function for security vulnerabilities
@Deprecated public boolean getHintAmbientBigPicture() { return (mFlags & FLAG_BIG_PICTURE_AMBIENT) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHintAmbientBigPicture File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
getHintAmbientBigPicture
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); return file; } catch (IOException e) { throw new ApiException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: downloadFileFromResponse File: samples/openapi3/client/extensions/x-auth-id-alias/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
downloadFileFromResponse
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void sendErrorMessage(Errors errors, PageModel model, MessageSourceService mss, HttpServletRequest request) { model.addAttribute("errors", errors); StringBuffer errorMessage = new StringBuffer(mss.getMessage("error.failed.validation")); errorMessage.append("<ul>"); for (ObjectError error : errors.getAllErrors()) { errorMessage.append("<li>"); errorMessage.append(mss.getMessage(error.getCode(), error.getArguments(), error.getDefaultMessage(), null)); errorMessage.append("</li>"); } errorMessage.append("</ul>"); request.getSession().setAttribute(UiCommonsConstants.SESSION_ATTRIBUTE_ERROR_MESSAGE, errorMessage.toString()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendErrorMessage File: omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java Repository: openmrs/openmrs-module-adminui The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-36636
MEDIUM
6.1
openmrs/openmrs-module-adminui
sendErrorMessage
omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java
702fbfdac7c4418f23bb5f6452482b4a88020061
0
Analyze the following code function for security vulnerabilities
@Override public Route.Definition head(final String path, final Route.Handler handler) { return appendDefinition(HEAD, path, handler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: head File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
head
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
@Deprecated public int getIntValue(String className, String fieldName) { return getIntValue(resolveClassReference(className), fieldName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIntValue File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getIntValue
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private boolean isInstantApp(ProcessRecord record, @Nullable String callerPackage, int uid) { if (UserHandle.getAppId(uid) < FIRST_APPLICATION_UID) { return false; } // Easy case -- we have the app's ProcessRecord. if (record != null) { return record.info.isInstantApp(); } // Otherwise check with PackageManager. IPackageManager pm = AppGlobals.getPackageManager(); try { if (callerPackage == null) { final String[] packageNames = pm.getPackagesForUid(uid); if (packageNames == null || packageNames.length == 0) { throw new IllegalArgumentException("Unable to determine caller package name"); } // Instant Apps can't use shared uids, so its safe to only check the first package. callerPackage = packageNames[0]; } mAppOpsService.checkPackage(uid, callerPackage); return pm.isInstantApp(callerPackage, UserHandle.getUserId(uid)); } catch (RemoteException e) { Slog.e(TAG, "Error looking up if " + callerPackage + " is an instant app.", e); return true; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isInstantApp 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
isInstantApp
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void onLocationInWindowChanged(int x, int y) { mLocationInWindowX = x; mLocationInWindowY = y; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLocationInWindowChanged 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
onLocationInWindowChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String filename = file.getFileName().toString(); if(filename.endsWith(WikiManager.WIKI_PROPERTIES_SUFFIX)) { String f = convertAlternativeFilename(file.toString()); final Path destFile = Paths.get(wikiDir.toString(), f); resetAndCopyProperties(file, destFile); } else if (filename.endsWith(WIKI_FILE_SUFFIX)) { String f = convertAlternativeFilename(file.toString()); final Path destFile = Paths.get(wikiDir.toString(), f); Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING); } else if (!filename.contains(WIKI_FILE_SUFFIX + "-") && !filename.contains(WIKI_PROPERTIES_SUFFIX + "-")) { final Path destFile = Paths.get(mediaDir.toString(), file.toString()); Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING); } return FileVisitResult.CONTINUE; }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-39180 - Severity: HIGH - CVSS Score: 9.0 Description: OO-5549: check parent by unzip Function: visitFile File: src/main/java/org/olat/modules/wiki/WikiManager.java Repository: OpenOLAT Fixed Code: @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String filename = file.getFileName().toString(); Path normalizedPath = file.normalize(); if(!normalizedPath.startsWith(destDir)) { throw new IOException("Invalid ZIP"); } if(filename.endsWith(WikiManager.WIKI_PROPERTIES_SUFFIX)) { String f = convertAlternativeFilename(file.toString()); final Path destFile = Paths.get(wikiDir.toString(), f); resetAndCopyProperties(file, destFile); } else if (filename.endsWith(WIKI_FILE_SUFFIX)) { String f = convertAlternativeFilename(file.toString()); final Path destFile = Paths.get(wikiDir.toString(), f); Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING); } else if (!filename.contains(WIKI_FILE_SUFFIX + "-") && !filename.contains(WIKI_PROPERTIES_SUFFIX + "-")) { final Path destFile = Paths.get(mediaDir.toString(), file.toString()); Files.copy(file, destFile, StandardCopyOption.REPLACE_EXISTING); } return FileVisitResult.CONTINUE; }
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
visitFile
src/main/java/org/olat/modules/wiki/WikiManager.java
5668a41ab3f1753102a89757be013487544279d5
1
Analyze the following code function for security vulnerabilities
@GET @Path("file") @Produces("text/plain") public File getFile() { return file; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFile File: testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java Repository: resteasy The code follows secure coding practices.
[ "CWE-378" ]
CVE-2023-0482
MEDIUM
5.5
resteasy
getFile
testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java
807d7456f2137cde8ef7c316707211bf4e542d56
0
Analyze the following code function for security vulnerabilities
public void onLocationResult(LocationResult var1) { AndroidLocationPlayServiceManager.this.onLocationChanged(var1.getLastLocation()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onLocationResult File: Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onLocationResult
Ports/Android/src/com/codename1/location/AndroidLocationPlayServiceManager.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public int getSpdyMaxConcurrentStreams() { return spdyMaxConcurrentStreams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSpdyMaxConcurrentStreams File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
getSpdyMaxConcurrentStreams
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
protected void handleSendComplete(AsyncResult ar) { SmsTracker tracker = (SmsTracker) ar.userObj; PendingIntent sentIntent = tracker.mSentIntent; if (ar.result != null) { tracker.mMessageRef = ((SmsResponse)ar.result).mMessageRef; } else { Rlog.d(TAG, "SmsResponse was null"); } if (ar.exception == null) { if (DBG) Rlog.d(TAG, "SMS send complete. Broadcasting intent: " + sentIntent); if (tracker.mDeliveryIntent != null) { // Expecting a status report. Add it to the list. deliveryPendingList.add(tracker); } tracker.onSent(mContext); } else { if (DBG) Rlog.d(TAG, "SMS send failed"); int ss = mPhone.getServiceState().getState(); if ( tracker.mImsRetry > 0 && ss != ServiceState.STATE_IN_SERVICE) { // This is retry after failure over IMS but voice is not available. // Set retry to max allowed, so no retry is sent and // cause RESULT_ERROR_GENERIC_FAILURE to be returned to app. tracker.mRetryCount = MAX_SEND_RETRIES; Rlog.d(TAG, "handleSendComplete: Skipping retry: " +" isIms()="+isIms() +" mRetryCount="+tracker.mRetryCount +" mImsRetry="+tracker.mImsRetry +" mMessageRef="+tracker.mMessageRef +" SS= "+mPhone.getServiceState().getState()); } // if sms over IMS is not supported on data and voice is not available... if (!isIms() && ss != ServiceState.STATE_IN_SERVICE) { tracker.onFailed(mContext, getNotInServiceError(ss), 0/*errorCode*/); } else if ((((CommandException)(ar.exception)).getCommandError() == CommandException.Error.SMS_FAIL_RETRY) && tracker.mRetryCount < MAX_SEND_RETRIES) { // Retry after a delay if needed. // TODO: According to TS 23.040, 9.2.3.6, we should resend // with the same TP-MR as the failed message, and // TP-RD set to 1. However, we don't have a means of // knowing the MR for the failed message (EF_SMSstatus // may or may not have the MR corresponding to this // message, depending on the failure). Also, in some // implementations this retry is handled by the baseband. tracker.mRetryCount++; Message retryMsg = obtainMessage(EVENT_SEND_RETRY, tracker); sendMessageDelayed(retryMsg, SEND_RETRY_DELAY); } else { int errorCode = 0; if (ar.result != null) { errorCode = ((SmsResponse)ar.result).mErrorCode; } int error = RESULT_ERROR_GENERIC_FAILURE; if (((CommandException)(ar.exception)).getCommandError() == CommandException.Error.FDN_CHECK_FAILURE) { error = RESULT_ERROR_FDN_CHECK_FAILURE; } tracker.onFailed(mContext, error, errorCode); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSendComplete File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
handleSendComplete
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; // Rebuild HTTP Client according to the new "debugging" value. this.httpClient = buildHttpClient(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDebugging 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
setDebugging
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
public static boolean prepareHelpMenuItem(Activity activity, Menu menu, String helpUri, String backupContext) { MenuItem helpItem = menu.add(0, MENU_HELP, 0, R.string.help_feedback_label); return prepareHelpMenuItem(activity, helpItem, helpUri, backupContext); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: prepareHelpMenuItem File: packages/SettingsLib/src/com/android/settingslib/HelpUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
prepareHelpMenuItem
packages/SettingsLib/src/com/android/settingslib/HelpUtils.java
e206f02d46ae5e38c74d138b51f6e1637e261abe
0
Analyze the following code function for security vulnerabilities
protected String serialize(Object object) { if (object == null) { return ""; } try { return MarshallerFactory.getMarshaller(MarshallingFormat.JSON, this.getClass().getClassLoader()).marshall(object); } catch ( MarshallingException e ) { throw new IllegalStateException( "Error while serializing request data!", e ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: serialize File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java Repository: kiegroup/droolsjbpm-integration The code follows secure coding practices.
[ "CWE-260" ]
CVE-2016-7043
MEDIUM
5
kiegroup/droolsjbpm-integration
serialize
kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
e916032edd47aa46d15f3a11909b4804ee20a7e8
0
Analyze the following code function for security vulnerabilities
public boolean test(PackageInfo pi) { return !isInstalled(pi); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: test File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
test
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void mergeConference(String conferenceCallId, Session.Info info) throws RemoteException { }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mergeConference File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
mergeConference
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context) throws XWikiException { return searchDocumentReferences(wheresql, 0, 0, "", context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocumentReferences File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
searchDocumentReferences
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
boolean isEnum() { resolveProperties(); return isEnum; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEnum File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
isEnum
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
public void removeStatusChangeListener(ISyncStatusObserver callback) { synchronized (mAuthorities) { mChangeListeners.unregister(callback); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeStatusChangeListener 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
removeStatusChangeListener
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
protected List<AnnotationValue<CacheInvalidate>> invalidateOperations(MethodInvocationContext context) { return context.getAnnotationValuesByType(CacheInvalidate.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: invalidateOperations File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
invalidateOperations
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public DeletedAttachment getDeletedAttachment(String id) { try { com.xpn.xwiki.doc.DeletedAttachment attachment = this.xwiki.getDeletedAttachment(id, this.context); if (attachment != null) { return new DeletedAttachment(attachment, this.context); } } catch (Exception ex) { LOGGER.warn("Failed to retrieve deleted attachment", ex); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeletedAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-668" ]
CVE-2023-37911
MEDIUM
6.5
xwiki/xwiki-platform
getDeletedAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("resource") static final Writer writeValue(Writer writer, Object value, int indentFactor, int indent) throws JSONException, IOException { if (value == null || value.equals(null)) { writer.write("null"); } else if (value instanceof JSONString) { Object o; try { o = ((JSONString) value).toJSONString(); } catch (Exception e) { throw new JSONException(e); } writer.write(o != null ? o.toString() : quote(value.toString())); } else if (value instanceof Number) { // not all Numbers may match actual JSON Numbers. i.e. fractions or Imaginary final String numberAsString = numberToString((Number) value); if(NUMBER_PATTERN.matcher(numberAsString).matches()) { writer.write(numberAsString); } else { // The Number value is not a valid JSON number. // Instead we will quote it as a string quote(numberAsString, writer); } } else if (value instanceof Boolean) { writer.write(value.toString()); } else if (value instanceof Enum<?>) { writer.write(quote(((Enum<?>)value).name())); } else if (value instanceof JSONObject) { ((JSONObject) value).write(writer, indentFactor, indent); } else if (value instanceof JSONArray) { ((JSONArray) value).write(writer, indentFactor, indent); } else if (value instanceof Map) { Map<?, ?> map = (Map<?, ?>) value; new JSONObject(map).write(writer, indentFactor, indent); } else if (value instanceof Collection) { Collection<?> coll = (Collection<?>) value; new JSONArray(coll).write(writer, indentFactor, indent); } else if (value.getClass().isArray()) { new JSONArray(value).write(writer, indentFactor, indent); } else { quote(value.toString(), writer); } return writer; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeValue File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
writeValue
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0