instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public long inputDispatchingTimedOut(int pid, final boolean aboveSystem, String reason) {
if (checkCallingPermission(android.Manifest.permission.FILTER_EVENTS)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires permission "
+ android.Manifest.permission.FILTER_EVENTS);
}
ProcessRecord proc;
long timeout;
synchronized (this) {
synchronized (mPidsSelfLocked) {
proc = mPidsSelfLocked.get(pid);
}
timeout = getInputDispatchingTimeoutLocked(proc);
}
if (inputDispatchingTimedOut(proc, null, null, aboveSystem, reason)) {
return -1;
}
return timeout;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: inputDispatchingTimedOut
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
|
inputDispatchingTimedOut
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public Jooby securePort(final int port) {
this.securePort = port;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: securePort
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
securePort
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
private void saveProjectBuildGradle() throws IOException {
TemplateFile tmpl = TemplateFile.fromResources("/export/build.gradle.tmpl");
tmpl.save(new File(projectDir, "build.gradle"));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveProjectBuildGradle
File: jadx-core/src/main/java/jadx/core/export/ExportGradleProject.java
Repository: skylot/jadx
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-0219
|
MEDIUM
| 4.3
|
skylot/jadx
|
saveProjectBuildGradle
|
jadx-core/src/main/java/jadx/core/export/ExportGradleProject.java
|
d22db30166e7cb369d72be41382bb63ac8b81c52
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeFieldBegin(TField field) throws TException {
writeByte(field.type);
writeI16(field.id);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeFieldBegin
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
writeFieldBegin
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TBinaryProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
public ValueInstantiator _valueInstantiatorInstance(DeserializationConfig config,
Annotated annotated, Object instDef)
throws JsonMappingException
{
if (instDef == null) {
return null;
}
ValueInstantiator inst;
if (instDef instanceof ValueInstantiator) {
return (ValueInstantiator) instDef;
}
if (!(instDef instanceof Class)) {
throw new IllegalStateException("AnnotationIntrospector returned key deserializer definition of type "
+instDef.getClass().getName()
+"; expected type KeyDeserializer or Class<KeyDeserializer> instead");
}
Class<?> instClass = (Class<?>)instDef;
if (ClassUtil.isBogusClass(instClass)) {
return null;
}
if (!ValueInstantiator.class.isAssignableFrom(instClass)) {
throw new IllegalStateException("AnnotationIntrospector returned Class "+instClass.getName()
+"; expected Class<ValueInstantiator>");
}
HandlerInstantiator hi = config.getHandlerInstantiator();
if (hi != null) {
inst = hi.valueInstantiatorInstance(config, annotated, instClass);
if (inst != null) {
return inst;
}
}
return (ValueInstantiator) ClassUtil.createInstance(instClass,
config.canOverrideAccessModifiers());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _valueInstantiatorInstance
File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2019-16942
|
HIGH
| 7.5
|
FasterXML/jackson-databind
|
_valueInstantiatorInstance
|
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
public Builder database(String database) {
if (!ClickHouseChecker.isNullOrEmpty(database)) {
options.put(ClickHouseClientOption.DATABASE.getKey(), database);
} else {
options.remove(ClickHouseClientOption.DATABASE.getKey());
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: database
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
database
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Iterable<Map.Entry<String, String>> getAllResponseHeaders() {
return response.headers();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllResponseHeaders
File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
Repository: quarkusio/quarkus
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-0981
|
MEDIUM
| 6.5
|
quarkusio/quarkus
|
getAllResponseHeaders
|
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
|
96c64fd8f09c02a497e2db366c64dd9196582442
| 0
|
Analyze the following code function for security vulnerabilities
|
private static int getRunningDevServerPort(File npmFolder) {
int port = 0;
File portFile = getDevServerPortFile(npmFolder);
if (portFile.canRead()) {
try {
String portString = FileUtils
.readFileToString(portFile, StandardCharsets.UTF_8)
.trim();
if (!portString.isEmpty()) {
port = Integer.parseInt(portString);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
return port;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRunningDevServerPort
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-36321
|
MEDIUM
| 5
|
vaadin/flow
|
getRunningDevServerPort
|
flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
|
6ae6460ca4f3a9b50bd46fbf49c807fe67718307
| 0
|
Analyze the following code function for security vulnerabilities
|
protected List<IBaseResource> doSearchOrEverything(final int theFromIndex, final int theToIndex) {
if (mySearchEntity.getTotalCount() != null && mySearchEntity.getNumFound() <= 0) {
// No resources to fetch (e.g. we did a _summary=count search)
return Collections.emptyList();
}
String resourceName = mySearchEntity.getResourceType();
Class<? extends IBaseResource> resourceType = myContext.getResourceDefinition(resourceName).getImplementingClass();
IFhirResourceDao<?> dao = myDaoRegistry.getResourceDao(resourceName);
final ISearchBuilder sb = mySearchBuilderFactory.newSearchBuilder(dao, resourceName, resourceType);
final List<ResourcePersistentId> pidsSubList = mySearchCoordinatorSvc.getResources(myUuid, theFromIndex, theToIndex, myRequest);
TransactionTemplate template = new TransactionTemplate(myTxManager);
template.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
return template.execute(theStatus -> toResourceList(sb, pidsSubList));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doSearchOrEverything
File: hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-32053
|
MEDIUM
| 5
|
hapifhir/hapi-fhir
|
doSearchOrEverything
|
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/PersistedJpaBundleProvider.java
|
a5e4f56e1c6f55093ff334cf698ffdeea2f33960
| 0
|
Analyze the following code function for security vulnerabilities
|
JsonValue parse() throws IOException {
read();
skipWhiteSpace();
JsonValue result=readValue();
skipWhiteSpace();
if (!isEndOfText()) throw error("Unexpected character");
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parse
File: src/main/org/hjson/JsonParser.java
Repository: hjson/hjson-java
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-34620
|
HIGH
| 7.5
|
hjson/hjson-java
|
parse
|
src/main/org/hjson/JsonParser.java
|
91bef056d56bf968451887421c89a44af1d692ff
| 0
|
Analyze the following code function for security vulnerabilities
|
private void onUserCreated(int userId) {
mAddedUserId = userId;
mAddingUser = false;
if (mUserManager.getUserInfo(userId).isRestricted()) {
showDialog(DIALOG_SETUP_PROFILE);
} else {
showDialog(DIALOG_SETUP_USER);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserCreated
File: src/com/android/settings/users/UserSettings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
onUserCreated
|
src/com/android/settings/users/UserSettings.java
|
bd5d5176c74021e8cf4970f93f273ba3023c3d72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void run() {
synchronized (mNotificationList) {
final StatusBarNotification n = r.sbn;
if (DBG) Slog.d(TAG, "EnqueueNotificationRunnable.run for: " + n.getKey());
NotificationRecord old = mNotificationsByKey.get(n.getKey());
if (old != null) {
// Retain ranking information from previous record
r.copyRankingInformation(old);
}
final int callingUid = n.getUid();
final int callingPid = n.getInitialPid();
final Notification notification = n.getNotification();
final String pkg = n.getPackageName();
final int id = n.getId();
final String tag = n.getTag();
final boolean isSystemNotification = isUidSystem(callingUid) ||
("android".equals(pkg));
// Handle grouped notifications and bail out early if we
// can to avoid extracting signals.
handleGroupedNotificationLocked(r, old, callingUid, callingPid);
// This conditional is a dirty hack to limit the logging done on
// behalf of the download manager without affecting other apps.
if (!pkg.equals("com.android.providers.downloads")
|| Log.isLoggable("DownloadManager", Log.VERBOSE)) {
int enqueueStatus = EVENTLOG_ENQUEUE_STATUS_NEW;
if (old != null) {
enqueueStatus = EVENTLOG_ENQUEUE_STATUS_UPDATE;
}
EventLogTags.writeNotificationEnqueue(callingUid, callingPid,
pkg, id, tag, userId, notification.toString(),
enqueueStatus);
}
mRankingHelper.extractSignals(r);
final boolean isPackageSuspended = isPackageSuspendedForUser(pkg, callingUid);
// blocked apps
if (r.getImportance() == NotificationListenerService.Ranking.IMPORTANCE_NONE
|| !noteNotificationOp(pkg, callingUid) || isPackageSuspended) {
if (!isSystemNotification) {
if (isPackageSuspended) {
Slog.e(TAG, "Suppressing notification from package due to package "
+ "suspended by administrator.");
mUsageStats.registerSuspendedByAdmin(r);
} else {
Slog.e(TAG, "Suppressing notification from package by user request.");
mUsageStats.registerBlocked(r);
}
return;
}
}
// tell the ranker service about the notification
if (mRankerServices.isEnabled()) {
mRankerServices.onNotificationEnqueued(r);
// TODO delay the code below here for 100ms or until there is an answer
}
int index = indexOfNotificationLocked(n.getKey());
if (index < 0) {
mNotificationList.add(r);
mUsageStats.registerPostedByApp(r);
} else {
old = mNotificationList.get(index);
mNotificationList.set(index, r);
mUsageStats.registerUpdatedByApp(r, old);
// Make sure we don't lose the foreground service state.
notification.flags |=
old.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE;
r.isUpdate = true;
}
mNotificationsByKey.put(n.getKey(), r);
// Ensure if this is a foreground service that the proper additional
// flags are set.
if ((notification.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
notification.flags |= Notification.FLAG_ONGOING_EVENT
| Notification.FLAG_NO_CLEAR;
}
applyZenModeLocked(r);
mRankingHelper.sort(mNotificationList);
if (notification.getSmallIcon() != null) {
StatusBarNotification oldSbn = (old != null) ? old.sbn : null;
mListeners.notifyPostedLocked(n, oldSbn);
} else {
Slog.e(TAG, "Not posting notification without small icon: " + notification);
if (old != null && !old.isCanceled) {
mListeners.notifyRemovedLocked(n);
}
// ATTENTION: in a future release we will bail out here
// so that we do not play sounds, show lights, etc. for invalid
// notifications
Slog.e(TAG, "WARNING: In a future release this will crash the app: "
+ n.getPackageName());
}
buzzBeepBlinkLocked(r);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
run
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public SignedJWT generateJWToken(Map<String, Object> claims) {
return generateJWToken(claims, CONF.jwtExpiresAfterSec());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateJWToken
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
generateJWToken
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isInputMethodPermittedByAdmin(ComponentName who, String packageName,
int userHandle, boolean calledOnParentInstance) {
if (!mHasFeature) {
return true;
}
Objects.requireNonNull(who, "ComponentName is null");
Preconditions.checkStringNotEmpty(packageName, "packageName is null");
Preconditions.checkCallAuthorization(isSystemUid(getCallerIdentity()),
String.format(NOT_SYSTEM_CALLER_MSG,
"query if an input method is disabled by admin"));
synchronized (getLockObject()) {
ActiveAdmin admin = getParentOfAdminIfRequired(
getActiveAdminUncheckedLocked(who, userHandle), calledOnParentInstance);
if (admin == null) {
return false;
}
if (admin.permittedInputMethods == null) {
return true;
}
return checkPackagesInPermittedListOrSystem(Collections.singletonList(packageName),
admin.permittedInputMethods, userHandle);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInputMethodPermittedByAdmin
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
|
isInputMethodPermittedByAdmin
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean setNetworkNoInternetAccessExpected(int networkId, boolean expected) {
WifiConfiguration config = getInternalConfiguredNetwork(networkId);
if (config == null) {
return false;
}
config.noInternetAccessExpected = expected;
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNetworkNoInternetAccessExpected
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
setNetworkNoInternetAccessExpected
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public ArtemisSecurityConfigurationBuilder withAllowedThreadCount(OptionalInt allowedThreadCount) {
this.allowedThreadCount = Objects.requireNonNull(allowedThreadCount);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withAllowedThreadCount
File: src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java
Repository: ls1intum/Ares
The code follows secure coding practices.
|
[
"CWE-501",
"CWE-653"
] |
CVE-2024-23682
|
HIGH
| 8.2
|
ls1intum/Ares
|
withAllowedThreadCount
|
src/main/java/de/tum/in/test/api/security/ArtemisSecurityConfigurationBuilder.java
|
4c146ff85a0fa6022087fb0cffa6b8021d51101f
| 0
|
Analyze the following code function for security vulnerabilities
|
public void calcAutoCompleteSettings(String field, Map<String,Object> attributes) {
String capitalizedFieldName = StringUtils.capitalize(field);
String methodName = "doAutoComplete" + capitalizedFieldName;
Method method = ReflectionUtils.getPublicMethodNamed(getClass(), methodName);
if(method==null)
return; // no auto-completion
attributes.put("autoCompleteUrl", String.format("%s/%s/autoComplete%s", getCurrentDescriptorByNameUrl(), getDescriptorUrl(), capitalizedFieldName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: calcAutoCompleteSettings
File: core/src/main/java/hudson/model/Descriptor.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
calcAutoCompleteSettings
|
core/src/main/java/hudson/model/Descriptor.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isSleepingOrShuttingDownLocked() {
return isSleepingLocked() || mShuttingDown;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSleepingOrShuttingDownLocked
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
|
isSleepingOrShuttingDownLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void openFileChooser(ValueCallback uploadMsg, String acceptType)
{
mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType(acceptType);
AndroidNativeUtil.getActivity().startActivityForResult(Intent.createChooser(i, "File Browser"), FILECHOOSER_RESULTCODE);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openFileChooser
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
|
openFileChooser
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
protected HashMap<String,Integer> getItemGroupOIDPos(MetaDataVersionBean metadata){
HashMap<String,Integer> igPoses = new HashMap<String,Integer>();
ArrayList<ItemGroupDefBean> igs = (ArrayList<ItemGroupDefBean>)metadata.getItemGroupDefs();
for(int i=0; i<igs.size();++i) {
igPoses.put(igs.get(i).getOid(), i);
}
return igPoses;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getItemGroupOIDPos
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getItemGroupOIDPos
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
private final boolean canGcNowLocked() {
boolean processingBroadcasts = false;
for (BroadcastQueue q : mBroadcastQueues) {
if (q.mParallelBroadcasts.size() != 0 || q.mOrderedBroadcasts.size() != 0) {
processingBroadcasts = true;
}
}
return !processingBroadcasts
&& (isSleepingLocked() || mStackSupervisor.allResumedActivitiesIdle());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canGcNowLocked
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
|
canGcNowLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private float getLineExtent(int line, boolean full) {
int start = getLineStart(line);
int end = full ? getLineEnd(line) : getLineVisibleEnd(line);
boolean hasTabsOrEmoji = getLineContainsTab(line);
TabStops tabStops = null;
if (hasTabsOrEmoji && mText instanceof Spanned) {
// Just checking this line should be good enough, tabs should be
// consistent across all lines in a paragraph.
TabStopSpan[] tabs = getParagraphSpans((Spanned) mText, start, end, TabStopSpan.class);
if (tabs.length > 0) {
tabStops = new TabStops(TAB_INCREMENT, tabs); // XXX should reuse
}
}
Directions directions = getLineDirections(line);
// Returned directions can actually be null
if (directions == null) {
return 0f;
}
int dir = getParagraphDirection(line);
TextLine tl = TextLine.obtain();
tl.set(mPaint, mText, start, end, dir, directions, hasTabsOrEmoji, tabStops);
float width = tl.metrics(null);
TextLine.recycle(tl);
return width;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLineExtent
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-9452
|
MEDIUM
| 4.3
|
android
|
getLineExtent
|
core/java/android/text/Layout.java
|
3b6f84b77c30ec0bab5147b0cffc192c86ba2634
| 0
|
Analyze the following code function for security vulnerabilities
|
public void throwKeyManagerException() throws PSQLException {
if (km != null) {
if (km instanceof LazyKeyManager) {
((LazyKeyManager)km).throwKeyManagerException();
}
if (km instanceof PKCS12KeyManager) {
((PKCS12KeyManager)km).throwKeyManagerException();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: throwKeyManagerException
File: pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-665"
] |
CVE-2022-21724
|
HIGH
| 7.5
|
pgjdbc
|
throwKeyManagerException
|
pgjdbc/src/main/java/org/postgresql/ssl/LibPQFactory.java
|
f4d0ed69c0b3aae8531d83d6af4c57f22312c813
| 0
|
Analyze the following code function for security vulnerabilities
|
private void generateUserKeyLocked(int userId) {
// Generate a random key for each user used for creating a new ssaid.
final byte[] keyBytes = new byte[32];
final SecureRandom rand = new SecureRandom();
rand.nextBytes(keyBytes);
// Convert to string for storage in settings table.
final String userKey = HexEncoding.encodeToString(keyBytes, true /* upperCase */);
// Store the key in the ssaid table.
final SettingsState ssaidSettings = getSettingsLocked(SETTINGS_TYPE_SSAID, userId);
final boolean success = ssaidSettings.insertSettingLocked(SSAID_USER_KEY, userKey, null,
true, SettingsState.SYSTEM_PACKAGE_NAME);
if (!success) {
throw new IllegalStateException("Ssaid settings not accessible");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateUserKeyLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
generateUserKeyLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateExternalMediaStatusInner(boolean isMounted, boolean reportStatus,
boolean externalStorage) {
ArrayMap<AsecInstallArgs, String> processCids = new ArrayMap<>();
int[] uidArr = EmptyArray.INT;
final String[] list = PackageHelper.getSecureContainerList();
if (ArrayUtils.isEmpty(list)) {
Log.i(TAG, "No secure containers found");
} else {
// Process list of secure containers and categorize them
// as active or stale based on their package internal state.
// reader
synchronized (mPackages) {
for (String cid : list) {
// Leave stages untouched for now; installer service owns them
if (PackageInstallerService.isStageName(cid)) continue;
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Processing container " + cid);
String pkgName = getAsecPackageName(cid);
if (pkgName == null) {
Slog.i(TAG, "Found stale container " + cid + " with no package name");
continue;
}
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Looking for pkg : " + pkgName);
final PackageSetting ps = mSettings.mPackages.get(pkgName);
if (ps == null) {
Slog.i(TAG, "Found stale container " + cid + " with no matching settings");
continue;
}
/*
* Skip packages that are not external if we're unmounting
* external storage.
*/
if (externalStorage && !isMounted && !isExternal(ps)) {
continue;
}
final AsecInstallArgs args = new AsecInstallArgs(cid,
getAppDexInstructionSets(ps), ps.isForwardLocked());
// The package status is changed only if the code path
// matches between settings and the container id.
if (ps.codePathString != null
&& ps.codePathString.startsWith(args.getCodePath())) {
if (DEBUG_SD_INSTALL) {
Log.i(TAG, "Container : " + cid + " corresponds to pkg : " + pkgName
+ " at code path: " + ps.codePathString);
}
// We do have a valid package installed on sdcard
processCids.put(args, ps.codePathString);
final int uid = ps.appId;
if (uid != -1) {
uidArr = ArrayUtils.appendInt(uidArr, uid);
}
} else {
Slog.i(TAG, "Found stale container " + cid + ": expected codePath="
+ ps.codePathString);
}
}
}
Arrays.sort(uidArr);
}
// Process packages with valid entries.
if (isMounted) {
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Loading packages");
loadMediaPackages(processCids, uidArr, externalStorage);
startCleaningPackages();
mInstallerService.onSecureContainersAvailable();
} else {
if (DEBUG_SD_INSTALL)
Log.i(TAG, "Unloading packages");
unloadMediaPackages(processCids, uidArr, reportStatus);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateExternalMediaStatusInner
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
|
updateExternalMediaStatusInner
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getExternalURL(String fullname, String action, String querystring, XWikiContext context)
throws XWikiException
{
XWikiDocument doc = new XWikiDocument(getCurrentMixedDocumentReferenceResolver().resolve(fullname));
URL url = context.getURLFactory().createExternalURL(doc.getSpace(), doc.getName(), action, querystring, null,
doc.getDatabase(), context);
return url.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExternalURL
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
|
getExternalURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
final long getTimeMillisAndRemove(CharSequence name, long defaultValue) {
final Long v = getTimeMillisAndRemove(name);
return v != null ? v : defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTimeMillisAndRemove
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2019-16771
|
MEDIUM
| 5
|
line/armeria
|
getTimeMillisAndRemove
|
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
|
b597f7a865a527a84ee3d6937075cfbb4470ed20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null) {
return false;
}
if (!(other instanceof DecimalQuantity_AbstractBCD)) {
return false;
}
DecimalQuantity_AbstractBCD _other = (DecimalQuantity_AbstractBCD) other;
boolean basicEquals =
scale == _other.scale
&& precision == _other.precision
&& flags == _other.flags
&& lOptPos == _other.lOptPos
&& lReqPos == _other.lReqPos
&& rReqPos == _other.rReqPos
&& rOptPos == _other.rOptPos
&& isApproximate == _other.isApproximate;
if (!basicEquals) {
return false;
}
if (precision == 0) {
return true;
} else if (isApproximate) {
return origDouble == _other.origDouble && origDelta == _other.origDelta;
} else {
for (int m = getUpperDisplayMagnitude(); m >= getLowerDisplayMagnitude(); m--) {
if (getDigit(m) != _other.getDigit(m)) {
return false;
}
}
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
equals
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addArg( Arg argument )
{
this.addArg( argument, false );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addArg
File: src/main/java/org/codehaus/plexus/util/cli/Commandline.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2017-1000487
|
HIGH
| 7.5
|
codehaus-plexus/plexus-utils
|
addArg
|
src/main/java/org/codehaus/plexus/util/cli/Commandline.java
|
b38a1b3a4352303e4312b2bb601a0d7ec6e28f41
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setSystemSetting(ComponentName who, String setting, String value) {
Objects.requireNonNull(who, "ComponentName is null");
Preconditions.checkStringNotEmpty(setting, "String setting is null or empty");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_SET_SYSTEM_SETTING);
synchronized (getLockObject()) {
if (!SYSTEM_SETTINGS_ALLOWLIST.contains(setting)) {
throw new SecurityException(String.format(
"Permission denial: device owners cannot update %1$s", setting));
}
mInjector.binderWithCleanCallingIdentity(() ->
mInjector.settingsSystemPutStringForUser(setting, value, caller.getUserId()));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSystemSetting
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
|
setSystemSetting
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<XWikiDocument> searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context)
throws XWikiException
{
return searchDocuments(wheresql, 0, 0, parameterValues, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: searchDocuments
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
searchDocuments
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public void configureHttpRequest(HTTPRequest request) {
request.setConnectTimeout(getConnectTimeout());
request.setReadTimeout(getReadTimeout());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: configureHttpRequest
File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
Repository: pac4j
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-44878
|
MEDIUM
| 5
|
pac4j
|
configureHttpRequest
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String _getLogicalExprConditionSQL(Condition[] conditions, String op) {
StringBuilder out = new StringBuilder();
out.append("(");
for (int i = 0; i < conditions.length; i++) {
Condition condition = conditions[i];
String conditionSQL = getConditionSQL(condition);
if (i > 0) {
out.append(" ").append(op).append(" ");
}
out.append(conditionSQL);
}
out.append(")");
return out.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _getLogicalExprConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4999
|
HIGH
| 7.5
|
dashbuilder
|
_getLogicalExprConditionSQL
|
dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
|
8574899e3b6455547b534f570b2330ff772e524b
| 0
|
Analyze the following code function for security vulnerabilities
|
@POST
@Produces(MediaType.TEXT_XML)
@Path("addDCCatalog")
@RestQuery(name = "addDCCatalog", description = "Add a dublincore episode catalog to a given media package using an url", restParameters = {
@RestParameter(description = "The media package as XML", isRequired = true, name = "mediaPackage", type = RestParameter.Type.TEXT),
@RestParameter(description = "DublinCore catalog as XML", isRequired = true, name = "dublinCore", type = RestParameter.Type.TEXT),
@RestParameter(defaultValue = "dublincore/episode", description = "DublinCore Flavor", isRequired = false, name = "flavor", type = RestParameter.Type.STRING) }, reponses = {
@RestResponse(description = "Returns augmented media package", responseCode = HttpServletResponse.SC_OK),
@RestResponse(description = "Media package not valid", responseCode = HttpServletResponse.SC_BAD_REQUEST),
@RestResponse(description = "", responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR) }, returnDescription = "")
public Response addDCCatalog(@FormParam("mediaPackage") String mp, @FormParam("dublinCore") String dc,
@FormParam("flavor") String flavor) {
logger.trace("add DC catalog: {} with flavor: {} to media package: {}", dc, flavor, mp);
MediaPackageElementFlavor dcFlavor = MediaPackageElements.EPISODE;
if (flavor != null) {
try {
dcFlavor = MediaPackageElementFlavor.parseFlavor(flavor);
} catch (IllegalArgumentException e) {
logger.warn("Unable to set dublin core flavor to {}, using {} instead", flavor, MediaPackageElements.EPISODE);
}
}
MediaPackage mediaPackage;
/* Check if we got a proper mediapackage and try to parse it */
try {
mediaPackage = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().loadFromXml(mp);
} catch (MediaPackageException e) {
return Response.serverError().status(Status.BAD_REQUEST).build();
}
if (MediaPackageSupport.sanityCheck(mediaPackage).isSome()) {
return Response.serverError().status(Status.BAD_REQUEST).build();
}
/* Check if we got a proper catalog */
if (StringUtils.isBlank(dc)) {
return Response.serverError().status(Status.BAD_REQUEST).build();
}
InputStream in = null;
try {
in = IOUtils.toInputStream(dc, "UTF-8");
mediaPackage = ingestService.addCatalog(in, "dublincore.xml", dcFlavor, mediaPackage);
} catch (MediaPackageException e) {
return Response.serverError().status(Status.BAD_REQUEST).build();
} catch (IOException e) {
/* Return an internal server error if we could not write to disk */
logger.error("Could not write catalog to disk: {}", e.getMessage());
return Response.serverError().build();
} catch (Exception e) {
logger.error(e.getMessage());
return Response.serverError().build();
} finally {
IOUtils.closeQuietly(in);
}
return Response.ok(mediaPackage).build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addDCCatalog
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2020-5230
|
MEDIUM
| 5
|
opencast
|
addDCCatalog
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/endpoint/IngestRestService.java
|
bbb473f34ab95497d6c432c81285efb0c739f317
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean apply(File file) {
return file.isFile();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: apply
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2023-2976
|
HIGH
| 7.1
|
google/guava
|
apply
|
guava/src/com/google/common/io/Files.java
|
feb83a1c8fd2e7670b244d5afd23cba5aca43284
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getPrefix() {
return doc.getPrefix();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPrefix
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
|
getPrefix
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getRippleAlpha() {
return mRippleAlpha;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRippleAlpha
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getRippleAlpha
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public float getContentWidthCss() {
return mRenderCoordinates.getContentWidthCss();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentWidthCss
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
|
getContentWidthCss
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private SSLEngine createSSLEngine() throws IOException, GeneralSecurityException {
if (nettyProviderConfig.getSslEngineFactory() != null) {
return nettyProviderConfig.getSslEngineFactory().newSSLEngine();
} else {
SSLContext sslContext = config.getSSLContext();
if (sslContext == null) {
sslContext = SslUtils.getInstance().getSSLContext();
}
SSLEngine sslEngine = sslContext.createSSLEngine();
sslEngine.setUseClientMode(true);
return sslEngine;
}
}
|
Vulnerability Classification:
- CWE: CWE-345
- CVE: CVE-2013-7397
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Introduce acceptAnyCertificate config, defaulting to false, close #526, close #352
Function: createSSLEngine
File: providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
Repository: AsyncHttpClient/async-http-client
Fixed Code:
private SSLEngine createSSLEngine() throws IOException, GeneralSecurityException {
if (nettyProviderConfig.getSslEngineFactory() != null) {
return nettyProviderConfig.getSslEngineFactory().newSSLEngine();
} else {
SSLContext sslContext = config.getSSLContext();
if (sslContext == null)
sslContext = SslUtils.getInstance().getSSLContext(config.isAcceptAnyCertificate());
SSLEngine sslEngine = sslContext.createSSLEngine();
sslEngine.setUseClientMode(true);
return sslEngine;
}
}
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
createSSLEngine
|
providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/Channels.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 1
|
Analyze the following code function for security vulnerabilities
|
public Form<T> withError(final String key, final String error) {
return withError(key, error, new ArrayList<>());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withError
File: web/play-java-forms/src/main/java/play/data/Form.java
Repository: playframework
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-31018
|
MEDIUM
| 5
|
playframework
|
withError
|
web/play-java-forms/src/main/java/play/data/Form.java
|
15393b736df939e35e275af2347155f296c684f2
| 0
|
Analyze the following code function for security vulnerabilities
|
public <V> Column<T, V> addColumn(ValueProvider<T, V> valueProvider) {
return addColumn(valueProvider, new TextRenderer());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addColumn
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
|
addColumn
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
protected BeanDefinitionBuilder createBeanBuilder(Class clazz) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(clazz);
builder.setScope(configBuilder.getBeanDefinition().getScope());
builder.setLazyInit(configBuilder.getBeanDefinition().isLazyInit());
return builder;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createBeanBuilder
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
createBeanBuilder
|
hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Sessional
@Override
public void useAvatar(User user, String avatarData) {
Lock avatarLock = LockUtils.getLock("uploaded-user-avatar:" + user.getId());
avatarLock.lock();
try {
File avatarFile = getUploaded(user);
FileUtils.createDir(avatarFile.getParentFile());
AvatarUploadField.writeToFile(avatarFile, avatarData);
} finally {
avatarLock.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: useAvatar
File: server-core/src/main/java/io/onedev/server/web/avatar/DefaultAvatarManager.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-552"
] |
CVE-2022-39208
|
HIGH
| 7.5
|
theonedev/onedev
|
useAvatar
|
server-core/src/main/java/io/onedev/server/web/avatar/DefaultAvatarManager.java
|
8aa94e0daf8447cdf76d4f27bfda0a85a7ea5822
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void replaceResource(
CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
int type,
byte[] content,
List<CmsProperty> properties)
throws CmsException {
if (resource.getRootPath().toLowerCase().endsWith(".svg")) {
List<CmsProperty> newProperties = tryAddImageSizeFromSvg(content, properties);
if (properties != newProperties) { // yes, we actually do want to compare object identity here
writePropertyObjects(cms, securityManager, resource, newProperties);
}
} else if (CmsImageLoader.isEnabled()) {
// check if the user has write access and if resource is locked
// done here so that no image operations are performed in case no write access is granted
securityManager.checkPermissions(
cms.getRequestContext(),
resource,
CmsPermissionSet.ACCESS_WRITE,
true,
CmsResourceFilter.ALL);
// get the downscaler to use
CmsImageScaler downScaler = getDownScaler(cms, resource.getRootPath());
// create a new image scale adjuster
CmsImageAdjuster adjuster = new CmsImageAdjuster(content, resource.getRootPath(), properties, downScaler);
// update the image scale adjuster - this will calculate the image dimensions and (optionally) adjust the size
adjuster.adjust();
// continue with the updated content
content = adjuster.getContent();
if (adjuster.getProperties() != null) {
// write properties
writePropertyObjects(cms, securityManager, resource, adjuster.getProperties());
}
}
super.replaceResource(cms, securityManager, resource, type, content, properties);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: replaceResource
File: src/org/opencms/file/types/CmsResourceTypeImage.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3312
|
MEDIUM
| 4
|
alkacon/opencms-core
|
replaceResource
|
src/org/opencms/file/types/CmsResourceTypeImage.java
|
92e035423aa6967822d343e54392d4291648c0ee
| 0
|
Analyze the following code function for security vulnerabilities
|
private void sendRssiChangeBroadcast(final int newRssi) {
mBatteryStatsManager.reportWifiRssiChanged(newRssi);
WifiStatsLog.write(WifiStatsLog.WIFI_SIGNAL_STRENGTH_CHANGED,
RssiUtil.calculateSignalLevel(mContext, newRssi));
Intent intent = new Intent(WifiManager.RSSI_CHANGED_ACTION);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
intent.putExtra(WifiManager.EXTRA_NEW_RSSI, newRssi);
mBroadcastQueue.queueOrSendBroadcast(
mClientModeManager,
() -> mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
android.Manifest.permission.ACCESS_WIFI_STATE));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendRssiChangeBroadcast
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
sendRssiChangeBroadcast
|
service/java/com/android/server/wifi/ClientModeImpl.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private static List<Pattern> getAllowedRegexp3(Map<String, AntiSamyPattern> commonRegularExpressions1, Element ele, String name) throws PolicyException {
List<Pattern> allowedRegExp = new ArrayList<Pattern>();
for (Element regExpNode : getGrandChildrenByTagName(ele, "regexp-list", "regexp")) {
String regExpName = getAttributeValue(regExpNode, "name");
String value = getAttributeValue(regExpNode, "value");
AntiSamyPattern pattern = commonRegularExpressions1.get(regExpName);
if (pattern != null) {
allowedRegExp.add(pattern.getPattern());
} else if (value != null) {
allowedRegExp.add(Pattern.compile(REGEXP_BEGIN + value + REGEXP_END));
} else {
throw new PolicyException("Regular expression '" + regExpName + "' was referenced as a common regexp in definition of '" + name + "', but does not exist in <common-regexp>");
}
}
return allowedRegExp;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2017-14735
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Issue #10 (#15)
* upgraded batik-css version
removed redundant regex beginning/end markers
updated policies to contain new url validation which is sensitive to
html5 colon entity
* removed test code
Function: getAllowedRegexp3
File: src/main/java/org/owasp/validator/html/Policy.java
Repository: nahsra/antisamy
Fixed Code:
private static List<Pattern> getAllowedRegexp3(Map<String, AntiSamyPattern> commonRegularExpressions1, Element ele, String name) throws PolicyException {
List<Pattern> allowedRegExp = new ArrayList<Pattern>();
for (Element regExpNode : getGrandChildrenByTagName(ele, "regexp-list", "regexp")) {
String regExpName = getAttributeValue(regExpNode, "name");
String value = getAttributeValue(regExpNode, "value");
AntiSamyPattern pattern = commonRegularExpressions1.get(regExpName);
if (pattern != null) {
allowedRegExp.add(pattern.getPattern());
} else if (value != null) {
allowedRegExp.add(Pattern.compile(value));
} else {
throw new PolicyException("Regular expression '" + regExpName + "' was referenced as a common regexp in definition of '" + name + "', but does not exist in <common-regexp>");
}
}
return allowedRegExp;
}
|
[
"CWE-79"
] |
CVE-2017-14735
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
getAllowedRegexp3
|
src/main/java/org/owasp/validator/html/Policy.java
|
82da009e733a989a57190cd6aa1b6824724f6d36
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
TextView textView = (TextView) v;
Selection.selectAll((Spannable) textView.getText());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFocusChange
File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
onFocusChange
|
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 0
|
Analyze the following code function for security vulnerabilities
|
public Setting generateSsaidLocked(PackageInfo callingPkg, int userId) {
// Read the user's key from the ssaid table.
Setting userKeySetting = getSettingLocked(SETTINGS_TYPE_SSAID, userId, SSAID_USER_KEY);
if (userKeySetting == null || userKeySetting.isNull()
|| userKeySetting.getValue() == null) {
// Lazy initialize and store the user key.
generateUserKeyLocked(userId);
userKeySetting = getSettingLocked(SETTINGS_TYPE_SSAID, userId, SSAID_USER_KEY);
if (userKeySetting == null || userKeySetting.isNull()
|| userKeySetting.getValue() == null) {
throw new IllegalStateException("User key not accessible");
}
}
final String userKey = userKeySetting.getValue();
if (userKey == null || userKey.length() % 2 != 0) {
throw new IllegalStateException("User key invalid");
}
// Convert the user's key back to a byte array.
final byte[] keyBytes = HexEncoding.decode(userKey);
// Validate that the key is of expected length.
// Keys are currently 32 bytes, but were once 16 bytes during Android O development.
if (keyBytes.length != 16 && keyBytes.length != 32) {
throw new IllegalStateException("User key invalid");
}
final Mac m;
try {
m = Mac.getInstance("HmacSHA256");
m.init(new SecretKeySpec(keyBytes, m.getAlgorithm()));
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("HmacSHA256 is not available", e);
} catch (InvalidKeyException e) {
throw new IllegalStateException("Key is corrupted", e);
}
// Mac each of the developer signatures.
for (int i = 0; i < callingPkg.signatures.length; i++) {
byte[] sig = callingPkg.signatures[i].toByteArray();
m.update(getLengthPrefix(sig), 0, 4);
m.update(sig);
}
// Convert result to a string for storage in settings table. Only want first 64 bits.
final String ssaid = HexEncoding.encodeToString(m.doFinal(), false /* upperCase */)
.substring(0, 16);
// Save the ssaid in the ssaid table.
final String uid = Integer.toString(callingPkg.applicationInfo.uid);
final SettingsState ssaidSettings = getSettingsLocked(SETTINGS_TYPE_SSAID, userId);
final boolean success = ssaidSettings.insertSettingLocked(uid, ssaid, null, true,
callingPkg.packageName);
if (!success) {
throw new IllegalStateException("Ssaid settings not accessible");
}
return getSettingLocked(SETTINGS_TYPE_SSAID, userId, uid);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generateSsaidLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
generateSsaidLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforceCanSetProfileOwnerLocked(
CallerIdentity caller, @Nullable ComponentName owner, int userHandle,
boolean hasIncompatibleAccountsOrNonAdb) {
UserInfo info = getUserInfo(userHandle);
if (info == null) {
// User doesn't exist.
throw new IllegalArgumentException(
"Attempted to set profile owner for invalid userId: " + userHandle);
}
if (info.isGuest()) {
throw new IllegalStateException("Cannot set a profile owner on a guest");
}
if (mOwners.hasProfileOwner(userHandle)) {
throw new IllegalStateException("Trying to set the profile owner, but profile owner "
+ "is already set.");
}
if (mOwners.hasDeviceOwner() && mOwners.getDeviceOwnerUserId() == userHandle) {
throw new IllegalStateException("Trying to set the profile owner, but the user "
+ "already has a device owner.");
}
if (isAdb(caller)) {
if ((mIsWatch || hasUserSetupCompleted(userHandle))
&& hasIncompatibleAccountsOrNonAdb) {
throw new IllegalStateException("Not allowed to set the profile owner because "
+ "there are already some accounts on the profile");
}
return;
}
Preconditions.checkCallAuthorization(
hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS));
if ((mIsWatch || hasUserSetupCompleted(userHandle))) {
Preconditions.checkState(isSystemUid(caller),
"Cannot set the profile owner on a user which is already set-up");
if (!mIsWatch) {
if (!isSupervisionComponentLocked(owner)) {
throw new IllegalStateException("Unable to set non-default profile owner"
+ " post-setup " + owner);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceCanSetProfileOwnerLocked
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
|
enforceCanSetProfileOwnerLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public IIntentSender getIntentSender(int type,
String packageName, IBinder token, String resultWho,
int requestCode, Intent[] intents, String[] resolvedTypes,
int flags, Bundle options, int userId) {
enforceNotIsolatedCaller("getIntentSender");
// Refuse possible leaked file descriptors
if (intents != null) {
if (intents.length < 1) {
throw new IllegalArgumentException("Intents array length must be >= 1");
}
for (int i=0; i<intents.length; i++) {
Intent intent = intents[i];
if (intent != null) {
if (intent.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
if (type == ActivityManager.INTENT_SENDER_BROADCAST &&
(intent.getFlags()&Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0) {
throw new IllegalArgumentException(
"Can't use FLAG_RECEIVER_BOOT_UPGRADE here");
}
intents[i] = new Intent(intent);
}
}
if (resolvedTypes != null && resolvedTypes.length != intents.length) {
throw new IllegalArgumentException(
"Intent array length does not match resolvedTypes length");
}
}
if (options != null) {
if (options.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in options");
}
}
synchronized(this) {
int callingUid = Binder.getCallingUid();
int origUserId = userId;
userId = handleIncomingUser(Binder.getCallingPid(), callingUid, userId,
type == ActivityManager.INTENT_SENDER_BROADCAST,
ALLOW_NON_FULL, "getIntentSender", null);
if (origUserId == UserHandle.USER_CURRENT) {
// We don't want to evaluate this until the pending intent is
// actually executed. However, we do want to always do the
// security checking for it above.
userId = UserHandle.USER_CURRENT;
}
try {
if (callingUid != 0 && callingUid != Process.SYSTEM_UID) {
int uid = AppGlobals.getPackageManager()
.getPackageUid(packageName, UserHandle.getUserId(callingUid));
if (!UserHandle.isSameApp(callingUid, uid)) {
String msg = "Permission Denial: getIntentSender() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ ", (need uid=" + uid + ")"
+ " is not allowed to send as package " + packageName;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
}
return getIntentSenderLocked(type, packageName, callingUid, userId,
token, resultWho, requestCode, intents, resolvedTypes, flags, options);
} catch (RemoteException e) {
throw new SecurityException(e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntentSender
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
getIntentSender
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public Mac getMac() {
return mCrypto instanceof Mac ? (Mac) mCrypto : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMac
File: core/java/android/hardware/fingerprint/FingerprintManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
getMac
|
core/java/android/hardware/fingerprint/FingerprintManager.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onLayoutChange(
View v, int left, int top, int right, int bottom, int oldLeft,
int oldTop, int oldRight, int oldBottom) {
boolean needsInvalidate = false;
if (v == mNavigationButton) {
if (mSuggestionIconLeft != getSuggestionIconLeftPosition()
&& mSuggestionIconLeft != Integer.MIN_VALUE) {
needsInvalidate = true;
}
} else {
if (mTextLeft != getSuggestionTextLeftPosition()
&& mTextLeft != Integer.MIN_VALUE) {
needsInvalidate = true;
}
if (mTextRight != getSuggestionTextRightPosition()
&& mTextRight != Integer.MIN_VALUE) {
needsInvalidate = true;
}
}
if (needsInvalidate) {
removeCallbacks(mRelayoutRunnable);
postDelayed(mRelayoutRunnable, RELAYOUT_DELAY_MS);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onLayoutChange
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
onLayoutChange
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
private ResourceInfo findResource(LibraryInfo library,
String resourceName,
String localePrefix,
boolean compressable,
boolean skipToFaceletResourceHelper,
FacesContext ctx) {
if (library != null) {
return library.getHelper().findResource(library,
resourceName,
localePrefix,
compressable,
ctx);
} else {
ResourceInfo resource = null;
if (!skipToFaceletResourceHelper) {
resource = webappResourceHelper.findResource(null,
resourceName,
localePrefix,
compressable,
ctx);
}
if (resource == null && !skipToFaceletResourceHelper) {
resource = classpathResourceHelper.findResource(null,
resourceName,
localePrefix,
compressable,
ctx);
}
if (resource == null) {
resource = faceletWebappResourceHelper.findResource(library,
resourceName,
localePrefix,
compressable,
ctx);
}
return resource;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findResource
File: impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
Repository: eclipse-ee4j/mojarra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-14371
|
MEDIUM
| 5
|
eclipse-ee4j/mojarra
|
findResource
|
impl/src/main/java/com/sun/faces/application/resource/ResourceManager.java
|
1b434748d9239f42eae8aa7d37d7a0930c061e24
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onTrackingStarted() {
mFalsingManager.onTrackingStarted();
super.onTrackingStarted();
if (mQsFullyExpanded) {
mQsExpandImmediate = true;
}
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
mAffordanceHelper.animateHideLeftRightIcon();
}
mNotificationStackScroller.onPanelTrackingStarted();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTrackingStarted
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onTrackingStarted
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String buildCountStatement(String sql) {
return "select count(1) total from (select 1 " + sql + " )";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildCountStatement
File: oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
Repository: apache/skywalking
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2020-13921
|
HIGH
| 7.5
|
apache/skywalking
|
buildCountStatement
|
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2TraceQueryDAO.java
|
ddb6d9a5019a9c1fe31c364485a4e4b5066fefc3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void unsetStaticMetadataService(StaticMetadataService mdService) {
this.mdServices.remove(mdService);
if (indexManager != null)
indexManager.setStaticMetadataServices(mdServices);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unsetStaticMetadataService
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-21318
|
MEDIUM
| 5.5
|
opencast
|
unsetStaticMetadataService
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
static Intent parseIntentAttribute(TypedXmlPullParser parser, String attribute) {
Intent parsed = parseIntentAttributeNoDefault(parser, attribute);
if (parsed == null) {
// Default intent.
parsed = new Intent(Intent.ACTION_VIEW);
}
return parsed;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseIntentAttribute
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
parseIntentAttribute
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
public void saveTagAndAttribute(Short siteId, Long userId, Long id, CmsContentParameters contentParameters, CmsModel cmsModel,
CmsCategory category, CmsContentAttribute attribute) {
Long[] tagIds = tagService.update(siteId, contentParameters.getTags());
CmsContent entity = getEntity(id);
if (null != entity) {
entity.setTagIds(arrayToDelimitedString(tagIds, CommonConstants.BLANK_SPACE));
if (entity.isHasImages() || entity.isHasFiles()) {
contentFileService.update(entity.getId(), userId, entity.isHasFiles() ? contentParameters.getFiles() : null,
entity.isHasImages() ? contentParameters.getImages() : null);// 更新保存图集,附件
}
String text = HtmlUtils.removeHtmlTag(attribute.getText());
if (null != text) {
attribute.setWordCount(text.length());
}
if (CommonUtils.empty(entity.getDescription())) {
entity.setDescription(StringUtils.substring(text, 0, 300));
}
List<SysExtendField> modelExtendList = cmsModel.getExtendList();
List<SysExtendField> categoryExtendList = null;
Map<String, String> map = ExtendUtils.getExtentDataMap(contentParameters.getModelExtendDataList(), modelExtendList);
if (null != category && null != extendService.getEntity(category.getExtendId())) {
categoryExtendList = extendFieldService.getList(category.getExtendId());
Map<String, String> categoryMap = ExtendUtils.getSysExtentDataMap(contentParameters.getCategoryExtendDataList(),
categoryExtendList);
if (CommonUtils.notEmpty(map)) {
map.putAll(categoryMap);
} else {
map = categoryMap;
}
}
if (CommonUtils.notEmpty(map)) {
StringBuilder sb = new StringBuilder();
if (cmsModel.isSearchable() && CommonUtils.notEmpty(text)) {
sb.append(text).append(CommonConstants.BLANK_SPACE);
}
List<String> dictionaryValueList = new ArrayList<>();
dealExtend(modelExtendList, dictionaryValueList, map, sb);
dealExtend(categoryExtendList, dictionaryValueList, map, sb);
if (CommonUtils.notEmpty(dictionaryValueList)) {
String[] dictionaryValues = dictionaryValueList.toArray(new String[dictionaryValueList.size()]);
entity.setDictionaryValues(arrayToDelimitedString(dictionaryValues, CommonConstants.BLANK_SPACE));
}
attribute.setData(ExtendUtils.getExtendString(map));
attribute.setSearchText(sb.toString());
} else {
attribute.setData(null);
entity.setDictionaryValues(null);
if (cmsModel.isSearchable()) {
attribute.setSearchText(text);
} else {
attribute.setSearchText(null);
}
}
attributeService.updateAttribute(id, attribute);// 更新保存扩展字段,文本字段
if (CommonUtils.notEmpty(contentParameters.getContentRelateds())) {
cmsContentRelatedService.update(id, userId, contentParameters.getContentRelateds());// 更新保存推荐内容
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveTagAndAttribute
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
saveTagAndAttribute
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated(since = "2.2M2")
public long getLongValue(String className, String fieldName)
{
return getLongValue(resolveClassReference(className), fieldName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLongValue
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2023-29523
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getLongValue
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
0d547181389f7941e53291af940966413823f61c
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTenant() {
return tenant;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTenant
File: src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
Repository: opensearch-project/security
The code follows secure coding practices.
|
[
"CWE-612",
"CWE-863"
] |
CVE-2022-41918
|
MEDIUM
| 6.3
|
opensearch-project/security
|
getTenant
|
src/main/java/org/opensearch/security/securityconf/ConfigModelV7.java
|
f7cc569c9d3fa5d5432c76c854eed280d45ce6f4
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String makeQueryString(final HttpServletRequest request, final Map<String,Object> additions, final String[] ignores) {
return (makeQueryString(request, additions, ignores, IgnoreType.BOTH));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeQueryString
File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-0869
|
MEDIUM
| 6.1
|
OpenNMS/opennms
|
makeQueryString
|
opennms-web-api/src/main/java/org/opennms/web/api/Util.java
|
66b4ba96a18b9952f25a350bbccc2a7e206238d1
| 0
|
Analyze the following code function for security vulnerabilities
|
private void repairForLegacyLibrary(Document doc, Element root) {
Element legacyElt = null;
String legacyLabel = null;
for (Element libElt : XmlIterator.forChildElements(root, "lib")) {
String desc = libElt.getAttribute("desc");
String label = libElt.getAttribute("name");
if (desc != null && desc.equals("#Legacy")) {
legacyElt = libElt;
legacyLabel = label;
}
}
if (legacyElt != null) {
root.removeChild(legacyElt);
ArrayList<Element> toRemove = new ArrayList<Element>();
findLibraryUses(toRemove, legacyLabel,
XmlIterator.forDescendantElements(root, "comp"));
boolean componentsRemoved = !toRemove.isEmpty();
findLibraryUses(toRemove, legacyLabel,
XmlIterator.forDescendantElements(root, "tool"));
for (Element elt : toRemove) {
elt.getParentNode().removeChild(elt);
}
if (componentsRemoved) {
String error = "Some components have been deleted;"
+ " the Legacy library is no longer supported.";
Element elt = doc.createElement("message");
elt.setAttribute("value", error);
root.appendChild(elt);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: repairForLegacyLibrary
File: src/com/cburch/logisim/file/XmlReader.java
Repository: logisim-evolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000889
|
MEDIUM
| 6.8
|
logisim-evolution
|
repairForLegacyLibrary
|
src/com/cburch/logisim/file/XmlReader.java
|
90aee8f8ceef463884cc400af4f6d1f109fb0972
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getRemoteHost() {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRemoteHost
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getRemoteHost
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private TimeZone getNitzTimeZone(int offset, boolean dst, long when) {
TimeZone guess = findTimeZone(offset, dst, when);
if (guess == null) {
// Couldn't find a proper timezone. Perhaps the DST data is wrong.
guess = findTimeZone(offset, !dst, when);
}
if (DBG) log("getNitzTimeZone returning " + (guess == null ? guess : guess.getID()));
return guess;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNitzTimeZone
File: src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
getNitzTimeZone
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public Tag getTagByLowercaseName(String tagName) {
return tagRules.get(tagName);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTagByLowercaseName
File: src/main/java/org/owasp/validator/html/Policy.java
Repository: nahsra/antisamy
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-14735
|
MEDIUM
| 4.3
|
nahsra/antisamy
|
getTagByLowercaseName
|
src/main/java/org/owasp/validator/html/Policy.java
|
82da009e733a989a57190cd6aa1b6824724f6d36
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean notificationMatchesCurrentProfiles(NotificationRecord r, int userId) {
return notificationMatchesUserId(r, userId)
|| mUserProfiles.isCurrentProfile(r.getUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notificationMatchesCurrentProfiles
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
notificationMatchesCurrentProfiles
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getLogDetails(String id) {
IssuesWithBLOBs issuesWithBLOBs = issuesMapper.selectByPrimaryKey(id);
if (issuesWithBLOBs != null) {
List<DetailColumn> columns = ReflexObjectUtil.getColumns(issuesWithBLOBs, TestPlanReference.issuesColumns);
OperatingLogDetails details = new OperatingLogDetails(JSON.toJSONString(issuesWithBLOBs.getId()), issuesWithBLOBs.getProjectId(), issuesWithBLOBs.getTitle(), issuesWithBLOBs.getCreator(), columns);
return JSON.toJSONString(details);
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLogDetails
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
getLogDetails
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean thirdPartTemplateEnable(String projectId) {
Project project = baseProjectService.getProjectById(projectId);
return BooleanUtils.isTrue(project.getThirdPartTemplate())
&& platformPluginService.isThirdPartTemplateSupport(project.getPlatform());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: thirdPartTemplateEnable
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
thirdPartTemplateEnable
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public synchronized StompServerHandler stompHandler() {
return handler;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stompHandler
File: src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
Repository: vert-x3/vertx-stomp
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2023-32081
|
MEDIUM
| 6.5
|
vert-x3/vertx-stomp
|
stompHandler
|
src/main/java/io/vertx/ext/stomp/impl/StompServerImpl.java
|
0de4bc5a44ddb57e74d92c445f16456fa03f265b
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeJavascriptInterface(String name) {
mJavaScriptInterfaces.remove(name);
if (mNativeContentViewCore != 0) {
nativeRemoveJavascriptInterface(mNativeContentViewCore, name);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeJavascriptInterface
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
|
removeJavascriptInterface
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean updateAutomaticZenRule(String id, AutomaticZenRule automaticZenRule)
throws RemoteException {
Preconditions.checkNotNull(automaticZenRule, "automaticZenRule is null");
Preconditions.checkNotNull(automaticZenRule.getName(), "Name is null");
Preconditions.checkNotNull(automaticZenRule.getOwner(), "Owner is null");
Preconditions.checkNotNull(automaticZenRule.getConditionId(), "ConditionId is null");
enforcePolicyAccess(Binder.getCallingUid(), "updateAutomaticZenRule");
return mZenModeHelper.updateAutomaticZenRule(id, automaticZenRule,
"updateAutomaticZenRule");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateAutomaticZenRule
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
updateAutomaticZenRule
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Intent createReplyIntent(final Context launcher, final Account account,
final Uri messageUri, final boolean isReplyAll) {
return createActionIntent(launcher, account, messageUri, isReplyAll ? REPLY_ALL : REPLY);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createReplyIntent
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
createReplyIntent
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String url2PathWithQuery(String urlString) {
try {
URL url = new URL(urlString);
String path = url.getPath();
String query = url.getQuery();
String pathWithQuery = path;
if (query != null && query.length() > 0) {
pathWithQuery += "?" + query;
}
return pathWithQuery;
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid url pattern: " + urlString, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: url2PathWithQuery
File: apollo-core/src/main/java/com/ctrip/framework/apollo/core/signature/Signature.java
Repository: apolloconfig/apollo
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2020-15170
|
MEDIUM
| 6.8
|
apolloconfig/apollo
|
url2PathWithQuery
|
apollo-core/src/main/java/com/ctrip/framework/apollo/core/signature/Signature.java
|
ae9ba6cfd32ed80469f162e5e3583e2477862ddf
| 0
|
Analyze the following code function for security vulnerabilities
|
private static native void nativeThemeDump(long ptr, long themePtr, int priority, String tag,
String prefix);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeThemeDump
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
|
nativeThemeDump
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public double getDouble(K name, double defaultValue) {
Double v = getDouble(name);
return v != null ? v : defaultValue;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDouble
File: codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-436",
"CWE-113"
] |
CVE-2022-41915
|
MEDIUM
| 6.5
|
netty
|
getDouble
|
codec/src/main/java/io/netty/handler/codec/DefaultHeaders.java
|
fe18adff1c2b333acb135ab779a3b9ba3295a1c4
| 0
|
Analyze the following code function for security vulnerabilities
|
private File tempFile() throws IOException {
String newpostfix;
String diskFilename = getDiskFilename();
if (diskFilename != null) {
newpostfix = '_' + diskFilename;
} else {
newpostfix = getPostfix();
}
File tmpFile;
if (getBaseDirectory() == null) {
// create a temporary file
tmpFile = File.createTempFile(getPrefix(), newpostfix);
} else {
tmpFile = File.createTempFile(getPrefix(), newpostfix, new File(
getBaseDirectory()));
}
if (deleteOnExit()) {
// See https://github.com/netty/netty/issues/10351
DeleteFileOnExitHook.add(tmpFile.getPath());
}
return tmpFile;
}
|
Vulnerability Classification:
- CWE: CWE-378, CWE-379
- CVE: CVE-2021-21290
- Severity: LOW
- CVSS Score: 1.9
Description: Use Files.createTempFile(...) to ensure the file is created with proper permissions
Motivation:
File.createTempFile(String, String)` will create a temporary file in the system temporary directory if the 'java.io.tmpdir'. The permissions on that file utilize the umask. In a majority of cases, this means that the file that java creates has the permissions: `-rw-r--r--`, thus, any other local user on that system can read the contents of that file.
This can be a security concern if any sensitive data is stored in this file.
This was reported by Jonathan Leitschuh <jonathan.leitschuh@gmail.com> as a security problem.
Modifications:
Use Files.createTempFile(...) which will use safe-defaults when running on java 7 and later. If running on java 6 there isnt much we can do, which is fair enough as java 6 shouldnt be considered "safe" anyway.
Result:
Create temporary files with sane permissions by default.
Function: tempFile
File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
Repository: netty
Fixed Code:
private File tempFile() throws IOException {
String newpostfix;
String diskFilename = getDiskFilename();
if (diskFilename != null) {
newpostfix = '_' + diskFilename;
} else {
newpostfix = getPostfix();
}
File tmpFile;
if (getBaseDirectory() == null) {
// create a temporary file
tmpFile = PlatformDependent.createTempFile(getPrefix(), newpostfix, null);
} else {
tmpFile = PlatformDependent.createTempFile(getPrefix(), newpostfix, new File(
getBaseDirectory()));
}
if (deleteOnExit()) {
// See https://github.com/netty/netty/issues/10351
DeleteFileOnExitHook.add(tmpFile.getPath());
}
return tmpFile;
}
|
[
"CWE-378",
"CWE-379"
] |
CVE-2021-21290
|
LOW
| 1.9
|
netty
|
tempFile
|
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
|
c735357bf29d07856ad171c6611a2e1a0e0000ec
| 1
|
Analyze the following code function for security vulnerabilities
|
void updateSleepIfNeededLocked() {
final boolean shouldSleep = !mRootWindowContainer.hasAwakeDisplay();
final boolean wasSleeping = mSleeping;
boolean updateOomAdj = false;
if (!shouldSleep) {
// If wasSleeping is true, we need to wake up activity manager state from when
// we started sleeping. In either case, we need to apply the sleep tokens, which
// will wake up root tasks or put them to sleep as appropriate.
if (wasSleeping) {
mSleeping = false;
FrameworkStatsLog.write(FrameworkStatsLog.ACTIVITY_MANAGER_SLEEP_STATE_CHANGED,
FrameworkStatsLog.ACTIVITY_MANAGER_SLEEP_STATE_CHANGED__STATE__AWAKE);
startTimeTrackingFocusedActivityLocked();
mTopProcessState = ActivityManager.PROCESS_STATE_TOP;
Slog.d(TAG, "Top Process State changed to PROCESS_STATE_TOP");
mTaskSupervisor.comeOutOfSleepIfNeededLocked();
}
mRootWindowContainer.applySleepTokens(true /* applyToRootTasks */);
if (wasSleeping) {
updateOomAdj = true;
}
} else if (!mSleeping && shouldSleep) {
mSleeping = true;
FrameworkStatsLog.write(FrameworkStatsLog.ACTIVITY_MANAGER_SLEEP_STATE_CHANGED,
FrameworkStatsLog.ACTIVITY_MANAGER_SLEEP_STATE_CHANGED__STATE__ASLEEP);
if (mCurAppTimeTracker != null) {
mCurAppTimeTracker.stop();
}
mTopProcessState = ActivityManager.PROCESS_STATE_TOP_SLEEPING;
Slog.d(TAG, "Top Process State changed to PROCESS_STATE_TOP_SLEEPING");
mTaskSupervisor.goingToSleepLocked();
updateResumedAppTrace(null /* resumed */);
updateOomAdj = true;
}
if (updateOomAdj) {
updateOomAdj();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateSleepIfNeededLocked
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
|
updateSleepIfNeededLocked
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable TaskFragment getTaskFragment() {
return mActivityRecord != null ? mActivityRecord.getTaskFragment() : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTaskFragment
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getTaskFragment
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean isJ9Jvm0() {
String vmName = SystemPropertyUtil.get("java.vm.name", "").toLowerCase();
return vmName.startsWith("ibm j9") || vmName.startsWith("eclipse openj9");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isJ9Jvm0
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
isJ9Jvm0
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
static ClickHouseNode probe(String host, int port, int timeout) {
ClickHouseDnsResolver resolver = ClickHouseDnsResolver.getInstance();
InetSocketAddress address = resolver != null
? resolver.resolve(ClickHouseProtocol.ANY, host, port)
: new InetSocketAddress(host, port);
ClickHouseProtocol p = ClickHouseProtocol.HTTP;
// TODO needs a better way so that we can detect PostgreSQL port as well
try (Socket client = new Socket()) {
client.setKeepAlive(false);
client.connect(address, timeout);
client.setSoTimeout(timeout);
try (OutputStream out = client.getOutputStream(); InputStream in = client.getInputStream()) {
out.write("GET /ping HTTP/1.1\r\n\r\n".getBytes(StandardCharsets.US_ASCII));
out.flush();
byte[] buf = new byte[12]; // HTTP/1.x xxx
int read = in.read(buf);
if (read == buf.length && buf[0] == 0) {
p = ClickHouseProtocol.GRPC;
} else if (buf[0] != 0 && buf[3] == 0) {
p = ClickHouseProtocol.MYSQL;
} else if (buf[0] == 72 && buf[9] == 52) {
p = ClickHouseProtocol.TCP;
}
}
} catch (IOException e) {
// PostgreSQL will end up with SocketTimeoutException
log.debug("Failed to probe %s:%d", host, port, e);
}
return new ClickHouseNode(host, p, port, null, null, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: probe
File: clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
Repository: ClickHouse/clickhouse-java
The code follows secure coding practices.
|
[
"CWE-209"
] |
CVE-2024-23689
|
HIGH
| 8.8
|
ClickHouse/clickhouse-java
|
probe
|
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseNode.java
|
4f8d9303eb991b39ec7e7e34825241efa082238a
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract BaseXMLBuilder elementBefore(String name);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: elementBefore
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
|
elementBefore
|
src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override public void run() {
mProcessStats.writeStateAsync();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21292
|
MEDIUM
| 5.5
|
android
|
run
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void printXMLStartElement(String name, Map<String, String> attributes)
{
handleSpaceWhenStartElement();
super.printXMLStartElement(name, attributes);
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-32070
- Severity: MEDIUM
- CVSS Score: 6.1
Description: XRENDERING-663: Restrict allowed attributes in HTML rendering
* Change HTML renderers to only print allowed attributes and elements.
* Add prefix to forbidden attributes to preserve them in XWiki syntax.
* Adapt tests to expect that invalid attributes get a prefix.
Function: printXMLStartElement
File: xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
Repository: xwiki/xwiki-rendering
Fixed Code:
@Override
public void printXMLStartElement(String name, Map<String, String> attributes)
{
if (this.htmlElementSanitizer == null || this.htmlElementSanitizer.isElementAllowed(name)) {
handleSpaceWhenStartElement();
super.printXMLStartElement(name, cleanAttributes(name, attributes));
}
}
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
printXMLStartElement
|
xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XHTMLWikiPrinter.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getMetricsCategory() {
return SettingsEnums.CHOOSE_LOCK_PASSWORD;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMetricsCategory
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
getMetricsCategory
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public SecurityDesc getJarPermissions(final URL codebaseHost) {
if (!runInSandbox && classLoader.jcv.isFullySigned()) {
// Already trust application, nested jar should be given
return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE,
SecurityDesc.ALL_PERMISSIONS,
codebaseHost);
} else {
return new SecurityDesc(classLoader.file, AppletPermissionLevel.NONE,
SecurityDesc.SANDBOX_PERMISSIONS,
codebaseHost);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJarPermissions
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
getJarPermissions
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int compareTo(WorkBundle that) {
if (this.getPriority() < that.getPriority()) {
return -1;
} else if (that.getPriority() < this.getPriority()) {
return 1;
} else {
return 0;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compareTo
File: src/main/java/emissary/pickup/WorkBundle.java
Repository: NationalSecurityAgency/emissary
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-32634
|
MEDIUM
| 6.5
|
NationalSecurityAgency/emissary
|
compareTo
|
src/main/java/emissary/pickup/WorkBundle.java
|
40260b1ec1f76cc92361702cc14fa1e4388e19d7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String buildUrl(InstanceEvent event, Instance instance) {
if ((event instanceof InstanceStatusChangedEvent)
&& (StatusInfo.STATUS_UP.equals(((InstanceStatusChangedEvent) event).getStatusInfo().getStatus()))) {
return String.format("%s/%s/close", url.toString(), generateAlias(instance));
}
return url.toString();
}
|
Vulnerability Classification:
- CWE: CWE-94
- CVE: CVE-2022-46166
- Severity: CRITICAL
- CVSS Score: 9.8
Description: feat: improve notifiers
Function: buildUrl
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
Repository: codecentric/spring-boot-admin
Fixed Code:
protected String buildUrl(InstanceEvent event, Instance instance) {
if ((event instanceof InstanceStatusChangedEvent)
&& (StatusInfo.STATUS_UP.equals(((InstanceStatusChangedEvent) event).getStatusInfo().getStatus()))) {
return String.format("%s/%s/close", url, generateAlias(instance));
}
return url.toString();
}
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
buildUrl
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/OpsGenieNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTextChanged() {
if (conversation != null && conversation.getCorrectingMessage() != null) {
updateSendButton();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTextChanged
File: src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2018-18467
|
MEDIUM
| 5
|
iNPUTmice/Conversations
|
onTextChanged
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean runsModal() {
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runsModal
File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-41152
|
MEDIUM
| 4
|
OpenOLAT
|
runsModal
|
src/main/java/org/olat/core/commons/modules/bc/commands/CmdZip.java
|
418bb509ffcb0e25ab4390563c6c47f0458583eb
| 0
|
Analyze the following code function for security vulnerabilities
|
public Element toDOM(Document document, String poElementName) {
Element poElement = document.createElement(poElementName);
toDOM(document, poElement);
return poElement;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toDOM
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
toDOM
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileOutput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getRealFilePath() {
String path = this.fileRoot + getFilePath();
return FileManagerUtils.rebulid(path);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRealFilePath
File: src/main/java/com/jflyfox/modules/filemanager/FileManager.java
Repository: jflyfox/jfinal_cms
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2021-37262
|
MEDIUM
| 5
|
jflyfox/jfinal_cms
|
getRealFilePath
|
src/main/java/com/jflyfox/modules/filemanager/FileManager.java
|
e7fd0fe9362464c4d2bd308318eecc89a847b116
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public String getRoom() {
return room;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRoom
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-46166
|
CRITICAL
| 9.8
|
codecentric/spring-boot-admin
|
getRoom
|
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/LetsChatNotifier.java
|
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURLContent(String surl, String username, String password, int timeout, String userAgent)
throws IOException
{
HttpClient client = getHttpClient(timeout, userAgent);
// pass our credentials to HttpClient, they will only be used for
// authenticating to servers with realm "realm", to authenticate agains
// an arbitrary realm change this to null.
client.getState().setCredentials(new AuthScope(null, -1, null),
new UsernamePasswordCredentials(username, password));
// create a GET method that reads a file over HTTPS, we're assuming
// that this file requires basic authentication using the realm above.
GetMethod get = new GetMethod(surl);
try {
// Tell the GET method to automatically handle authentication. The
// method will use any appropriate credentials to handle basic
// authentication requests. Setting this value to false will cause
// any request for authentication to return with a status of 401.
// It will then be up to the client to handle the authentication.
get.setDoAuthentication(true);
// execute the GET
client.executeMethod(get);
// print the status and response
return get.getResponseBodyAsString();
} finally {
// release any connection resources used by the method
get.releaseConnection();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURLContent
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
|
getURLContent
|
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 XWikiDeletedDocument getDeletedDocument(long index, XWikiContext context) throws XWikiException
{
if (hasRecycleBin(context)) {
return getRecycleBinStore().getDeletedDocument(index, context, true);
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeletedDocument
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
|
getDeletedDocument
|
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 String sanitizeQueryString(String query, HttpServletRequest req) {
String qf = getSpaceFilteredQuery(req);
String defaultQuery = "*";
String q = StringUtils.trimToEmpty(query);
if (qf.isEmpty() || qf.length() > 1) {
q = q.replaceAll("[\\?<>]", "").trim();
q = q.replaceAll("$[\\*]*", "");
q = RegExUtils.removeAll(q, "AND");
q = RegExUtils.removeAll(q, "OR");
q = RegExUtils.removeAll(q, "NOT");
q = q.trim();
defaultQuery = "";
}
if (qf.isEmpty()) {
return defaultQuery;
} else if ("*".equals(qf)) {
return q;
} else if ("*".equals(q)) {
return qf;
} else {
if (q.isEmpty()) {
return qf;
} else {
return qf + " AND " + q;
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sanitizeQueryString
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices.
|
[
"CWE-130"
] |
CVE-2022-1543
|
MEDIUM
| 6.5
|
Erudika/scoold
|
sanitizeQueryString
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int[] startListening(IAppWidgetHost callbacks, String callingPackage,
int hostId, List<RemoteViews> updatedViews) {
final int userId = UserHandle.getCallingUserId();
if (DEBUG) {
Slog.i(TAG, "startListening() " + userId);
}
// Make sure the package runs under the caller uid.
mSecurityPolicy.enforceCallFromPackage(callingPackage);
synchronized (mLock) {
ensureGroupStateLoadedLocked(userId);
// NOTE: The lookup is enforcing security across users by making
// sure the caller can only access hosts it owns.
HostId id = new HostId(Binder.getCallingUid(), hostId, callingPackage);
Host host = lookupOrAddHostLocked(id);
host.callbacks = callbacks;
updatedViews.clear();
ArrayList<Widget> instances = host.widgets;
int N = instances.size();
int[] updatedIds = new int[N];
for (int i = 0; i < N; i++) {
Widget widget = instances.get(i);
updatedIds[i] = widget.appWidgetId;
updatedViews.add(cloneIfLocalBinder(widget.views));
}
return updatedIds;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startListening
File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-1541
|
MEDIUM
| 4.3
|
android
|
startListening
|
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
|
0b98d304c467184602b4c6bce76fda0b0274bc07
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isRunning() {
return reader.isAlive() && !close.isSet();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isRunning
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
hierynomus/sshj
|
isRunning
|
src/main/java/net/schmizz/sshj/transport/TransportImpl.java
|
94fcc960e0fb198ddec0f7efc53f95ac627fe083
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
@Transactional(rollbackFor = Exception.class)
public boolean deleteUser(String userId) {
//1.删除用户
this.removeById(userId);
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteUser
File: jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
Repository: jeecgboot/jeecg-boot
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-45208
|
MEDIUM
| 4.3
|
jeecgboot/jeecg-boot
|
deleteUser
|
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/service/impl/SysUserServiceImpl.java
|
51e2227bfe54f5d67b09411ee9a336750164e73d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
// reader
synchronized (mPackages) {
final int N = mPermissionGroups.size();
ArrayList<PermissionGroupInfo> out
= new ArrayList<PermissionGroupInfo>(N);
for (PackageParser.PermissionGroup pg : mPermissionGroups.values()) {
out.add(PackageParser.generatePermissionGroupInfo(pg, flags));
}
return out;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllPermissionGroups
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
|
getAllPermissionGroups
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getInvertFilter() {
return invertFilter;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInvertFilter
File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
getInvertFilter
|
domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.