instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public void setResource(String resource) { this.resource = resource; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setResource File: services/src/main/java/org/keycloak/services/managers/ClientManager.java Repository: keycloak The code follows secure coding practices.
[ "CWE-798" ]
CVE-2019-14837
MEDIUM
6.4
keycloak
setResource
services/src/main/java/org/keycloak/services/managers/ClientManager.java
9a7c1a91a59ab85e7f8889a505be04a71580777f
0
Analyze the following code function for security vulnerabilities
@Override void startSelected(int which, boolean always, boolean filtered) { super.startSelected(which, always, filtered); if (mChooserListAdapter != null) { // Log the index of which type of target the user picked. // Lower values mean the ranking was better. int cat = 0; int value = which; switch (mChooserListAdapter.getPositionTargetType(which)) { case ChooserListAdapter.TARGET_CALLER: cat = MetricsLogger.ACTION_ACTIVITY_CHOOSER_PICKED_APP_TARGET; break; case ChooserListAdapter.TARGET_SERVICE: cat = MetricsLogger.ACTION_ACTIVITY_CHOOSER_PICKED_SERVICE_TARGET; value -= mChooserListAdapter.getCallerTargetCount(); break; case ChooserListAdapter.TARGET_STANDARD: cat = MetricsLogger.ACTION_ACTIVITY_CHOOSER_PICKED_STANDARD_TARGET; value -= mChooserListAdapter.getCallerTargetCount() + mChooserListAdapter.getServiceTargetCount(); break; } if (cat != 0) { MetricsLogger.action(this, cat, value); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startSelected File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
startSelected
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
@Override public void onBootPhase(int phase) { if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) { // no beeping until we're basically done booting mSystemReady = true; // Grab our optional AudioService mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE); mAudioManagerInternal = getLocalService(AudioManagerInternal.class); mVrManagerInternal = getLocalService(VrManagerInternal.class); mZenModeHelper.onSystemReady(); } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) { // This observer will force an update when observe is called, causing us to // bind to listener services. mSettingsObserver.observe(); mListeners.onBootPhaseAppsCanStart(); mRankerServices.onBootPhaseAppsCanStart(); mConditionProviders.onBootPhaseAppsCanStart(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onBootPhase File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
onBootPhase
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private static boolean equalsSafe(byte[] bytes1, int startPos1, byte[] bytes2, int startPos2, int length) { final int end = startPos1 + length; for (; startPos1 < end; ++startPos1, ++startPos2) { if (bytes1[startPos1] != bytes2[startPos2]) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equalsSafe File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
equalsSafe
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public void logIn(Response response) throws UnauthorizedException { // Check user against login whitelist, if it exists if (GribbitServer.loginWhitelistChecker == null || GribbitServer.loginWhitelistChecker.allowUserToLogin(id)) { // Create new session token sessionTok = new Token(TokenType.SESSION, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS); csrfTok = CSRF.generateRandomCSRFToken(); save(); if (sessionTokHasExpired()) { // Shouldn't happen, since we just created session tok, but just in case clearSessionTok(); throw new UnauthorizedException("Couldn't create auth session"); } // Save login cookies in result response.setCookie(new Cookie(Cookie.SESSION_COOKIE_NAME, "/", sessionTok.token, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS)); response.setCookie(new Cookie(Cookie.EMAIL_COOKIE_NAME, "/", id, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS)); } else { // User is not authorized throw new UnauthorizedException("User is not whitelisted for login: " + id); } }
Vulnerability Classification: - CWE: CWE-346 - CVE: CVE-2014-125071 - Severity: MEDIUM - CVSS Score: 5.2 Description: Protect against CSWSH: (Cross-Site WebSocket Hijacking) Function: logIn File: src/gribbit/auth/User.java Repository: lukehutch/gribbit Fixed Code: public void logIn(Response response) throws UnauthorizedException { // Check user against login whitelist, if it exists if (GribbitServer.loginWhitelistChecker == null || GribbitServer.loginWhitelistChecker.allowUserToLogin(id)) { // Create new session token sessionTok = new Token(TokenType.SESSION, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS); // Create new random CSRF token every time user logs in csrfTok = CSRF.generateRandomCSRFToken(); if (sessionTokHasExpired()) { // Shouldn't happen, since we just created session tok, but just in case clearSessionTok(); throw new UnauthorizedException("Couldn't create auth session"); } // Save tokens in database save(); // Save login cookies in result response.setCookie(new Cookie(Cookie.SESSION_COOKIE_NAME, "/", sessionTok.token, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS)); response.setCookie(new Cookie(Cookie.EMAIL_COOKIE_NAME, "/", id, Cookie.SESSION_COOKIE_MAX_AGE_SECONDS)); } else { // User is not authorized throw new UnauthorizedException("User is not whitelisted for login: " + id); } }
[ "CWE-346" ]
CVE-2014-125071
MEDIUM
5.2
lukehutch/gribbit
logIn
src/gribbit/auth/User.java
620418df247aebda3dd4be1dda10fe229ea505dd
1
Analyze the following code function for security vulnerabilities
private static File getTmpFolder() { try { File outputFolder = Files.createTempFile("codegen-", "-tmp").toFile(); outputFolder.delete(); outputFolder.mkdir(); outputFolder.deleteOnExit(); return outputFolder; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Cannot access tmp folder"); } }
Vulnerability Classification: - CWE: CWE-668 - CVE: CVE-2021-21428 - Severity: MEDIUM - CVSS Score: 4.4 Description: Update modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java Co-authored-by: Jonathan Leitschuh <Jlleitschuh@wpi.edu> Function: getTmpFolder File: modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java Repository: OpenAPITools/openapi-generator Fixed Code: private static File getTmpFolder() { try { File outputFolder = Files.createTempDirectory("codegen-tmp").toFile(); outputFolder.deleteOnExit(); return outputFolder; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Cannot access tmp folder"); } }
[ "CWE-668" ]
CVE-2021-21428
MEDIUM
4.4
OpenAPITools/openapi-generator
getTmpFolder
modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java
0c38e6dfcee4d3dacb29755e7c796942aefbfb2c
1
Analyze the following code function for security vulnerabilities
private void appendTypeSource(OutputStream out, Type type, Set<Type> types) throws IOException { if (type instanceof Class) { Class classType = (Class) type; if (classType.isArray()) { appendTypeSource(out, classType.getComponentType(), types); return; } if (classType.getName().startsWith("java.") || types.contains(type) || classType.isPrimitive()) return; // Keep track of which types we've already added types.add(type); appendClassSource(out, classType, types); } else if (type instanceof ParameterizedType) { for (Type t : ((ParameterizedType) type).getActualTypeArguments()) appendTypeSource(out, t, types); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendTypeSource File: jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/InterfaceGenerator.java Repository: seam2/jboss-seam The code follows secure coding practices.
[ "CWE-264", "CWE-200" ]
CVE-2013-6447
MEDIUM
5
seam2/jboss-seam
appendTypeSource
jboss-seam-remoting/src/main/java/org/jboss/seam/remoting/InterfaceGenerator.java
090aa6252affc978a96c388e3fc2c1c2688d9bb5
0
Analyze the following code function for security vulnerabilities
@Override protected boolean allowInert(UI ui, JsonObject invocationJson) { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allowInert 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
allowInert
flow-server/src/main/java/com/vaadin/flow/server/communication/rpc/PublishedServerEventHandlerRpcHandler.java
1fa4976902a117455bf2f98b191f8c80692b53c8
0
Analyze the following code function for security vulnerabilities
private static boolean isIncludableConstructor(Constructor<?> c) { return !c.isSynthetic(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIncludableConstructor File: src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isIncludableConstructor
src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
public String modifyEntry(String dn, LDAPModification mod) { logger.info("SecurityDomainProcessor: Modifying entry " + dn); String status = SUCCESS; LdapBoundConnFactory connFactory = null; LDAPConnection conn = null; CMSEngine engine = CMS.getCMSEngine(); EngineConfig cs = engine.getConfig(); PKISocketConfig socketConfig = cs.getSocketConfig(); try { LDAPConfig ldapConfig = cs.getInternalDBConfig(); connFactory = new LdapBoundConnFactory("UpdateDomainXML"); connFactory.init(socketConfig, ldapConfig, engine.getPasswordStore()); conn = connFactory.getConn(); conn.modify(dn, mod); } catch (LDAPException e) { int resultCode = e.getLDAPResultCode(); if (resultCode != LDAPException.NO_SUCH_OBJECT && resultCode != LDAPException.NO_SUCH_ATTRIBUTE) { logger.error("SecurityDomainProcessor: Unable to modify entry: " + e.getMessage(), e); status = FAILED; } } catch (Exception e) { logger.warn("SecurityDomainProcessor: Unable to modify entry: " + e.getMessage(), e); } finally { try { if (conn != null && connFactory != null) { logger.debug("SecurityDomainProcessor: Releasing LDAP connection"); connFactory.returnConn(conn); } } catch (Exception e) { logger.warn("SecurityDomainProcessor: Unable to release LDAP connection: " + e.getMessage(), e); } } return status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: modifyEntry File: base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
modifyEntry
base/server/src/main/java/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public TypeDeserializer findTypeDeserializer(DeserializationConfig config, JavaType baseType) throws JsonMappingException { BeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); // Ok: if there is no explicit type info handler, we may want to // use a default. If so, config object knows what to use. Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); if (b == null) { return null; } } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypesByTypeId(config, ac); } // May need to figure out default implementation, if none found yet // (note: check for abstract type is not 100% mandatory, more of an optimization) if ((b.getDefaultImpl() == null) && baseType.isAbstract()) { JavaType defaultType = mapAbstractType(config, baseType); if ((defaultType != null) && !defaultType.hasRawClass(baseType.getRawClass())) { b = b.defaultImpl(defaultType.getRawClass()); } } // 05-Apt-2018, tatu: Since we get non-mapping exception due to various limitations, // map to better type here try { return b.buildTypeDeserializer(config, baseType, subtypes); } catch (IllegalArgumentException e0) { InvalidDefinitionException e = InvalidDefinitionException.from((JsonParser) null, ClassUtil.exceptionMessage(e0), baseType); e.initCause(e0); throw e; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findTypeDeserializer File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
findTypeDeserializer
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private void finishOff() { reader.interrupt(); IOUtils.closeQuietly(connInfo.in); IOUtils.closeQuietly(connInfo.out); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: finishOff File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java Repository: hierynomus/sshj The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
hierynomus/sshj
finishOff
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@Override public boolean setProcessMemoryTrimLevel(String process, int userId, int level) { synchronized (this) { final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel"); if (app == null) { return false; } if (app.trimMemoryLevel < level && app.thread != null && (level < ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN || app.curProcState >= ActivityManager.PROCESS_STATE_IMPORTANT_BACKGROUND)) { try { app.thread.scheduleTrimMemory(level); app.trimMemoryLevel = level; return true; } catch (RemoteException e) { // Fallthrough to failure case. } } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setProcessMemoryTrimLevel File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
setProcessMemoryTrimLevel
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Override protected Config getConfig() { Config c = new Config(); c.caption = "notification listener"; c.serviceInterface = NotificationListenerService.SERVICE_INTERFACE; c.secureSettingName = Settings.Secure.ENABLED_NOTIFICATION_LISTENERS; c.bindPermission = android.Manifest.permission.BIND_NOTIFICATION_LISTENER_SERVICE; c.settingsAction = Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS; c.clientLabel = R.string.notification_listener_binding_label; return c; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfig File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
getConfig
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
public void setInputs(List<ProfileInput> inputs) { this.inputs = inputs; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setInputs File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setInputs
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public Klass<?> getKlass() { return Klass.java(clazz); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKlass File: core/src/main/java/hudson/model/Descriptor.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
getKlass
core/src/main/java/hudson/model/Descriptor.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregisterUserSwitchObserver File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
unregisterUserSwitchObserver
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public void beginTableHeadCell(Map<String, String> parameters) { getXHTMLWikiPrinter().setStandalone(); // Find proper scope attribute value Map<String, String> parametersWithScope; if (!parameters.containsKey("scope")) { parametersWithScope = new LinkedHashMap<String, String>(parameters); if (getBlockState().getCellRow() == 0 || getBlockState().getCellCol() > 0) { parametersWithScope.put("scope", "col"); } else { parametersWithScope.put("scope", "row"); } } else { parametersWithScope = parameters; } // Write th element getXHTMLWikiPrinter().printXMLStartElement("th", parametersWithScope); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginTableHeadCell File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
beginTableHeadCell
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
@RequiresPermissions("topic:edit") @PostMapping("edit") @ResponseBody public Result update(Integer id, String title, String content, String tags) { Topic topic = topicService.selectById(id); topic.setTitle(title); topic.setContent(content); topic.setModifyTime(new Date()); topicService.update(topic, tags); return success(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2022-23391 - Severity: MEDIUM - CVSS Score: 4.3 Description: 修复了一部分页面上输入框的xss注入 https://github.com/atjiu/pybbs/issues/171 Function: update File: src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java Repository: atjiu/pybbs Fixed Code: @RequiresPermissions("topic:edit") @PostMapping("edit") @ResponseBody public Result update(Integer id, String title, String content, String tags) { title = Jsoup.clean(title, Whitelist.basic()); ApiAssert.notEmpty(title, "话题标题不能为空"); Topic topic = topicService.selectById(id); topic.setTitle(title); topic.setContent(content); topic.setModifyTime(new Date()); topicService.update(topic, tags); return success(); }
[ "CWE-79" ]
CVE-2022-23391
MEDIUM
4.3
atjiu/pybbs
update
src/main/java/co/yiiu/pybbs/controller/admin/TopicAdminController.java
7d83b97d19f5fed9f29f72e654ef3c2818021b4d
1
Analyze the following code function for security vulnerabilities
private void logSetCrossProfilePackages(ComponentName who, List<String> packageNames) { DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_CROSS_PROFILE_PACKAGES) .setAdmin(who) .setStrings(packageNames.toArray(new String[packageNames.size()])) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logSetCrossProfilePackages File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
logSetCrossProfilePackages
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Editable(order=40, description="Optionally specify cluster role the job pods service account " + "binding to. This is necessary if you want to do things such as running other " + "Kubernetes pods in job command") public String getClusterRole() { return clusterRole; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClusterRole 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
getClusterRole
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 void enforceCallingPackage(String packageName, String message) { int packageUid = -1; int callingUid = Binder.getCallingUid(); PackageManager pm = mContext.createContextAsUser( UserHandle.getUserHandleForUid(callingUid), 0).getPackageManager(); if (pm != null) { try { packageUid = pm.getPackageUid(packageName, 0); } catch (PackageManager.NameNotFoundException e) { // packageUid is -1 } } if (packageUid != callingUid && callingUid != Process.ROOT_UID) { throw new SecurityException(message + ": Package " + packageName + " does not belong to " + callingUid); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceCallingPackage 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
enforceCallingPackage
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException { try { return ccm.doFinal(out, 0); } catch (InvalidCipherTextException e) { throw new IllegalStateException("exception on doFinal()", e); } }
Vulnerability Classification: - CWE: CWE-310 - CVE: CVE-2016-1000339 - Severity: MEDIUM - CVSS Score: 5.0 Description: Added table use obfuscation to AESFastEngine JDK 1.4 compiler updates. Function: doFinal File: prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java Repository: bcgit/bc-java Fixed Code: public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException { try { return ccm.doFinal(out, 0); } catch (InvalidCipherTextException e) { throw new IllegalStateException("exception on doFinal(): " + e.toString()); } }
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
doFinal
prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
8a73f08931450c17c749af067b6a8185abdfd2c0
1
Analyze the following code function for security vulnerabilities
public byte[] getResourceContentAsBytes(String name) throws IOException { if (getEngineContext() != null) { try (InputStream is = getResourceAsStream(name)) { if (is != null) { return IOUtils.toByteArray(is); } } catch (Exception e) { } } return FileUtils.readFileToByteArray(new File(name)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceContentAsBytes File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getResourceContentAsBytes
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeInt(userId); data.writeStringArray(packages); mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0); reply.readException(); data.recycle(); reply.recycle(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLockTaskPackages File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
updateLockTaskPackages
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public void deleteLatestVersion(String space, String page) { deleteVersion(space, page, "latest"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteLatestVersion File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2023-35166
HIGH
8.8
xwiki/xwiki-platform
deleteLatestVersion
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
0
Analyze the following code function for security vulnerabilities
@Override public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "registerTaskStackListener()"); mTaskChangeNotificationController.registerTaskStackListener(listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerTaskStackListener 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
registerTaskStackListener
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public void printXMLStartElement(String name, Attributes attributes) { handleSpaceWhenStartElement(); super.printXMLStartElement(name, attributes); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-32070 - Severity: MEDIUM - CVSS Score: 6.1 Description: XRENDERING-663: Restrict allowed attributes in HTML rendering * Change HTML renderers to only print allowed attributes and elements. * Add prefix to forbidden attributes to preserve them in XWiki syntax. * Adapt tests to expect that invalid attributes get a prefix. Function: printXMLStartElement File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering Fixed Code: @Override public void printXMLStartElement(String name, Attributes attributes) { if (this.htmlElementSanitizer == null || this.htmlElementSanitizer.isElementAllowed(name)) { handleSpaceWhenStartElement(); super.printXMLStartElement(name, cleanAttributes(name, attributes)); } }
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
printXMLStartElement
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
1
Analyze the following code function for security vulnerabilities
public Pipeline schedulePipeline(PipelineConfig pipelineConfig, Clock clock) { return schedulePipeline(pipelineConfig, ModificationsMother.modifySomeFiles(pipelineConfig), clock); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: schedulePipeline File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
schedulePipeline
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@Override public String getType(final Uri uri) { int match = sURIMatcher.match(uri); switch (match) { case MY_DOWNLOADS: case ALL_DOWNLOADS: { return DOWNLOAD_LIST_TYPE; } case MY_DOWNLOADS_ID: case ALL_DOWNLOADS_ID: case PUBLIC_DOWNLOAD_ID: { // return the mimetype of this id from the database final String id = getDownloadIdFromUri(uri); final SQLiteDatabase db = mOpenHelper.getReadableDatabase(); final String mimeType = DatabaseUtils.stringForQuery(db, "SELECT " + Downloads.Impl.COLUMN_MIME_TYPE + " FROM " + DB_TABLE + " WHERE " + Downloads.Impl._ID + " = ?", new String[]{id}); if (TextUtils.isEmpty(mimeType)) { return DOWNLOAD_TYPE; } else { return mimeType; } } default: { if (Constants.LOGV) { Log.v(Constants.TAG, "calling getType on an unknown URI: " + uri); } throw new IllegalArgumentException("Unknown URI: " + uri); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getType File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
getType
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CertData other = (CertData) obj; if (encoded == null) { if (other.encoded != null) return false; } else if (!encoded.equals(other.encoded)) return false; if (issuerDN == null) { if (other.issuerDN != null) return false; } else if (!issuerDN.equals(other.issuerDN)) return false; if (nonce == null) { if (other.nonce != null) return false; } else if (!nonce.equals(other.nonce)) return false; if (notAfter == null) { if (other.notAfter != null) return false; } else if (!notAfter.equals(other.notAfter)) return false; if (notBefore == null) { if (other.notBefore != null) return false; } else if (!notBefore.equals(other.notBefore)) return false; if (pkcs7CertChain == null) { if (other.pkcs7CertChain != null) return false; } else if (!pkcs7CertChain.equals(other.pkcs7CertChain)) return false; if (prettyPrint == null) { if (other.prettyPrint != null) return false; } else if (!prettyPrint.equals(other.prettyPrint)) return false; if (serialNumber == null) { if (other.serialNumber != null) return false; } else if (!serialNumber.equals(other.serialNumber)) return false; if (status == null) { if (other.status != null) return false; } else if (!status.equals(other.status)) return false; if (subjectDN == null) { if (other.subjectDN != null) return false; } else if (!subjectDN.equals(other.subjectDN)) return false; if (revokedOn == null) { if (other.revokedOn != null) return false; } else if (!revokedOn.equals(other.revokedOn)) return false; if (revokedBy == null) { if (other.revokedBy != null) return false; } else if (!revokedBy.equals(other.revokedBy)) return false; return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equals File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
equals
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Nullable public String getClassAttribute() { final int id = nativeGetClassAttribute(mParseState); if (id == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } return id >= 0 ? getSequenceString(mStrings.getSequence(id)) : null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getClassAttribute File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getClassAttribute
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private ClassPathXmlApplicationContext createDataContext() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:WEB-INF/applicationContext-dataLocalAccess.xml"); this.stageDao = (StageSqlMapDao) context.getBean("stageDao"); this.jobInstanceDao = (JobInstanceDao) context.getBean("buildInstanceDao"); this.propertyDao = (PropertyDao) context.getBean("propertyDao"); this.pipelineDao = (PipelineSqlMapDao) context.getBean("pipelineDao"); this.materialRepository = (MaterialRepository) context.getBean("materialRepository"); this.goCache = (GoCache) context.getBean("goCache"); this.instanceFactory = (InstanceFactory) context.getBean("instanceFactory"); this.jobAgentMetadataDao = (JobAgentMetadataDao) context.getBean("jobAgentMetadataDao"); setSessionFactory((SessionFactory) context.getBean("sessionFactory")); return context; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createDataContext File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
createDataContext
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
public void setLock(String userName, XWikiContext context) throws XWikiException { XWikiLock lock = new XWikiLock(getId(), userName); getStore(context).saveLock(lock, context, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLock 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
setLock
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
public boolean getOverrideTaskTransition() { return mOverrideTaskTransition; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOverrideTaskTransition File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getOverrideTaskTransition
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public void setSeparateProfileChallengeEnabled(int userHandle, boolean enabled, String managedUserPassword) { UserInfo info = getUserManager().getUserInfo(userHandle); if (info.isManagedProfile()) { try { getLockSettings().setSeparateProfileChallengeEnabled(userHandle, enabled, managedUserPassword); onAfterChangingPassword(userHandle); } catch (RemoteException e) { Log.e(TAG, "Couldn't update work profile challenge enabled"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSeparateProfileChallengeEnabled 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
setSeparateProfileChallengeEnabled
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private boolean hasChildAssert(StateNode child) { AtomicBoolean found = new AtomicBoolean(false); forEachChild(c -> { if (c == child) { found.set(true); } }); return found.get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasChildAssert File: flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
hasChildAssert
flow-server/src/main/java/com/vaadin/flow/internal/StateNode.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private <V extends Future<V>> V submitUnchecked(IQueueChunk chunk) { if (chunk.isEmpty()) { chunk.recycle(); Future result = Futures.immediateFuture(null); return (V) result; } if (Fawe.isMainThread()) { V result = (V) chunk.call(); if (result == null) { return (V) (Future) Futures.immediateFuture(null); } else { return result; } } return (V) Fawe.instance().getQueueHandler().submit(chunk); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: submitUnchecked File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
submitUnchecked
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
@Override public AuthenticationResponse authenticate( AuthenticationIdentity authenticationIdentity) throws RepositoryLoginException, RepositoryException { String userLoginName = IdentityUtil.getCanonicalUsername(authenticationIdentity); if (userLoginName == null) { return new AuthenticationResponse(false, ""); } else { String userDomain = IdentityUtil.getDomain(authenticationIdentity); String password = authenticationIdentity.getPassword(); ISessionManager sessionManagerUser; boolean authenticate; String userName; try { if (Strings.isNullOrEmpty(password)) { sessionManagerUser = getSessionManager(connector.getLogin(), connector.getPassword()); //check for user existence when null password userName = getUserName(sessionManagerUser, userLoginName, userDomain); authenticate = (userName != null); } else { // TODO(jlacey): We are using the raw username from the GSA // here because we always have and no bugs have been reported. sessionManagerUser = getSessionManager(authenticationIdentity.getUsername(), password); // Use getSession instead of authenticate, so we can get the // authenticated user name. ISession session = sessionManagerUser.getSession(docbase); try { userName = session.getLoginUserName(); } finally { sessionManagerUser.release(session); } authenticate = true; } } catch (RepositoryLoginException e) { LOGGER.finer(e.getMessage()); return new AuthenticationResponse(false, ""); } if (authenticate) { return new AuthenticationResponse(authenticate, "", getAllGroupsForUser( sessionManagerUser, userName)); } else { return new AuthenticationResponse(false, ""); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: authenticate File: projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java Repository: AnantLabs/google-enterprise-connector-dctm The code follows secure coding practices.
[ "CWE-89" ]
CVE-2014-125083
MEDIUM
5.2
AnantLabs/google-enterprise-connector-dctm
authenticate
projects/dctm-core/source/java/com/google/enterprise/connector/dctm/DctmAuthenticationManager.java
6fba04f18ab7764002a1da308e7cd9712b501cb7
0
Analyze the following code function for security vulnerabilities
JSONAware handleRequest(HttpServletRequest pReq, HttpServletResponse pResp) throws IOException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleRequest File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
handleRequest
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public static boolean isClassField(Set<String> fieldSet, Class clazz){ Field[] fields = clazz.getDeclaredFields(); for(String field: fieldSet){ boolean exist = false; for(int i=0;i<fields.length;i++){ String fieldName = fields[i].getName(); String tableColumnName = oConvertUtils.camelToUnderline(fieldName); if(fieldName.equalsIgnoreCase(field) || tableColumnName.equalsIgnoreCase(field)){ exist = true; break; } } if(!exist){ return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isClassField File: jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java Repository: jeecgboot/jeecg-boot The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-47105
CRITICAL
9.8
jeecgboot/jeecg-boot
isClassField
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/SqlInjectionUtil.java
0fc374de4745eac52620eeb8caf6a7b76127529a
0
Analyze the following code function for security vulnerabilities
public PdfDictionary getPageN(int pageNum) { PRIndirectReference ref = getPageOrigRef(pageNum); return (PdfDictionary)PdfReader.getPdfObject(ref); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageN File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
getPageN
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { String ID = ""; String filter = ""; String callerUrl = request.getParameter("callerUrl"); if (request.getParameter("ID") != null) { ID = request.getParameter("ID"); } if (request.getParameter("filter") != null) { filter = request.getParameter("filter"); } request.getSession() .setAttribute("controlledvocabulary.filter", filter); request.getSession().setAttribute("controlledvocabulary.ID", ID); response.sendRedirect(callerUrl); }
Vulnerability Classification: - CWE: CWE-601, CWE-79 - CVE: CVE-2022-31192 - Severity: MEDIUM - CVSS Score: 6.1 Description: [DS-4133] Improve URL handling in Controlled Vocab JSPUI servlet Function: doDSGet File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/ControlledVocabularyServlet.java Repository: DSpace Fixed Code: protected void doDSGet(Context context, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException { String ID = ""; String filter = ""; String callerUrl = request.getParameter("callerUrl"); // callerUrl must starts with URL outside DSpace request context path if(!callerUrl.startsWith(request.getContextPath())) { log.error("Controlled vocabulary caller URL would result in redirect outside DSpace web app: " + callerUrl + ". Rejecting request with 400 Bad Request."); response.sendError(400, "The caller URL must be within the DSpace base URL of " + request.getContextPath()); return; } if (request.getParameter("ID") != null) { ID = request.getParameter("ID"); } if (request.getParameter("filter") != null) { filter = request.getParameter("filter"); } request.getSession() .setAttribute("controlledvocabulary.filter", filter); request.getSession().setAttribute("controlledvocabulary.ID", ID); response.sendRedirect(callerUrl); }
[ "CWE-601", "CWE-79" ]
CVE-2022-31192
MEDIUM
6.1
DSpace
doDSGet
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/ControlledVocabularyServlet.java
f7758457b7ec3489d525e39aa753cc70809d9ad9
1
Analyze the following code function for security vulnerabilities
@Override public LogWatch watchLog(OutputStream out) { try { PodOperationUtil.waitUntilReadyBeforeFetchingLogs(this, getContext().getLogWaitTimeout() != null ? getContext().getLogWaitTimeout() : DEFAULT_POD_LOG_WAIT_TIMEOUT); // Issue Pod Logs HTTP request URL url = new URL(URLUtils.join(getResourceUrl().toString(), getLogParameters() + "&follow=true")); Request request = new Request.Builder().url(url).get().build(); final LogWatchCallback callback = new LogWatchCallback(out); OkHttpClient clone = client.newBuilder().readTimeout(0, TimeUnit.MILLISECONDS).build(); clone.newCall(request).enqueue(callback); callback.waitUntilReady(); return callback; } catch (IOException ioException) { throw KubernetesClientException.launderThrowable(forOperationType("watchLog"), ioException); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: watchLog File: kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java Repository: fabric8io/kubernetes-client The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-20218
MEDIUM
5.8
fabric8io/kubernetes-client
watchLog
kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/internal/core/v1/PodOperationsImpl.java
325d67cc80b73f049a5d0cea4917c1f2709a8d86
0
Analyze the following code function for security vulnerabilities
@Override public void noteWakeupAlarm(PendingIntent ps, WorkSource workSource, int sourceUid, String sourcePkg, String tag) { ActivityManagerService.this.noteWakeupAlarm((ps != null) ? ps.getTarget() : null, workSource, sourceUid, sourcePkg, tag); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteWakeupAlarm File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
noteWakeupAlarm
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public boolean removeUser(ComponentName who, UserHandle userHandle) { Objects.requireNonNull(who, "ComponentName is null"); Objects.requireNonNull(userHandle, "UserHandle is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_REMOVE_USER); return mInjector.binderWithCleanCallingIdentity(() -> { String restriction = isManagedProfile(userHandle.getIdentifier()) ? UserManager.DISALLOW_REMOVE_MANAGED_PROFILE : UserManager.DISALLOW_REMOVE_USER; if (isAdminAffectedByRestriction(who, restriction, caller.getUserId())) { Slogf.w(LOG_TAG, "The device owner cannot remove a user because %s is enabled, and " + "was not set by the device owner", restriction); return false; } return mUserManagerInternal.removeUserEvenWhenDisallowed(userHandle.getIdentifier()); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeUser File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
removeUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void onSave() { if (sDebug) Slog.d(TAG, "OneTimeListener.onSave(): " + mDone); if (mDone) { return; } mRealListener.onSave(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSave File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
onSave
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public void setContent(String content) { this.content = content; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-29638 - Severity: MEDIUM - CVSS Score: 5.4 Description: fix:There is a stored XSS on the article page. #74 Function: setContent File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site Fixed Code: public void setContent(String content) { //xss过滤 if (StringUtils.isNotBlank(content)) { this.content = XSSUtil.stripXSS(content); } else { this.content = content; } }
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
setContent
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
1
Analyze the following code function for security vulnerabilities
public User getUser() { return user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUser File: src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-4040
MEDIUM
6.5
dotCMS/core
getUser
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
@Override public void acknowledgeNewUserDisclaimer(@UserIdInt int userId) { CallerIdentity callerIdentity = getCallerIdentity(); Preconditions.checkCallAuthorization(canManageUsers(callerIdentity) || hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS)); setShowNewUserDisclaimer(userId, DevicePolicyData.NEW_USER_DISCLAIMER_ACKNOWLEDGED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: acknowledgeNewUserDisclaimer File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21284
MEDIUM
5.5
android
acknowledgeNewUserDisclaimer
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean dispatchKeyEventPreIme(KeyEvent event) { try { TraceEvent.begin(); return mContainerViewInternals.super_dispatchKeyEventPreIme(event); } finally { TraceEvent.end(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchKeyEventPreIme File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
dispatchKeyEventPreIme
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
@Override public void run() throws InterruptedException { switch (inputType | outputType << 4 | zipMethod) { case FILE | FILE << 4 | COPY: case FILE | STREAM << 4 | COPY: case STREAM | FILE << 4 | COPY: case STREAM | STREAM << 4 | COPY: populateStreamsForFiles(); streamCopy(); break; case FOLDER | FOLDER << 4 | COPY: folderCopy(); break; case STREAM | FOLDER << 4 | EXTRACT: case FILE | FOLDER << 4 | EXTRACT: populateStreamsForFiles(); zipExtract(); break; case FOLDER | STREAM << 4 | COMPRESS: case FOLDER | FILE << 4 | COMPRESS: populateStreamsForFiles(); zipCompress(); break; default: throw new RuntimeException("Invalid copy task parameters: " + inputType + ", " + outputType + ", " + zipMethod); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java Repository: Calsign/APDE The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-36628
CRITICAL
9.8
Calsign/APDE
run
APDE/src/main/java/com/calsignlabs/apde/build/dag/CopyBuildTask.java
c6d64cbe465348c1bfd211122d89e3117afadecf
0
Analyze the following code function for security vulnerabilities
private PostgresClient insertXAndSingleQuotePojo(TestContext context, JsonArray ids) { Async async = context.async(); postgresClient = createFoo(context); postgresClient.save(FOO, ids.getString(0), xPojo, res1 -> { assertSuccess(context, res1); postgresClient.save(FOO, ids.getString(1), singleQuotePojo, res2 -> { assertSuccess(context, res2); async.complete(); }); }); async.awaitSuccess(5000); return postgresClient; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertXAndSingleQuotePojo File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
insertXAndSingleQuotePojo
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public int getHelpResource() { return R.string.help_url_choose_lockscreen; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHelpResource File: src/com/android/settings/password/ChooseLockGeneric.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2018-9501
HIGH
7.2
android
getHelpResource
src/com/android/settings/password/ChooseLockGeneric.java
5e43341b8c7eddce88f79c9a5068362927c05b54
0
Analyze the following code function for security vulnerabilities
public void setClientAuthenticationMethod(final ClientAuthenticationMethod clientAuthenticationMethod) { this.clientAuthenticationMethod = clientAuthenticationMethod; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setClientAuthenticationMethod File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
setClientAuthenticationMethod
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
private void setFeed(SyndFeed feed) { this.execution.getContext().setProperty(FEED_PROPERTY, feed); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFeed File: xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29202
CRITICAL
9
xwiki/xwiki-platform
setFeed
xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
5c7ebe47c2897e92d8f04fe2e15027e84dc3ec03
0
Analyze the following code function for security vulnerabilities
private synchronized void updateStreamIdsCountersInHeaders(int streamNo) { if (streamNo % 2 != 0) { // the last good stream is always the last client ID sent by the client or received by the server lastGoodStreamId = Math.max(lastGoodStreamId, streamNo); if (!isClient()) { // server received client request ID => update the last assigned for the server lastAssignedStreamOtherSide = lastGoodStreamId; } } else if (isClient()) { // client received push promise => update the last assigned for the client lastAssignedStreamOtherSide = Math.max(lastAssignedStreamOtherSide, streamNo); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateStreamIdsCountersInHeaders File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
updateStreamIdsCountersInHeaders
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
public Authentication getAuthentication(String authName) { return authentications.get(authName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthentication File: samples/client/petstore/java/okhttp-gson-dynamicOperations/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
getAuthentication
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private String getIpIfPossible(String pHost) { try { InetAddress address = InetAddress.getByName(pHost); return address.getHostAddress(); } catch (UnknownHostException e) { return pHost; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getIpIfPossible File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java Repository: jolokia The code follows secure coding practices.
[ "CWE-352" ]
CVE-2014-0168
MEDIUM
6.8
jolokia
getIpIfPossible
agent/core/src/main/java/org/jolokia/http/AgentServlet.java
2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364
0
Analyze the following code function for security vulnerabilities
public @NearbyStreamingPolicy int getNearbyNotificationStreamingPolicy(int userId) { throwIfParentInstance("getNearbyNotificationStreamingPolicy"); if (mService == null) { return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY; } try { return mService.getNearbyNotificationStreamingPolicy(userId); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNearbyNotificationStreamingPolicy File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
getNearbyNotificationStreamingPolicy
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setCharacterEncoding(String encoding) { characterEncoding = encoding; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCharacterEncoding File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
setCharacterEncoding
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
public static byte[] decodePredictor(byte in[], PdfObject dicPar) { if (dicPar == null || !dicPar.isDictionary()) return in; PdfDictionary dic = (PdfDictionary)dicPar; PdfObject obj = getPdfObject(dic.get(PdfName.PREDICTOR)); if (obj == null || !obj.isNumber()) return in; int predictor = ((PdfNumber)obj).intValue(); if (predictor < 10) return in; int width = 1; obj = getPdfObject(dic.get(PdfName.COLUMNS)); if (obj != null && obj.isNumber()) width = ((PdfNumber)obj).intValue(); int colors = 1; obj = getPdfObject(dic.get(PdfName.COLORS)); if (obj != null && obj.isNumber()) colors = ((PdfNumber)obj).intValue(); int bpc = 8; obj = getPdfObject(dic.get(PdfName.BITSPERCOMPONENT)); if (obj != null && obj.isNumber()) bpc = ((PdfNumber)obj).intValue(); DataInputStream dataStream = new DataInputStream(new ByteArrayInputStream(in)); ByteArrayOutputStream fout = new ByteArrayOutputStream(in.length); int bytesPerPixel = colors * bpc / 8; int bytesPerRow = (colors*width*bpc + 7)/8; byte[] curr = new byte[bytesPerRow]; byte[] prior = new byte[bytesPerRow]; // Decode the (sub)image row-by-row while (true) { // Read the filter type byte and a row of data int filter = 0; try { filter = dataStream.read(); if (filter < 0) { return fout.toByteArray(); } dataStream.readFully(curr, 0, bytesPerRow); } catch (Exception e) { return fout.toByteArray(); } switch (filter) { case 0: //PNG_FILTER_NONE break; case 1: //PNG_FILTER_SUB for (int i = bytesPerPixel; i < bytesPerRow; i++) { curr[i] += curr[i - bytesPerPixel]; } break; case 2: //PNG_FILTER_UP for (int i = 0; i < bytesPerRow; i++) { curr[i] += prior[i]; } break; case 3: //PNG_FILTER_AVERAGE for (int i = 0; i < bytesPerPixel; i++) { curr[i] += prior[i] / 2; } for (int i = bytesPerPixel; i < bytesPerRow; i++) { curr[i] += ((curr[i - bytesPerPixel] & 0xff) + (prior[i] & 0xff))/2; } break; case 4: //PNG_FILTER_PAETH for (int i = 0; i < bytesPerPixel; i++) { curr[i] += prior[i]; } for (int i = bytesPerPixel; i < bytesPerRow; i++) { int a = curr[i - bytesPerPixel] & 0xff; int b = prior[i] & 0xff; int c = prior[i - bytesPerPixel] & 0xff; int p = a + b - c; int pa = Math.abs(p - a); int pb = Math.abs(p - b); int pc = Math.abs(p - c); int ret; if ((pa <= pb) && (pa <= pc)) { ret = a; } else if (pb <= pc) { ret = b; } else { ret = c; } curr[i] += (byte)(ret); } break; default: // Error -- unknown filter type throw new RuntimeException("PNG filter unknown."); } try { fout.write(curr); } catch (IOException ioe) { // Never happens } // Swap curr and prior byte[] tmp = prior; prior = curr; curr = tmp; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: decodePredictor File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
decodePredictor
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mFields.size()); for (Map.Entry<String, String> entry : mFields.entrySet()) { dest.writeString(entry.getKey()); dest.writeString(entry.getValue()); } writeCertificate(dest, mCaCert); if (mClientPrivateKey != null) { String algorithm = mClientPrivateKey.getAlgorithm(); byte[] userKeyBytes = mClientPrivateKey.getEncoded(); dest.writeInt(userKeyBytes.length); dest.writeByteArray(userKeyBytes); dest.writeString(algorithm); } else { dest.writeInt(0); } writeCertificate(dest, mClientCertificate); dest.writeInt(mTls12Enable ? 1: 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: writeToParcel File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
writeToParcel
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
public static String getNativeLibraryVersion() { URL versionFile = SnappyLoader.class.getResource("/org/xerial/snappy/VERSION"); String version = "unknown"; try { if (versionFile != null) { InputStream in = null; try { Properties versionData = new Properties(); in = versionFile.openStream(); versionData.load(in); version = versionData.getProperty("version", version); if (version.equals("unknown")) { version = versionData.getProperty("SNAPPY_VERSION", version); } version = version.trim().replaceAll("[^0-9\\.]", ""); } finally { if(in != null) { in.close(); } } } } catch (IOException e) { e.printStackTrace(); } return version; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNativeLibraryVersion File: src/main/java/org/xerial/snappy/Snappy.java Repository: xerial/snappy-java The code follows secure coding practices.
[ "CWE-190" ]
CVE-2023-34454
HIGH
7.5
xerial/snappy-java
getNativeLibraryVersion
src/main/java/org/xerial/snappy/Snappy.java
d0042551e4a3509a725038eb9b2ad1f683674d94
0
Analyze the following code function for security vulnerabilities
public void crashApplication(int uid, int initialPid, String packageName, String message) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: crashApplication File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
crashApplication
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public V getAndRemove(K name) { int h = hashingStrategy.hashCode(name); return remove0(h, index(h), checkNotNull(name, "name")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAndRemove File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-436", "CWE-113" ]
CVE-2022-41915
MEDIUM
6.5
netty
getAndRemove
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public void addItem(Context context, Collection collection, Item item) throws SQLException, AuthorizeException { // Check authorisation authorizeService.authorizeAction(context, collection, Constants.ADD); log.info(LogHelper.getHeader(context, "add_item", "collection_id=" + collection.getID() + ",item_id=" + item.getID())); // Create mapping // We do NOT add the item to the collection template since we would have to load in all our items // Instead we add the collection to an item which works in the same way. if (!item.getCollections().contains(collection)) { item.addCollection(collection); } context.addEvent(new Event(Event.ADD, Constants.COLLECTION, collection.getID(), Constants.ITEM, item.getID(), item.getHandle(), getIdentifiers(context, collection))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addItem File: dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41189
HIGH
9
DSpace
addItem
dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
277b499a5cd3a4f5eb2370513a1b7e4ec2a6e041
0
Analyze the following code function for security vulnerabilities
private void pruneWidgetStateLocked(String pkg, int userId) { if (!mPrunedApps.contains(pkg)) { if (DEBUG) { Slog.i(TAG, "pruning widget state for restoring package " + pkg); } for (int i = mWidgets.size() - 1; i >= 0; i--) { Widget widget = mWidgets.get(i); Host host = widget.host; Provider provider = widget.provider; if (host.hostsPackageForUser(pkg, userId) || (provider != null && provider.isInPackageForUser(pkg, userId))) { // 'pkg' is either the host or the provider for this instances, // so we tear it down in anticipation of it (possibly) being // reconstructed due to the restore host.widgets.remove(widget); provider.widgets.remove(widget); unbindAppWidgetRemoteViewsServicesLocked(widget); mWidgets.remove(i); } } mPrunedApps.add(pkg); } else { if (DEBUG) { Slog.i(TAG, "already pruned " + pkg + ", continuing normally"); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: pruneWidgetStateLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
pruneWidgetStateLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
@Override public void removeAttribute(String name) { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAttribute File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
removeAttribute
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public String getUserName() { return this.userName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserName File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java Repository: gocd The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-39309
MEDIUM
6.5
gocd
getUserName
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
691b479f1310034992da141760e9c5d1f5b60e8a
0
Analyze the following code function for security vulnerabilities
@JRubyMethod(visibility=Visibility.PRIVATE) public IRubyObject validate_document(ThreadContext context, IRubyObject document) { return validate_document_or_file(context, (XmlDocument)document); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate_document File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
validate_document
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
private void applyProtocols() throws SSLException { debug("JSSEngine: applyProtocols() min_protocol=" + min_protocol + " max_protocol=" + max_protocol); // Enable the protocols only when both a maximum and minimum protocol // version are specified. if (min_protocol == null || max_protocol == null) { debug("JSSEngine: applyProtocols() - missing min_protocol or max_protocol; using defaults"); return; } // We should bound this range by crypto-policies in the future to // match the current behavior. However, Tomcat already bounds // what we set in the server.xml config by what the JSSEngine // indicates it supports. Because we only indicate we support // what is allowed under crypto-policies, it effective does // this bounding for us. SSLVersionRange vrange = new SSLVersionRange(min_protocol, max_protocol); if (SSL.VersionRangeSet(ssl_fd, vrange) == SSL.SECFailure) { throw new SSLException("Unable to set version range: " + errorText(PR.GetError())); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyProtocols File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
applyProtocols
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
public String getPlainUserName(DocumentReference userReference) { return this.xwiki.getPlainUserName(userReference, getXWikiContext()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPlainUserName 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
getPlainUserName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public String getContainerTag() { return "flow-container-" + getFullAppId().toLowerCase(Locale.ENGLISH); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContainerTag File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getContainerTag
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private void handleSpaceWhenInText() { if (this.elementEnded || this.hasTextBeenPrinted) { handleSpaceWhenStartElement(); } else { handleSpaceWhenEndlement(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleSpaceWhenInText File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
handleSpaceWhenInText
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
@Reference public void setServiceRegistry(ServiceRegistry serviceRegistry) { this.serviceRegistry = serviceRegistry; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServiceRegistry 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
setServiceRegistry
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
private void readRequiredChar(char ch) throws IOException { if (!readIf(ch)) { throw expected("'"+ch+"'"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readRequiredChar File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readRequiredChar
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
private static WordBlock renderBlock(String translationKey, Object[] parameters) { return new WordBlock(renderString(translationKey, parameters)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderBlock File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-352" ]
CVE-2023-29213
HIGH
8.8
xwiki/xwiki-platform
renderBlock
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/src/main/java/org/xwiki/test/page/LocalizationSetup.java
49fdfd633ddfa346c522d2fe71754dc72c9496ca
0
Analyze the following code function for security vulnerabilities
public static ProfileParameter fromDOM(Element profileParameterElement) { String name = profileParameterElement.getAttribute("name"); String value = null; NodeList valueList = profileParameterElement.getElementsByTagName("value"); if (valueList.getLength() > 0) { value = valueList.item(0).getTextContent(); } return new ProfileParameter(name, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fromDOM File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
fromDOM
base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override protected Class<? extends XWikiForm> getFormClass() { return EditForm.class; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFormClass File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/InlineAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-862" ]
CVE-2022-23617
MEDIUM
4
xwiki/xwiki-platform
getFormClass
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/InlineAction.java
30c52b01559b8ef5ed1035dac7c34aaf805764d5
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getDelegatedShellPermissions() { if (UserHandle.getCallingAppId() != Process.SHELL_UID && UserHandle.getCallingAppId() != Process.ROOT_UID) { throw new SecurityException("Only the shell can get delegated permissions"); } synchronized (mProcLock) { return getPermissionManagerInternal().getDelegatedShellPermissions(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDelegatedShellPermissions File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
getDelegatedShellPermissions
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public void setSchemaLanguage(String schemaLanguage) { this.schemaLanguage = schemaLanguage; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSchemaLanguage File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java Repository: spring-projects/spring-framework The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-4152
MEDIUM
6.8
spring-projects/spring-framework
setSchemaLanguage
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
2843b7d2ee12e3f9c458f6f816befd21b402e3b9
0
Analyze the following code function for security vulnerabilities
private void setAndBroadcastNetworkSetTime(long time) { if (DBG) log("setAndBroadcastNetworkSetTime: time=" + time + "ms"); SystemClock.setCurrentTimeMillis(time); Intent intent = new Intent(TelephonyIntents.ACTION_NETWORK_SET_TIME); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra("time", time); mPhone.getContext().sendStickyBroadcastAsUser(intent, UserHandle.ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAndBroadcastNetworkSetTime File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-3831
MEDIUM
5
android
setAndBroadcastNetworkSetTime
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
0
Analyze the following code function for security vulnerabilities
public void createSchedule(ScheduleRequest request) { Schedule schedule = scheduleService.buildApiTestSchedule(request); ApiScenarioWithBLOBs apiScene = apiScenarioMapper.selectByPrimaryKey(request.getResourceId()); schedule.setName(apiScene.getName()); // add场景定时任务时,设置新增的数据库表字段的值 schedule.setProjectId(apiScene.getProjectId()); schedule.setJob(ApiScenarioTestJob.class.getName()); schedule.setGroup(ScheduleGroup.API_SCENARIO_TEST.name()); schedule.setType(ScheduleType.CRON.name()); scheduleService.addSchedule(schedule); this.addOrUpdateApiScenarioCronJob(request); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createSchedule File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
createSchedule
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
@Override public void addPacketSendingListener(StanzaListener packetListener, StanzaFilter packetFilter) { if (packetListener == null) { throw new NullPointerException("Packet listener is null."); } ListenerWrapper wrapper = new ListenerWrapper(packetListener, packetFilter); synchronized (sendListeners) { sendListeners.put(packetListener, wrapper); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addPacketSendingListener File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
addPacketSendingListener
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
protected void _invalidToken(int ch) throws JsonParseException { ch &= 0xFF; if (ch == 0xFF) { throw _constructError("Mismatched BREAK byte (0xFF): encountered where value expected"); } throw _constructError("Invalid CBOR value token (first byte): 0x"+Integer.toHexString(ch)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _invalidToken File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java Repository: FasterXML/jackson-dataformats-binary The code follows secure coding practices.
[ "CWE-770" ]
CVE-2020-28491
MEDIUM
5
FasterXML/jackson-dataformats-binary
_invalidToken
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public byte[] readFromStream() { try { int av = getAvailableInput(); if(av > 0) { byte[] arr = new byte[av]; int size = getInput().read(arr); if(size == arr.length) { return arr; } return shrink(arr, size); } byte[] arr = new byte[8192]; int size = getInput().read(arr); if(size == arr.length) { return arr; } return shrink(arr, size); } catch(IOException err) { err.printStackTrace(); errorMessage = err.toString(); return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFromStream 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
readFromStream
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void resetArchive(XWikiContext context) throws XWikiException { boolean hasVersioning = context.getWiki().hasVersioning(context); if (hasVersioning) { WikiReference currentWiki = context.getWikiReference(); try { context.setWikiReference(getDocumentReference().getWikiReference()); getVersioningStore(context).resetRCSArchive(this, true, context); } finally { context.setWikiReference(currentWiki); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetArchive 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-74" ]
CVE-2023-29523
HIGH
8.8
xwiki/xwiki-platform
resetArchive
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
0d547181389f7941e53291af940966413823f61c
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") private String displayCategory(final String friendlyUrl, final String ref, Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception { MerchantStore store = (MerchantStore)request.getAttribute(Constants.MERCHANT_STORE); //set ref as request attribute request.setAttribute("ref", ref); //get category Category category = categoryService.getBySeUrl(store, friendlyUrl); Language language = (Language)request.getAttribute("LANGUAGE"); if(category==null) { LOGGER.error("No category found for friendlyUrl " + friendlyUrl); //redirect on page not found return PageBuilderUtils.build404(store); } if(!category.isVisible()) { return PageBuilderUtils.buildHomePage(store); } ReadableCategoryPopulator populator = new ReadableCategoryPopulator(); ReadableCategory categoryProxy = populator.populate(category, new ReadableCategory(), store, language); Breadcrumb breadCrumb = breadcrumbsUtils.buildCategoryBreadcrumb(categoryProxy, store, language, request.getContextPath()); request.getSession().setAttribute(Constants.BREADCRUMB, breadCrumb); request.setAttribute(Constants.BREADCRUMB, breadCrumb); //meta information PageInformation pageInformation = new PageInformation(); pageInformation.setPageDescription(categoryProxy.getDescription().getMetaDescription()); pageInformation.setPageKeywords(categoryProxy.getDescription().getKeyWords()); pageInformation.setPageTitle(categoryProxy.getDescription().getTitle()); pageInformation.setPageUrl(categoryProxy.getDescription().getFriendlyUrl()); //** retrieves category id drill down**// String lineage = new StringBuilder().append(category.getLineage()).append(Constants.CATEGORY_LINEAGE_DELIMITER).toString(); request.setAttribute(Constants.REQUEST_PAGE_INFORMATION, pageInformation); List<Category> categs = categoryService.getListByLineage(store, lineage); categs.add(category); StringBuilder subCategoriesCacheKey = new StringBuilder(); subCategoriesCacheKey .append(store.getId()) .append("_") .append(category.getId()) .append("_") .append(Constants.SUBCATEGORIES_CACHE_KEY) .append("-") .append(language.getCode()); StringBuilder subCategoriesMissed = new StringBuilder(); subCategoriesMissed .append(subCategoriesCacheKey.toString()) .append(Constants.MISSED_CACHE_KEY); List<BigDecimal> prices = new ArrayList<BigDecimal>(); List<ReadableCategory> subCategories = null; Map<Long,Long> countProductsByCategories = null; if(store.isUseCache()) { //get from the cache subCategories = (List<ReadableCategory>) cache.getFromCache(subCategoriesCacheKey.toString()); if(subCategories==null) { //get from missed cache //Boolean missedContent = (Boolean)cache.getFromCache(subCategoriesMissed.toString()); //if(missedContent==null) { countProductsByCategories = getProductsByCategory(store, categs); subCategories = getSubCategories(store,category,countProductsByCategories,language,locale); if(subCategories!=null) { cache.putInCache(subCategories, subCategoriesCacheKey.toString()); } else { //cache.putInCache(new Boolean(true), subCategoriesCacheKey.toString()); } //} } } else { countProductsByCategories = getProductsByCategory(store, categs); subCategories = getSubCategories(store,category,countProductsByCategories,language,locale); } //Parent category ReadableCategory parentProxy = null; if(category.getParent()!=null) { Category parent = categoryService.getById(category.getParent().getId(), store.getId()); parentProxy = populator.populate(parent, new ReadableCategory(), store, language); } //** List of manufacturers **// List<ReadableManufacturer> manufacturerList = getManufacturersByProductAndCategory(store,category,categs,language); model.addAttribute("manufacturers", manufacturerList); model.addAttribute("parent", parentProxy); model.addAttribute("category", categoryProxy); model.addAttribute("subCategories", subCategories); if(parentProxy!=null) { request.setAttribute(Constants.LINK_CODE, parentProxy.getDescription().getFriendlyUrl()); } /** template **/ StringBuilder template = new StringBuilder().append(ControllerConstants.Tiles.Category.category).append(".").append(store.getStoreTemplate()); return template.toString(); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2021-33561 - Severity: LOW - CVSS Score: 3.5 Description: xss robustness Function: displayCategory File: sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java Repository: shopizer-ecommerce/shopizer Fixed Code: @SuppressWarnings("unchecked") private String displayCategory(final String friendlyUrl, final String ref, Model model, HttpServletRequest request, HttpServletResponse response, Locale locale) throws Exception { MerchantStore store = (MerchantStore)request.getAttribute(Constants.MERCHANT_STORE); //set ref as request attribute String encoded = HtmlUtils.htmlEscape(ref); if(!encoded.equals(ref)) {//possible xss throw new Exception("Wrong input"); } request.setAttribute("ref", encoded); //get category Category category = categoryService.getBySeUrl(store, friendlyUrl); Language language = (Language)request.getAttribute("LANGUAGE"); if(category==null) { LOGGER.error("No category found for friendlyUrl " + friendlyUrl); //redirect on page not found return PageBuilderUtils.build404(store); } if(!category.isVisible()) { return PageBuilderUtils.buildHomePage(store); } ReadableCategoryPopulator populator = new ReadableCategoryPopulator(); ReadableCategory categoryProxy = populator.populate(category, new ReadableCategory(), store, language); Breadcrumb breadCrumb = breadcrumbsUtils.buildCategoryBreadcrumb(categoryProxy, store, language, request.getContextPath()); request.getSession().setAttribute(Constants.BREADCRUMB, breadCrumb); request.setAttribute(Constants.BREADCRUMB, breadCrumb); //meta information PageInformation pageInformation = new PageInformation(); pageInformation.setPageDescription(categoryProxy.getDescription().getMetaDescription()); pageInformation.setPageKeywords(categoryProxy.getDescription().getKeyWords()); pageInformation.setPageTitle(categoryProxy.getDescription().getTitle()); pageInformation.setPageUrl(categoryProxy.getDescription().getFriendlyUrl()); //** retrieves category id drill down**// String lineage = new StringBuilder().append(category.getLineage()).append(Constants.CATEGORY_LINEAGE_DELIMITER).toString(); request.setAttribute(Constants.REQUEST_PAGE_INFORMATION, pageInformation); List<Category> categs = categoryService.getListByLineage(store, lineage); categs.add(category); StringBuilder subCategoriesCacheKey = new StringBuilder(); subCategoriesCacheKey .append(store.getId()) .append("_") .append(category.getId()) .append("_") .append(Constants.SUBCATEGORIES_CACHE_KEY) .append("-") .append(language.getCode()); StringBuilder subCategoriesMissed = new StringBuilder(); subCategoriesMissed .append(subCategoriesCacheKey.toString()) .append(Constants.MISSED_CACHE_KEY); List<BigDecimal> prices = new ArrayList<BigDecimal>(); List<ReadableCategory> subCategories = null; Map<Long,Long> countProductsByCategories = null; if(store.isUseCache()) { //get from the cache subCategories = (List<ReadableCategory>) cache.getFromCache(subCategoriesCacheKey.toString()); if(subCategories==null) { //get from missed cache //Boolean missedContent = (Boolean)cache.getFromCache(subCategoriesMissed.toString()); //if(missedContent==null) { countProductsByCategories = getProductsByCategory(store, categs); subCategories = getSubCategories(store,category,countProductsByCategories,language,locale); if(subCategories!=null) { cache.putInCache(subCategories, subCategoriesCacheKey.toString()); } else { //cache.putInCache(new Boolean(true), subCategoriesCacheKey.toString()); } //} } } else { countProductsByCategories = getProductsByCategory(store, categs); subCategories = getSubCategories(store,category,countProductsByCategories,language,locale); } //Parent category ReadableCategory parentProxy = null; if(category.getParent()!=null) { Category parent = categoryService.getById(category.getParent().getId(), store.getId()); parentProxy = populator.populate(parent, new ReadableCategory(), store, language); } //** List of manufacturers **// List<ReadableManufacturer> manufacturerList = getManufacturersByProductAndCategory(store,category,categs,language); model.addAttribute("manufacturers", manufacturerList); model.addAttribute("parent", parentProxy); model.addAttribute("category", categoryProxy); model.addAttribute("subCategories", subCategories); if(parentProxy!=null) { request.setAttribute(Constants.LINK_CODE, parentProxy.getDescription().getFriendlyUrl()); } /** template **/ StringBuilder template = new StringBuilder().append(ControllerConstants.Tiles.Category.category).append(".").append(store.getStoreTemplate()); return template.toString(); }
[ "CWE-79" ]
CVE-2021-33561
LOW
3.5
shopizer-ecommerce/shopizer
displayCategory
sm-shop/src/main/java/com/salesmanager/shop/store/controller/category/ShoppingCategoryController.java
197f8c78c8f673b957e41ca2c823afc654c19271
1
Analyze the following code function for security vulnerabilities
protected void filterResponse(QueryResponse response, List<DocumentReference> usersToCheck) { SolrDocumentList results = response.getResults(); long numFound = results.getNumFound(); // Since we are modifying the results collection, we need to iterate over its copy. for (SolrDocument result : new ArrayList<SolrDocument>(results)) { try { DocumentReference resultDocumentReference = this.solrDocumentReferenceResolver.resolve(result); if (!isAllowed(resultDocumentReference, usersToCheck)) { // Remove the current incompatible result. results.remove(result); // Decrement the number of results. numFound--; // FIXME: We should update maxScore as well when removing the top scored item. How do we do that? // Sorting based on score might be a not so expensive option. // FIXME: What about highlighting, facets and all the other data inside the QueryResponse? } } catch (Exception e) { this.logger.warn("Skipping bad result: {}", result, e); } } // Update the new number of results, excluding the filtered ones. if (numFound < 0) { // Lower bound guard for the total number of results. numFound = 0; } results.setNumFound(numFound); }
Vulnerability Classification: - CWE: CWE-285 - CVE: CVE-2023-48241 - Severity: HIGH - CVSS Score: 7.5 Description: XWIKI-21138: Improve Solr query filtering Function: filterResponse File: xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java Repository: xwiki/xwiki-platform Fixed Code: protected void filterResponse(QueryResponse response, List<DocumentReference> usersToCheck) { SolrDocumentList results = response.getResults(); long numResults = results.size(); results.removeIf(result -> { boolean keep = false; try { DocumentReference resultDocumentReference = this.solrDocumentReferenceResolver.resolve(result); keep = isAllowed(resultDocumentReference, usersToCheck); } catch (Exception e) { // Don't take any risk of including a result for which we cannot determine the document reference and // thus cannot determine if the given users have access to it or not. this.logger.warn("Removing bad result: {}", result, e); } // FIXME: We should update maxScore as well when removing the top scored item. How do we do that? // Sorting based on score might be a not so expensive option. // FIXME: What about highlighting, facets and all the other data inside the QueryResponse? return !keep; }); long numFilteredResults = numResults - results.size(); // Update the number of results, excluding the filtered ones. // Lower bound guard for the total number of results. long numFound = Math.max(0, response.getResults().getNumFound() - numFilteredResults); results.setNumFound(numFound); }
[ "CWE-285" ]
CVE-2023-48241
HIGH
7.5
xwiki/xwiki-platform
filterResponse
xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-query/src/main/java/org/xwiki/query/solr/internal/SolrQueryExecutor.java
93b8ec702d7075f0f5794bb05dfb651382596764
1
Analyze the following code function for security vulnerabilities
public void dumpIpClient(FileDescriptor fd, PrintWriter pw, String[] args) { if (mIpClient != null) { // All dumpIpClient does is print this log message. // TODO: consider deleting this, since it's not useful. pw.println("IpClient logs have moved to dumpsys network_stack"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpIpClient File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
dumpIpClient
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private int getHTMLVersion(HTMLCleanerConfiguration configuration) { String param = configuration.getParameters().get(HTMLCleanerConfiguration.HTML_VERSION); int htmlVersion = 4; if ("5".equals(param)) { htmlVersion = 5; } return htmlVersion; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHTMLVersion File: xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java Repository: xwiki/xwiki-commons The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29201
CRITICAL
9
xwiki/xwiki-commons
getHTMLVersion
xwiki-commons-core/xwiki-commons-xml/src/main/java/org/xwiki/xml/internal/html/DefaultHTMLCleaner.java
b11eae9d82cb53f32962056b5faa73f3720c6182
0
Analyze the following code function for security vulnerabilities
private void configureMode() { boolean useSimSecurity = mCurrentSecurityMode == SecurityMode.SimPin || mCurrentSecurityMode == SecurityMode.SimPuk; int mode = KeyguardSecurityContainer.MODE_DEFAULT; if (canDisplayUserSwitcher() && !useSimSecurity) { mode = KeyguardSecurityContainer.MODE_USER_SWITCHER; } else if (canUseOneHandedBouncer()) { mode = KeyguardSecurityContainer.MODE_ONE_HANDED; } mView.initMode(mode, mGlobalSettings, mFalsingManager, mUserSwitcherController); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: configureMode File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21245
HIGH
7.8
android
configureMode
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
a33159e8cb297b9eee6fa5c63c0e343d05fad622
0
Analyze the following code function for security vulnerabilities
public String getFormat() { return this.format != null ? this.format : ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFormat 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
getFormat
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
@Override public void initialize() throws InitializationException { ListenerChain chain = new ListenerChain(); setListenerChain(chain); // Construct the listener chain in the right order. Listeners early in the chain are called before listeners // placed later in the chain. chain.addListener(this); chain.addListener(new BlockStateChainingListener(chain)); chain.addListener(new EmptyBlockChainingListener(chain)); chain.addListener(new MetaDataStateChainingListener(chain)); chain.addListener(new AnnotatedHTML5ChainingRenderer(this.linkRenderer, this.imageRenderer, chain)); }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2023-32070 - Severity: MEDIUM - CVSS Score: 6.1 Description: XRENDERING-663: Restrict allowed attributes in HTML rendering * Change HTML renderers to only print allowed attributes and elements. * Add prefix to forbidden attributes to preserve them in XWiki syntax. * Adapt tests to expect that invalid attributes get a prefix. Function: initialize File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-annotatedhtml5/src/main/java/org/xwiki/rendering/internal/renderer/html5/AnnotatedHTML5Renderer.java Repository: xwiki/xwiki-rendering Fixed Code: @Override public void initialize() throws InitializationException { ListenerChain chain = new ListenerChain(); setListenerChain(chain); // Construct the listener chain in the right order. Listeners early in the chain are called before listeners // placed later in the chain. chain.addListener(this); chain.addListener(new BlockStateChainingListener(chain)); chain.addListener(new EmptyBlockChainingListener(chain)); chain.addListener(new MetaDataStateChainingListener(chain)); chain.addListener(new AnnotatedHTML5ChainingRenderer(this.linkRenderer, this.imageRenderer, this.htmlElementSanitizer, chain)); }
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
initialize
xwiki-rendering-syntaxes/xwiki-rendering-syntax-annotatedhtml5/src/main/java/org/xwiki/rendering/internal/renderer/html5/AnnotatedHTML5Renderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
1
Analyze the following code function for security vulnerabilities
private void migrate100(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Builds.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.addElement("paused").setText("false"); dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate100 File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
migrate100
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public boolean hasManifest() { return manifestFile; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasManifest File: src/main/java/org/olat/fileresource/types/ImsCPFileResource.java Repository: OpenOLAT The code follows secure coding practices.
[ "CWE-22" ]
CVE-2021-39180
HIGH
9
OpenOLAT
hasManifest
src/main/java/org/olat/fileresource/types/ImsCPFileResource.java
699490be8e931af0ef1f135c55384db1f4232637
0
Analyze the following code function for security vulnerabilities
@Override public boolean setApplicationHidden(ComponentName who, String callerPackage, String packageName, boolean hidden, boolean parent) { CallerIdentity caller = getCallerIdentity(who, callerPackage); final int userId = parent ? getProfileParentId(caller.getUserId()) : caller.getUserId(); if (isPolicyEngineForFinanceFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_PACKAGE_STATE, caller.getPackageName(), userId); } else { Preconditions.checkCallAuthorization((caller.hasAdminComponent() && (isProfileOwner(caller) || isDefaultDeviceOwner(caller))) || (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_PACKAGE_ACCESS))); } List<String> exemptApps = listPolicyExemptAppsUnchecked(mContext); if (exemptApps.contains(packageName)) { Slogf.d(LOG_TAG, "setApplicationHidden(): ignoring %s as it's on policy-exempt list", packageName); return false; } boolean result; synchronized (getLockObject()) { if (parent) { if (!isPolicyEngineForFinanceFlagEnabled()) { Preconditions.checkCallAuthorization( isProfileOwnerOfOrganizationOwnedDevice( caller.getUserId()) && isManagedProfile(caller.getUserId())); } // Ensure the package provided is a system package, this is to ensure that this // API cannot be used to leak if certain non-system package exists in the person // profile. mInjector.binderWithCleanCallingIdentity(() -> enforcePackageIsSystemPackage(packageName, userId)); } checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_APPLICATION_HIDDEN); if (VERBOSE_LOG) { Slogf.v(LOG_TAG, "calling pm.setApplicationHiddenSettingAsUser(%s, %b, %d)", packageName, hidden, userId); } if (isPolicyEngineForFinanceFlagEnabled()) { EnforcingAdmin admin = getEnforcingAdminForCaller(who, callerPackage); mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.APPLICATION_HIDDEN(packageName), admin, new BooleanPolicyValue(hidden), userId); result = mInjector.binderWithCleanCallingIdentity(() -> { try { // This is a best effort to continue returning the same value that was // returned before the policy engine migration. return mInjector.getIPackageManager().getPackageInfo( packageName, MATCH_UNINSTALLED_PACKAGES, userId) != null && (mIPackageManager.getApplicationHiddenSettingAsUser( packageName, userId) == hidden); } catch (RemoteException e) { return false; } }); } else { result = mInjector.binderWithCleanCallingIdentity(() -> mIPackageManager .setApplicationHiddenSettingAsUser(packageName, hidden, userId)); } } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_APPLICATION_HIDDEN) .setAdmin(caller.getPackageName()) .setBoolean(/* isDelegate */ isCallerDelegate(caller)) .setStrings(packageName, hidden ? "hidden" : "not_hidden", parent ? CALLED_FROM_PARENT : NOT_CALLED_FROM_PARENT) .write(); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setApplicationHidden 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
setApplicationHidden
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void updatePersistentConfiguration(Configuration values) { updatePersistentConfigurationWithAttribution(values, Settings.getPackageNameForUid(mContext, Binder.getCallingUid()), null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updatePersistentConfiguration File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
updatePersistentConfiguration
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
private int runListFeatures() { try { List<FeatureInfo> list = new ArrayList<FeatureInfo>(); FeatureInfo[] rawList = mPm.getSystemAvailableFeatures(); for (int i=0; i<rawList.length; i++) { list.add(rawList[i]); } // Sort by name Collections.sort(list, new Comparator<FeatureInfo>() { public int compare(FeatureInfo o1, FeatureInfo o2) { if (o1.name == o2.name) return 0; if (o1.name == null) return -1; if (o2.name == null) return 1; return o1.name.compareTo(o2.name); } }); int count = (list != null) ? list.size() : 0; for (int p = 0; p < count; p++) { FeatureInfo fi = list.get(p); System.out.print("feature:"); if (fi.name != null) System.out.println(fi.name); else System.out.println("reqGlEsVersion=0x" + Integer.toHexString(fi.reqGlEsVersion)); } return 0; } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(PM_NOT_RUNNING_ERR); return 1; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runListFeatures File: cmds/pm/src/com/android/commands/pm/Pm.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3833
HIGH
9.3
android
runListFeatures
cmds/pm/src/com/android/commands/pm/Pm.java
4e4743a354e26467318b437892a9980eb9b8328a
0