instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static String validEquation(String equation) { if (StringUtils.isBlank(equation)) { return "OR"; } if ("OR".equalsIgnoreCase(equation) || "AND".equalsIgnoreCase(equation)) { return equation; } String clearEquation = equation.toUpperCase() .replace("OR", " OR ") .replace("AND", " AND ") .replaceAll("\\s+", " ") .trim(); equation = clearEquation; if (clearEquation.startsWith("AND") || clearEquation.startsWith("OR") || clearEquation.endsWith("AND") || clearEquation.endsWith("OR")) { return null; } if (clearEquation.contains("()") || clearEquation.contains("( )")) { return null; } for (String token : clearEquation.split(" ")) { token = token.replace("(", ""); token = token.replace(")", ""); // 数字不能大于 10 if (NumberUtils.isNumber(token)) { if (NumberUtils.toInt(token) > 10) { return null; } else { // 允许 } } else if ("AND".equals(token) || "OR".equals(token) || "(".equals(token) || ")".equals(token)) { // 允许 } else { return null; } } // 去除 AND OR 0-9 及空格 // noinspection RegExpDuplicateCharacterInClass clearEquation = clearEquation.replaceAll("[AND|OR|0-9|\\s]", ""); // 括弧成对出现 for (int i = 0; i < 20; i++) { clearEquation = clearEquation.replace("()", ""); if (clearEquation.length() == 0) { return equation; } } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validEquation File: src/main/java/com/rebuild/core/service/query/AdvFilterParser.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
validEquation
src/main/java/com/rebuild/core/service/query/AdvFilterParser.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
private String getUpdatableString( String updatableStringId, int defaultStringId, Object... formatArgs) { ParcelableResource resource = mDeviceManagementResourcesProvider.getString( updatableStringId); if (resource == null) { return ParcelableResource.loadDefaultString(() -> mContext.getString(defaultStringId, formatArgs)); } return resource.getString( mContext, () -> mContext.getString(defaultStringId, formatArgs), formatArgs); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUpdatableString 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
getUpdatableString
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalSetMaxConsumers(Integer maxConsumers) { if (maxConsumers != null && maxConsumers < 0) { throw new RestException(Status.PRECONDITION_FAILED, "maxConsumers must be 0 or more"); } return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new); topicPolicies.setMaxConsumerPerTopic(maxConsumers); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetMaxConsumers File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetMaxConsumers
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
public final boolean replaceParallelBroadcastLocked(BroadcastRecord r) { for (int i = mParallelBroadcasts.size() - 1; i >= 0; i--) { if (r.intent.filterEquals(mParallelBroadcasts.get(i).intent)) { if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "***** DROPPING PARALLEL [" + mQueueName + "]: " + r.intent); mParallelBroadcasts.set(i, r); return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceParallelBroadcastLocked 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
replaceParallelBroadcastLocked
services/core/java/com/android/server/am/BroadcastQueue.java
6c049120c2d749f0c0289d822ec7d0aa692f55c5
0
Analyze the following code function for security vulnerabilities
@Override public Stream<UserSessionModel> loadUserSessionsStream(RealmModel realm, ClientModel client, boolean offline, Integer firstResult, Integer maxResults) { String offlineStr = offlineToString(offline); TypedQuery<PersistentUserSessionEntity> query; StorageId clientStorageId = new StorageId(client.getId()); if (clientStorageId.isLocal()) { query = paginateQuery( em.createNamedQuery("findUserSessionsByClientId", PersistentUserSessionEntity.class), firstResult, maxResults); query.setParameter("clientId", client.getId()); } else { query = paginateQuery( em.createNamedQuery("findUserSessionsByExternalClientId", PersistentUserSessionEntity.class), firstResult, maxResults); query.setParameter("clientStorageProvider", clientStorageId.getProviderId()); query.setParameter("externalClientId", clientStorageId.getExternalId()); } query.setParameter("offline", offlineStr); query.setParameter("realmId", realm.getId()); return loadUserSessionsWithClientSessions(query, offlineStr); }
Vulnerability Classification: - CWE: CWE-770 - CVE: CVE-2023-6563 - Severity: HIGH - CVSS Score: 7.7 Description: Fix performance issues with many offline sessions Fixes: #13340 Function: loadUserSessionsStream File: model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java Repository: keycloak Fixed Code: @Override public Stream<UserSessionModel> loadUserSessionsStream(RealmModel realm, ClientModel client, boolean offline, Integer firstResult, Integer maxResults) { String offlineStr = offlineToString(offline); TypedQuery<PersistentUserSessionEntity> query; StorageId clientStorageId = new StorageId(client.getId()); if (clientStorageId.isLocal()) { query = paginateQuery( em.createNamedQuery("findUserSessionsByClientId", PersistentUserSessionEntity.class), firstResult, maxResults); query.setParameter("clientId", client.getId()); } else { query = paginateQuery( em.createNamedQuery("findUserSessionsByExternalClientId", PersistentUserSessionEntity.class), firstResult, maxResults); query.setParameter("clientStorageProvider", clientStorageId.getProviderId()); query.setParameter("externalClientId", clientStorageId.getExternalId()); } query.setParameter("offline", offlineStr); query.setParameter("realmId", realm.getId()); return loadUserSessionsWithClientSessions(query, offlineStr, true); }
[ "CWE-770" ]
CVE-2023-6563
HIGH
7.7
keycloak
loadUserSessionsStream
model/jpa/src/main/java/org/keycloak/models/jpa/session/JpaUserSessionPersisterProvider.java
11eb952e1df7cbb95b1e2c101dfd4839a2375695
1
Analyze the following code function for security vulnerabilities
@Nullable public List<PermissionInfo> queryPermissionsByGroup(@Nullable String groupName, @PackageManager.PermissionInfoFlags int flags) { try { final ParceledListSlice<PermissionInfo> parceledList = mPermissionManager.queryPermissionsByGroup(groupName, flags); if (parceledList == null) { return null; } return parceledList.getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: queryPermissionsByGroup File: core/java/android/permission/PermissionManager.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
queryPermissionsByGroup
core/java/android/permission/PermissionManager.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public void close() { try { socket.close(); } catch (IOException ex) { Log.e(LOG_TAG,"I/O exception on routine close", ex); } mClosed = true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
close
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
private static void initRegionListByStr(String regionStr) { for (String str : regionStr.split(";")) { regionList.add(getRegionByStr(str)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initRegionListByStr File: src/main/java/model/Input.java Repository: nickzren/alsdb The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-15021
MEDIUM
5.2
nickzren/alsdb
initRegionListByStr
src/main/java/model/Input.java
cbc79a68145e845f951113d184b4de207c341599
0
Analyze the following code function for security vulnerabilities
public String getDescription() { return description.getExpressionString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getDescription
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/PagerdutyNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { return null; } for (String accept : accepts) { if (isJsonMime(accept)) { return accept; } } return StringUtil.join(accepts, ","); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderAccept File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
selectHeaderAccept
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void clearCache() { entityCache.clearCache(KBTemplateImpl.class); finderCache.clearCache(FINDER_CLASS_NAME_ENTITY); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: clearCache File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
clearCache
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
private void addParameter(String name, String val, DataOutputStream postRequest) throws IOException { addParameterHeader(name, null, postRequest); postRequest.writeBytes(val); postRequest.writeBytes(CRLF); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addParameter File: src/main/java/com/mxgraph/online/ConverterServlet.java Repository: jgraph/drawio The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-3398
HIGH
7.5
jgraph/drawio
addParameter
src/main/java/com/mxgraph/online/ConverterServlet.java
064729fec4262f9373d9fdcafda0be47cd18dd50
0
Analyze the following code function for security vulnerabilities
public static boolean isDataOrObbPath(@Nullable String path) { if (path == null) return false; final Matcher m = PATTERN_DATA_OR_OBB_PATH.matcher(path); return m.matches(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDataOrObbPath File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
isDataOrObbPath
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
abstract AbstractResource<InputSource> createResource(String resourcePath, String resourceName);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createResource File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-29253
MEDIUM
4
xwiki/xwiki-platform
createResource
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/AbstractResourceSkin.java
4917c8f355717bb636d763844528b1fe0f95e8e2
0
Analyze the following code function for security vulnerabilities
public JSONArray names() { if(this.map.isEmpty()) { return null; } return new JSONArray(this.map.keySet()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: names File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
names
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
public String parameterToString(Object param) { if (param == null) { return ""; } else if (param instanceof Date) { return formatDate((Date) param); } else if (param instanceof OffsetDateTime) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); for(Object o : (Collection)param) { if(b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); } return b.toString(); } else { return String.valueOf(param); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parameterToString File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
parameterToString
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@NonNull public static PermissionManagerServiceInternal create(@NonNull Context context, ArrayMap<String, FeatureInfo> availableFeatures) { final PermissionManagerServiceInternal permMgrInt = LocalServices.getService(PermissionManagerServiceInternal.class); if (permMgrInt != null) { return permMgrInt; } PermissionManagerService permissionService = (PermissionManagerService) ServiceManager.getService("permissionmgr"); if (permissionService == null) { permissionService = new PermissionManagerService(context, availableFeatures); ServiceManager.addService("permissionmgr", permissionService); ServiceManager.addService("permission_checker", new PermissionCheckerService(context)); } return LocalServices.getService(PermissionManagerServiceInternal.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create 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
create
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Nullable CharSequence getPooledStringForCookie(int cookie, int id) { // Cookies map to ApkAssets starting at 1. return getApkAssets()[cookie - 1].getStringFromPool(id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPooledStringForCookie File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getPooledStringForCookie
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
@Override public List<Event> getEvents() { return LISTENER_EVENTS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getEvents 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
getEvents
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public int getPasswordMinimumSymbols(ComponentName who, int userHandle, boolean parent) { return getStrictestPasswordRequirement(who, userHandle, parent, admin -> admin.mPasswordPolicy.symbols, PASSWORD_QUALITY_COMPLEX); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMinimumSymbols 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
getPasswordMinimumSymbols
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public SsurgeonWordlist getResource(String id) { return wordListResources.get(id); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResource File: src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3878
HIGH
7.5
stanfordnlp/CoreNLP
getResource
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java
e5bbe135a02a74b952396751ed3015e8b8252e99
0
Analyze the following code function for security vulnerabilities
public static void saveStructure(Structure structure, String existingId) throws DotHibernateException { structure.setUrlMapPattern(cleanURLMap(structure.getUrlMapPattern())); Date now = new Date(); structure.setiDate(now); structure.setModDate(now); fixFolderHost(structure); HibernateUtil.saveWithPrimaryKey(structure, existingId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveStructure File: src/com/dotmarketing/portlets/structure/factories/StructureFactory.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
saveStructure
src/com/dotmarketing/portlets/structure/factories/StructureFactory.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @AnyRes int getResourceIdentifier(@NonNull String name, @Nullable String defType, @Nullable String defPackage) { synchronized (this) { ensureValidLocked(); // name is checked in JNI. return nativeGetResourceIdentifier(mObject, name, defType, defPackage); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceIdentifier File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getResourceIdentifier
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void save(String table, String id, Object entity, boolean returnId, boolean upsert, Handler<AsyncResult<String>> replyHandler) { client.getConnection(conn -> save(conn, table, id, entity, returnId, upsert, /* convertEntity */ true, closeAndHandleResult(conn, replyHandler))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: save File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
save
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
@Override public MediaPackage addAttachment(InputStream in, String fileName, MediaPackageElementFlavor flavor, String[] tags, MediaPackage mediaPackage) throws IOException, IngestException { Job job = null; try { job = serviceRegistry.createJob(JOB_TYPE, INGEST_ATTACHMENT, null, null, false, ingestFileJobLoad); job.setStatus(Status.RUNNING); job = serviceRegistry.updateJob(job); String elementId = UUID.randomUUID().toString(); logger.info("Start adding attachment {} from input stream on mediapackage {}", elementId, mediaPackage); URI newUrl = addContentToRepo(mediaPackage, elementId, fileName, in); MediaPackage mp = addContentToMediaPackage(mediaPackage, elementId, newUrl, MediaPackageElement.Type.Attachment, flavor); if (tags != null && tags.length > 0) { MediaPackageElement trackElement = mp.getAttachment(elementId); for (String tag : tags) { logger.info("Adding Tag: " + tag + " to Element: " + elementId); trackElement.addTag(tag); } } job.setStatus(Job.Status.FINISHED); logger.info("Successful added attachment {} on mediapackage {} at URL {}", elementId, mediaPackage, newUrl); return mp; } catch (ServiceRegistryException e) { throw new IngestException(e); } catch (NotFoundException e) { throw new IngestException("Unable to update ingest job", e); } finally { finallyUpdateJob(job); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAttachment File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
addAttachment
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
public <T> Column setRenderer(Renderer<T> renderer, Converter<? extends T, ?> converter) { if (renderer.getParent() != null) { throw new IllegalArgumentException( "Cannot set a renderer that is already connected to a grid column (in " + toString() + ")"); } if (getRenderer() != null) { grid.removeExtension(getRenderer()); } grid.addRenderer(renderer); state.rendererConnector = renderer; setConverter(converter); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRenderer File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setRenderer
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
private static boolean isCompatible(SocketInterceptorConfig c1, SocketInterceptorConfig c2) { boolean c1Disabled = c1 == null || !c1.isEnabled(); boolean c2Disabled = c2 == null || !c2.isEnabled(); return c1 == c2 || (c1Disabled && c2Disabled) || (c1 != null && c2 != null && nullSafeEqual(c1.getClassName(), c2.getClassName()) && nullSafeEqual(c1.getImplementation(), c2.getImplementation())) && nullSafeEqual(c1.getProperties(), c2.getProperties()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCompatible File: hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
isCompatible
hazelcast/src/test/java/com/hazelcast/config/ConfigCompatibilityChecker.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
protected final boolean _byteOverflow(int value) { // 07-nov-2016, tatu: We support "unsigned byte" as well // as Java signed range since that's relatively common usage return (value < Byte.MIN_VALUE || value > 255); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _byteOverflow File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_byteOverflow
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
static boolean isSerializable(Class<?> cl) { return SERIALIZABLE.isAssignableFrom(cl); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isSerializable 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
isSerializable
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private boolean extractSearchParamsDstu2(IBaseResource theConformance, String resourceName, TreeSet<String> includes, TreeSet<String> theRevIncludes, TreeSet<String> sortParams, boolean haveSearchParams, List<List<String>> queryIncludes) { ca.uhn.fhir.model.dstu2.resource.Conformance conformance = (ca.uhn.fhir.model.dstu2.resource.Conformance) theConformance; for (ca.uhn.fhir.model.dstu2.resource.Conformance.Rest nextRest : conformance.getRest()) { for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResource nextRes : nextRest.getResource()) { if (nextRes.getTypeElement().getValue().equals(resourceName)) { for (StringDt next : nextRes.getSearchInclude()) { if (next.isEmpty() == false) { includes.add(next.getValue()); } } for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResourceSearchParam next : nextRes.getSearchParam()) { if (next.getTypeElement().getValueAsEnum() != ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum.COMPOSITE) { sortParams.add(next.getNameElement().getValue()); } } if (nextRes.getSearchParam().size() > 0) { haveSearchParams = true; } } else { // It's a different resource from the one we're searching, so // scan for revinclude candidates for (ca.uhn.fhir.model.dstu2.resource.Conformance.RestResourceSearchParam next : nextRes.getSearchParam()) { if (next.getTypeElement().getValueAsEnum() == ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum.REFERENCE) { for (BoundCodeDt<ResourceTypeEnum> nextTargetType : next.getTarget()) { if (nextTargetType.getValue().equals(resourceName)) { theRevIncludes.add(nextRes.getTypeElement().getValue() + ":" + next.getName()); } } } } } } } return haveSearchParams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractSearchParamsDstu2 File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-24301
MEDIUM
4.3
hapifhir/hapi-fhir
extractSearchParamsDstu2
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
0
Analyze the following code function for security vulnerabilities
@POST @Produces(MediaType.TEXT_XML) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("addMediaPackage/{wdID}") @RestQuery(name = "addMediaPackage", description = "<p>Create and ingest media package from media tracks with additional Dublin Core metadata. It is " + "mandatory to set a title for the recording. This can be done with the 'title' form field or by supplying a DC " + "catalog with a title included. The identifier of the newly created media package will be taken from the " + "<em>identifier</em> field or the episode DublinCore catalog (deprecated<sup>*</sup>). If no identifier is " + "set, a newa randumm UUIDv4 will be generated. This endpoint is not meant to be used by capture agents for " + "scheduled recordings. It's primary use is for manual ingests with command line tools like curl.</p> " + "<p>Multiple tracks can be ingested by using multiple form fields. It's important, however, to always set the " + "flavor of the next media file <em>before</em> sending the media file itself.</p>" + "<b>(*)</b> The special treatment of the identifier field is deprecated any may be removed in future versions " + "without further notice in favor of a random UUID generation to ensure uniqueness of identifiers. " + "<h3>Example curl command:</h3>" + "<p>Ingest one video file:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage/fast -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording.mp4' \n" + "</pre></p>" + "<p>Ingest two video files:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage/fast -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording-vga.mp4' \\\n" + " -F 'flavor=presenter/source' -F 'BODY=@test-recording-camera.mp4' \n" + "</pre></p>", pathParameters = { @RestParameter(description = "Workflow definition id", isRequired = true, name = "wdID", type = RestParameter.Type.STRING) }, restParameters = { @RestParameter(description = "The kind of media track. This has to be specified prior to each media track", isRequired = true, name = "flavor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "abstract", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "accessRights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "available", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "contributor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "coverage", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "created", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "creator", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "date", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "description", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "extent", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "format", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "identifier", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isPartOf", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReferencedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReplacedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "language", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "license", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "publisher", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "relation", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "replaces", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rightsHolder", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "source", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "spatial", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "subject", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "temporal", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "title", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "type", type = RestParameter.Type.STRING), @RestParameter(description = "URL of episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of series DublinCore Catalog", isRequired = false, name = "seriesDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Series DublinCore Catalog", isRequired = false, name = "seriesDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of a media track file", isRequired = false, name = "mediaUri", type = RestParameter.Type.STRING) }, bodyParameter = @RestParameter(description = "The media track file", isRequired = true, name = "BODY", type = RestParameter.Type.FILE), reponses = { @RestResponse(description = "Ingest successfull. Returns workflow instance as XML", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Ingest failed due to invalid requests.", responseCode = HttpServletResponse.SC_BAD_REQUEST), @RestResponse(description = "Ingest failed. Something went wrong internally. Please have a look at the log files", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "") public Response addMediaPackage(@Context HttpServletRequest request, @PathParam("wdID") String wdID) { logger.trace("add mediapackage as multipart-form-data with workflow definition id: {}", wdID); MediaPackageElementFlavor flavor = null; try { MediaPackage mp = ingestService.createMediaPackage(); DublinCoreCatalog dcc = null; Map<String, String> workflowProperties = new HashMap<>(); int seriesDCCatalogNumber = 0; int episodeDCCatalogNumber = 0; boolean hasMedia = false; if (ServletFileUpload.isMultipartContent(request)) { for (FileItemIterator iter = new ServletFileUpload().getItemIterator(request); iter.hasNext();) { FileItemStream item = iter.next(); if (item.isFormField()) { String fieldName = item.getFieldName(); String value = Streams.asString(item.openStream(), "UTF-8"); logger.trace("form field {}: {}", fieldName, value); /* Ignore empty fields */ if ("".equals(value)) { continue; } /* “Remember” the flavor for the next media. */ if ("flavor".equals(fieldName)) { try { flavor = MediaPackageElementFlavor.parseFlavor(value); } catch (IllegalArgumentException e) { String error = String.format("Could not parse flavor '%s'", value); logger.debug(error, e); return Response.status(Status.BAD_REQUEST).entity(error).build(); } /* Fields for DC catalog */ } else if (dcterms.contains(fieldName)) { if ("identifier".equals(fieldName)) { /* Use the identifier for the mediapackage */ mp.setIdentifier(new IdImpl(value)); } EName en = new EName(DublinCore.TERMS_NS_URI, fieldName); if (dcc == null) { dcc = dublinCoreService.newInstance(); } dcc.add(en, value); /* Episode metadata by URL */ } else if ("episodeDCCatalogUri".equals(fieldName)) { try { URI dcurl = new URI(value); updateMediaPackageID(mp, dcurl); ingestService.addCatalog(dcurl, MediaPackageElements.EPISODE, mp); episodeDCCatalogNumber += 1; } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Episode metadata DC catalog (XML) as string */ } else if ("episodeDCCatalog".equals(fieldName)) { InputStream is = new ByteArrayInputStream(value.getBytes("UTF-8")); updateMediaPackageID(mp, is); is.reset(); String fileName = "episode" + episodeDCCatalogNumber + ".xml"; episodeDCCatalogNumber += 1; ingestService.addCatalog(is, fileName, MediaPackageElements.EPISODE, mp); /* Series by URL */ } else if ("seriesDCCatalogUri".equals(fieldName)) { try { URI dcurl = new URI(value); ingestService.addCatalog(dcurl, MediaPackageElements.SERIES, mp); } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Series DC catalog (XML) as string */ } else if ("seriesDCCatalog".equals(fieldName)) { String fileName = "series" + seriesDCCatalogNumber + ".xml"; seriesDCCatalogNumber += 1; InputStream is = new ByteArrayInputStream(value.getBytes("UTF-8")); ingestService.addCatalog(is, fileName, MediaPackageElements.SERIES, mp); /* Add media files by URL */ } else if ("mediaUri".equals(fieldName)) { if (flavor == null) { /* A flavor has to be specified in the request prior the media file */ return Response.serverError().status(Status.BAD_REQUEST).build(); } URI mediaUrl; try { mediaUrl = new URI(value); } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } ingestService.addTrack(mediaUrl, flavor, mp); hasMedia = true; } else { /* Tread everything else as workflow properties */ workflowProperties.put(fieldName, value); } /* Media files as request parameter */ } else { if (flavor == null) { /* A flavor has to be specified in the request prior the video file */ logger.debug("A flavor has to be specified in the request prior to the content BODY"); return Response.serverError().status(Status.BAD_REQUEST).build(); } ingestService.addTrack(item.openStream(), item.getName(), flavor, mp); hasMedia = true; } } /* Check if we got any media. Fail if not. */ if (!hasMedia) { logger.warn("Rejected ingest without actual media."); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Add episode mediapackage if metadata were send separately */ if (dcc != null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); dcc.toXml(out, true); InputStream in = new ByteArrayInputStream(out.toByteArray()); ingestService.addCatalog(in, "dublincore.xml", MediaPackageElements.EPISODE, mp); /* Check if we have metadata for the episode */ } else if (episodeDCCatalogNumber == 0) { logger.warn("Rejected ingest without episode metadata. At least provide a title."); return Response.serverError().status(Status.BAD_REQUEST).build(); } WorkflowInstance workflow = (wdID == null) ? ingestService.ingest(mp) : ingestService.ingest(mp, wdID, workflowProperties); return Response.ok(workflow).build(); } return Response.serverError().status(Status.BAD_REQUEST).build(); } catch (Exception e) { logger.warn(e.getMessage(), e); return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build(); } }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2020-5230 - Severity: MEDIUM - CVSS Score: 5.0 Description: Limit Characters Allowed In Ids Opencast allows almost arbitrary identifiers for media packages and elements to be used. This can be problematic for operation and security since such identifiers are sometimes used for file system operations which may lead to attacker being able to escape working directories and write files to other locations. In addition, Opencast's `Id.toString(…)` vs `Id.compact(…)` behavior, the latter trying to mitigate some of the file system problems, can cause errors due to identifier mismatch since an identifier may unintentionally change. This patch limits the characters allowed to be used in identifiers to ensure no unsafe operations are possible and no mismatch may happen. Function: addMediaPackage File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java Repository: opencast Fixed Code: @POST @Produces(MediaType.TEXT_XML) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("addMediaPackage/{wdID}") @RestQuery(name = "addMediaPackage", description = "<p>Create and ingest media package from media tracks with additional Dublin Core metadata. It is " + "mandatory to set a title for the recording. This can be done with the 'title' form field or by supplying a DC " + "catalog with a title included. The identifier of the newly created media package will be taken from the " + "<em>identifier</em> field or the episode DublinCore catalog (deprecated<sup>*</sup>). If no identifier is " + "set, a newa randumm UUIDv4 will be generated. This endpoint is not meant to be used by capture agents for " + "scheduled recordings. It's primary use is for manual ingests with command line tools like curl.</p> " + "<p>Multiple tracks can be ingested by using multiple form fields. It's important, however, to always set the " + "flavor of the next media file <em>before</em> sending the media file itself.</p>" + "<b>(*)</b> The special treatment of the identifier field is deprecated any may be removed in future versions " + "without further notice in favor of a random UUID generation to ensure uniqueness of identifiers. " + "<h3>Example curl command:</h3>" + "<p>Ingest one video file:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage/fast -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording.mp4' \n" + "</pre></p>" + "<p>Ingest two video files:</p>" + "<p><pre>\n" + "curl -f -i --digest -u opencast_system_account:CHANGE_ME -H 'X-Requested-Auth: Digest' \\\n" + " http://localhost:8080/ingest/addMediaPackage/fast -F creator='John Doe' -F title='Test Recording' \\\n" + " -F 'flavor=presentation/source' -F 'BODY=@test-recording-vga.mp4' \\\n" + " -F 'flavor=presenter/source' -F 'BODY=@test-recording-camera.mp4' \n" + "</pre></p>", pathParameters = { @RestParameter(description = "Workflow definition id", isRequired = true, name = "wdID", type = RestParameter.Type.STRING) }, restParameters = { @RestParameter(description = "The kind of media track. This has to be specified prior to each media track", isRequired = true, name = "flavor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "abstract", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "accessRights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "available", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "contributor", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "coverage", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "created", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "creator", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "date", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "description", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "extent", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "format", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "identifier", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isPartOf", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReferencedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "isReplacedBy", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "language", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "license", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "publisher", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "relation", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "replaces", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rights", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "rightsHolder", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "source", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "spatial", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "subject", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "temporal", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "title", type = RestParameter.Type.STRING), @RestParameter(description = "Episode metadata value", isRequired = false, name = "type", type = RestParameter.Type.STRING), @RestParameter(description = "URL of episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Episode DublinCore Catalog", isRequired = false, name = "episodeDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of series DublinCore Catalog", isRequired = false, name = "seriesDCCatalogUri", type = RestParameter.Type.STRING), @RestParameter(description = "Series DublinCore Catalog", isRequired = false, name = "seriesDCCatalog", type = RestParameter.Type.STRING), @RestParameter(description = "URL of a media track file", isRequired = false, name = "mediaUri", type = RestParameter.Type.STRING) }, bodyParameter = @RestParameter(description = "The media track file", isRequired = true, name = "BODY", type = RestParameter.Type.FILE), reponses = { @RestResponse(description = "Ingest successfull. Returns workflow instance as XML", responseCode = HttpServletResponse.SC_OK), @RestResponse(description = "Ingest failed due to invalid requests.", responseCode = HttpServletResponse.SC_BAD_REQUEST), @RestResponse(description = "Ingest failed. Something went wrong internally. Please have a look at the log files", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "") public Response addMediaPackage(@Context HttpServletRequest request, @PathParam("wdID") String wdID) { logger.trace("add mediapackage as multipart-form-data with workflow definition id: {}", wdID); MediaPackageElementFlavor flavor = null; try { MediaPackage mp = ingestService.createMediaPackage(); DublinCoreCatalog dcc = null; Map<String, String> workflowProperties = new HashMap<>(); int seriesDCCatalogNumber = 0; int episodeDCCatalogNumber = 0; boolean hasMedia = false; if (ServletFileUpload.isMultipartContent(request)) { for (FileItemIterator iter = new ServletFileUpload().getItemIterator(request); iter.hasNext();) { FileItemStream item = iter.next(); if (item.isFormField()) { String fieldName = item.getFieldName(); String value = Streams.asString(item.openStream(), "UTF-8"); logger.trace("form field {}: {}", fieldName, value); /* Ignore empty fields */ if ("".equals(value)) { continue; } /* “Remember” the flavor for the next media. */ if ("flavor".equals(fieldName)) { try { flavor = MediaPackageElementFlavor.parseFlavor(value); } catch (IllegalArgumentException e) { String error = String.format("Could not parse flavor '%s'", value); logger.debug(error, e); return Response.status(Status.BAD_REQUEST).entity(error).build(); } /* Fields for DC catalog */ } else if (dcterms.contains(fieldName)) { if ("identifier".equals(fieldName)) { /* Use the identifier for the mediapackage */ mp.setIdentifier(new IdImpl(value)); } EName en = new EName(DublinCore.TERMS_NS_URI, fieldName); if (dcc == null) { dcc = dublinCoreService.newInstance(); } dcc.add(en, value); /* Episode metadata by URL */ } else if ("episodeDCCatalogUri".equals(fieldName)) { try { URI dcurl = new URI(value); updateMediaPackageID(mp, dcurl); ingestService.addCatalog(dcurl, MediaPackageElements.EPISODE, mp); episodeDCCatalogNumber += 1; } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Episode metadata DC catalog (XML) as string */ } else if ("episodeDCCatalog".equals(fieldName)) { InputStream is = new ByteArrayInputStream(value.getBytes("UTF-8")); updateMediaPackageID(mp, is); is.reset(); String fileName = "episode" + episodeDCCatalogNumber + ".xml"; episodeDCCatalogNumber += 1; ingestService.addCatalog(is, fileName, MediaPackageElements.EPISODE, mp); /* Series by URL */ } else if ("seriesDCCatalogUri".equals(fieldName)) { try { URI dcurl = new URI(value); ingestService.addCatalog(dcurl, MediaPackageElements.SERIES, mp); } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Series DC catalog (XML) as string */ } else if ("seriesDCCatalog".equals(fieldName)) { String fileName = "series" + seriesDCCatalogNumber + ".xml"; seriesDCCatalogNumber += 1; InputStream is = new ByteArrayInputStream(value.getBytes("UTF-8")); ingestService.addCatalog(is, fileName, MediaPackageElements.SERIES, mp); /* Add media files by URL */ } else if ("mediaUri".equals(fieldName)) { if (flavor == null) { /* A flavor has to be specified in the request prior the media file */ return Response.serverError().status(Status.BAD_REQUEST).build(); } URI mediaUrl; try { mediaUrl = new URI(value); } catch (java.net.URISyntaxException e) { /* Parameter was not a valid URL: Return 400 Bad Request */ logger.warn(e.getMessage(), e); return Response.serverError().status(Status.BAD_REQUEST).build(); } ingestService.addTrack(mediaUrl, flavor, mp); hasMedia = true; } else { /* Tread everything else as workflow properties */ workflowProperties.put(fieldName, value); } /* Media files as request parameter */ } else { if (flavor == null) { /* A flavor has to be specified in the request prior the video file */ logger.debug("A flavor has to be specified in the request prior to the content BODY"); return Response.serverError().status(Status.BAD_REQUEST).build(); } ingestService.addTrack(item.openStream(), item.getName(), flavor, mp); hasMedia = true; } } /* Check if we got any media. Fail if not. */ if (!hasMedia) { logger.warn("Rejected ingest without actual media."); return Response.serverError().status(Status.BAD_REQUEST).build(); } /* Add episode mediapackage if metadata were send separately */ if (dcc != null) { ByteArrayOutputStream out = new ByteArrayOutputStream(); dcc.toXml(out, true); InputStream in = new ByteArrayInputStream(out.toByteArray()); ingestService.addCatalog(in, "dublincore.xml", MediaPackageElements.EPISODE, mp); /* Check if we have metadata for the episode */ } else if (episodeDCCatalogNumber == 0) { logger.warn("Rejected ingest without episode metadata. At least provide a title."); return Response.serverError().status(Status.BAD_REQUEST).build(); } WorkflowInstance workflow = (wdID == null) ? ingestService.ingest(mp) : ingestService.ingest(mp, wdID, workflowProperties); return Response.ok(workflow).build(); } return Response.serverError().status(Status.BAD_REQUEST).build(); } catch (IllegalArgumentException e) { return Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build(); } catch (Exception e) { logger.warn(e.getMessage(), e); return Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build(); } }
[ "CWE-74" ]
CVE-2020-5230
MEDIUM
5
opencast
addMediaPackage
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
bbb473f34ab95497d6c432c81285efb0c739f317
1
Analyze the following code function for security vulnerabilities
@SuppressWarnings("javadoc") protected void firePacketSendingListeners(final Stanza packet) { final List<StanzaListener> listenersToNotify = new LinkedList<StanzaListener>(); synchronized (sendListeners) { for (ListenerWrapper listenerWrapper : sendListeners.values()) { if (listenerWrapper.filterMatches(packet)) { listenersToNotify.add(listenerWrapper.getListener()); } } } if (listenersToNotify.isEmpty()) { return; } // Notify in a new thread, because we can asyncGo(new Runnable() { @Override public void run() { for (StanzaListener listener : listenersToNotify) { try { listener.processPacket(packet); } catch (Exception e) { LOGGER.log(Level.WARNING, "Sending listener threw exception", e); continue; } } }}); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: firePacketSendingListeners File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
firePacketSendingListeners
smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
private RuntimeException asRuntimeException(Throwable throwable) { if (throwable instanceof RuntimeException) { return (RuntimeException) throwable; } else { return new RuntimeException(throwable); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: asRuntimeException File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
asRuntimeException
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public static MediaException createMediaException(int extra) { MediaErrorType type; String message; switch (extra) { case MediaPlayer.MEDIA_ERROR_IO: type = MediaErrorType.Network; message = "IO error"; break; case MediaPlayer.MEDIA_ERROR_MALFORMED: type = MediaErrorType.Decode; message = "Media was malformed"; break; case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK: type = MediaErrorType.SrcNotSupported; message = "Not valie for progressive playback"; break; case MediaPlayer.MEDIA_ERROR_SERVER_DIED: type = MediaErrorType.Network; message = "Server died"; break; case MediaPlayer.MEDIA_ERROR_TIMED_OUT: type = MediaErrorType.Network; message = "Timed out"; break; case MediaPlayer.MEDIA_ERROR_UNKNOWN: type = MediaErrorType.Network; message = "Unknown error"; break; case MediaPlayer.MEDIA_ERROR_UNSUPPORTED: type = MediaErrorType.SrcNotSupported; message = "Unsupported media"; break; default: type = MediaErrorType.Network; message = "Unknown error"; } return new MediaException(type, message); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createMediaException 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
createMediaException
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public void onStateUpdateFromHandler(State state) { if (function == null || sourceFormat == null) { logger.warn( "Please specify a function and a source format for this Profile in the '{}' and '{}' parameters. Returning the original state now.", FUNCTION_PARAM, SOURCE_FORMAT_PARAM); callback.sendUpdate(state); return; } callback.sendUpdate((State) transformState(state)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStateUpdateFromHandler File: bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java Repository: openhab/openhab-addons The code follows secure coding practices.
[ "CWE-863" ]
CVE-2020-5242
HIGH
9.3
openhab/openhab-addons
onStateUpdateFromHandler
bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
0
Analyze the following code function for security vulnerabilities
public void initialize(int keySize, SecureRandom secureRandom) { KeyGenerationParameters kgp; if (keySize <= 10) { // create 2^10 keys int[] defh = {10}; int[] defw = {3}; int[] defk = {2}; // XXX sec random neede? kgp = new GMSSKeyGenerationParameters(secureRandom, new GMSSParameters(defh.length, defh, defw, defk)); } else if (keySize <= 20) { // create 2^20 keys int[] defh = {10, 10}; int[] defw = {5, 4}; int[] defk = {2, 2}; kgp = new GMSSKeyGenerationParameters(secureRandom, new GMSSParameters(defh.length, defh, defw, defk)); } else { // create 2^40 keys, keygen lasts around 80 seconds int[] defh = {10, 10, 10, 10}; int[] defw = {9, 9, 9, 3}; int[] defk = {2, 2, 2, 2}; kgp = new GMSSKeyGenerationParameters(secureRandom, new GMSSParameters(defh.length, defh, defw, defk)); } // call the initializer with the chosen parameters this.initialize(kgp); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initialize File: core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
initialize
core/src/main/java/org/bouncycastle/pqc/crypto/gmss/GMSSKeyPairGenerator.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
void enforceBeamShareActivityPolicy(Context context, UserHandle uh, boolean isGlobalEnabled){ UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); IPackageManager mIpm = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); boolean isActiveForUser = (!um.hasUserRestriction(UserManager.DISALLOW_OUTGOING_BEAM, uh)) && isGlobalEnabled; if (DBG){ Log.d(TAG, "Enforcing a policy change on user: " + uh + ", isActiveForUser = " + isActiveForUser); } try { mIpm.setComponentEnabledSetting(new ComponentName( BeamShareActivity.class.getPackageName$(), BeamShareActivity.class.getName()), isActiveForUser ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP, uh.getIdentifier()); } catch (RemoteException e) { Log.w(TAG, "Unable to change Beam status for user " + uh); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceBeamShareActivityPolicy File: src/com/android/nfc/NfcService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3761
LOW
2.1
android
enforceBeamShareActivityPolicy
src/com/android/nfc/NfcService.java
9ea802b5456a36f1115549b645b65c791eff3c2c
0
Analyze the following code function for security vulnerabilities
public void setUseDesktopUserAgent(boolean override, boolean reloadOnChange) { if (mNativeContentViewCore != 0) { nativeSetUseDesktopUserAgent(mNativeContentViewCore, override, reloadOnChange); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUseDesktopUserAgent File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
setUseDesktopUserAgent
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public boolean isHardKeyboardAvailable() { synchronized (mWindowMap) { return mHardKeyboardAvailable; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isHardKeyboardAvailable File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
isHardKeyboardAvailable
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
Context getContext() { return mContext; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContext 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
getContext
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
public String getPath() { return internal.getPath(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPath File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
getPath
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public boolean hasAccessLevel(String level, String user, String docname) { try { return this.xwiki.getRightService().hasAccessLevel(level, user, docname, getXWikiContext()); } catch (Exception e) { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasAccessLevel 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
hasAccessLevel
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 isTurningOff() { return mIsTurningOff; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTurningOff File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
isTurningOff
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
@Nullable private String getRoleHolderPackageName(Context context, String role) { return getRoleHolderPackageNameOnUser(context, role, Process.myUserHandle()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRoleHolderPackageName 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
getRoleHolderPackageName
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
boolean instrumentationSourceHasPermission(int pid, String permission) { final WindowProcessController process; synchronized (mGlobalLock) { process = mProcessMap.getProcess(pid); } if (process == null || !process.isInstrumenting()) { return false; } final int sourceUid = process.getInstrumentationSourceUid(); return checkPermission(permission, -1, sourceUid) == PackageManager.PERMISSION_GRANTED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: instrumentationSourceHasPermission 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
instrumentationSourceHasPermission
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public Set<String> getGroups() { Set<String> groups = new LinkedHashSet<String>(); groups.add(SecurityLogic.getAllGroup(portofinoConfiguration)); groups.add(SecurityLogic.getAnonymousGroup(portofinoConfiguration)); groups.add(SecurityLogic.getRegisteredGroup(portofinoConfiguration)); groups.add(SecurityLogic.getAdministratorsGroup(portofinoConfiguration)); return groups; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGroups File: portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java Repository: ManyDesigns/Portofino The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-29451
MEDIUM
6.4
ManyDesigns/Portofino
getGroups
portofino-core/src/main/java/com/manydesigns/portofino/shiro/AbstractPortofinoRealm.java
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
0
Analyze the following code function for security vulnerabilities
protected String appendDelimiter(String attribute) { if (CmsStringUtil.isNotEmpty(attribute)) { if (!attribute.startsWith(" ")) { // add a delimiter space between the beginning button HTML and the button tag attributes return " " + attribute; } else { return attribute; } } return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendDelimiter File: src/org/opencms/workplace/CmsDialog.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
appendDelimiter
src/org/opencms/workplace/CmsDialog.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
public void setError(String msg, PackageManagerException e) { returnCode = e.error; returnMsg = ExceptionUtils.getCompleteMessage(msg, e); Slog.w(TAG, msg, e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setError 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
setError
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public ServerBuilder service( HttpServiceWithRoutes serviceWithRoutes, Iterable<? extends Function<? super HttpService, ? extends HttpService>> decorators) { virtualHostTemplate.service(serviceWithRoutes, decorators); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: service 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
service
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public int getManagedUserId(@UserIdInt int callingUserId) { if (VERBOSE_LOG) Slogf.v(LOG_TAG, "getManagedUserId: callingUserId=%d", callingUserId); for (UserInfo ui : mUserManager.getProfiles(callingUserId)) { if (ui.id == callingUserId || !ui.isManagedProfile()) { continue; // Caller user self, or not a managed profile. Skip. } if (VERBOSE_LOG) Slogf.v(LOG_TAG, "Managed user=%d", ui.id); return ui.id; } if (VERBOSE_LOG) Slogf.v(LOG_TAG, "Managed user not found."); return UserHandle.USER_NULL; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getManagedUserId 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
getManagedUserId
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int describeContents() { return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: describeContents File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
describeContents
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public static float getDesiredWidth(CharSequence source, int start, int end, TextPaint paint) { float need = 0; int next; for (int i = start; i <= end; i = next) { next = TextUtils.indexOf(source, '\n', i, end); if (next < 0) next = end; // note, omits trailing paragraph char float w = measurePara(paint, source, i, next); if (w > need) need = w; next++; } return need; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDesiredWidth File: core/java/android/text/Layout.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2018-9452
MEDIUM
4.3
android
getDesiredWidth
core/java/android/text/Layout.java
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
0
Analyze the following code function for security vulnerabilities
@Override public int getActivityDisplayId(IBinder activityToken) throws RemoteException { synchronized (this) { final ActivityStack stack = ActivityRecord.getStackLocked(activityToken); if (stack != null && stack.mDisplayId != INVALID_DISPLAY) { return stack.mDisplayId; } return DEFAULT_DISPLAY; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getActivityDisplayId 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
getActivityDisplayId
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public List<? extends TextEdit> format(TextDocument document, Range range, XMLFormattingOptions options) { return formatter.format(document, range, options); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: format File: org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java Repository: eclipse/lemminx The code follows secure coding practices.
[ "CWE-22" ]
CVE-2019-18212
MEDIUM
4
eclipse/lemminx
format
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/services/XMLLanguageService.java
e37c399aa266be1b7a43061d4afc43dc230410d2
0
Analyze the following code function for security vulnerabilities
private void setEditorField(Object propertyId, Field<?> field) { checkColumnExists(propertyId); Field<?> oldField = editorFieldGroup.getField(propertyId); if (oldField != null) { editorFieldGroup.unbind(oldField); oldField.setParent(null); } if (field != null) { field.setParent(this); editorFieldGroup.bind(field, propertyId); } // Store field for this property for future reference editorFields.put(propertyId, field); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEditorField File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setEditorField
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public String getDefaultDialerPackage() { try { Log.startSession("TSI.gDDP"); final long token = Binder.clearCallingIdentity(); try { return mDefaultDialerCache.getDefaultDialerApplication( ActivityManager.getCurrentUser()); } finally { Binder.restoreCallingIdentity(token); } } finally { Log.endSession(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultDialerPackage File: src/com/android/server/telecom/TelecomServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21394
MEDIUM
5.5
android
getDefaultDialerPackage
src/com/android/server/telecom/TelecomServiceImpl.java
68dca62035c49e14ad26a54f614199cb29a3393f
0
Analyze the following code function for security vulnerabilities
public boolean isDebugging() { return debugging; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isDebugging File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
isDebugging
samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public boolean isAutoTypeSupport() { return autoTypeSupport; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isAutoTypeSupport File: src/main/java/com/alibaba/fastjson/parser/ParserConfig.java Repository: alibaba/fastjson The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-25845
MEDIUM
6.8
alibaba/fastjson
isAutoTypeSupport
src/main/java/com/alibaba/fastjson/parser/ParserConfig.java
8f3410f81cbd437f7c459f8868445d50ad301f15
0
Analyze the following code function for security vulnerabilities
public void warning(final SAXParseException x) { logger.warn( buildPrintMessage( x ) ); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: warning File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java Repository: apache/incubator-kie-drools The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2014-8125
HIGH
7.5
apache/incubator-kie-drools
warning
drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3
0
Analyze the following code function for security vulnerabilities
@PostMapping("/assert") public ResultDTO<Long> assertApp(@RequestBody AppAssertRequest request) { return ResultDTO.success(appInfoService.assertApp(request.getAppName(), request.getPassword())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: assertApp File: powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java Repository: PowerJob The code follows secure coding practices.
[ "CWE-522" ]
CVE-2020-28865
MEDIUM
5
PowerJob
assertApp
powerjob-server/src/main/java/com/github/kfcfans/powerjob/server/web/controller/AppInfoController.java
464ce2dc0ca3e65fa1dc428239829890c52a413a
0
Analyze the following code function for security vulnerabilities
private void migrate29(File dataDir, Stack<Integer> versions) { for (File file: dataDir.listFiles()) { if (file.getName().startsWith("Users.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) element.addElement("webHooks"); dom.writeToFile(file, false); } else if (file.getName().startsWith("Projects.xml")) { VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file); for (Element element: dom.getRootElement().elements()) { for (Element branchProtectionElement: element.element("branchProtections").elements()) branchProtectionElement.element("user").setName("userMatch"); for (Element tagProtectionElement: element.element("tagProtections").elements()) tagProtectionElement.element("user").setName("userMatch"); } dom.writeToFile(file, false); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: migrate29 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
migrate29
server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
0
Analyze the following code function for security vulnerabilities
@Deactivate public void deactivate() { JmxUtil.unregisterMXBean(registerMXBean); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deactivate File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java Repository: opencast The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-29237
MEDIUM
5.5
opencast
deactivate
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
0
Analyze the following code function for security vulnerabilities
@Override public void setShortProperty(String name, short value) throws JMSException { this.setObjectProperty(name, value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setShortProperty File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
setShortProperty
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@NonNull public BubbleMetadata.Builder setDeleteIntent(@Nullable PendingIntent deleteIntent) { mDeleteIntent = deleteIntent; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDeleteIntent File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setDeleteIntent
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
public void setLocusId(LocusId locusId, IBinder appToken) { synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.isInRootTaskLocked(appToken); if (r != null) { r.setLocusId(locusId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLocusId 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
setLocusId
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
protected void setupHeaders(XWikiResponse response, String mimetype, Date lastChanged, long length) { if (!StringUtils.isBlank(mimetype)) { response.setContentType(mimetype); } else { response.setContentType("application/octet-stream"); } response.setDateHeader("Last-Modified", lastChanged.getTime()); // Cache for one month (30 days) response.setHeader("Cache-Control", "public"); response.setDateHeader("Expires", (new Date()).getTime() + 30 * 24 * 3600 * 1000L); setContentLength(response, length); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setupHeaders File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-36092
HIGH
7.5
xwiki/xwiki-platform
setupHeaders
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/SkinAction.java
71a6d0bb6f8ab718fcfaae0e9b8c16c2d69cd4bb
0
Analyze the following code function for security vulnerabilities
public void setCertTypeInUse(boolean certTypeInUse) { this.certTypeInUse = certTypeInUse; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCertTypeInUse File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setCertTypeInUse
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
@Override public void setFrontActivityScreenCompatMode(int mode) { mAmInternal.enforceCallingPermission(android.Manifest.permission.SET_SCREEN_COMPATIBILITY, "setFrontActivityScreenCompatMode"); ApplicationInfo ai; synchronized (mGlobalLock) { final Task rootTask = getTopDisplayFocusedRootTask(); final ActivityRecord r = rootTask != null ? rootTask.topRunningActivity() : null; if (r == null) { Slog.w(TAG, "setFrontActivityScreenCompatMode failed: no top activity"); return; } ai = r.info.applicationInfo; mCompatModePackages.setPackageScreenCompatModeLocked(ai, mode); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setFrontActivityScreenCompatMode 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
setFrontActivityScreenCompatMode
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public static ActivityOptions makeOpenCrossProfileAppsAnimation() { ActivityOptions options = new ActivityOptions(); options.mAnimationType = ANIM_OPEN_CROSS_PROFILE_APPS; return options; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: makeOpenCrossProfileAppsAnimation File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
makeOpenCrossProfileAppsAnimation
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
protected StatusBarNotification removeNotificationViews(String key, RankingMap ranking) { NotificationData.Entry entry = mNotificationData.remove(key, ranking); if (entry == null) { Log.w(TAG, "removeNotification for unknown key: " + key); return null; } updateNotifications(); Dependency.get(LeakDetector.class).trackGarbage(entry); return entry.notification; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeNotificationViews File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
removeNotificationViews
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void fixedLongToBytes(long n, byte[] buf, int off) { buf[off + 0] = (byte) ((n >> 56) & 0xff); buf[off + 1] = (byte) ((n >> 48) & 0xff); buf[off + 2] = (byte) ((n >> 40) & 0xff); buf[off + 3] = (byte) ((n >> 32) & 0xff); buf[off + 4] = (byte) ((n >> 24) & 0xff); buf[off + 5] = (byte) ((n >> 16) & 0xff); buf[off + 6] = (byte) ((n >> 8) & 0xff); buf[off + 7] = (byte) (n & 0xff); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fixedLongToBytes File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java Repository: facebook/fbthrift The code follows secure coding practices.
[ "CWE-770" ]
CVE-2019-11938
MEDIUM
5
facebook/fbthrift
fixedLongToBytes
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
private TaskEntity getCurrentTask(String procInsId) { return (TaskEntity) taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCurrentTask File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java Repository: thinkgem/jeesite The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-34601
CRITICAL
9.8
thinkgem/jeesite
getCurrentTask
src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
30750011b49f7c8d45d0f3ab13ed3a1a422655bb
0
Analyze the following code function for security vulnerabilities
private boolean isReceivingBroadcastLocked(ProcessRecord app, ArraySet<BroadcastQueue> receivingQueues) { final int N = app.curReceivers.size(); if (N > 0) { for (int i = 0; i < N; i++) { receivingQueues.add(app.curReceivers.valueAt(i).queue); } return true; } // It's not the current receiver, but it might be starting up to become one for (BroadcastQueue queue : mBroadcastQueues) { final BroadcastRecord r = queue.mPendingBroadcast; if (r != null && r.curApp == app) { // found it; report which queue it's in receivingQueues.add(queue); } } return !receivingQueues.isEmpty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isReceivingBroadcastLocked 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
isReceivingBroadcastLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void seekTo(String packageName, int pid, int uid, long pos) { try { final String reason = TAG + ":seekTo"; mService.tempAllowlistTargetPkgIfPossible(getUid(), getPackageName(), pid, uid, packageName, reason); mCb.onSeekTo(packageName, pid, uid, pos); } catch (RemoteException e) { Log.e(TAG, "Remote failure in seekTo.", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: seekTo File: services/core/java/com/android/server/media/MediaSessionRecord.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21280
MEDIUM
5.5
android
seekTo
services/core/java/com/android/server/media/MediaSessionRecord.java
06e772e05514af4aa427641784c5eec39a892ed3
0
Analyze the following code function for security vulnerabilities
@Override public void setCertifiedText(boolean certified) { fCertifiedText = certified; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCertifiedText File: ext/java/nokogiri/XmlSchema.java Repository: sparklemotion/nokogiri The code follows secure coding practices.
[ "CWE-611" ]
CVE-2020-26247
MEDIUM
4
sparklemotion/nokogiri
setCertifiedText
ext/java/nokogiri/XmlSchema.java
9c87439d9afa14a365ff13e73adc809cb2c3d97b
0
Analyze the following code function for security vulnerabilities
public String optString(String key, String defaultValue) { Object o = opt(key); return o != null ? o.toString() : defaultValue; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optString File: src/main/java/org/codehaus/jettison/json/JSONObject.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
optString
src/main/java/org/codehaus/jettison/json/JSONObject.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
void sendStartRestore(int numPackages) { if (mObserver != null) { try { mObserver.restoreStarting(numPackages); } catch (RemoteException e) { Slog.w(TAG, "Restore observer went away: startRestore"); mObserver = null; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendStartRestore File: services/backup/java/com/android/server/backup/BackupManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3759
MEDIUM
5
android
sendStartRestore
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public Integer getServerIndex() { return serverIndex; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerIndex File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
getServerIndex
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public String displayPrettyName(String fieldname, boolean showMandatory, XWikiContext context) { return displayPrettyName(fieldname, showMandatory, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayPrettyName 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
displayPrettyName
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
private void doDeleteApplicationTemplate(String templateName, String tenantDomain) throws IdentityApplicationManagementException { // Delete SP template from database ApplicationTemplateDAO applicationTemplateDAO = ApplicationMgtSystemConfig.getInstance() .getApplicationTemplateDAO(); applicationTemplateDAO.deleteApplicationTemplate(templateName, tenantDomain); // Delete SP template from cache ServiceProviderTemplateCacheKey templateCacheKey = new ServiceProviderTemplateCacheKey(templateName, tenantDomain); ServiceProviderTemplateCache.getInstance().clearCacheEntry(templateCacheKey); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doDeleteApplicationTemplate 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
doDeleteApplicationTemplate
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
int getFirstRowPosition(int row) { final int callerCount = mChooserListAdapter.getCallerTargetCount(); final int callerRows = (int) Math.ceil((float) callerCount / mColumnCount); if (row < callerRows) { return row * mColumnCount; } final int serviceCount = mChooserListAdapter.getServiceTargetCount(); final int serviceRows = (int) Math.ceil((float) serviceCount / mColumnCount); if (row < callerRows + serviceRows) { return callerCount + (row - callerRows) * mColumnCount; } return callerCount + serviceCount + (row - callerRows - serviceRows) * mColumnCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFirstRowPosition File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
getFirstRowPosition
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
public abstract BaseXMLBuilder ref(String name);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: ref File: src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java Repository: jmurty/java-xmlbuilder The code follows secure coding practices.
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
ref
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
e6fddca201790abab4f2c274341c0bb8835c3e73
0
Analyze the following code function for security vulnerabilities
NeededUriGrants collectGrants(Intent intent, ActivityRecord target) { if (target != null) { return mUgmInternal.checkGrantUriPermissionFromIntent(intent, Binder.getCallingUid(), target.packageName, target.mUserId); } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: collectGrants 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
collectGrants
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public XMSSMTPrivateKeyParameters build() { return new XMSSMTPrivateKeyParameters(this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: build File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-470" ]
CVE-2018-1000613
HIGH
7.5
bcgit/bc-java
build
core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
4092ede58da51af9a21e4825fbad0d9a3ef5a223
0
Analyze the following code function for security vulnerabilities
static RMQMessage normalise(Message msg) throws JMSException { if (msg instanceof RMQMessage) return (RMQMessage) msg; /* If not one of our own, copy it into an RMQMessage */ if (msg instanceof BytesMessage ) return RMQBytesMessage.recreate((BytesMessage)msg); else if (msg instanceof MapMessage ) return RMQMapMessage.recreate((MapMessage)msg); else if (msg instanceof ObjectMessage) return RMQObjectMessage.recreate((ObjectMessage) msg); else if (msg instanceof StreamMessage) return RMQStreamMessage.recreate((StreamMessage)msg); else if (msg instanceof TextMessage ) return RMQTextMessage.recreate((TextMessage)msg); else return RMQNullMessage.recreate(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalise File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
normalise
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
public boolean isBubbleNotification() { return (flags & Notification.FLAG_BUBBLE) != 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isBubbleNotification File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
isBubbleNotification
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public @NonNull InputStream openNonAsset(@NonNull String fileName, int accessMode) throws IOException { return openNonAsset(0, fileName, accessMode); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: openNonAsset File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
openNonAsset
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public void setSocketFactory(SocketFactory factory) { this.socketFactory = factory; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSocketFactory File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
setSocketFactory
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); if (session == null) { AccessControlContext acc = AccessController.getContext(); Subject subject = Subject.getSubject(acc); if (subject == null) { Helpers.doForbidden(response); return; } session = request.getSession(true); session.setAttribute("subject", subject); } else { Subject subject = (Subject) session.getAttribute("subject"); if (subject == null) { session.invalidate(); Helpers.doForbidden(response); return; } } String encoding = request.getHeader("Accept-Encoding"); boolean supportsGzip = (encoding != null && encoding.toLowerCase().indexOf("gzip") > -1); SessionTerminal st = (SessionTerminal) session.getAttribute("terminal"); if (st == null || st.isClosed()) { st = new SessionTerminal(getCommandProcessor(), getThreadIO()); session.setAttribute("terminal", st); } String str = request.getParameter("k"); String f = request.getParameter("f"); String dump = st.handle(str, f != null && f.length() > 0); if (dump != null) { if (supportsGzip) { response.setHeader("Content-Encoding", "gzip"); response.setHeader("Content-Type", "text/html"); try { GZIPOutputStream gzos = new GZIPOutputStream(response.getOutputStream()); gzos.write(dump.getBytes()); gzos.close(); } catch (IOException ie) { LOG.info("Exception writing response: ", ie); } } else { response.getOutputStream().write(dump.getBytes()); } } }
Vulnerability Classification: - CWE: CWE-352 - CVE: CVE-2014-0120 - Severity: MEDIUM - CVSS Score: 6.8 Description: Add a LoginTokenServlet that plugins can use to fetch a token, and let's use it in hawtio-karaf-terminal. Also handle cases where the terminal scope gets created a couple times. Function: doPost File: hawtio-karaf-terminal/src/main/java/io/hawt/web/plugin/karaf/terminal/TerminalServlet.java Repository: hawtio Fixed Code: @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); String token = request.getHeader(LoginTokenServlet.LOGIN_TOKEN); if (token == null || session == null) { Helpers.doForbidden(response); return; } String sessionToken = (String) session.getAttribute(LoginTokenServlet.LOGIN_TOKEN); if (!token.equals(sessionToken)) { Helpers.doForbidden(response); return; } String encoding = request.getHeader("Accept-Encoding"); boolean supportsGzip = (encoding != null && encoding.toLowerCase().indexOf("gzip") > -1); SessionTerminal st = (SessionTerminal) session.getAttribute("terminal"); if (st == null || st.isClosed()) { st = new SessionTerminal(getCommandProcessor(), getThreadIO()); session.setAttribute("terminal", st); } String str = request.getParameter("k"); String f = request.getParameter("f"); String dump = st.handle(str, f != null && f.length() > 0); if (dump != null) { if (supportsGzip) { response.setHeader("Content-Encoding", "gzip"); response.setHeader("Content-Type", "text/html"); try { GZIPOutputStream gzos = new GZIPOutputStream(response.getOutputStream()); gzos.write(dump.getBytes()); gzos.close(); } catch (IOException ie) { LOG.info("Exception writing response: ", ie); } } else { response.getOutputStream().write(dump.getBytes()); } } }
[ "CWE-352" ]
CVE-2014-0120
MEDIUM
6.8
hawtio
doPost
hawtio-karaf-terminal/src/main/java/io/hawt/web/plugin/karaf/terminal/TerminalServlet.java
b4e23e002639c274a2f687ada980118512f06113
1
Analyze the following code function for security vulnerabilities
public static void createProperty(FF4j ff4j, HttpServletRequest req) { String name = req.getParameter("name"); String type = req.getParameter("pType"); String description = req.getParameter("desc"); String value = req.getParameter("pValue"); String featureId = req.getParameter(WebConstants.FEATURE_UID); Property<?> ap = PropertyFactory.createProperty(name, type, value); ap.setDescription(description); if (Util.hasLength(featureId)) { Feature current = ff4j.getFeatureStore().read(featureId); current.addProperty(ap); ff4j.getFeatureStore().update(current); } else { ff4j.getPropertiesStore().createProperty(ap); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createProperty File: ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java Repository: ff4j The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2022-44262
CRITICAL
9.8
ff4j
createProperty
ff4j-web/src/main/java/org/ff4j/web/embedded/ConsoleOperations.java
991df72725f78adbc413d9b0fbb676201f1882e0
0
Analyze the following code function for security vulnerabilities
private <K, V> RemoteCacheImpl<K, V> createRemoteCache(String cacheName) { switch (configuration.nearCache().mode()) { case INVALIDATED: return new InvalidatedNearRemoteCache<>(this, cacheName, createNearCacheService(configuration.nearCache())); case DISABLED: default: return new RemoteCacheImpl<>(this, cacheName); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRemoteCache File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java Repository: infinispan The code follows secure coding practices.
[ "CWE-502" ]
CVE-2017-15089
MEDIUM
6.5
infinispan
createRemoteCache
client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
efc44b7b0a5dd4f44773808840dd9785cabcf21c
0
Analyze the following code function for security vulnerabilities
@Override public String getTextContent() throws DOMException { return doc.getTextContent(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTextContent 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
getTextContent
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
9b75694cedfa4825d4a2330abf2719d470c654cd
0
Analyze the following code function for security vulnerabilities
@Override protected BroadcastFilter newResult(BroadcastFilter filter, int match, int userId) { if (userId == UserHandle.USER_ALL || filter.owningUserId == UserHandle.USER_ALL || userId == filter.owningUserId) { return super.newResult(filter, match, userId); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newResult 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
newResult
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
protected Restrictor createRestrictor() { return RestrictorFactory.createRestrictor(configuration, logHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createRestrictor File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
createRestrictor
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
@Override public void installUpdateFromFile(ComponentName admin, String callerPackageName, ParcelFileDescriptor updateFileDescriptor, StartInstallingUpdateCallback callback) { if (!isPermissionCheckFlagEnabled()) { Objects.requireNonNull(admin, "ComponentName is null"); } CallerIdentity caller; if (isPermissionCheckFlagEnabled()) { caller = getCallerIdentity(admin, callerPackageName); enforcePermission(MANAGE_DEVICE_POLICY_SYSTEM_UPDATES, caller.getPackageName(), UserHandle.USER_ALL); } else { caller = getCallerIdentity(admin); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller)); } checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_INSTALL_SYSTEM_UPDATE); DevicePolicyEventLogger .createEvent(DevicePolicyEnums.INSTALL_SYSTEM_UPDATE) .setAdmin(caller.getPackageName()) .setBoolean(isDeviceAB()) .write(); mInjector.binderWithCleanCallingIdentity(() -> { UpdateInstaller updateInstaller; if (isDeviceAB()) { updateInstaller = new AbUpdateInstaller( mContext, updateFileDescriptor, callback, mInjector, mConstants); } else { updateInstaller = new NonAbUpdateInstaller( mContext, updateFileDescriptor, callback, mInjector, mConstants); } updateInstaller.startInstallUpdate(); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: installUpdateFromFile 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
installUpdateFromFile
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void updateNotification(StatusBarNotification notification, RankingMap ranking) throws InflationException { if (DEBUG) Log.d(TAG, "updateNotification(" + notification + ")"); final String key = notification.getKey(); abortExistingInflation(key); Entry entry = mNotificationData.get(key); if (entry == null) { return; } else { mHeadsUpEntriesToRemoveOnSwitch.remove(entry); mRemoteInputEntriesToRemoveOnCollapse.remove(entry); } Notification n = notification.getNotification(); mNotificationData.updateRanking(ranking); final StatusBarNotification oldNotification = entry.notification; entry.notification = notification; mGroupManager.onEntryUpdated(entry, oldNotification); entry.updateIcons(mContext, notification); inflateViews(entry, mStackScroller); mForegroundServiceController.updateNotification(notification, mNotificationData.getImportance(key)); boolean shouldPeek = shouldPeek(entry, notification); boolean alertAgain = alertAgain(entry, n); updateHeadsUp(key, entry, shouldPeek, alertAgain); updateNotifications(); if (!notification.isClearable()) { // The user may have performed a dismiss action on the notification, since it's // not clearable we should snap it back. mStackScroller.snapViewIfNeeded(entry.row); } if (DEBUG) { // Is this for you? boolean isForCurrentUser = isNotificationForCurrentProfiles(notification); Log.d(TAG, "notification is " + (isForCurrentUser ? "" : "not ") + "for you"); } setAreThereNotifications(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateNotification File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
updateNotification
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public boolean isEditCommentSuggested(XWikiContext context) { String bl = getXWikiPreference("editcomment_suggested", "", context); if ("1".equals(bl)) { return true; } if ("0".equals(bl)) { return false; } return "1".equals(getConfiguration().getProperty("xwiki.editcomment.suggested", "0")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEditCommentSuggested 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
isEditCommentSuggested
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 void onWindowFocusChanged(boolean hasWindowFocus) { if (!hasWindowFocus) resetGestureDetection(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onWindowFocusChanged File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
onWindowFocusChanged
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public void setExceptionHandler(ExceptionHandler exceptionHandler) { if (exceptionHandler == null) { throw new IllegalArgumentException("exception handler cannot be null!"); } this.exceptionHandler = exceptionHandler; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setExceptionHandler File: src/main/java/com/rabbitmq/client/ConnectionFactory.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
setExceptionHandler
src/main/java/com/rabbitmq/client/ConnectionFactory.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
@Override public int startActivityAsUser(IApplicationThread caller, String callerPackage, @Nullable String callerFeatureId, Intent intent, @Nullable IBinder resultTo, int startFlags, Bundle options, int userId) { return ActivityTaskManagerService.this.startActivityAsUser( caller, callerPackage, callerFeatureId, intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), resultTo, null, 0, startFlags, null, options, userId, false /*validateIncomingUser*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAsUser 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
startActivityAsUser
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0