instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public int getHelpResource() { return R.string.help_url_users; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHelpResource File: src/com/android/settings/users/UserSettings.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3889
HIGH
7.2
android
getHelpResource
src/com/android/settings/users/UserSettings.java
bd5d5176c74021e8cf4970f93f273ba3023c3d72
0
Analyze the following code function for security vulnerabilities
void sendDeviceOwnerOrProfileOwnerCommand(String action, Bundle extras, int userId) { if (userId == UserHandle.USER_ALL) { userId = UserHandle.USER_SYSTEM; } boolean inForeground = false; ComponentName receiverComponent = null; if (action.equals(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE)) { inForeground = true; receiverComponent = resolveDelegateReceiver(DELEGATION_NETWORK_LOGGING, action, userId); } if (action.equals(DeviceAdminReceiver.ACTION_SECURITY_LOGS_AVAILABLE)) { inForeground = true; receiverComponent = resolveDelegateReceiver( DELEGATION_SECURITY_LOGGING, action, userId); } if (receiverComponent == null) { receiverComponent = getOwnerComponent(userId); } sendActiveAdminCommand(action, extras, userId, receiverComponent, inForeground); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendDeviceOwnerOrProfileOwnerCommand 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
sendDeviceOwnerOrProfileOwnerCommand
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override boolean check(PNCounterConfig c1, PNCounterConfig c2) { if (c1 == c2) { return true; } if (c1 == null || c2 == null) { return false; } return nullSafeEqual(c1.getName(), c2.getName()) && c1.getReplicaCount() == c2.getReplicaCount() && nullSafeEqual(c1.getQuorumName(), c2.getQuorumName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: check File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
check
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public T addObject(K name, Object... values) { for (Object value: values) { addObject(name, value); } return thisT(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addObject 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
addObject
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override public ApplicationBasicInfo[] getApplicationBasicInfo(String tenantDomain, String username, String filter, int offset, int limit) throws IdentityApplicationManagementException { ApplicationBasicInfo[] applicationBasicInfoArray; try { startTenantFlow(tenantDomain, username); ApplicationDAO appDAO = ApplicationMgtSystemConfig.getInstance().getApplicationDAO(); if (appDAO instanceof PaginatableFilterableApplicationDAO) { // Invoking pre listeners. Collection<ApplicationMgtListener> listeners = getApplicationMgtListeners(); for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && listener instanceof AbstractApplicationMgtListener && !((AbstractApplicationMgtListener) listener).doPreGetApplicationBasicInfo (tenantDomain, username, filter, offset, limit)) { if (log.isDebugEnabled()) { log.debug("Invoking pre listener: " + listener.getClass().getName()); } return new ApplicationBasicInfo[0]; } } applicationBasicInfoArray = ((PaginatableFilterableApplicationDAO) appDAO). getApplicationBasicInfo(filter, offset, limit); // Invoking post listeners. for (ApplicationMgtListener listener : listeners) { if (listener.isEnable() && listener instanceof AbstractApplicationMgtListener && !((AbstractApplicationMgtListener) listener).doPostGetApplicationBasicInfo (tenantDomain, username, filter, offset, limit, applicationBasicInfoArray)) { if (log.isDebugEnabled()) { log.debug("Invoking post listener: " + listener.getClass().getName()); } return new ApplicationBasicInfo[0]; } } } else { throw new UnsupportedOperationException("Application filtering and pagination not supported in " + appDAO.getClass().getName() + " with tenant domain: " + tenantDomain); } } finally { endTenantFlow(); } return applicationBasicInfoArray; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApplicationBasicInfo File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getApplicationBasicInfo
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@Test public void testDeserializationAsFloatEdgeCase06() throws Exception { // Into the positive zone where everything becomes zero. String input = "1e64"; Instant value = MAPPER.readValue(input, Instant.class); assertEquals(0, value.getEpochSecond()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testDeserializationAsFloatEdgeCase06 File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java Repository: FasterXML/jackson-modules-java8 The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-1000873
MEDIUM
4.3
FasterXML/jackson-modules-java8
testDeserializationAsFloatEdgeCase06
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
0
Analyze the following code function for security vulnerabilities
@NonNull public DevicePolicyResourcesManager getResources() { return mResourcesManager; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResources 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
getResources
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public void setMaxLines(int maxlines) { super.setMaxLines(maxlines); mCurrentMaxLines = maxlines; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setMaxLines File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2015-1261
MEDIUM
5
chromium
setMaxLines
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
0
Analyze the following code function for security vulnerabilities
long getConstructor() { return constructor; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConstructor File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
getConstructor
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public TtyExecable<String, ExecWatch> redirectingErrorChannel() { return readingErrorChannel(new PipedInputStream()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: redirectingErrorChannel 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
redirectingErrorChannel
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
public void draw(Canvas c) { draw(c, null, null, 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: draw File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
draw
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
@Override public CustomResourceType getResourceType() { return CustomResourceType.XGBoost; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceType File: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/model/xgboostjob/XGBoostJob.java Repository: apache/submarine The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-46302
CRITICAL
9.8
apache/submarine
getResourceType
submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/model/xgboostjob/XGBoostJob.java
ed5ad3b824ba388259e0d1ea137d7fca5f0c288e
0
Analyze the following code function for security vulnerabilities
@Override public boolean process(byte value) throws Exception { validateHeaderNameElement(value); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: process File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java Repository: netty The code follows secure coding practices.
[ "CWE-444" ]
CVE-2021-43797
MEDIUM
4.3
netty
process
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
07aa6b5938a8b6ed7a6586e066400e2643897323
0
Analyze the following code function for security vulnerabilities
void noteUidProcessState(final int uid, final int state, final @ProcessCapability int capability) { mBatteryStatsService.noteUidProcessState(uid, state); mAppOpsService.updateUidProcState(uid, state, capability); if (mTrackingAssociations) { for (int i1=0, N1=mAssociations.size(); i1<N1; i1++) { ArrayMap<ComponentName, SparseArray<ArrayMap<String, Association>>> targetComponents = mAssociations.valueAt(i1); for (int i2=0, N2=targetComponents.size(); i2<N2; i2++) { SparseArray<ArrayMap<String, Association>> sourceUids = targetComponents.valueAt(i2); ArrayMap<String, Association> sourceProcesses = sourceUids.get(uid); if (sourceProcesses != null) { for (int i4=0, N4=sourceProcesses.size(); i4<N4; i4++) { Association ass = sourceProcesses.valueAt(i4); if (ass.mNesting >= 1) { // currently associated long uptime = SystemClock.uptimeMillis(); ass.mStateTimes[ass.mLastState-ActivityManager.MIN_PROCESS_STATE] += uptime - ass.mLastStateUptime; ass.mLastState = state; ass.mLastStateUptime = uptime; } } } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: noteUidProcessState 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
noteUidProcessState
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public int getDeviceOwnerUserId() { if (mService != null) { try { return mService.getDeviceOwnerUserId(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } return UserHandle.USER_NULL; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceOwnerUserId 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
getDeviceOwnerUserId
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public boolean getBoolean(K name, boolean defaultValue) { Boolean v = getBoolean(name); return v != null ? v : defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBoolean 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
getBoolean
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
0
Analyze the following code function for security vulnerabilities
@Override protected List<Contentlet> findContentletsByIdentifier(String identifier, Boolean live, Long languageId) throws DotDataException, DotStateException, DotSecurityException { List<Contentlet> cons = new ArrayList<Contentlet>(); StringBuilder queryBuffer = new StringBuilder(); queryBuffer.append("select {contentlet.*} ") .append("from contentlet, inode contentlet_1_, contentlet_version_info contentvi ") .append("where contentlet_1_.type = 'contentlet' and contentlet.inode = contentlet_1_.inode and ") .append("contentvi.identifier=contentlet.identifier and ") .append(((live!=null && live.booleanValue()) ? "contentvi.live_inode":"contentvi.working_inode")) .append(" = contentlet_1_.inode "); if(languageId!=null){ queryBuffer.append(" and contentvi.lang = ? "); } queryBuffer.append(" and contentlet.identifier = ? "); HibernateUtil hu = new HibernateUtil(com.dotmarketing.portlets.contentlet.business.Contentlet.class); hu.setSQLQuery(queryBuffer.toString()); if(languageId!=null){ hu.setParam(languageId.longValue()); } hu.setParam(identifier); List<com.dotmarketing.portlets.contentlet.business.Contentlet> fatties = hu.list(); for (com.dotmarketing.portlets.contentlet.business.Contentlet fatty : fatties) { Contentlet con = convertFatContentletToContentlet(fatty); cc.add(String.valueOf(con.getInode()), con); cons.add(con); } return cons; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findContentletsByIdentifier File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
findContentletsByIdentifier
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@Override public String marshal(DateTime v) throws Exception { if (v == null) { return null; } else { return v.toString(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: marshal File: src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java Repository: steve-community/ocpp-jaxb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-52096
HIGH
7.5
steve-community/ocpp-jaxb
marshal
src/main/java/de/rwth/idsg/ocpp/jaxb/JodaDateTimeConverter.java
13667036f7a30c5e7aca796ef6e2a3b0926c679a
0
Analyze the following code function for security vulnerabilities
@Override public void put(K key, V value, Long expiryInSeconds) { Jedis jedis = jedisPool.getResource(); if (null == expiryInSeconds) { jedis.set(getKey(key), valueSerializer.serialize(value)); } else { jedis.setex(getKey(key), expiryInSeconds, valueSerializer.serialize(value)); } jedis.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: put File: publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-46990
CRITICAL
9.8
sanluan/PublicCMS
put
publiccms-parent/publiccms-cache/src/main/java/com/publiccms/common/redis/RedisCacheEntity.java
c7bf58bf07fdc60a71134c6a73a4947c7709abf7
0
Analyze the following code function for security vulnerabilities
@Override public boolean onUnbind(Intent intent) { ((FileUploaderBinder) mBinder).clearListeners(); return false; // not accepting rebinding (default behaviour) }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUnbind File: src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-732" ]
CVE-2022-24886
LOW
2.1
nextcloud/android
onUnbind
src/main/java/com/owncloud/android/files/services/FileUploader.java
c01fa0b17050cdcf77a468cc22f4071eae29d464
0
Analyze the following code function for security vulnerabilities
public XWikiRCSNodeInfo getRevisionInfo(String version, XWikiContext context) throws XWikiException { return getDocumentArchive(context).getNode(new Version(version)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevisionInfo 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
getRevisionInfo
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
void setIgnored() { mIgnored = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setIgnored File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
setIgnored
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
public void updateSQLXML(@Positive int columnIndex, @Nullable SQLXML xmlObject) throws SQLException { updateValue(columnIndex, xmlObject); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSQLXML File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateSQLXML
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void flushRecentTasks() { mRecentTasks.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flushRecentTasks File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
flushRecentTasks
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public final void update() throws IOException, FileNotFoundException { m_writeLock.lock(); try { doUpdate(); } finally { m_writeLock.unlock(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: update File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java Repository: OpenNMS/opennms The code follows secure coding practices.
[ "CWE-352" ]
CVE-2021-25931
MEDIUM
6.8
OpenNMS/opennms
update
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
607151ea8f90212a3fb37c977fa57c7d58d26a84
0
Analyze the following code function for security vulnerabilities
public String convertUsername(String username, XWikiContext context) { if (username == null) { return null; } if (getConvertingUserNameType(context).equals("1") && (username.indexOf('@') != -1)) { String id = "" + username.hashCode(); id = id.replace("-", ""); if (username.length() > 1) { int i1 = username.indexOf('@'); id = "" + username.charAt(0) + username.substring(i1 + 1, i1 + 2) + username.charAt(username.length() - 1) + id; } return id; } else if (getConvertingUserNameType(context).equals("2")) { return username.replaceAll("[\\.\\@]", "_"); } else { return username; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: convertUsername 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
convertUsername
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
public ServerBuilder withVirtualHost(Consumer<? super VirtualHostBuilder> customizer) { final VirtualHostBuilder virtualHostBuilder = new VirtualHostBuilder(this, false); customizer.accept(virtualHostBuilder); virtualHostBuilders.add(virtualHostBuilder); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: withVirtualHost File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
withVirtualHost
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public synchronized void updateCharacterStream( String columnName, java.io.@Nullable Reader reader, int length) throws SQLException { updateCharacterStream(findColumn(columnName), reader, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateCharacterStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateCharacterStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private void migrate3(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { String name = element.getName(); name = StringUtils.replace(name, "com.pmease.commons", "com.gitplex.commons"); name = StringUtils.replace(name, "com.pmease.gitplex", "com.gitplex.server"); element.setName(name); } if (file.getName().startsWith("Configs.xml")) { for (Element element: dom.getRootElement().elements()) { Element settingElement = element.element("setting"); if (settingElement != null) { String clazz = settingElement.attributeValue("class"); settingElement.addAttribute("class", StringUtils.replace(clazz, "com.pmease.gitplex", "com.gitplex.server")); Element gitConfigElement = settingElement.element("gitConfig"); if (gitConfigElement != null) { clazz = gitConfigElement.attributeValue("class"); gitConfigElement.addAttribute("class", StringUtils.replace(clazz, "com.pmease.gitplex", "com.gitplex.server")); } } } } dom.writeToFile(file, false); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate3 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
migrate3
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
public ComponentName startService(IApplicationThread caller, Intent service, String resolvedType, String callingPackage, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startService File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
startService
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
public boolean apply(XWikiDocument document, boolean clean) { boolean modified = false; // ///////////////////////////////// // Document if (!StringUtils.equals(getContent(), document.getContent())) { setContent(document.getContent()); modified = true; } if (ObjectUtils.notEqual(getSyntax(), document.getSyntax())) { setSyntax(document.getSyntax()); modified = true; } if (ObjectUtils.notEqual(getDefaultLocale(), document.getDefaultLocale())) { setDefaultLocale(document.getDefaultLocale()); modified = true; } if (!StringUtils.equals(getTitle(), document.getTitle())) { setTitle(document.getTitle()); modified = true; } if (!StringUtils.equals(getDefaultTemplate(), document.getDefaultTemplate())) { setDefaultTemplate(document.getDefaultTemplate()); modified = true; } if (ObjectUtils.notEqual(getRelativeParentReference(), document.getRelativeParentReference())) { setParentReference(document.getRelativeParentReference()); modified = true; } if (!StringUtils.equals(getCustomClass(), document.getCustomClass())) { setCustomClass(document.getCustomClass()); modified = true; } if (!StringUtils.equals(getValidationScript(), document.getValidationScript())) { setValidationScript(document.getValidationScript()); modified = true; } if (isHidden() != document.isHidden()) { setHidden(document.isHidden()); modified = true; } // ///////////////////////////////// // XObjects if (clean) { // Delete objects that don't exist anymore for (List<BaseObject> objects : getXObjects().values()) { // Duplicate the list since we are potentially going to modify it for (BaseObject originalObj : new ArrayList<BaseObject>(objects)) { if (originalObj != null) { BaseObject newObj = document.getXObject(originalObj.getXClassReference(), originalObj.getNumber()); if (newObj == null) { // The object was deleted removeXObject(originalObj); modified = true; } } } } } // Add new objects or update existing objects for (List<BaseObject> objects : document.getXObjects().values()) { for (BaseObject newObj : objects) { if (newObj != null) { BaseObject originalObj = getXObject(newObj.getXClassReference(), newObj.getNumber()); if (originalObj == null) { // The object added or modified setXObject(newObj.getNumber(), newObj); modified = true; } else { // The object added or modified modified |= originalObj.apply(newObj, clean); } } } } // ///////////////////////////////// // XClass modified |= getXClass().apply(document.getXClass(), clean); if (ObjectUtils.notEqual(getXClassXML(), document.getXClassXML())) { setXClassXML(document.getXClassXML()); modified = true; } // ///////////////////////////////// // Attachments if (clean) { // Delete attachments that don't exist anymore for (XWikiAttachment attachment : new ArrayList<XWikiAttachment>(getAttachmentList())) { if (document.getAttachment(attachment.getFilename()) == null) { removeAttachment(attachment); } } } // Add new attachments or update existing attachments for (XWikiAttachment attachment : document.getAttachmentList()) { XWikiAttachment originalAttachment = getAttachment(attachment.getFilename()); if (originalAttachment == null) { addAttachment(attachment); } else { originalAttachment.apply(attachment); } } return modified; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply 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
apply
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 isOemPaid() { return mIsOemPaid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isOemPaid File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
isOemPaid
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
@Override public boolean unlockUser(int userId, byte[] token, byte[] secret, IProgressListener listener) { return mUserController.unlockUser(userId, token, secret, listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unlockUser 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
unlockUser
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public String link() { return "link"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: link File: web/src/main/java/com/zrlog/web/controller/blog/ArticleController.java Repository: 94fzb/zrlog The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21316
MEDIUM
4.3
94fzb/zrlog
link
web/src/main/java/com/zrlog/web/controller/blog/ArticleController.java
b921c1ae03b8290f438657803eee05226755c941
0
Analyze the following code function for security vulnerabilities
public static ObjectNode parse( final TomlFactory tomlFactory, final IOContext ioContext, final Reader reader ) throws IOException { final TomlFactory factory = tomlFactory == null ? new TomlFactory() : tomlFactory; Parser parser = new Parser(factory, ioContext, new TomlStreamReadException.ErrorContext(ioContext.contentReference(), null), factory.getFormatParserFeatures(), reader); try { return parser.parse(); } finally { parser.lexer.releaseBuffers(); } }
Vulnerability Classification: - CWE: CWE-787 - CVE: CVE-2023-3894 - Severity: HIGH - CVSS Score: 7.5 Description: validate nesting depth goes back tp zero Function: parse File: toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java Repository: FasterXML/jackson-dataformats-text Fixed Code: public static ObjectNode parse( final TomlFactory tomlFactory, final IOContext ioContext, final Reader reader ) throws IOException { final TomlFactory factory = tomlFactory == null ? new TomlFactory() : tomlFactory; Parser parser = new Parser(factory, ioContext, new TomlStreamReadException.ErrorContext(ioContext.contentReference(), null), factory.getFormatParserFeatures(), reader); try { return parser.parse(); } finally { if (factory.isEnabled(TomlReadFeature.VALIDATE_NESTING_DEPTH) && parser.getNestingDepth() > 0) { throw new IOException("Nesting Depth is non-zero after parsing TOML"); } parser.lexer.releaseBuffers(); } }
[ "CWE-787" ]
CVE-2023-3894
HIGH
7.5
FasterXML/jackson-dataformats-text
parse
toml/src/main/java/com/fasterxml/jackson/dataformat/toml/Parser.java
6f2f87f94d53fe440afd353b74c07ffa97d9888f
1
Analyze the following code function for security vulnerabilities
@Override public String getRemoteHost() { return connInfo.host; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRemoteHost 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
getRemoteHost
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
94fcc960e0fb198ddec0f7efc53f95ac627fe083
0
Analyze the following code function for security vulnerabilities
@GET @Path("query/distributions/{cohortId}/{sourceKey}") @Produces(MediaType.APPLICATION_JSON) public List<DistributionStat> getCohortFeatureDistributionStats( @PathParam("cohortId") final long cohortId, @PathParam("sourceKey") final String sourceKey, @QueryParam("searchTerm") final String searchTerm, @QueryParam("analysisId") final List<String> analysisIds, @QueryParam("timeWindow") final List<String> timeWindows, @QueryParam("domain") final List<String> domains ) { List<String> criteriaClauses = buildCriteriaClauses(searchTerm, analysisIds, timeWindows, domains); Source source = getSourceRepository().findBySourceKey(sourceKey); String resultsSchema = source.getTableQualifier(SourceDaimon.DaimonType.Results); String cdmSchema = source.getTableQualifier(SourceDaimon.DaimonType.CDM); String continuousQuery = SqlRender.renderSql( QUERY_COVARIATE_DIST, new String[]{"cdm_database_schema", "cdm_results_schema", "cohort_definition_id", "criteria_clauses"}, new String[]{cdmSchema, resultsSchema, Long.toString(cohortId), criteriaClauses.isEmpty() ? "" : " AND\n" + StringUtils.join(criteriaClauses, "\n AND ")} ); String translatedSql = SqlTranslate.translateSql(continuousQuery, source.getSourceDialect(), SessionUtils.sessionId(), resultsSchema); List<DistributionStat> distStats = this.getSourceJdbcTemplate(source).query(translatedSql, (rs, rowNum) -> { DistributionStat mappedRow = new DistributionStat() { { covariateId = rs.getLong("covariate_id"); covariateName = rs.getString("covariate_name"); analysisId = rs.getLong("analysis_id"); analysisName = getAnalysisName( rs.getString("analysis_name"), rs.getString("domain_id")); domainId = rs.getString("domain_id"); timeWindow = getTimeWindow(rs.getString("analysis_name")); conceptId = rs.getLong("concept_id"); countValue = rs.getLong("count_value"); avgValue = new BigDecimal(rs.getDouble("average_value")).setScale(5, RoundingMode.DOWN); stdevValue = new BigDecimal(rs.getDouble("standard_deviation")).setScale(5, RoundingMode.DOWN); minValue = rs.getLong("min_value"); p10Value = rs.getLong("p10_value"); p25Value = rs.getLong("p25_value"); medianValue = rs.getLong("median_value"); p75Value = rs.getLong("p75_value"); p90Value = rs.getLong("p90_value"); maxValue = rs.getLong("max_value"); } }; return mappedRow; }); return distStats; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCohortFeatureDistributionStats File: src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java Repository: OHDSI/WebAPI The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15563
HIGH
7.5
OHDSI/WebAPI
getCohortFeatureDistributionStats
src/main/java/org/ohdsi/webapi/service/FeatureExtractionService.java
b3944074a1976c95d500239cbbf0741917ed75ca
0
Analyze the following code function for security vulnerabilities
public long getStartTime() { return _startTime; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStartTime File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
getStartTime
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
protected int load(int offset) throws IOException { if (DEBUG_BUFFER) { debugBufferIfNeeded("(load: "); } // resize buffer, if needed if (offset == buffer.length) { int adjust = buffer.length / 4; char[] array = new char[buffer.length + adjust]; System.arraycopy(buffer, 0, array, 0, length); buffer = array; } // read a block of characters int count = stream_.read(buffer, offset, buffer.length - offset); if (count == -1) { endReached_ = true; } length = count != -1 ? count + offset : offset; this.offset = offset; if (DEBUG_BUFFER) { debugBufferIfNeeded(")load: ", " -> " + count); } return count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: load File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
load
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
public static String generateSourceID(String siteURL) { if ((siteURL == null) || (siteURL.length() == 0)) { SAMLUtils.debug.error("SAMLUtils.genrateSourceID: empty siteURL."); return null; } MessageDigest md = null; try { md = MessageDigest.getInstance("SHA"); } catch (Exception e) { SAMLUtils.debug.error("SAMLUtils.generateSourceID: Exception when" + " generating digest:",e); return null; } md.update(SAMLUtils.stringToByteArray(siteURL)); byte byteResult[] = md.digest(); String result = null; try { result = Base64.encode(byteResult).trim(); } catch (Exception e) { SAMLUtils.debug.error("SAMLUtils.generateSourceID: Exception:",e); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generateSourceID File: openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java Repository: OpenIdentityPlatform/OpenAM The code follows secure coding practices.
[ "CWE-287" ]
CVE-2023-37471
CRITICAL
9.8
OpenIdentityPlatform/OpenAM
generateSourceID
openam-federation/openam-federation-library/src/main/java/com/sun/identity/saml/common/SAMLUtils.java
7c18543d126e8a567b83bb4535631825aaa9d742
0
Analyze the following code function for security vulnerabilities
@Override public KeyEvent dispatchUnhandledKey(WindowState win, KeyEvent event, int policyFlags) { // Note: This method is only called if the initial down was unhandled. if (DEBUG_INPUT) { Slog.d(TAG, "Unhandled key: win=" + win + ", action=" + event.getAction() + ", flags=" + event.getFlags() + ", keyCode=" + event.getKeyCode() + ", scanCode=" + event.getScanCode() + ", metaState=" + event.getMetaState() + ", repeatCount=" + event.getRepeatCount() + ", policyFlags=" + policyFlags); } KeyEvent fallbackEvent = null; if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) { final KeyCharacterMap kcm = event.getKeyCharacterMap(); final int keyCode = event.getKeyCode(); final int metaState = event.getMetaState(); final boolean initialDown = event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0; // Check for fallback actions specified by the key character map. final FallbackAction fallbackAction; if (initialDown) { fallbackAction = kcm.getFallbackAction(keyCode, metaState); } else { fallbackAction = mFallbackActions.get(keyCode); } if (fallbackAction != null) { if (DEBUG_INPUT) { Slog.d(TAG, "Fallback: keyCode=" + fallbackAction.keyCode + " metaState=" + Integer.toHexString(fallbackAction.metaState)); } final int flags = event.getFlags() | KeyEvent.FLAG_FALLBACK; fallbackEvent = KeyEvent.obtain( event.getDownTime(), event.getEventTime(), event.getAction(), fallbackAction.keyCode, event.getRepeatCount(), fallbackAction.metaState, event.getDeviceId(), event.getScanCode(), flags, event.getSource(), null); if (!interceptFallback(win, fallbackEvent, policyFlags)) { fallbackEvent.recycle(); fallbackEvent = null; } if (initialDown) { mFallbackActions.put(keyCode, fallbackAction); } else if (event.getAction() == KeyEvent.ACTION_UP) { mFallbackActions.remove(keyCode); fallbackAction.recycle(); } } } if (DEBUG_INPUT) { if (fallbackEvent == null) { Slog.d(TAG, "No fallback."); } else { Slog.d(TAG, "Performing fallback: " + fallbackEvent); } } return fallbackEvent; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispatchUnhandledKey File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
dispatchUnhandledKey
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
public void clearLastSelectedNetwork() { if (mVerboseLoggingEnabled) { Log.v(TAG, "Clearing last selected network"); } mLastSelectedNetworkId = WifiConfiguration.INVALID_NETWORK_ID; mLastSelectedTimeStamp = NetworkSelectionStatus.INVALID_NETWORK_SELECTION_DISABLE_TIMESTAMP; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearLastSelectedNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
clearLastSelectedNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void badRequest(final BadRequestException exception) { logWarn("Bad Request on " + request().getUri() + ": " + exception.getMessage()); if (this.api_version > 0) { // always default to the latest version of the error formatter since we // need to return something switch (this.api_version) { case 1: default: sendReply(exception.getStatus(), serializer.formatErrorV1(exception)); } return; } if (hasQueryStringParam("json")) { final StringBuilder buf = new StringBuilder(10 + exception.getDetails().length()); buf.append("{\"err\":\""); HttpQuery.escapeJson(exception.getMessage(), buf); buf.append("\"}"); sendReply(HttpResponseStatus.BAD_REQUEST, buf); } else { sendReply(HttpResponseStatus.BAD_REQUEST, makePage("Bad Request", "Looks like it's your fault this time", "<blockquote>" + "<h1>Bad Request</h1>" + "Sorry but your request was rejected as being" + " invalid.<br/><br/>" + "The reason provided was:<blockquote>" + exception.getMessage() + "</blockquote></blockquote>")); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2023-36812 - Severity: CRITICAL - CVSS Score: 9.8 Description: Fix for #2269 and #2267 XSS vulnerability. Escaping the user supplied input when outputing the HTML for the old BadRequest HTML handlers should help. Thanks to the reporters. Fixes CVE-2018-13003. Function: badRequest File: src/tsd/HttpQuery.java Repository: OpenTSDB/opentsdb Fixed Code: @Override public void badRequest(final BadRequestException exception) { logWarn("Bad Request on " + request().getUri() + ": " + exception.getMessage()); if (this.api_version > 0) { // always default to the latest version of the error formatter since we // need to return something switch (this.api_version) { case 1: default: sendReply(exception.getStatus(), serializer.formatErrorV1(exception)); } return; } if (hasQueryStringParam("json")) { final StringBuilder buf = new StringBuilder(10 + exception.getDetails().length()); buf.append("{\"err\":\""); HttpQuery.escapeJson(exception.getMessage(), buf); buf.append("\"}"); sendReply(HttpResponseStatus.BAD_REQUEST, buf); } else { String response = ""; if (exception.getMessage() != null) { response = HtmlEscapers.htmlEscaper().escape(exception.getMessage()); } sendReply(HttpResponseStatus.BAD_REQUEST, makePage("Bad Request", "Looks like it's your fault this time", "<blockquote>" + "<h1>Bad Request</h1>" + "Sorry but your request was rejected as being" + " invalid.<br/><br/>" + "The reason provided was:<blockquote>" + response + "</blockquote></blockquote>")); } }
[ "CWE-74" ]
CVE-2023-36812
CRITICAL
9.8
OpenTSDB/opentsdb
badRequest
src/tsd/HttpQuery.java
fa88d3e4b5369f9fb73da384fab0b23e246309ba
1
Analyze the following code function for security vulnerabilities
@Override public boolean getCrossProfileContactsSearchDisabled(ComponentName who) { if (!mHasFeature) { return false; } Objects.requireNonNull(who, "ComponentName is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isProfileOwner(caller)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId()); if (admin == null) { return false; } if (admin.mManagedProfileContactsAccess == null) { return admin.disableContactsSearch; } return admin.mManagedProfileContactsAccess.getPolicyType() != PackagePolicy.PACKAGE_POLICY_BLOCKLIST; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCrossProfileContactsSearchDisabled 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
getCrossProfileContactsSearchDisabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") private void dumpForUserLocked(int userId, PrintWriter pw) { if (userId == UserHandle.USER_SYSTEM) { pw.println("CONFIG SETTINGS (user " + userId + ")"); SettingsState configSettings = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_CONFIG, UserHandle.USER_SYSTEM); if (configSettings != null) { dumpSettingsLocked(configSettings, pw); pw.println(); configSettings.dumpHistoricalOperations(pw); } pw.println("GLOBAL SETTINGS (user " + userId + ")"); SettingsState globalSettings = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM); if (globalSettings != null) { dumpSettingsLocked(globalSettings, pw); pw.println(); globalSettings.dumpHistoricalOperations(pw); } } pw.println("SECURE SETTINGS (user " + userId + ")"); SettingsState secureSettings = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_SECURE, userId); if (secureSettings != null) { dumpSettingsLocked(secureSettings, pw); pw.println(); secureSettings.dumpHistoricalOperations(pw); } pw.println("SYSTEM SETTINGS (user " + userId + ")"); SettingsState systemSettings = mSettingsRegistry.getSettingsLocked( SETTINGS_TYPE_SYSTEM, userId); if (systemSettings != null) { dumpSettingsLocked(systemSettings, pw); pw.println(); systemSettings.dumpHistoricalOperations(pw); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpForUserLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
dumpForUserLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
final void broadcastTimeoutLocked(boolean fromMsg) { if (fromMsg) { mPendingBroadcastTimeoutMessage = false; } if (mOrderedBroadcasts.size() == 0) { return; } long now = SystemClock.uptimeMillis(); BroadcastRecord r = mOrderedBroadcasts.get(0); if (fromMsg) { if (mService.mDidDexOpt) { // Delay timeouts until dexopt finishes. mService.mDidDexOpt = false; long timeoutTime = SystemClock.uptimeMillis() + mTimeoutPeriod; setBroadcastTimeoutLocked(timeoutTime); return; } if (!mService.mProcessesReady) { // Only process broadcast timeouts if the system is ready. That way // PRE_BOOT_COMPLETED broadcasts can't timeout as they are intended // to do heavy lifting for system up. return; } long timeoutTime = r.receiverTime + mTimeoutPeriod; if (timeoutTime > now) { // We can observe premature timeouts because we do not cancel and reset the // broadcast timeout message after each receiver finishes. Instead, we set up // an initial timeout then kick it down the road a little further as needed // when it expires. if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Premature timeout [" + mQueueName + "] @ " + now + ": resetting BROADCAST_TIMEOUT_MSG for " + timeoutTime); setBroadcastTimeoutLocked(timeoutTime); return; } } BroadcastRecord br = mOrderedBroadcasts.get(0); if (br.state == BroadcastRecord.WAITING_SERVICES) { // In this case the broadcast had already finished, but we had decided to wait // for started services to finish as well before going on. So if we have actually // waited long enough time timeout the broadcast, let's give up on the whole thing // and just move on to the next. Slog.i(TAG, "Waited long enough for: " + (br.curComponent != null ? br.curComponent.flattenToShortString() : "(null)")); br.curComponent = null; br.state = BroadcastRecord.IDLE; processNextBroadcast(false); return; } Slog.w(TAG, "Timeout of broadcast " + r + " - receiver=" + r. receiver + ", started " + (now - r.receiverTime) + "ms ago"); r.receiverTime = now; r.anrCount++; // Current receiver has passed its expiration date. if (r.nextReceiver <= 0) { Slog.w(TAG, "Timeout on receiver with nextReceiver <= 0"); return; } ProcessRecord app = null; String anrMessage = null; Object curReceiver = r.receivers.get(r.nextReceiver-1); r.delivery[r.nextReceiver-1] = BroadcastRecord.DELIVERY_TIMEOUT; Slog.w(TAG, "Receiver during timeout: " + curReceiver); logBroadcastReceiverDiscardLocked(r); if (curReceiver instanceof BroadcastFilter) { BroadcastFilter bf = (BroadcastFilter)curReceiver; if (bf.receiverList.pid != 0 && bf.receiverList.pid != ActivityManagerService.MY_PID) { synchronized (mService.mPidsSelfLocked) { app = mService.mPidsSelfLocked.get( bf.receiverList.pid); } } } else { app = r.curApp; } if (app != null) { anrMessage = "Broadcast of " + r.intent.toString(); } if (mPendingBroadcast == r) { mPendingBroadcast = null; } // Move on to the next receiver. finishReceiverLocked(r, r.resultCode, r.resultData, r.resultExtras, r.resultAbort, false); scheduleBroadcastsLocked(); if (anrMessage != null) { // Post the ANR to the handler since we do not want to process ANRs while // potentially holding our lock. mHandler.post(new AppNotResponding(app, anrMessage)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastTimeoutLocked File: services/core/java/com/android/server/am/BroadcastQueue.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
broadcastTimeoutLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
private URLConfiguration getURLConfiguration() { if (this.urlConfiguration == null) { this.urlConfiguration = Utils.getComponent(URLConfiguration.class); } return this.urlConfiguration; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURLConfiguration 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
getURLConfiguration
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private void updateSplitLayout() { if (!mIsEmbeddingActivityEnabled) { return; } if (mIsTwoPane) { if (mIsRegularLayout == ActivityEmbeddingUtils.isRegularHomepageLayout(this)) { // Layout unchanged return; } } else if (mIsRegularLayout) { // One pane mode with the regular layout, not needed to change return; } mIsRegularLayout = !mIsRegularLayout; // Update search title padding View searchTitle = findViewById(R.id.search_bar_title); if (searchTitle != null) { int paddingStart = getResources().getDimensionPixelSize( mIsRegularLayout ? R.dimen.search_bar_title_padding_start_regular_two_pane : R.dimen.search_bar_title_padding_start); searchTitle.setPaddingRelative(paddingStart, 0, 0, 0); } // Notify fragments getSupportFragmentManager().getFragments().forEach(fragment -> { if (fragment instanceof SplitLayoutListener) { ((SplitLayoutListener) fragment).onSplitLayoutChanged(mIsRegularLayout); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateSplitLayout File: src/com/android/settings/homepage/SettingsHomepageActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21256
HIGH
7.8
android
updateSplitLayout
src/com/android/settings/homepage/SettingsHomepageActivity.java
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
0
Analyze the following code function for security vulnerabilities
public Builder setRequestInitializer(HttpRequestInitializer requestInitializer) { this.requestInitializer = requestInitializer; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRequestInitializer File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java Repository: googleapis/google-oauth-java-client The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-7692
MEDIUM
6.4
googleapis/google-oauth-java-client
setRequestInitializer
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
13433cd7dd06267fc261f0b1d4764f8e3432c824
0
Analyze the following code function for security vulnerabilities
void startRunningVoiceLocked(IVoiceInteractionSession session, int targetUid) { Slog.d(TAG, "<<< startRunningVoiceLocked()"); mVoiceWakeLock.setWorkSource(new WorkSource(targetUid)); if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) { boolean wasRunningVoice = mRunningVoice != null; mRunningVoice = session; if (!wasRunningVoice) { mVoiceWakeLock.acquire(); updateSleepIfNeededLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startRunningVoiceLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3912
HIGH
9.3
android
startRunningVoiceLocked
services/core/java/com/android/server/am/ActivityManagerService.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
public List<ValidationError> globalErrors() { return Collections.unmodifiableList( errors.stream().filter(error -> error.key().isEmpty()).collect(Collectors.toList())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: globalErrors File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
globalErrors
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
public void create(String tenantKey) { final StopWatch stopWatch = createStarted(); log.info("START - SETUP:CreateTenant:schema tenantKey: {}", tenantKey); try { DatabaseUtil.createSchema(dataSource, tenantKey); log.info("STOP - SETUP:CreateTenant:schema tenantKey: {}, result: OK, time = {} ms", tenantKey, stopWatch.getTime()); } catch (Exception e) { log.info("STOP - SETUP:CreateTenant:schema tenantKey: {}, result: FAIL, error: {}, time = {} ms", tenantKey, e.getMessage(), stopWatch.getTime()); throw e; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java Repository: xm-online/xm-uaa The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15557
HIGH
7.5
xm-online/xm-uaa
create
src/main/java/com/icthh/xm/uaa/service/tenant/TenantDatabaseService.java
ffa9609c809c17e7a39ae1d92843c4463e3ca739
0
Analyze the following code function for security vulnerabilities
public static boolean isConfigForOweNetwork(WifiConfiguration config) { return config.isSecurityType(WifiConfiguration.SECURITY_TYPE_OWE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isConfigForOweNetwork File: service/java/com/android/server/wifi/WifiConfigurationUtil.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21252
MEDIUM
5.5
android
isConfigForOweNetwork
service/java/com/android/server/wifi/WifiConfigurationUtil.java
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
0
Analyze the following code function for security vulnerabilities
private void logAddAccountMetrics( String callerPackage, String accountType, String[] requiredFeatures, String authTokenType) { // Although this is not a 'device policy' API, enterprise is the current use case. DevicePolicyEventLogger .createEvent(DevicePolicyEnums.ADD_ACCOUNT) .setStrings( TextUtils.emptyIfNull(accountType), TextUtils.emptyIfNull(callerPackage), TextUtils.emptyIfNull(authTokenType), requiredFeatures == null ? "" : TextUtils.join(";", requiredFeatures)) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logAddAccountMetrics File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
logAddAccountMetrics
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public void scanQRCode(ScanResult callback) { if (getActivity() == null) { return; } if (getActivity() instanceof CodenameOneActivity) { ((CodenameOneActivity) getActivity()).setIntentResultListener(this); } this.callback = callback; IntentIntegrator in = new IntentIntegrator(getActivity()); if(!in.initiateScan(IntentIntegrator.QR_CODE_TYPES, "QR_CODE_MODE")){ // restore old activity handling Display.getInstance().callSerially(new Runnable() { @Override public void run() { if(CodeScannerImpl.this != null && CodeScannerImpl.this.callback != null) { CodeScannerImpl.this.callback.scanError(-1, "no scan app"); CodeScannerImpl.this.callback = null; } } }); if (getActivity() instanceof CodenameOneActivity) { ((CodenameOneActivity) getActivity()).restoreIntentResultListener(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: scanQRCode 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
scanQRCode
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Deprecated private void requestBugReportWithDescription(String shareTitle, String shareDescription, int bugreportType) { if (!TextUtils.isEmpty(shareTitle)) { if (shareTitle.length() > MAX_BUGREPORT_TITLE_SIZE) { String errorStr = "shareTitle should be less than " + MAX_BUGREPORT_TITLE_SIZE + " characters"; throw new IllegalArgumentException(errorStr); } else { if (!TextUtils.isEmpty(shareDescription)) { int length; try { length = shareDescription.getBytes("UTF-8").length; } catch (UnsupportedEncodingException e) { String errorStr = "shareDescription: UnsupportedEncodingException"; throw new IllegalArgumentException(errorStr); } if (length > SystemProperties.PROP_VALUE_MAX) { String errorStr = "shareTitle should be less than " + SystemProperties.PROP_VALUE_MAX + " bytes"; throw new IllegalArgumentException(errorStr); } else { SystemProperties.set("dumpstate.options.description", shareDescription); } } SystemProperties.set("dumpstate.options.title", shareTitle); } } Slog.d(TAG, "Bugreport notification title " + shareTitle + " description " + shareDescription); requestBugReport(bugreportType); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestBugReportWithDescription 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
requestBugReportWithDescription
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public long getMaxHttpUploadSize(Conversation conversation) { final XmppConnection connection = conversation.getAccount().getXmppConnection(); return connection == null ? -1 : connection.getFeatures().getMaxHttpUploadSize(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMaxHttpUploadSize File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java Repository: iNPUTmice/Conversations The code follows secure coding practices.
[ "CWE-200" ]
CVE-2018-18467
MEDIUM
5
iNPUTmice/Conversations
getMaxHttpUploadSize
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
7177c523a1b31988666b9337249a4f1d0c36f479
0
Analyze the following code function for security vulnerabilities
@Override public DOMConfiguration getDomConfig() { return doc.getDomConfig(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDomConfig File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java Repository: LoboEvolution The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000540
MEDIUM
6.8
LoboEvolution
getDomConfig
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
void stopDtmfTone(Call call) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("stopDtmfTone")) { try { logOutgoing("stopDtmfTone %s", callId); mServiceInterface.stopDtmfTone(callId, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopDtmfTone File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
stopDtmfTone
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
private void load(Dependency dependency) throws LoadFailureException { try { classLoader.addURL(dragonfly.getDirectory().resolve(dependency.getFileName()).toUri().toURL()); } catch (MalformedURLException ex) { throw new LoadFailureException(ex); } }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2022-41967 - Severity: HIGH - CVSS Score: 7.5 Description: fix: CVE-2022-41967 Dragonfly v0.3.0-SNAPSHOT fails to properly configure the DocumentBuilderFactory to prevent XML enternal entity (XXE) attacks when parsing maven-metadata.xml files provided by external Maven repositories during "SNAPSHOT" version resolution. This patches CVE-2022-41967 by disabling features which may lead to XXE. If you are currently using v0.3.0-SNAPSHOT it is STRONGLY advised to update Dragonfly to v0.3.1-SNAPSHOT just to be safe. Function: load File: src/main/java/dev/hypera/dragonfly/loading/DependencyLoader.java Repository: HyperaDev/Dragonfly Fixed Code: private void load(@NotNull Dependency dependency) throws LoadFailureException { try { classLoader.addURL(dragonfly.getDirectory().resolve(dependency.getFileName()).toUri().toURL()); } catch (MalformedURLException ex) { throw new LoadFailureException(ex); } }
[ "CWE-611" ]
CVE-2022-41967
HIGH
7.5
HyperaDev/Dragonfly
load
src/main/java/dev/hypera/dragonfly/loading/DependencyLoader.java
9661375e1135127ca6cdb5712e978bec33cc06b3
1
Analyze the following code function for security vulnerabilities
private void showSaverNotification() { final Notification.Builder nb = new Notification.Builder(mContext) .setSmallIcon(R.drawable.ic_power_saver) .setContentTitle(mContext.getString(R.string.battery_saver_notification_title)) .setContentText(mContext.getString(R.string.battery_saver_notification_text)) .setOngoing(true) .setShowWhen(false) .setVisibility(Notification.VISIBILITY_PUBLIC) .setColor(mContext.getColor( com.android.internal.R.color.battery_saver_mode_color)); addStopSaverAction(nb); if (hasSaverSettings()) { nb.setContentIntent(pendingActivity(mOpenSaverSettings)); } mNoMan.notifyAsUser(TAG_NOTIFICATION, R.id.notification_power, nb.build(), UserHandle.ALL); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: showSaverNotification File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3854
MEDIUM
5
android
showSaverNotification
packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
05e0705177d2078fa9f940ce6df723312cfab976
0
Analyze the following code function for security vulnerabilities
void clearIntentFilterVerificationsLPw(String packageName, int userId) { if (userId == UserHandle.USER_ALL) { if (mSettings.removeIntentFilterVerificationLPw(packageName, sUserManager.getUserIds())) { for (int oneUserId : sUserManager.getUserIds()) { scheduleWritePackageRestrictionsLocked(oneUserId); } } } else { if (mSettings.removeIntentFilterVerificationLPw(packageName, userId)) { scheduleWritePackageRestrictionsLocked(userId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearIntentFilterVerificationsLPw File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
clearIntentFilterVerificationsLPw
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public boolean isHasLanguages() { return recordLanguages != null && !recordLanguages.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHasLanguages File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java Repository: intranda/goobi-viewer-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29014
MEDIUM
6.1
intranda/goobi-viewer-core
isHasLanguages
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@NonNull public String getAttributeName(int index) { final int id = nativeGetAttributeName(mParseState, index); if (DEBUG) System.out.println("getAttributeName of " + index + " = " + id); if (id == ERROR_NULL_DOCUMENT) { throw new NullPointerException("Null document"); } if (id >= 0) return getSequenceString(mStrings.getSequence(id)); throw new IndexOutOfBoundsException(String.valueOf(index)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAttributeName 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
getAttributeName
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@TestApi public boolean shouldShowForegroundImmediately() { // Has the app demanded immediate display? if (mFgsDeferBehavior == FOREGROUND_SERVICE_IMMEDIATE) { return true; } // Has the app demanded deferred display? if (mFgsDeferBehavior == FOREGROUND_SERVICE_DEFERRED) { return false; } // We show these sorts of notifications immediately in the absence of // any explicit app declaration if (isMediaNotification() || CATEGORY_CALL.equals(category) || CATEGORY_NAVIGATION.equals(category) || (actions != null && actions.length > 0)) { return true; } // No extenuating circumstances: defer visibility return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldShowForegroundImmediately File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
shouldShowForegroundImmediately
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
static void setPlotParams(final HttpQuery query, final Plot plot) { final HashMap<String, String> params = new HashMap<String, String>(); final Map<String, List<String>> querystring = query.getQueryString(); String value; if ((value = popParam(querystring, "yrange")) != null) { if (!RANGE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'yrange' was invalid. " + "Must be in the format [min:max]."); } params.put("yrange", value); } if ((value = popParam(querystring, "y2range")) != null) { if (!RANGE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2range' was invalid. " + "Must be in the format [min:max]."); } params.put("y2range", value); } if ((value = popParam(querystring, "ylabel")) != null) { if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'ylabel' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("ylabel", stringify(value)); } if ((value = popParam(querystring, "y2label")) != null) { if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2label' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("y2label", stringify(value)); } if ((value = popParam(querystring, "yformat")) != null) { if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'yformat' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format y", stringify(value)); } if ((value = popParam(querystring, "y2format")) != null) { if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2format' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format y2", stringify(value)); } if ((value = popParam(querystring, "xformat")) != null) { if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'xformat' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format x", stringify(value)); } if ((value = popParam(querystring, "ylog")) != null) { params.put("logscale y", ""); } if ((value = popParam(querystring, "y2log")) != null) { params.put("logscale y2", ""); } if ((value = popParam(querystring, "key")) != null) { if (!KEY_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'key' was invalid. Must " + "satisfy the pattern " + KEY_VALIDATOR.toString()); } params.put("key", value); } if ((value = popParam(querystring, "title")) != null) { if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'title' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("title", stringify(value)); } if ((value = popParam(querystring, "bgcolor")) != null) { if (!COLOR_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'bgcolor' was invalid. Must " + "be a hex value e.g. 'xFFFFFF'"); } params.put("bgcolor", value); } if ((value = popParam(querystring, "fgcolor")) != null) { if (!COLOR_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'fgcolor' was invalid. Must " + "be a hex value e.g. 'xFFFFFF'"); } params.put("fgcolor", value); } if ((value = popParam(querystring, "smooth")) != null) { if (!SMOOTH_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'smooth' was invalid. Must " + "satisfy the pattern " + SMOOTH_VALIDATOR.toString()); } params.put("smooth", value); } if ((value = popParam(querystring, "style")) != null) { if (!STYLE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'style' was invalid. Must " + "satisfy the pattern " + STYLE_VALIDATOR.toString()); } params.put("style", value); } // This must remain after the previous `if' in order to properly override // any previous `key' parameter if a `nokey' parameter is given. if ((value = popParam(querystring, "nokey")) != null) { params.put("key", null); } plot.setParams(params); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2023-36812 - Severity: CRITICAL - CVSS Score: 9.8 Description: Improved fix for #2261. Regular expressions wouldn't catch the newlines or possibly other control characters. Now we'll use the TAG validation code to make sure the inputs are only plain ASCII printables first. Fixes CVE-2018-12972, CVE-2020-35476 Function: setPlotParams File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb Fixed Code: static void setPlotParams(final HttpQuery query, final Plot plot) { final HashMap<String, String> params = new HashMap<String, String>(); final Map<String, List<String>> querystring = query.getQueryString(); String value; if ((value = popParam(querystring, "yrange")) != null) { validateString("yrange", value, "[:]"); if (!RANGE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'yrange' was invalid. " + "Must be in the format [min:max]."); } params.put("yrange", value); } if ((value = popParam(querystring, "y2range")) != null) { validateString("y2range", value, "[:]"); if (!RANGE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2range' was invalid. " + "Must be in the format [min:max]."); } params.put("y2range", value); } if ((value = popParam(querystring, "ylabel")) != null) { validateString("ylabel", value, " "); if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'ylabel' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("ylabel", stringify(value)); } if ((value = popParam(querystring, "y2label")) != null) { validateString("y2label", value, " "); if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2label' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("y2label", stringify(value)); } if ((value = popParam(querystring, "yformat")) != null) { validateString("yformat", value, "% "); if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'yformat' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format y", stringify(value)); } if ((value = popParam(querystring, "y2format")) != null) { validateString("y2format", value, "% "); if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'y2format' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format y2", stringify(value)); } if ((value = popParam(querystring, "xformat")) != null) { validateString("xformat", value, "% "); if (!FORMAT_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'xformat' was invalid. Must " + "satisfy the pattern " + FORMAT_VALIDATOR.toString()); } params.put("format x", stringify(value)); } if ((value = popParam(querystring, "ylog")) != null) { params.put("logscale y", ""); } if ((value = popParam(querystring, "y2log")) != null) { params.put("logscale y2", ""); } if ((value = popParam(querystring, "key")) != null) { validateString("key", value); if (!KEY_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'key' was invalid. Must " + "satisfy the pattern " + KEY_VALIDATOR.toString()); } params.put("key", value); } if ((value = popParam(querystring, "title")) != null) { validateString("title", value, " "); if (!LABEL_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'title' was invalid. Must " + "satisfy the pattern " + LABEL_VALIDATOR.toString()); } params.put("title", stringify(value)); } if ((value = popParam(querystring, "bgcolor")) != null) { validateString("bgcolor", value); if (!COLOR_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'bgcolor' was invalid. Must " + "be a hex value e.g. 'xFFFFFF'"); } params.put("bgcolor", value); } if ((value = popParam(querystring, "fgcolor")) != null) { validateString("fgcolor", value); if (!COLOR_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'fgcolor' was invalid. Must " + "be a hex value e.g. 'xFFFFFF'"); } params.put("fgcolor", value); } if ((value = popParam(querystring, "smooth")) != null) { validateString("smooth", value); if (!SMOOTH_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'smooth' was invalid. Must " + "satisfy the pattern " + SMOOTH_VALIDATOR.toString()); } params.put("smooth", value); } if ((value = popParam(querystring, "style")) != null) { validateString("style", value); if (!STYLE_VALIDATOR.matcher(value).find()) { throw new BadRequestException("'style' was invalid. Must " + "satisfy the pattern " + STYLE_VALIDATOR.toString()); } params.put("style", value); } // This must remain after the previous `if' in order to properly override // any previous `key' parameter if a `nokey' parameter is given. if ((value = popParam(querystring, "nokey")) != null) { params.put("key", null); } plot.setParams(params); }
[ "CWE-74" ]
CVE-2023-36812
CRITICAL
9.8
OpenTSDB/opentsdb
setPlotParams
src/tsd/GraphHandler.java
07c4641471c6f5c2ab5aab615969e97211eb50d9
1
Analyze the following code function for security vulnerabilities
public void setCount(int count) { this.count = count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCount 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
setCount
src/com/dotmarketing/portlets/workflows/model/WorkflowSearcher.java
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
0
Analyze the following code function for security vulnerabilities
public String getGlobalExcludedRevprop() { return globalExcludedRevprop; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGlobalExcludedRevprop File: src/main/java/hudson/scm/SubversionSCM.java Repository: jenkinsci/subversion-plugin The code follows secure coding practices.
[ "CWE-255" ]
CVE-2013-6372
LOW
2.1
jenkinsci/subversion-plugin
getGlobalExcludedRevprop
src/main/java/hudson/scm/SubversionSCM.java
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
0
Analyze the following code function for security vulnerabilities
public abstract String getUrl();
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrl File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
getUrl
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
@Override @PermissionCheckerManager.PermissionResult public int checkOp(int op, AttributionSourceState attributionSource, String message, boolean forDataDelivery, boolean startDataDelivery) { int result = checkOp(mContext, op, mPermissionManagerServiceInternal, new AttributionSource(attributionSource), message, forDataDelivery, startDataDelivery); if (result != PermissionChecker.PERMISSION_GRANTED && startDataDelivery) { // Finish any started op if some step in the attribution chain failed. finishDataDelivery(op, attributionSource, /*fromDatasource*/ false); } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkOp File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
checkOp
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public StyleSheet getStyleSheet() { return style; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getStyleSheet File: org/w3c/css/css/StyleSheetParser.java Repository: w3c/css-validator The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-4070
LOW
3.5
w3c/css-validator
getStyleSheet
org/w3c/css/css/StyleSheetParser.java
e5c09a9119167d3064db786d5f00d730b584a53b
0
Analyze the following code function for security vulnerabilities
protected void storeInRepository(String uuid, String svg, String transformto, String processid, Repository repository) { String assetFullName = ""; try { if(processid != null) { Asset<byte[]> processAsset = repository.loadAsset(uuid); String assetExt = ""; String assetFileExt = ""; if(transformto.equals(TO_PDF)) { assetExt = "-pdf"; assetFileExt = ".pdf"; } if(transformto.equals(TO_PNG)) { assetExt = "-image"; assetFileExt = ".png"; } if(transformto.equals(TO_SVG)) { assetExt = "-svg"; assetFileExt = ".svg"; } if(processid.startsWith(".")) { processid = processid.substring(1, processid.length()); } assetFullName = processid + assetExt + assetFileExt; repository.deleteAssetFromPath(processAsset.getAssetLocation() + File.separator + assetFullName); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); if (transformto.equals(TO_PDF)) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); Document pdfDoc = new Document(PageSize.A4); PdfWriter pdfWriter = PdfWriter.getInstance(pdfDoc, outputStream); pdfDoc.open(); pdfDoc.addCreationDate(); PNGTranscoder t = new PNGTranscoder(); t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen"); TranscoderInput input = new TranscoderInput(new StringReader( svg)); TranscoderOutput output = new TranscoderOutput(bout); t.transcode(input, output); Image processImage = Image.getInstance(bout.toByteArray()); scalePDFImage(pdfDoc, processImage); pdfDoc.add(processImage); pdfDoc.close(); } else if (transformto.equals(TO_PNG)) { PNGTranscoder t = new PNGTranscoder(); t.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "screen"); TranscoderInput input = new TranscoderInput(new StringReader( svg)); TranscoderOutput output = new TranscoderOutput(outputStream); try { t.transcode(input, output); } catch (Exception e) { // issue with batik here..do not make a big deal _logger.debug(e.getMessage()); } } else if(transformto.equals(TO_SVG)) { OutputStreamWriter outStreamWriter = new OutputStreamWriter(outputStream); outStreamWriter.write(svg); outStreamWriter.close(); } AssetBuilder builder = AssetBuilderFactory.getAssetBuilder(Asset.AssetType.Byte); builder.name(processid + assetExt) .type(assetFileExt.substring(1)) .location(processAsset.getAssetLocation()) .version(processAsset.getVersion()) .content(outputStream.toByteArray()); Asset<byte[]> resourceAsset = builder.getAsset(); repository.createAsset(resourceAsset); } } catch (Exception e) { // just log that error happened if (e.getMessage() != null) { _logger.error(e.getMessage()); } else { _logger.error(e.getClass().toString() + " " + assetFullName); } e.printStackTrace(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: storeInRepository File: jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java Repository: kiegroup/jbpm-designer The code follows secure coding practices.
[ "CWE-611" ]
CVE-2017-7545
MEDIUM
4
kiegroup/jbpm-designer
storeInRepository
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
a143f3b92a6a5a527d929d68c02a0c5d914ab81d
0
Analyze the following code function for security vulnerabilities
@Override public void addMediaErrorListener(ActionListener<MediaErrorEvent> l) { errorListeners.addListener(l); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addMediaErrorListener 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
addMediaErrorListener
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@NonNull public static SQLiteDatabase create(@Nullable CursorFactory factory) { // This is a magic string with special meaning for SQLite. return openDatabase(SQLiteDatabaseConfiguration.MEMORY_DB_PATH, factory, CREATE_IF_NECESSARY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: core/java/android/database/sqlite/SQLiteDatabase.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
create
core/java/android/database/sqlite/SQLiteDatabase.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
private Study getParentStudy(String studyOid) { Study study = studyDao.findByOcOID(studyOid); Study parentStudy = study.getStudy(); if (parentStudy != null && parentStudy.getStudyId() > 0) return parentStudy; else return study; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParentStudy File: web/src/main/java/org/akaza/openclinica/controller/openrosa/OpenRosaSubmissionController.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
getParentStudy
web/src/main/java/org/akaza/openclinica/controller/openrosa/OpenRosaSubmissionController.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
private void exposePlace(SysSite site, String templatePath, CmsPlaceMetadata metadata, Map<String, Object> model) { if (null != metadata.getSize() && 0 < metadata.getSize()) { Date now = CommonUtils.getMinuteDate(); PageHandler page = placeService.getPage(site.getId(), null, templatePath, null, null, null, now, now, CmsPlaceService.STATUS_NORMAL_ARRAY, false, null, null, 1, metadata.getSize()); @SuppressWarnings("unchecked") List<CmsPlace> list = (List<CmsPlace>) page.getList(); if (null != list) { list.forEach(e -> { Integer clicks = statisticsComponent.getPlaceClicks(e.getId()); if (null != clicks) { e.setClicks(e.getClicks() + clicks); } initPlaceCover(site, e); }); } model.put("page", page); } model.put("metadata", metadata); AbstractFreemarkerView.exposeSite(model, site); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exposePlace File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-89" ]
CVE-2020-20914
CRITICAL
9.8
sanluan/PublicCMS
exposePlace
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/component/template/TemplateComponent.java
bf24c5dd9177cb2da30d0f0a62cf8e130003c2ae
0
Analyze the following code function for security vulnerabilities
private void setSecurity() throws LaunchException { URL codebase = UrlUtils.guessCodeBase(file); this.security = securityDelegate.getClassLoaderSecurity(codebase); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSecurity File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
setSecurity
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
@Override public void setTransformIdentity(Object transform) { CN1Matrix4f m = (CN1Matrix4f)transform; m.setIdentity(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTransformIdentity 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
setTransformIdentity
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void setUserName(int userId, String name) { checkManageUsersPermission("rename users"); boolean changed = false; synchronized (mPackagesLock) { UserInfo info = mUsers.get(userId); if (info == null || info.partial) { Slog.w(LOG_TAG, "setUserName: unknown user #" + userId); return; } if (name != null && !name.equals(info.name)) { info.name = name; writeUserLocked(info); changed = true; } } if (changed) { sendUserInfoChangedBroadcast(userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUserName File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
setUserName
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@Override protected AbstractChainingPrintRenderer getSyntaxRenderer() { return new XHTMLChainingRenderer(this.linkRenderer, this.imageRenderer, getListenerChain()); }
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: getSyntaxRenderer File: xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacroXHTMLRenderer.java Repository: xwiki/xwiki-rendering Fixed Code: @Override protected AbstractChainingPrintRenderer getSyntaxRenderer() { return new XHTMLChainingRenderer(this.linkRenderer, this.imageRenderer, this.htmlElementSanitizer, getListenerChain()); }
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
getSyntaxRenderer
xwiki-rendering-macros/xwiki-rendering-macro-html/src/main/java/org/xwiki/rendering/internal/macro/html/HTMLMacroXHTMLRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
1
Analyze the following code function for security vulnerabilities
private void createLoggingSocket() throws SSLException { if (debug_port == 0) { return; } try { ss_socket = new ServerSocket(debug_port); ss_socket.setReuseAddress(true); ss_socket.setReceiveBufferSize(BUFFER_SIZE); c_socket = new Socket(ss_socket.getInetAddress(), ss_socket.getLocalPort()); c_socket.setReuseAddress(true); c_socket.setReceiveBufferSize(BUFFER_SIZE); c_socket.setSendBufferSize(BUFFER_SIZE); s_socket = ss_socket.accept(); s_socket.setReuseAddress(true); s_socket.setReceiveBufferSize(BUFFER_SIZE); s_socket.setSendBufferSize(BUFFER_SIZE); s_istream = s_socket.getInputStream(); s_ostream = s_socket.getOutputStream(); c_istream = c_socket.getInputStream(); c_ostream = c_socket.getOutputStream(); } catch (Exception e) { throw new SSLException("Unable to enable debug socket logging! " + e.getMessage(), e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createLoggingSocket 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
createLoggingSocket
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
protected abstract Assertion parseResponseFromServer(final String response) throws TicketValidationException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseResponseFromServer File: cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java Repository: apereo/java-cas-client The code follows secure coding practices.
[ "CWE-74" ]
CVE-2014-4172
HIGH
7.5
apereo/java-cas-client
parseResponseFromServer
cas-client-core/src/main/java/org/jasig/cas/client/validation/AbstractUrlBasedTicketValidator.java
ae37092100c8eaec610dab6d83e5e05a8ee58814
0
Analyze the following code function for security vulnerabilities
private void saveLocaleLocked(Locale l, boolean isDiff, boolean isPersist) { if(isDiff) { SystemProperties.set("user.language", l.getLanguage()); SystemProperties.set("user.region", l.getCountry()); } if(isPersist) { SystemProperties.set("persist.sys.language", l.getLanguage()); SystemProperties.set("persist.sys.country", l.getCountry()); SystemProperties.set("persist.sys.localevar", l.getVariant()); mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, l)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveLocaleLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
saveLocaleLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public static ClickHouseNode of(String uri, ClickHouseNode template) { return of(normalize(uri, template != null ? template.getProtocol() : null), template); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: of File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java Repository: ClickHouse/clickhouse-java The code follows secure coding practices.
[ "CWE-209" ]
CVE-2024-23689
HIGH
8.8
ClickHouse/clickhouse-java
of
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
4f8d9303eb991b39ec7e7e34825241efa082238a
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting void saveBaseState() { try (ResilientAtomicFile file = getBaseStateFile()) { if (DEBUG || DEBUG_REBOOT) { Slog.d(TAG, "Saving to " + file.getBaseFile()); } FileOutputStream outs = null; try { synchronized (mLock) { outs = file.startWrite(); } // Write to XML TypedXmlSerializer out = Xml.resolveSerializer(outs); out.startDocument(null, true); out.startTag(null, TAG_ROOT); // Body. // No locking required. Ok to add lock later if we save more data. writeTagValue(out, TAG_LAST_RESET_TIME, mRawLastResetTime.get()); // Epilogue. out.endTag(null, TAG_ROOT); out.endDocument(); // Close. file.finishWrite(outs); } catch (IOException e) { Slog.e(TAG, "Failed to write to file " + file.getBaseFile(), e); file.failWrite(outs); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveBaseState File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
saveBaseState
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public void onChange(boolean selfChange, Uri uri) { update(uri); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onChange 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
onChange
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@HiddenApiEnforcementPolicy int getPolicyForPrePApps() { return mPolicyPreP; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPolicyForPrePApps 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
getPolicyForPrePApps
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@GuardedBy({"mPm.mLock", "mPm.mInstallLock"}) void installSystemStubPackages(@NonNull List<String> systemStubPackageNames, @PackageManagerService.ScanFlags int scanFlags) { for (int i = systemStubPackageNames.size() - 1; i >= 0; --i) { final String packageName = systemStubPackageNames.get(i); // skip if the system package is already disabled if (mPm.mSettings.isDisabledSystemPackageLPr(packageName)) { systemStubPackageNames.remove(i); continue; } // skip if the package isn't installed (?!); this should never happen final AndroidPackage pkg = mPm.mPackages.get(packageName); if (pkg == null) { systemStubPackageNames.remove(i); continue; } // skip if the package has been disabled by the user final PackageSetting ps = mPm.mSettings.getPackageLPr(packageName); if (ps != null) { final int enabledState = ps.getEnabled(UserHandle.USER_SYSTEM); if (enabledState == PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER) { systemStubPackageNames.remove(i); continue; } } // install the package to replace the stub on /system try { installStubPackageLI(pkg, 0, scanFlags); ps.setEnabled(PackageManager.COMPONENT_ENABLED_STATE_DEFAULT, UserHandle.USER_SYSTEM, "android"); systemStubPackageNames.remove(i); } catch (PackageManagerException e) { Slog.e(TAG, "Failed to parse uncompressed system package: " + e.getMessage()); } // any failed attempt to install the package will be cleaned up later } // disable any stub still left; these failed to install the full application for (int i = systemStubPackageNames.size() - 1; i >= 0; --i) { final String pkgName = systemStubPackageNames.get(i); final PackageSetting ps = mPm.mSettings.getPackageLPr(pkgName); ps.setEnabled(PackageManager.COMPONENT_ENABLED_STATE_DISABLED, UserHandle.USER_SYSTEM, "android"); logCriticalInfo(Log.ERROR, "Stub disabled; pkg: " + pkgName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installSystemStubPackages File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
installSystemStubPackages
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public String getProjectId() { return projectId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getProjectId File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java Repository: metersphere The code follows secure coding practices.
[ "CWE-918" ]
CVE-2022-23544
MEDIUM
6.1
metersphere
getProjectId
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
d0f95b50737c941b29d507a4cc3545f2dc6ab121
0
Analyze the following code function for security vulnerabilities
public String getLocalUserName(String user) { try { return this.xwiki.getUserName(user.substring(user.indexOf(":") + 1), null, getXWikiContext()); } catch (Exception e) { return this.xwiki.getUserName(user, null, getXWikiContext()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLocalUserName 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
getLocalUserName
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 boolean fileNameExists(Host host, Folder folder, String fileName, String identifier, long languageId) throws DotDataException{ if( !UtilMethods.isSet(fileName) ){ return true; } if( folder == null || host == null ) { return false; } boolean exist = false; Identifier folderId = APILocator.getIdentifierAPI().find(folder); String path = folder.getInode().equals(FolderAPI.SYSTEM_FOLDER)?"/"+fileName:folderId.getPath()+fileName; Identifier fileAsset = APILocator.getIdentifierAPI().find(host, path); if(fileAsset!=null && InodeUtils.isSet(fileAsset.getId()) && !identifier.equals(fileAsset.getId()) && !fileAsset.getAssetType().equals("folder")){ // Let's not break old logic. ie calling fileNameExists method without languageId parameter. if (languageId == -1){ exist = true; } else { // New logic. //We need to make sure that the contentlets for this identifier have the same language. try { contAPI.findContentletByIdentifier(fileAsset.getId(), false, languageId, APILocator.getUserAPI().getSystemUser(), false); exist = true; } catch (DotSecurityException dse) { // Something could failed, lets log and assume true to not break anything. Logger.error(FileAssetAPIImpl.class, "Error trying to find contentlet from identifier:" + fileAsset.getId(), dse); exist = true; } catch (DotContentletStateException dcse){ // DotContentletStateException is thrown when content is not found. exist = false; } } } return exist; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fileNameExists File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-434" ]
CVE-2017-11466
HIGH
9
dotCMS/core
fileNameExists
dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
ab2bb2e00b841d131b8734227f9106e3ac31bb99
0
Analyze the following code function for security vulnerabilities
@Override public void run() { dataSource = helperObject.getDataSource(); cBean = helperObject.getcBean(); reportLog = helperObject.getReportLog(); stBean = helperObject.getStBean(); resterms = helperObject.getResterms(); userAccountBean = helperObject.getUserAccountBean(); openClinicaMailSender = helperObject.getOpenClinicaMailSender(); sessionFactory = helperObject.getSessionFactory(); Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); helperObject.setSession(session); int i = 0; for (EventCRFBean eventCrfToMigrate : helperObject.getEventCrfListToMigrate()) { i++; executeMigrationAction(helperObject, eventCrfToMigrate); if (i % 50 == 0) { session.flush(); session.clear(); } StudySubjectBean ssBean = (StudySubjectBean) ssdao().findByPK(eventCrfToMigrate.getStudySubjectId()); StudyBean sBean = (StudyBean) sdao().findByPK(ssBean.getStudyId()); StudyEventBean seBean = (StudyEventBean) sedao().findByPK(eventCrfToMigrate.getStudyEventId()); StudyEventDefinitionBean sedBean = (StudyEventDefinitionBean) seddao().findByPK(seBean.getStudyEventDefinitionId()); reportLog.getLogs().add( cBean.getName() + "," + helperObject.getSourceCrfVersionBean().getName() + "," + helperObject.getTargetCrfVersionBean().getName() + "," + ssBean.getLabel() + "," + sBean.getName() + "," + sedBean.getName() + "," + seBean.getSampleOrdinal()); } tx.commit(); session.close(); String fileName = new SimpleDateFormat("_yyyy-MM-dd-hhmmssSaa'.txt'").format(new Date()); fileName = "logFile" + fileName; File file = createLogFile(fileName); PrintWriter writer = null; try { writer = openFile(file); } catch (FileNotFoundException | UnsupportedEncodingException e) { e.printStackTrace(); } finally { writer.print(toStringTextFormat(reportLog, resterms, stBean, cBean)); closeFile(writer); } String reportUrl = getReportUrl(fileName, helperObject.getUrlBase()); String fullName = userAccountBean.getFirstName() + " " + userAccountBean.getLastName(); StringBuilder body = new StringBuilder(); body.append(resterms.getString("Dear") + " " + fullName + ",<br><br>" + resterms.getString("Batch_CRF_version_migration_has_finished_running") + "<br>" + resterms.getString("Study") + ": " + stBean.getName() + "<br>" + resterms.getString("CRF") + ": " + cBean.getName() + "<br><br>" + resterms.getString("A_summary_report_of_the_migration_is_available_here") + ":<br>" + reportUrl + "<br><br>" + resterms.getString("Thank_you_Your_OpenClinica_System")); logger.info(body.toString()); openClinicaMailSender.sendEmail(userAccountBean.getEmail(), EmailEngine.getAdminEmail(), resterms.getString("Batch_Migration_Complete_For") + " " + stBean.getName(), body.toString(), true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: run File: web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java Repository: OpenClinica The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-24830
HIGH
7.5
OpenClinica
run
web/src/main/java/org/akaza/openclinica/controller/BatchCRFMigrationController.java
6f864e86543f903bd20d6f9fc7056115106441f3
0
Analyze the following code function for security vulnerabilities
private Cursor queryCleared(Uri uri, String[] projection, String selection, String[] selectionArgs, String sort) { final long token = Binder.clearCallingIdentity(); try { return query(uri, projection, selection, selectionArgs, sort); } finally { Binder.restoreCallingIdentity(token); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryCleared 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
queryCleared
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
protected final JsonToken _decodeFieldName() throws IOException { if (_inputPtr >= _inputEnd) { loadMoreGuaranteed(); } final int ch = _inputBuffer[_inputPtr++]; final int type = ((ch >> 5) & 0x7); // Expecting a String, but may need to allow other types too if (type != CBORConstants.MAJOR_TYPE_TEXT) { // the usual case if (ch == -1) { if (!_parsingContext.hasExpectedLength()) { _parsingContext = _parsingContext.getParent(); return JsonToken.END_OBJECT; } _reportUnexpectedBreak(); } // offline non-String cases, as they are expected to be rare _decodeNonStringName(ch); return JsonToken.FIELD_NAME; } final int lenMarker = ch & 0x1F; String name; if (lenMarker <= 23) { if (lenMarker == 0) { name = ""; } else { name = _findDecodedFromSymbols(lenMarker); if (name != null) { _inputPtr += lenMarker; } else { name = _decodeShortName(lenMarker); name = _addDecodedToSymbols(lenMarker, name); } } } else { final int actualLen = _decodeExplicitLength(lenMarker); if (actualLen < 0) { name = _decodeChunkedName(); } else { name = _decodeLongerName(actualLen); } } _parsingContext.setCurrentName(name); return JsonToken.FIELD_NAME; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _decodeFieldName 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
_decodeFieldName
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
public void resumeAppSwitches() { if (checkCallingPermission(android.Manifest.permission.STOP_APP_SWITCHES) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.STOP_APP_SWITCHES); } synchronized(this) { // Note that we don't execute any pending app switches... we will // let those wait until either the timeout, or the next start // activity request. mAppSwitchesAllowedTime = 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeAppSwitches 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
resumeAppSwitches
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
@Deprecated public void setCrossProfileCallerIdDisabled(@NonNull ComponentName admin, boolean disabled) { throwIfParentInstance("setCrossProfileCallerIdDisabled"); if (mService != null) { try { mService.setCrossProfileCallerIdDisabled(admin, disabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCrossProfileCallerIdDisabled 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
setCrossProfileCallerIdDisabled
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
private static final void checkManageUsersPermission(String message) { final int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID && uid != 0 && ActivityManager.checkComponentPermission( android.Manifest.permission.MANAGE_USERS, uid, -1, true) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("You need MANAGE_USERS permission to: " + message); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkManageUsersPermission File: services/core/java/com/android/server/pm/UserManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-2457
LOW
2.1
android
checkManageUsersPermission
services/core/java/com/android/server/pm/UserManagerService.java
12332e05f632794e18ea8c4ac52c98e82532e5db
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") public Form<T> bind( Lang lang, TypedMap attrs, Map<String, String> data, String... allowedFields) { return bind(lang, attrs, data, Collections.emptyMap(), allowedFields); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: web/play-java-forms/src/main/java/play/data/Form.java Repository: playframework The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-31018
MEDIUM
5
playframework
bind
web/play-java-forms/src/main/java/play/data/Form.java
15393b736df939e35e275af2347155f296c684f2
0
Analyze the following code function for security vulnerabilities
private void migratePermittedInputMethodsPolicyLocked() { Binder.withCleanCallingIdentity(() -> { List<UserInfo> users = mUserManager.getUsers(); for (UserInfo userInfo : users) { ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(userInfo.id); if (admin != null) { EnforcingAdmin enforcingAdmin = EnforcingAdmin.createEnterpriseEnforcingAdmin( admin.info.getComponent(), admin.getUserHandle().getIdentifier(), admin); if (admin.permittedInputMethods != null) { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.PERMITTED_INPUT_METHODS, enforcingAdmin, new StringSetPolicyValue( new HashSet<>(admin.permittedInputMethods)), admin.getUserHandle().getIdentifier()); } if (admin.getParentActiveAdmin() != null && admin.getParentActiveAdmin().permittedInputMethods != null) { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.PERMITTED_INPUT_METHODS, enforcingAdmin, new StringSetPolicyValue( new HashSet<>(admin.getParentActiveAdmin() .permittedInputMethods)), getProfileParentId(admin.getUserHandle().getIdentifier())); } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migratePermittedInputMethodsPolicyLocked 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
migratePermittedInputMethodsPolicyLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public @UserIdInt int getLastResumedActivityUserId() { mAmInternal.enforceCallingPermission( Manifest.permission.INTERACT_ACROSS_USERS_FULL, "getLastResumedActivityUserId()"); synchronized (mGlobalLock) { if (mLastResumedActivity == null) { return getCurrentUserId(); } return mLastResumedActivity.mUserId; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLastResumedActivityUserId File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getLastResumedActivityUserId
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0