instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public <F, C extends HasValue<F> & Component> Column<T, V> setEditorComponent(
C editorComponent) {
Objects.requireNonNull(editorComponent,
"Editor component cannot be null");
String propertyName = getId();
if (propertyName == null) {
throw new IllegalStateException(
"setEditorComponent without a setter can only be used if the column has an id. "
+ "Use another setEditorComponent(Component, Setter) or setEditorBinding(Binding) instead.");
}
Binding<T, F> binding = getGrid().getEditor().getBinder()
.bind(editorComponent, propertyName);
return setEditorBinding(binding);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setEditorComponent
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
|
setEditorComponent
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
@Deprecated
public static void write(CharSequence from, File to, Charset charset) throws IOException {
asCharSink(to, charset).write(from);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: write
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2020-8908
|
LOW
| 2.1
|
google/guava
|
write
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Object createMessage(InstanceEvent event, Instance instance) {
Map<String, String> messageJson = new HashMap<>();
messageJson.put("text", getText(event, instance));
return messageJson;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createMessage
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
|
createMessage
|
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 SSLContext getSSLContext() throws GeneralSecurityException, IOException {
return SSLContext.getDefault();
}
|
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: getSSLContext
File: api/src/main/java/org/asynchttpclient/util/SslUtils.java
Repository: AsyncHttpClient/async-http-client
Fixed Code:
public SSLContext getSSLContext(boolean acceptAnyCertificate) throws GeneralSecurityException, IOException {
return acceptAnyCertificate? looseTrustManagerSSLContext: SSLContext.getDefault();
}
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
getSSLContext
|
api/src/main/java/org/asynchttpclient/util/SslUtils.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 1
|
Analyze the following code function for security vulnerabilities
|
public @NonNull InputStream open(@NonNull String fileName) throws IOException {
return open(fileName, ACCESS_STREAMING);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: open
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
|
open
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String readInputStream(InputStream stream) throws IOException
{
BufferedReader reader = new BufferedReader(
new InputStreamReader(stream));
StringBuffer result = new StringBuffer();
String tmp = reader.readLine();
while (tmp != null)
{
result.append(tmp + "\n");
tmp = reader.readLine();
}
reader.close();
return result.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readInputStream
File: src/main/java/com/mxgraph/online/Utils.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-3398
|
HIGH
| 7.5
|
jgraph/drawio
|
readInputStream
|
src/main/java/com/mxgraph/online/Utils.java
|
064729fec4262f9373d9fdcafda0be47cd18dd50
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getRelatedItemsQueryString(String identifierField) {
logger.trace("getRelatedItemsQueryString: {}", identifierField);
List<String> relatedItemIdentifiers = viewManager.getTopStructElement().getMetadataValues(identifierField);
if (relatedItemIdentifiers.isEmpty()) {
return null;
}
StringBuilder sbQuery = new StringBuilder(SolrConstants.PI).append(":(");
int initLength = sbQuery.length();
for (String identifier : relatedItemIdentifiers) {
if (sbQuery.length() > initLength) {
sbQuery.append(" OR ");
}
sbQuery.append(identifier);
}
sbQuery.append(')');
return sbQuery.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRelatedItemsQueryString
File: goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
Repository: intranda/goobi-viewer-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29014
|
MEDIUM
| 6.1
|
intranda/goobi-viewer-core
|
getRelatedItemsQueryString
|
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
|
c29efe60e745a94d03debc17681c4950f3917455
| 0
|
Analyze the following code function for security vulnerabilities
|
private Cursor getAllGlobalSettings(String[] projection) {
if (DEBUG) {
Slog.v(LOG_TAG, "getAllGlobalSettings()");
}
synchronized (mLock) {
// Get the settings.
SettingsState settingsState = mSettingsRegistry.getSettingsLocked(
SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM);
List<String> names = getSettingsNamesLocked(SETTINGS_TYPE_GLOBAL,
UserHandle.USER_SYSTEM);
final int nameCount = names.size();
String[] normalizedProjection = normalizeProjection(projection);
MatrixCursor result = new MatrixCursor(normalizedProjection, nameCount);
// Anyone can get the global settings, so no security checks.
for (int i = 0; i < nameCount; i++) {
String name = names.get(i);
try {
enforceSettingReadable(name, SETTINGS_TYPE_GLOBAL,
UserHandle.getCallingUserId());
} catch (SecurityException e) {
// Caller doesn't have permission to read this setting
continue;
}
Setting setting = settingsState.getSettingLocked(name);
appendSettingToCursor(result, setting);
}
return result;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllGlobalSettings
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
|
getAllGlobalSettings
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean dumpProcessesToGc(PrintWriter pw, boolean needSep, String dumpPackage) {
if (mProcessesToGc.size() > 0) {
boolean printed = false;
long now = SystemClock.uptimeMillis();
for (int i=0; i<mProcessesToGc.size(); i++) {
ProcessRecord proc = mProcessesToGc.get(i);
if (dumpPackage != null && !dumpPackage.equals(proc.info.packageName)) {
continue;
}
if (!printed) {
if (needSep) pw.println();
needSep = true;
pw.println(" Processes that are waiting to GC:");
printed = true;
}
pw.print(" Process "); pw.println(proc);
pw.print(" lowMem="); pw.print(proc.reportLowMemory);
pw.print(", last gced=");
pw.print(now-proc.lastRequestedGc);
pw.print(" ms ago, last lowMem=");
pw.print(now-proc.lastLowMemory);
pw.println(" ms ago");
}
}
return needSep;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpProcessesToGc
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
|
dumpProcessesToGc
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onTaskSelectionEvent(@Observes TaskSelectionEvent event){
selectedTaskId = event.getTaskId();
selectedTaskName = event.getTaskName();
view.getTaskIdAndName().setText(String.valueOf(selectedTaskId) + " - "+selectedTaskName);
view.getContent().clear();
String placeToGo;
if(event.getPlace() != null && !event.getPlace().equals("")){
placeToGo = event.getPlace();
}else{
placeToGo = "Task Details";
}
DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest(placeToGo);
//Set Parameters here:
defaultPlaceRequest.addParameter("taskId", String.valueOf(selectedTaskId));
defaultPlaceRequest.addParameter("taskName", selectedTaskName);
Set<Activity> activities = activityManager.getActivities(defaultPlaceRequest);
AbstractWorkbenchScreenActivity activity = ((AbstractWorkbenchScreenActivity) activities.iterator().next());
activitiesMap.put(placeToGo, activity);
IsWidget widget = activity.getWidget();
activity.launch(place, null);
activity.onStartup(defaultPlaceRequest);
view.getContent().add(widget);
activity.onOpen();
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2013-6465
- Severity: LOW
- CVSS Score: 3.5
Description: BZ-1049109: escaping task name html inputs
Function: onTaskSelectionEvent
File: jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
Repository: kiegroup/jbpm-wb
Fixed Code:
public void onTaskSelectionEvent(@Observes TaskSelectionEvent event){
selectedTaskId = event.getTaskId();
selectedTaskName = event.getTaskName();
view.getTaskIdAndName().setText(SafeHtmlUtils.htmlEscape(String.valueOf(selectedTaskId) + " - "+selectedTaskName));
view.getContent().clear();
String placeToGo;
if(event.getPlace() != null && !event.getPlace().equals("")){
placeToGo = event.getPlace();
}else{
placeToGo = "Task Details";
}
DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest(placeToGo);
//Set Parameters here:
defaultPlaceRequest.addParameter("taskId", String.valueOf(selectedTaskId));
defaultPlaceRequest.addParameter("taskName", selectedTaskName);
Set<Activity> activities = activityManager.getActivities(defaultPlaceRequest);
AbstractWorkbenchScreenActivity activity = ((AbstractWorkbenchScreenActivity) activities.iterator().next());
activitiesMap.put(placeToGo, activity);
IsWidget widget = activity.getWidget();
activity.launch(place, null);
activity.onStartup(defaultPlaceRequest);
view.getContent().add(widget);
activity.onOpen();
}
|
[
"CWE-79"
] |
CVE-2013-6465
|
LOW
| 3.5
|
kiegroup/jbpm-wb
|
onTaskSelectionEvent
|
jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
|
4818204506e8e94645b52adb9426bedfa9ffdd04
| 1
|
Analyze the following code function for security vulnerabilities
|
private void updateScreenCaptureDisabled() {
mHandler.post(() -> {
try {
mInjector.getIWindowManager().refreshScreenCaptureDisabled();
} catch (RemoteException e) {
Slogf.w(LOG_TAG, "Unable to notify WindowManager.", e);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateScreenCaptureDisabled
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
|
updateScreenCaptureDisabled
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void renameProperties(String className, Map<String, String> fieldsToRename)
{
renameProperties(resolveClassReference(className), fieldsToRename);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renameProperties
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
renameProperties
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
|
db3d1c62fc5fb59fefcda3b86065d2d362f55164
| 0
|
Analyze the following code function for security vulnerabilities
|
OpenSSLSessionImpl getSessionToReuse(long sslNativePointer, String hostname, int port)
throws SSLException {
final OpenSSLSessionImpl sessionToReuse;
if (client_mode) {
// look for client session to reuse
sessionToReuse = getCachedClientSession(clientSessionContext, hostname, port);
if (sessionToReuse != null) {
NativeCrypto.SSL_set_session(sslNativePointer,
sessionToReuse.sslSessionNativePointer);
}
} else {
sessionToReuse = null;
}
return sessionToReuse;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionToReuse
File: src/main/java/org/conscrypt/SSLParametersImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3840
|
HIGH
| 10
|
android
|
getSessionToReuse
|
src/main/java/org/conscrypt/SSLParametersImpl.java
|
5af5e93463f4333187e7e35f3bd2b846654aa214
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getLastXref() {
return lastXref;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLastXref
File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
Repository: pdftk-java/pdftk
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2021-37819
|
HIGH
| 7.5
|
pdftk-java/pdftk
|
getLastXref
|
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
|
9b0cbb76c8434a8505f02ada02a94263dcae9247
| 0
|
Analyze the following code function for security vulnerabilities
|
void waitForCompletion(FullParams params) {
synchronized (params.latch) {
while (params.latch.get() == false) {
try {
params.latch.wait();
} catch (InterruptedException e) { /* never interrupted */ }
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: waitForCompletion
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
waitForCompletion
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
private UiccCardApplication getUiccCardApplication() {
return mUiccController.getUiccCardApplication(mPhone.getPhoneId(),
UiccController.APP_FAM_3GPP);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUiccCardApplication
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
|
getUiccCardApplication
|
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public final HttpExecuteInterceptor getClientAuthentication() {
return clientAuthentication;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClientAuthentication
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2020-7692
|
MEDIUM
| 6.4
|
googleapis/google-oauth-java-client
|
getClientAuthentication
|
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
|
13433cd7dd06267fc261f0b1d4764f8e3432c824
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unused")
@CalledByNative
private void onFlingStartEventConsumed(int vx, int vy) {
mTouchScrollInProgress = false;
mPotentiallyActiveFlingCount++;
temporarilyHideTextHandles();
for (mGestureStateListenersIterator.rewind();
mGestureStateListenersIterator.hasNext();) {
mGestureStateListenersIterator.next().onFlingStartGesture(
vx, vy, computeVerticalScrollOffset(), computeVerticalScrollExtent());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFlingStartEventConsumed
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
|
onFlingStartEventConsumed
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String getResetLink(String emailContent, String userName)
{
String result = null;
// Use a regex to extract the password reset link
Pattern resetLinkPattern = Pattern.compile("http[^\\s]+?authenticate/reset\\?u=" + userName + "\\&v=\\w+");
Matcher matcher = resetLinkPattern.matcher(emailContent);
if (matcher.find()) {
result = matcher.group();
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResetLink
File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2021-32731
|
MEDIUM
| 5
|
xwiki/xwiki-platform
|
getResetLink
|
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/ResetPasswordIT.java
|
0cf716250b3645a5974c80d8336dcdf885749dff
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory) {
this.organizationDirectory = organizationDirectory;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOrganizationDirectoryService
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
|
setOrganizationDirectoryService
|
modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
|
b18c6a7f81f08ed14884592a6c14c9ab611ad450
| 0
|
Analyze the following code function for security vulnerabilities
|
public @NonNull InputStream open(@NonNull String fileName, int accessMode) throws IOException {
Objects.requireNonNull(fileName, "fileName");
synchronized (this) {
ensureOpenLocked();
final long asset = nativeOpenAsset(mObject, fileName, accessMode);
if (asset == 0) {
throw new FileNotFoundException("Asset file: " + fileName);
}
final AssetInputStream assetInputStream = new AssetInputStream(asset);
incRefsLocked(assetInputStream.hashCode());
return assetInputStream;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: open
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
|
open
|
core/java/android/content/res/AssetManager.java
|
c3bc12c484ef3bbca4cec19234437c45af5e584d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void update(byte[] in, int inOff, int len)
throws DataLengthException, IllegalStateException
{
ccm.processAADBytes(in, inOff, len);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000339
|
MEDIUM
| 5
|
bcgit/bc-java
|
update
|
prov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/AES.java
|
413b42f4d770456508585c830cfcde95f9b0e93b
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean removeObserverLocked(IContentObserver observer) {
int size = mChildren.size();
for (int i = 0; i < size; i++) {
boolean empty = mChildren.get(i).removeObserverLocked(observer);
if (empty) {
mChildren.remove(i);
i--;
size--;
}
}
IBinder observerBinder = observer.asBinder();
size = mObservers.size();
for (int i = 0; i < size; i++) {
ObserverEntry entry = mObservers.get(i);
if (entry.observer.asBinder() == observerBinder) {
mObservers.remove(i);
// We no longer need to listen for death notifications. Remove it.
observerBinder.unlinkToDeath(entry, 0);
break;
}
}
if (mChildren.size() == 0 && mObservers.size() == 0) {
return true;
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeObserverLocked
File: services/core/java/com/android/server/content/ContentService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2426
|
MEDIUM
| 4.3
|
android
|
removeObserverLocked
|
services/core/java/com/android/server/content/ContentService.java
|
63363af721650e426db5b0bdfb8b2d4fe36abdb0
| 0
|
Analyze the following code function for security vulnerabilities
|
private ShortcutInfo disableDynamicWithId(@NonNull String shortcutId, boolean ignoreInvisible,
int disabledReason, boolean ignorePersistedShortcuts) {
return deleteOrDisableWithId(shortcutId, /* disable =*/ true, /* overrideImmutable=*/ false,
ignoreInvisible, disabledReason, ignorePersistedShortcuts);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: disableDynamicWithId
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
disableDynamicWithId
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
private void finishForceStopPackageLocked(final String packageName, int uid) {
Intent intent = new Intent(Intent.ACTION_PACKAGE_RESTARTED,
Uri.fromParts("package", packageName, null));
if (!mProcessesReady) {
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
| Intent.FLAG_RECEIVER_FOREGROUND);
}
intent.putExtra(Intent.EXTRA_UID, uid);
intent.putExtra(Intent.EXTRA_USER_HANDLE, UserHandle.getUserId(uid));
broadcastIntentLocked(null, null, intent,
null, null, 0, null, null, null, AppOpsManager.OP_NONE,
null, false, false, MY_PID, Process.SYSTEM_UID, UserHandle.getUserId(uid));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishForceStopPackageLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
finishForceStopPackageLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalSetPublishRate(PublishRate publishRate) {
if (publishRate == null) {
return CompletableFuture.completedFuture(null);
}
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new);
topicPolicies.setPublishRate(publishRate);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies);
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalSetPublishRate
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalSetPublishRate
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum) {
return getTasks(maxNum, false /* filterForVisibleRecents */, false /* keepIntentExtra */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTasks
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
|
getTasks
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getContentLength() {
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContentLength
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
|
getContentLength
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected AuthenticationFlowModel getAuthenticationFlow(AuthenticationSessionModel authSession) {
return realm.getAuthenticationFlowsStream()
.filter(flow -> Objects.equals(flow.getAlias(), DefaultAuthenticationFlows.SAML_ECP_FLOW))
.findFirst()
.orElseThrow(() -> new RuntimeException("Could not resolve authentication flow for SAML ECP Profile."));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAuthenticationFlow
File: services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2021-3827
|
MEDIUM
| 6.8
|
keycloak
|
getAuthenticationFlow
|
services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
|
44000caaf5051d7f218d1ad79573bd3d175cad0d
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public <T> T deserialize(Response response, GenericType<T> returnType) throws ApiException {
if (response == null || returnType == null) {
return null;
}
if ("byte[]".equals(returnType.toString())) {
// Handle binary response (byte array).
return (T) response.readEntity(byte[].class);
} else if (returnType.getRawType() == File.class) {
// Handle file downloading.
T file = (T) downloadFileFromResponse(response);
return file;
}
String contentType = null;
List<Object> contentTypes = response.getHeaders().get("Content-Type");
if (contentTypes != null && !contentTypes.isEmpty())
contentType = String.valueOf(contentTypes.get(0));
// read the entity stream multiple times
response.bufferEntity();
return response.readEntity(returnType);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deserialize
File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
deserialize
|
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static File createSmallFile() {
File smallfile = null;
try {
smallfile = File.createTempFile("smalltmp", "tmp");
FileOutputStream fos = new FileOutputStream(smallfile);
fos.write("123456789".getBytes());
fos.flush();
fos.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
return smallfile;
}
|
Vulnerability Classification:
- CWE: CWE-378
- CVE: CVE-2023-0482
- Severity: MEDIUM
- CVSS Score: 5.5
Description: [RESTEASY-3286] Use the new file utilities to create temporary files in tests.
https://issues.redhat.com/browse/RESTEASY-3286
Signed-off-by: James R. Perkins <jperkins@redhat.com>
Function: createSmallFile
File: testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java
Repository: resteasy
Fixed Code:
private static File createSmallFile() {
java.nio.file.Path smallfile = null;
try {
smallfile = Files.createTempFile("smalltmp", "tmp");
try (BufferedWriter writer = Files.newBufferedWriter(smallfile)) {
writer.write("123456789");
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return smallfile.toFile();
}
|
[
"CWE-378"
] |
CVE-2023-0482
|
MEDIUM
| 5.5
|
resteasy
|
createSmallFile
|
testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/response/resource/RangeResource.java
|
807d7456f2137cde8ef7c316707211bf4e542d56
| 1
|
Analyze the following code function for security vulnerabilities
|
public IntentBuilder setPassword(LockscreenCredential password) {
mIntent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, password);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPassword
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
|
setPassword
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
private CompletableFuture<Void> createSubscriptions(TopicName topicName, int numPartitions) {
CompletableFuture<Void> result = new CompletableFuture<>();
pulsar().getBrokerService().fetchPartitionedTopicMetadataAsync(topicName).thenAccept(partitionMetadata -> {
if (partitionMetadata.partitions < 1) {
result.completeExceptionally(new RestException(Status.CONFLICT, "Topic is not partitioned topic"));
return;
}
if (partitionMetadata.partitions >= numPartitions) {
result.completeExceptionally(new RestException(Status.CONFLICT,
"number of partitions must be more than existing " + partitionMetadata.partitions));
return;
}
PulsarAdmin admin;
try {
admin = pulsar().getAdminClient();
} catch (PulsarServerException e1) {
result.completeExceptionally(e1);
return;
}
admin.topics().getStatsAsync(topicName.getPartition(0).toString()).thenAccept(stats -> {
List<CompletableFuture<Void>> subscriptionFutures = new ArrayList<>();
stats.getSubscriptions().entrySet().forEach(e -> {
String subscription = e.getKey();
SubscriptionStats ss = e.getValue();
if (!ss.isDurable()) {
// We must not re-create non-durable subscriptions on the new partitions
return;
}
for (int i = partitionMetadata.partitions; i < numPartitions; i++) {
final String topicNamePartition = topicName.getPartition(i).toString();
subscriptionFutures.add(admin.topics().createSubscriptionAsync(topicNamePartition,
subscription, MessageId.latest));
}
});
FutureUtil.waitForAll(subscriptionFutures).thenRun(() -> {
log.info("[{}] Successfully created new partitions {}", clientAppId(), topicName);
result.complete(null);
}).exceptionally(ex -> {
log.warn("[{}] Failed to create subscriptions on new partitions for {}",
clientAppId(), topicName, ex);
result.completeExceptionally(ex);
return null;
});
}).exceptionally(ex -> {
if (ex.getCause() instanceof PulsarAdminException.NotFoundException) {
// The first partition doesn't exist, so there are currently to subscriptions to recreate
result.complete(null);
} else {
log.warn("[{}] Failed to get list of subscriptions of {}",
clientAppId(), topicName.getPartition(0), ex);
result.completeExceptionally(ex);
}
return null;
});
}).exceptionally(ex -> {
log.warn("[{}] Failed to get partition metadata for {}",
clientAppId(), topicName.toString());
result.completeExceptionally(ex);
return null;
});
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createSubscriptions
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
createSubscriptions
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public int optInt(int index) {
return optInt(index, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: optInt
File: src/main/java/org/codehaus/jettison/json/JSONArray.java
Repository: jettison-json/jettison
The code follows secure coding practices.
|
[
"CWE-674",
"CWE-787"
] |
CVE-2022-45693
|
HIGH
| 7.5
|
jettison-json/jettison
|
optInt
|
src/main/java/org/codehaus/jettison/json/JSONArray.java
|
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int startActivityIntentSender(IApplicationThread caller, IntentSender intent,
Intent fillInIntent, String resolvedType, IBinder resultTo, String resultWho,
int requestCode, int flagsMask, int flagsValues, Bundle options)
throws TransactionTooLargeException {
enforceNotIsolatedCaller("startActivityIntentSender");
// Refuse possible leaked file descriptors
if (fillInIntent != null && fillInIntent.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
IIntentSender sender = intent.getTarget();
if (!(sender instanceof PendingIntentRecord)) {
throw new IllegalArgumentException("Bad PendingIntent object");
}
PendingIntentRecord pir = (PendingIntentRecord)sender;
synchronized (this) {
// If this is coming from the currently resumed activity, it is
// effectively saying that app switches are allowed at this point.
final ActivityStack stack = getFocusedStack();
if (stack.mResumedActivity != null &&
stack.mResumedActivity.info.applicationInfo.uid == Binder.getCallingUid()) {
mAppSwitchesAllowedTime = 0;
}
}
int ret = pir.sendInner(0, fillInIntent, resolvedType, null, null,
resultTo, resultWho, requestCode, flagsMask, flagsValues, options, null);
return ret;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityIntentSender
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
startActivityIntentSender
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getApiCallCount(boolean unlimited) {
final ShortcutService s = mShortcutUser.mService;
// Reset the counter if:
// - the package is in foreground now.
// - the package is *not* in foreground now, but was in foreground at some point
// since the previous time it had been.
if (s.isUidForegroundLocked(mPackageUid)
|| (mLastKnownForegroundElapsedTime
< s.getUidLastForegroundElapsedTimeLocked(mPackageUid))
|| unlimited) {
mLastKnownForegroundElapsedTime = s.injectElapsedRealtime();
resetRateLimiting();
}
// Note resetThrottlingIfNeeded() and resetRateLimiting() will set 0 to mApiCallCount,
// but we just can't return 0 at this point, because we may have to update
// mLastResetTime.
final long last = s.getLastResetTimeLocked();
final long now = s.injectCurrentTimeMillis();
if (ShortcutService.isClockValid(now) && mLastResetTime > now) {
Slog.w(TAG, "Clock rewound");
// Clock rewound.
mLastResetTime = now;
mApiCallCount = 0;
return mApiCallCount;
}
// If not reset yet, then reset.
if (mLastResetTime < last) {
if (ShortcutService.DEBUG || ShortcutService.DEBUG_REBOOT) {
Slog.d(TAG, String.format("%s: last reset=%d, now=%d, last=%d: resetting",
getPackageName(), mLastResetTime, now, last));
}
mApiCallCount = 0;
mLastResetTime = last;
}
return mApiCallCount;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApiCallCount
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
getApiCallCount
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void fillArc(Object graphics, int x, int y, int width, int height,
int startAngle, int arcAngle) {
((AndroidGraphics) graphics).fillArc(x, y, width, height, startAngle, arcAngle);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: fillArc
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
|
fillArc
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public void testPOJOBean()
throws IOException
{
ObjectMapper mapper = new ObjectMapper();
// also need tree mapper to construct tree to serialize
ObjectNode n = mapper.getNodeFactory().objectNode();
n.set("pojo", mapper.getNodeFactory().pojoNode(new Bean()));
StringWriter sw = new StringWriter();
JsonGenerator jg = mapper.createGenerator(sw);
mapper.writeTree(jg, n);
Map<String,Object> result = (Map<String,Object>) mapper.readValue(sw.toString(), Map.class);
assertEquals(1, result.size());
Map<String,Object> bean = (Map<String,Object>) result.get("pojo");
assertEquals(2, bean.size());
assertEquals("y", bean.get("x"));
assertEquals(Integer.valueOf(13), bean.get("y"));
jg.close();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testPOJOBean
File: src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2020-36518
|
MEDIUM
| 5
|
FasterXML/jackson-databind
|
testPOJOBean
|
src/test/java/com/fasterxml/jackson/databind/ser/TestTreeSerialization.java
|
8238ab41d0350fb915797c89d46777b4496b74fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public static List<Provider> getProviders(List<ProviderRole> providerRoles) {
if (providerRoles == null || providerRoles.size() == 0) {
return new ArrayList<Provider>();
}
ProviderManagementService providerManagementService = Context.getService(ProviderManagementService.class);
//Service returns list of org.openmrs.module.providermanagement.Provider, not org.openmrs.Provider
return new ArrayList<Provider>(providerManagementService.getProvidersByRoles(providerRoles));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProviders
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
getProviders
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isPanelFullyCollapsed() {
return mNotificationPanel.isFullyCollapsed();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPanelFullyCollapsed
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
isPanelFullyCollapsed
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
public Annotation getAnnotation() {
return annotation;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAnnotation
File: src/main/java/object/Variant.java
Repository: nickzren/alsdb
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-15021
|
MEDIUM
| 5.2
|
nickzren/alsdb
|
getAnnotation
|
src/main/java/object/Variant.java
|
cbc79a68145e845f951113d184b4de207c341599
| 0
|
Analyze the following code function for security vulnerabilities
|
public void broadcastWpsFailEvent(String iface, int cfgError, int vendorErrorCode) {
int reason = 0;
switch(vendorErrorCode) {
case REASON_TKIP_ONLY_PROHIBITED:
sendMessage(iface, WPS_FAIL_EVENT, WifiManager.WPS_TKIP_ONLY_PROHIBITED);
return;
case REASON_WEP_PROHIBITED:
sendMessage(iface, WPS_FAIL_EVENT, WifiManager.WPS_WEP_PROHIBITED);
return;
default:
reason = vendorErrorCode;
break;
}
switch(cfgError) {
case CONFIG_AUTH_FAILURE:
sendMessage(iface, WPS_FAIL_EVENT, WifiManager.WPS_AUTH_FAILURE);
return;
case CONFIG_MULTIPLE_PBC_DETECTED:
sendMessage(iface, WPS_FAIL_EVENT, WifiManager.WPS_OVERLAP_ERROR);
return;
default:
if (reason == 0) {
reason = cfgError;
}
break;
}
//For all other errors, return a generic internal error
sendMessage(iface, WPS_FAIL_EVENT, WifiManager.ActionListener.FAILURE_INTERNAL_ERROR,
reason);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: broadcastWpsFailEvent
File: service/java/com/android/server/wifi/WifiMonitor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
broadcastWpsFailEvent
|
service/java/com/android/server/wifi/WifiMonitor.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateHeader() {
if (mStatusBar.getBarState() == StatusBarState.KEYGUARD) {
updateHeaderKeyguardAlpha();
}
updateQsExpansion();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateHeader
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
|
updateHeader
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void reinit(Object i) {
if (instance != null && ((i instanceof CodenameOneActivity) || instance.myView == null)) {
instance.init(i);
}
Display.init(i);
// This is a hack to fix an issue that caused the screen to appear blank when
// the app is loaded from memory after being unloaded.
// This issue only seems to occur when the Activity had been unloaded
// so to test this you'll need to check the "Don't keep activities" checkbox under/
// Developer options.
// Developer options.
Display.getInstance().callSerially(new Runnable() {
public void run() {
Display.getInstance().invokeAndBlock(new Runnable(){ public void run(){
try {
Thread.sleep(50);
} catch (Exception ex){}
}});
if (!Display.isInitialized() || Display.getInstance().isMinimized()) {
return;
}
Form cur = Display.getInstance().getCurrent();
if (cur != null) {
cur.forceRevalidate();
}
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reinit
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
|
reinit
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void initialize(ViewGroup containerView, InternalAccessDelegate internalDispatcher,
WebContents webContents, WindowAndroid windowAndroid) {
createContentViewAndroidDelegate();
setContainerView(containerView);
long windowNativePointer = windowAndroid.getNativePointer();
assert windowNativePointer != 0;
createViewAndroid(windowAndroid);
long viewAndroidNativePointer = mViewAndroid.getNativePointer();
assert viewAndroidNativePointer != 0;
mZoomControlsDelegate = NO_OP_ZOOM_CONTROLS_DELEGATE;
mNativeContentViewCore = nativeInit(
webContents, viewAndroidNativePointer, windowNativePointer,
mRetainedJavaScriptObjects);
mWebContents = nativeGetWebContentsAndroid(mNativeContentViewCore);
mContentSettings = new ContentSettings(this, mNativeContentViewCore);
setContainerViewInternals(internalDispatcher);
mRenderCoordinates.reset();
initPopupZoomer(mContext);
mImeAdapter = createImeAdapter(mContext);
attachImeAdapter();
mAccessibilityInjector = AccessibilityInjector.newInstance(this);
mWebContentsObserver = new WebContentsObserver(mWebContents) {
@Override
public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode,
String description, String failingUrl) {
// Navigation that fails the provisional load will have the strong binding removed
// here. One for which the provisional load is commited will have the strong binding
// removed in navigationEntryCommitted() below.
if (isProvisionalLoad) determinedProcessVisibility();
}
@Override
public void didNavigateMainFrame(String url, String baseUrl,
boolean isNavigationToDifferentPage, boolean isFragmentNavigation) {
if (!isNavigationToDifferentPage) return;
hidePopupsAndClearSelection();
resetScrollInProgress();
resetGestureDetection();
}
@Override
public void renderProcessGone(boolean wasOomProtected) {
hidePopupsAndClearSelection();
resetScrollInProgress();
// No need to reset gesture detection as the detector will have
// been destroyed in the RenderWidgetHostView.
}
@Override
public void navigationEntryCommitted() {
determinedProcessVisibility();
}
private void determinedProcessVisibility() {
// Signal to the process management logic that we can now rely on the process
// visibility signal for binding management. Before the navigation commits, its
// renderer is considered background even if the pending navigation happens in the
// foreground renderer.
ChildProcessLauncher.determinedVisibility(getCurrentRenderProcessId());
}
};
}
|
Vulnerability Classification:
- CWE: CWE-1021
- CVE: CVE-2015-1241
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Reset gesture detection upon page navigation for Aura
In order to stop the gesture events to be generated and sent while navigating
to a different page on the main frame or the window loses focus, we decide
to cancel all the active touch events on the current Aura window before
the touch release event.
BUG=418402
Review URL: https://codereview.chromium.org/868123002
Cr-Commit-Position: refs/heads/master@{#315705}
Function: initialize
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
Fixed Code:
public void initialize(ViewGroup containerView, InternalAccessDelegate internalDispatcher,
WebContents webContents, WindowAndroid windowAndroid) {
createContentViewAndroidDelegate();
setContainerView(containerView);
long windowNativePointer = windowAndroid.getNativePointer();
assert windowNativePointer != 0;
createViewAndroid(windowAndroid);
long viewAndroidNativePointer = mViewAndroid.getNativePointer();
assert viewAndroidNativePointer != 0;
mZoomControlsDelegate = NO_OP_ZOOM_CONTROLS_DELEGATE;
mNativeContentViewCore = nativeInit(
webContents, viewAndroidNativePointer, windowNativePointer,
mRetainedJavaScriptObjects);
mWebContents = nativeGetWebContentsAndroid(mNativeContentViewCore);
mContentSettings = new ContentSettings(this, mNativeContentViewCore);
setContainerViewInternals(internalDispatcher);
mRenderCoordinates.reset();
initPopupZoomer(mContext);
mImeAdapter = createImeAdapter(mContext);
attachImeAdapter();
mAccessibilityInjector = AccessibilityInjector.newInstance(this);
mWebContentsObserver = new WebContentsObserver(mWebContents) {
@Override
public void didFailLoad(boolean isProvisionalLoad, boolean isMainFrame, int errorCode,
String description, String failingUrl) {
// Navigation that fails the provisional load will have the strong binding removed
// here. One for which the provisional load is commited will have the strong binding
// removed in navigationEntryCommitted() below.
if (isProvisionalLoad) determinedProcessVisibility();
}
@Override
public void didNavigateMainFrame(String url, String baseUrl,
boolean isNavigationToDifferentPage, boolean isFragmentNavigation) {
if (!isNavigationToDifferentPage) return;
hidePopupsAndClearSelection();
resetScrollInProgress();
}
@Override
public void renderProcessGone(boolean wasOomProtected) {
hidePopupsAndClearSelection();
resetScrollInProgress();
// No need to reset gesture detection as the detector will have
// been destroyed in the RenderWidgetHostView.
}
@Override
public void navigationEntryCommitted() {
determinedProcessVisibility();
}
private void determinedProcessVisibility() {
// Signal to the process management logic that we can now rely on the process
// visibility signal for binding management. Before the navigation commits, its
// renderer is considered background even if the pending navigation happens in the
// foreground renderer.
ChildProcessLauncher.determinedVisibility(getCurrentRenderProcessId());
}
};
}
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
initialize
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean isAppInstalled(String packageName, UserHandle user) {
ApplicationInfo info = getApplicationInfo(packageName, user, 0);
return info != null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAppInstalled
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-40097
|
HIGH
| 7.8
|
android
|
isAppInstalled
|
src/com/android/launcher3/util/PackageManagerHelper.java
|
6c9a41117d5a9365cf34e770bbb00138f6bf997e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURL()
{
return this.doc.getURL("view", getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
protected boolean handleServiceRequest(String serviceName, Buffer buffer) throws Exception {
boolean debugEnabled = log.isDebugEnabled();
if (debugEnabled) {
log.debug("handleServiceRequest({}) SSH_MSG_SERVICE_REQUEST '{}'", this, serviceName);
}
KexState state = kexState.get();
if (!validateServiceKexState(state)) {
throw new IllegalStateException(
"Received " + SshConstants.getCommandMessageName(SshConstants.SSH_MSG_SERVICE_REQUEST)
+ " while in KEX state=" + state);
}
try {
startService(serviceName, buffer);
} catch (Throwable e) {
debug("handleServiceRequest({}) Service {} rejected: {} = {}",
this, serviceName, e.getClass().getSimpleName(), e.getMessage(), e);
disconnect(SshConstants.SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE, "Bad service request: " + serviceName);
return false;
}
if (debugEnabled) {
log.debug("handleServiceRequest({}) Accepted service {}", this, serviceName);
}
Buffer response = createBuffer(
SshConstants.SSH_MSG_SERVICE_ACCEPT, Byte.SIZE + GenericUtils.length(serviceName));
response.putString(serviceName);
writePacket(response);
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleServiceRequest
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices.
|
[
"CWE-354"
] |
CVE-2023-48795
|
MEDIUM
| 5.9
|
apache/mina-sshd
|
handleServiceRequest
|
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
|
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
void initializeConversationNotificationInfo(
final ExpandableNotificationRow row,
NotificationConversationInfo notificationInfoView) throws Exception {
NotificationGuts guts = row.getGuts();
NotificationEntry entry = row.getEntry();
StatusBarNotification sbn = entry.getSbn();
String packageName = sbn.getPackageName();
// Settings link is only valid for notifications that specify a non-system user
NotificationConversationInfo.OnSettingsClickListener onSettingsClick = null;
UserHandle userHandle = sbn.getUser();
PackageManager pmUser = CentralSurfaces.getPackageManagerForUser(
mContext, userHandle.getIdentifier());
final NotificationConversationInfo.OnAppSettingsClickListener onAppSettingsClick =
(View v, Intent intent) -> {
mMetricsLogger.action(MetricsProto.MetricsEvent.ACTION_APP_NOTE_SETTINGS);
guts.resetFalsingCheck();
mNotificationActivityStarter.startNotificationGutsIntent(intent, sbn.getUid(),
row);
};
final NotificationConversationInfo.OnConversationSettingsClickListener
onConversationSettingsListener =
() -> {
startConversationSettingsActivity(sbn.getUid(), row);
};
if (!userHandle.equals(UserHandle.ALL)
|| mLockscreenUserManager.getCurrentUserId() == UserHandle.USER_SYSTEM) {
onSettingsClick = (View v, NotificationChannel channel, int appUid) -> {
mMetricsLogger.action(MetricsProto.MetricsEvent.ACTION_NOTE_INFO);
guts.resetFalsingCheck();
mOnSettingsClickListener.onSettingsClick(sbn.getKey());
startAppNotificationSettingsActivity(packageName, appUid, channel, row);
};
}
ConversationIconFactory iconFactoryLoader = new ConversationIconFactory(mContext,
mLauncherApps, pmUser, IconDrawableFactory.newInstance(mContext, false),
mContext.getResources().getDimensionPixelSize(
R.dimen.notification_guts_conversation_icon_size));
notificationInfoView.bindNotification(
notificationInfoView.getSelectedAction(),
mShortcutManager,
pmUser,
mPeopleSpaceWidgetManager,
mNotificationManager,
mOnUserInteractionCallback,
packageName,
entry.getChannel(),
entry,
entry.getBubbleMetadata(),
onSettingsClick,
iconFactoryLoader,
mContextTracker.getUserContext(),
mDeviceProvisionedController.isDeviceProvisioned(),
mMainHandler,
mBgHandler,
onConversationSettingsListener,
mBubblesManagerOptional,
mShadeController);
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-40098
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Disable priority conversation widget for secondary users
Test: NotificationConversationInfoTest.java
Test: make a conversation priority on the primary user
Test: make a conversation priority on a secondary user
Bug: 288896269
(cherry picked from commit adf620316dcfaf19d7d4a73e2c63322b4a3a4d3a)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7444c007743970a9d6877c1b3fd2b28143687281)
Merged-In: I3f3991d2cb7fb9970cc8ada39ceae9a7ff2fcb31
Change-Id: I3f3991d2cb7fb9970cc8ada39ceae9a7ff2fcb31
Function: initializeConversationNotificationInfo
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
Repository: android
Fixed Code:
@VisibleForTesting
void initializeConversationNotificationInfo(
final ExpandableNotificationRow row,
NotificationConversationInfo notificationInfoView) throws Exception {
NotificationGuts guts = row.getGuts();
NotificationEntry entry = row.getEntry();
StatusBarNotification sbn = entry.getSbn();
String packageName = sbn.getPackageName();
// Settings link is only valid for notifications that specify a non-system user
NotificationConversationInfo.OnSettingsClickListener onSettingsClick = null;
UserHandle userHandle = sbn.getUser();
PackageManager pmUser = CentralSurfaces.getPackageManagerForUser(
mContext, userHandle.getIdentifier());
final NotificationConversationInfo.OnAppSettingsClickListener onAppSettingsClick =
(View v, Intent intent) -> {
mMetricsLogger.action(MetricsProto.MetricsEvent.ACTION_APP_NOTE_SETTINGS);
guts.resetFalsingCheck();
mNotificationActivityStarter.startNotificationGutsIntent(intent, sbn.getUid(),
row);
};
final NotificationConversationInfo.OnConversationSettingsClickListener
onConversationSettingsListener =
() -> {
startConversationSettingsActivity(sbn.getUid(), row);
};
if (!userHandle.equals(UserHandle.ALL)
|| mLockscreenUserManager.getCurrentUserId() == UserHandle.USER_SYSTEM) {
onSettingsClick = (View v, NotificationChannel channel, int appUid) -> {
mMetricsLogger.action(MetricsProto.MetricsEvent.ACTION_NOTE_INFO);
guts.resetFalsingCheck();
mOnSettingsClickListener.onSettingsClick(sbn.getKey());
startAppNotificationSettingsActivity(packageName, appUid, channel, row);
};
}
ConversationIconFactory iconFactoryLoader = new ConversationIconFactory(mContext,
mLauncherApps, pmUser, IconDrawableFactory.newInstance(mContext, false),
mContext.getResources().getDimensionPixelSize(
R.dimen.notification_guts_conversation_icon_size));
notificationInfoView.bindNotification(
notificationInfoView.getSelectedAction(),
mShortcutManager,
pmUser,
mUserManager,
mPeopleSpaceWidgetManager,
mNotificationManager,
mOnUserInteractionCallback,
packageName,
entry.getChannel(),
entry,
entry.getBubbleMetadata(),
onSettingsClick,
iconFactoryLoader,
mContextTracker.getUserContext(),
mDeviceProvisionedController.isDeviceProvisioned(),
mMainHandler,
mBgHandler,
onConversationSettingsListener,
mBubblesManagerOptional,
mShadeController);
}
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
initializeConversationNotificationInfo
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean findAndReInitByUuidOrArchive(@NonNull final String uuid) {
Conversation conversation = activity.xmppConnectionService.findConversationByUuid(uuid);
if (conversation == null) {
clearPending();
activity.onConversationArchived(null);
return false;
}
reInit(conversation);
ScrollState scrollState = pendingScrollState.pop();
String lastMessageUuid = pendingLastMessageUuid.pop();
List<Attachment> attachments = pendingMediaPreviews.pop();
if (scrollState != null) {
setScrollPosition(scrollState, lastMessageUuid);
}
if (attachments != null && attachments.size() > 0) {
Log.d(Config.LOGTAG, "had attachments on restore");
mediaPreviewAdapter.addMediaPreviews(attachments);
toggleInputMethod();
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findAndReInitByUuidOrArchive
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
|
findAndReInitByUuidOrArchive
|
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
|
7177c523a1b31988666b9337249a4f1d0c36f479
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setBrowserPage(PeerComponent browserPeer, String html, String baseUrl) {
((AndroidImplementation.AndroidBrowserComponent) browserPeer).setPage(html, baseUrl);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBrowserPage
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
|
setBrowserPage
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void allowPatch(HttpURLConnection connection) {
if(enabledPatch) {
return;
}
if(patchFailed) {
connection.setRequestProperty("X-HTTP-Method-Override", "PATCH");
return;
}
try {
Field methodsField = HttpURLConnection.class.getDeclaredField("methods");
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(methodsField, methodsField.getModifiers() & ~Modifier.FINAL);
methodsField.setAccessible(true);
String[] oldMethods = (String[]) methodsField.get(null);
Set<String> methodsSet = new LinkedHashSet<String>(Arrays.asList(oldMethods));
methodsSet.addAll(Arrays.asList("PATCH"));
String[] newMethods = methodsSet.toArray(new String[0]);
methodsField.set(null/*static field*/, newMethods);
enabledPatch = true;
} catch (NoSuchFieldException e) {
patchFailed = true;
connection.setRequestProperty("X-HTTP-Method-Override", "PATCH");
} catch(IllegalAccessException ee) {
patchFailed = true;
connection.setRequestProperty("X-HTTP-Method-Override", "PATCH");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: allowPatch
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
|
allowPatch
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public DeserializerFactoryConfig getFactoryConfig() {
return _factoryConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFactoryConfig
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
|
getFactoryConfig
|
src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
|
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean relatedToPackage(String packageName) {
return (mLastStartActivityRecord != null
&& packageName.equals(mLastStartActivityRecord.packageName))
|| (mStartActivity != null && packageName.equals(mStartActivity.packageName));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: relatedToPackage
File: services/core/java/com/android/server/wm/ActivityStarter.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-269"
] |
CVE-2023-21269
|
HIGH
| 7.8
|
android
|
relatedToPackage
|
services/core/java/com/android/server/wm/ActivityStarter.java
|
70ec64dc5a2a816d6aa324190a726a85fd749b30
| 0
|
Analyze the following code function for security vulnerabilities
|
public static @Nullable String sanitizeDisplayName(@Nullable String name) {
return sanitizeDisplayName(name, /*rewriteHiddenFileName*/ false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sanitizeDisplayName
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
sanitizeDisplayName
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nonnull
public static byte[] base64decode(@Nonnull final String text) throws IOException {
return Base64.decode(text);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: base64decode
File: mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
Repository: raydac/netbeans-mmd-plugin
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000542
|
MEDIUM
| 6.8
|
raydac/netbeans-mmd-plugin
|
base64decode
|
mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java
|
9fba652bf06e649186b8f9e612d60e9cc15097e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void toWriter(Writer writer, Properties outputProperties)
{
try {
super.toWriter(writer, outputProperties);
} catch (TransformerException e) {
throw wrapExceptionAsRuntimeException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toWriter
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
toWriter
|
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
public ToolContext getToolContext(String locale) {
Locale systemLocale = LocaleUtility.fromSpecification(locale);
//Defaults to en if systemLocale is null or invalid e.g en_GBs
if (systemLocale == null || !ArrayUtils.contains(Locale.getAvailableLocales(), systemLocale)) {
systemLocale = Locale.ENGLISH;
}
// If tool context has not been configured yet
if (toolContext == null) {
// first we are creating manager for tools, factory for configuring tools
// and empty configuration object for velocity tool box
ToolManager velocityToolManager = new ToolManager();
FactoryConfiguration factoryConfig = new FactoryConfiguration();
// since we are using one tool box for all request within wizard
// we should propagate toolbox's scope on all application
ToolboxConfiguration toolbox = new ToolboxConfiguration();
toolbox.setScope(Scope.APPLICATION);
// next we are directly configuring custom localization tool by
// setting its class name, locale property etc.
ToolConfiguration localizationTool = new ToolConfiguration();
localizationTool.setClassname(LocalizationTool.class.getName());
localizationTool.setProperty(ToolContext.LOCALE_KEY, systemLocale);
localizationTool.setProperty(LocalizationTool.BUNDLES_KEY, "messages");
// and finally we are adding just configured tool into toolbox
// and creating tool context for this toolbox
toolbox.addTool(localizationTool);
factoryConfig.addToolbox(toolbox);
velocityToolManager.configure(factoryConfig);
toolContext = velocityToolManager.createContext();
toolContext.setUserCanOverwriteTools(true);
} else {
// if it already has been configured, we just pull out our custom localization tool
// from tool context, then changing its locale property and putting this tool back to the context
// First, we need to obtain the value of default key annotation of our localization tool
// class using reflection
Annotation annotation = LocalizationTool.class.getAnnotation(DefaultKey.class);
DefaultKey defaultKeyAnnotation = (DefaultKey) annotation;
String key = defaultKeyAnnotation.value();
//
LocalizationTool localizationTool = (LocalizationTool) toolContext.get(key);
localizationTool.setLocale(systemLocale);
toolContext.put(key, localizationTool);
}
return toolContext;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getToolContext
File: web/src/main/java/org/openmrs/web/filter/StartupFilter.java
Repository: openmrs/openmrs-core
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-23612
|
MEDIUM
| 5
|
openmrs/openmrs-core
|
getToolContext
|
web/src/main/java/org/openmrs/web/filter/StartupFilter.java
|
db8454bf19a092a78d53ee4dba2af628b730a6e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getNavbarMenuLink1URL() {
return CONF.navbarCustomMenuLink1Url();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNavbarMenuLink1URL
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
|
getNavbarMenuLink1URL
|
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
|
62a0e92e1486ddc17676a7ead2c07ff653d167ce
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setPreferredJwsAlgorithmAsString(final String preferredJwsAlgorithm) {
this.preferredJwsAlgorithm = JWSAlgorithm.parse(preferredJwsAlgorithm);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPreferredJwsAlgorithmAsString
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
|
setPreferredJwsAlgorithmAsString
|
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
|
22b82ffd702a132d9f09da60362fc6264fc281ae
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setName(String name) {
this.name = name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setName
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setName
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURL(String fullname, String action) throws XWikiException
{
return this.xwiki.getURL(fullname, action, getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2023-37911
|
MEDIUM
| 6.5
|
xwiki/xwiki-platform
|
getURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
|
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void dispose(boolean finalized) {
final SQLiteConnectionPool pool;
synchronized (mLock) {
if (mCloseGuardLocked != null) {
if (finalized) {
mCloseGuardLocked.warnIfOpen();
}
mCloseGuardLocked.close();
}
pool = mConnectionPoolLocked;
mConnectionPoolLocked = null;
}
if (!finalized) {
synchronized (sActiveDatabases) {
sActiveDatabases.remove(this);
}
if (pool != null) {
pool.close();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispose
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2018-9493
|
LOW
| 2.1
|
android
|
dispose
|
core/java/android/database/sqlite/SQLiteDatabase.java
|
ebc250d16c747f4161167b5ff58b3aea88b37acf
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setClassId(String classId) {
this.classId = classId;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setClassId
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
setClassId
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileData.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void log(String s) {
Rlog.d(LOG_TAG, "[CdmaSST] " + s);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: log
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2016-3831
|
MEDIUM
| 5
|
android
|
log
|
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
|
f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058
| 0
|
Analyze the following code function for security vulnerabilities
|
public Stage scheduleStage(Pipeline pipeline, StageConfig stageConfig) {
return scheduleStage(pipeline, stageConfig, 0);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleStage
File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-697"
] |
CVE-2022-39308
|
MEDIUM
| 5.9
|
gocd
|
scheduleStage
|
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
|
236d4baf92e6607f2841c151c855adcc477238b8
| 0
|
Analyze the following code function for security vulnerabilities
|
protected CompletableFuture<Void> internalSetMessageTTL(Integer ttlInSecond) {
//Validate message ttl value.
if (ttlInSecond != null && ttlInSecond < 0) {
return FutureUtil.failedFuture(new RestException(Status.PRECONDITION_FAILED,
"Invalid value for message TTL"));
}
return getTopicPoliciesAsyncWithRetry(topicName)
.thenCompose(op -> {
TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new);
topicPolicies.setMessageTTLInSeconds(ttlInSecond);
return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies)
.thenRun(() ->
log.info("[{}] Successfully set topic message ttl: namespace={}, topic={}, ttl={}",
clientAppId(), namespaceName, topicName.getLocalName(), ttlInSecond));
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalSetMessageTTL
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-41571
|
MEDIUM
| 4
|
apache/pulsar
|
internalSetMessageTTL
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addResource(String key, InternetResource resource) {
resources.put(key, resource);
resource.setKey(key);
// TODO - set renderer ?
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addResource
File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Repository: nuxeo/richfaces-3.3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2013-4521
|
HIGH
| 7.5
|
nuxeo/richfaces-3.3
|
addResource
|
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
|
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void readIntToBcd(int n) {
assert n != 0;
// ints always fit inside the long implementation.
long result = 0L;
int i = 16;
for (; n != 0; n /= 10, i--) {
result = (result >>> 4) + (((long) n % 10) << 60);
}
assert !usingBytes;
bcdLong = result >>> (i * 4);
scale = 0;
precision = 16 - i;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readIntToBcd
File: icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
Repository: unicode-org/icu
The code follows secure coding practices.
|
[
"CWE-190"
] |
CVE-2018-18928
|
HIGH
| 7.5
|
unicode-org/icu
|
readIntToBcd
|
icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_DualStorageBCD.java
|
53d8c8f3d181d87a6aa925b449b51c4a2c922a51
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setHeader(Object connection, String key, String val) {
((URLConnection) connection).setRequestProperty(key, val);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHeader
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
|
setHeader
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean canUserModifyAccounts(int userId, int callingUid) {
// the managing app can always modify accounts
if (isProfileOwner(callingUid)) {
return true;
}
if (getUserManager().getUserRestrictions(new UserHandle(userId))
.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canUserModifyAccounts
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
canUserModifyAccounts
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean unbindService(IServiceConnection connection) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: unbindService
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
unbindService
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private int findStreamSuperclass(Class<?> cl, List<ObjectStreamClass> classList, int lastIndex) {
for (int i = lastIndex, end = classList.size(); i < end; i++) {
ObjectStreamClass objCl = classList.get(i);
String forName = objCl.forClass().getName();
if (objCl.getName().equals(forName)) {
if (cl.getName().equals(objCl.getName())) {
return i;
}
} else {
// there was a class replacement
if (cl.getName().equals(forName)) {
return i;
}
}
}
return -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findStreamSuperclass
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2014-7911
|
HIGH
| 7.2
|
android
|
findStreamSuperclass
|
luni/src/main/java/java/io/ObjectInputStream.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
public ServerBuilder http2MaxHeaderListSize(long http2MaxHeaderListSize) {
checkArgument(http2MaxHeaderListSize > 0 &&
http2MaxHeaderListSize <= 0xFFFFFFFFL,
"http2MaxHeaderListSize: %s (expected: a positive 32-bit unsigned integer)",
http2MaxHeaderListSize);
this.http2MaxHeaderListSize = http2MaxHeaderListSize;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: http2MaxHeaderListSize
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
http2MaxHeaderListSize
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void removeCompletionHandler(Runnable onCompletion) {
synchronized(this) {
if (completionHandlers != null) {
completionHandlers.remove(onCompletion);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeCompletionHandler
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
|
removeCompletionHandler
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<PlatformUser> getZentaoUsers(IssuesRequest request) {
IssuesPlatform platform = IssueFactory.createPlatform(IssuesManagePlatform.Zentao.name(), request);
return platform.getPlatformUser();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getZentaoUsers
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
|
getZentaoUsers
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String getSecret() {
return getConfiguration().getString("jwt.secret");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSecret
File: dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
Repository: ManyDesigns/Portofino
The code follows secure coding practices.
|
[
"CWE-347"
] |
CVE-2021-29451
|
MEDIUM
| 6.4
|
ManyDesigns/Portofino
|
getSecret
|
dispatcher/src/main/java/com/manydesigns/portofino/dispatcher/security/jwt/JWTRealm.java
|
8c754a0ad234555e813dcbf9e57d637f9f23d8fb
| 0
|
Analyze the following code function for security vulnerabilities
|
public long getSubscriptionCreationTimeInMillis() {
return mSubscriptionCreationTimeInMillis;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubscriptionCreationTimeInMillis
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
getSubscriptionCreationTimeInMillis
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isIgnoreDuplicates() {
return ignoreDuplicates;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isIgnoreDuplicates
File: quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
Repository: quartz-scheduler/quartz
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2019-13990
|
HIGH
| 7.5
|
quartz-scheduler/quartz
|
isIgnoreDuplicates
|
quartz-core/src/main/java/org/quartz/xml/XMLSchedulingDataProcessor.java
|
a1395ba118df306c7fe67c24fb0c9a95a4473140
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unused")
@CalledByNative
private void showSelectPopup(long nativeSelectPopupSourceFrame, Rect bounds, String[] items,
int[] enabled, boolean multiple, int[] selectedIndices) {
if (mContainerView.getParent() == null || mContainerView.getVisibility() != View.VISIBLE) {
mNativeSelectPopupSourceFrame = nativeSelectPopupSourceFrame;
selectPopupMenuItems(null);
return;
}
hidePopupsAndClearSelection();
assert mNativeSelectPopupSourceFrame == 0 : "Zombie popup did not clear the frame source";
assert items.length == enabled.length;
List<SelectPopupItem> popupItems = new ArrayList<SelectPopupItem>();
for (int i = 0; i < items.length; i++) {
popupItems.add(new SelectPopupItem(items[i], enabled[i]));
}
if (DeviceFormFactor.isTablet(mContext) && !multiple && !isTouchExplorationEnabled()) {
mSelectPopup = new SelectPopupDropdown(this, popupItems, bounds, selectedIndices);
} else {
mSelectPopup = new SelectPopupDialog(this, popupItems, multiple, selectedIndices);
}
mNativeSelectPopupSourceFrame = nativeSelectPopupSourceFrame;
mSelectPopup.show();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showSelectPopup
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-1021"
] |
CVE-2015-1241
|
MEDIUM
| 4.3
|
chromium
|
showSelectPopup
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
9d343ad2ea6ec395c377a4efa266057155bfa9c1
| 0
|
Analyze the following code function for security vulnerabilities
|
public Session getSession()
{
return this.new Session(getDriver().manage().getCookies(), getSecretToken());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSession
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2023-35166
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
getSession
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<String> getMeteredDataDisabledPackages(ComponentName who) {
Objects.requireNonNull(who);
if (!mHasFeature) {
return new ArrayList<>();
}
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller) || isProfileOwner(caller),
"Admin %s does not own the profile", caller.getComponentName());
synchronized (getLockObject()) {
final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller);
return admin.meteredDisabledPackages == null
? new ArrayList<>() : admin.meteredDisabledPackages;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMeteredDataDisabledPackages
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
|
getMeteredDataDisabledPackages
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean isDownload(@NonNull String path) {
return PATTERN_DOWNLOADS_FILE.matcher(path).matches();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDownload
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2023-35670
|
HIGH
| 7.8
|
android
|
isDownload
|
src/com/android/providers/media/util/FileUtils.java
|
db3c69afcb0a45c8aa2f333fcde36217889899fe
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSleeping() {
return mSleeping;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSleeping
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
|
isSleeping
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isManagedProfile(ComponentName admin) {
Objects.requireNonNull(admin, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(admin);
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller) || isProfileOwner(caller));
return isManagedProfile(caller.getUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isManagedProfile
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
|
isManagedProfile
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@android.support.annotation.RequiresApi(Build.VERSION_CODES.O)
private void createChannel() {
createChannelStatic(this);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createChannel
File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
createChannel
|
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
public void stop() {
LOG.debug("Attempting to stop DNS client");
if (nettyEventLoop == null) {
LOG.error("DNS resolution event loop not initialized");
return;
}
// Make sure to close the resolver before shutting down the event loop
resolver.close();
// Shutdown event loop (required by Netty).
final Future<?> shutdownFuture = nettyEventLoop.shutdownGracefully();
shutdownFuture.addListener(future -> LOG.debug("DNS client shutdown successful"));
}
|
Vulnerability Classification:
- CWE: CWE-345
- CVE: CVE-2023-41045
- Severity: MEDIUM
- CVSS Score: 5.3
Description: Merge pull request from GHSA-g96c-x7rh-99r3
* Add support for randomizing DNS Lookup source port
* Clarify purpose of lease
* Skip initial refresh
Previously, the pool was being refreshed immediately upon initialization. Now, the refresh waits until the `poolRefreshSeconds` duration has elapsed.
* Ensure thread safety, skip unused poller refreshes
* Add change log
* Restore location of local flag
Function: stop
File: graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
Repository: Graylog2/graylog2-server
Fixed Code:
public void stop() {
LOG.debug("Attempting to stop DNS client");
if (resolverPool == null) {
LOG.error("DNS resolution pool is not initialized.");
return;
}
resolverPool.stop();
}
|
[
"CWE-345"
] |
CVE-2023-41045
|
MEDIUM
| 5.3
|
Graylog2/graylog2-server
|
stop
|
graylog2-server/src/main/java/org/graylog2/lookup/adapters/dnslookup/DnsClient.java
|
a101f4f12180fd3dfa7d3345188a099877a3c327
| 1
|
Analyze the following code function for security vulnerabilities
|
void dispatchForegroundProfileChanged(int userId) {
final int N = mUserSwitchObservers.beginBroadcast();
for (int i = 0; i < N; i++) {
try {
mUserSwitchObservers.getBroadcastItem(i).onForegroundProfileSwitch(userId);
} catch (RemoteException e) {
// Ignore
}
}
mUserSwitchObservers.finishBroadcast();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispatchForegroundProfileChanged
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2500
|
MEDIUM
| 4.3
|
android
|
dispatchForegroundProfileChanged
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
9878bb99b77c3681f0fda116e2964bac26f349c3
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateNCharacterStream(@Positive int columnIndex,
@Nullable Reader x) throws SQLException {
throw org.postgresql.Driver.notImplemented(this.getClass(),
"updateNCharacterStream(int, Reader)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateNCharacterStream
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
updateNCharacterStream
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
void updateOomAdj() {
mH.removeCallbacks(mUpdateOomAdjRunnable);
mH.post(mUpdateOomAdjRunnable);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateOomAdj
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
|
updateOomAdj
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public XMLBuilder ns(String prefix, String namespaceURI) {
return attribute(prefix, namespaceURI);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ns
File: src/main/java/com/jamesmurty/utils/XMLBuilder.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2014-125087
|
MEDIUM
| 5.2
|
jmurty/java-xmlbuilder
|
ns
|
src/main/java/com/jamesmurty/utils/XMLBuilder.java
|
e6fddca201790abab4f2c274341c0bb8835c3e73
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int compare(WindowState w1, WindowState w2) {
final int layer1 = w1.mSubLayer;
final int layer2 = w2.mSubLayer;
if (layer1 < layer2 || (layer1 == layer2 && layer2 < 0 )) {
// We insert the child window into the list ordered by
// the sub-layer. For same sub-layers, the negative one
// should go below others; the positive one should go
// above others.
return -1;
}
return 1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compare
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
|
compare
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean textColorsNeedInversion() {
if (mStyle == null || !MediaStyle.class.equals(mStyle.getClass())) {
return false;
}
int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
return targetSdkVersion > Build.VERSION_CODES.M
&& targetSdkVersion < Build.VERSION_CODES.O;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: textColorsNeedInversion
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
textColorsNeedInversion
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void testAuth(String workspaceId, String platform) {
IssuesRequest issuesRequest = new IssuesRequest();
issuesRequest.setWorkspaceId(workspaceId);
IssuesPlatform abstractPlatform = IssueFactory.createPlatform(platform, issuesRequest);
abstractPlatform.testAuth();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testAuth
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
|
testAuth
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public void writeI32(int i32) throws TException {
writeVarint32(intToZigZag(i32));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeI32
File: thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
Repository: facebook/fbthrift
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2019-11938
|
MEDIUM
| 5
|
facebook/fbthrift
|
writeI32
|
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
|
08c2d412adb214c40bb03be7587057b25d053030
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public ServerBuilder annotatedService(String pathPrefix, Object service) {
virtualHostTemplate.annotatedService(pathPrefix, service);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: annotatedService
File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
Repository: line/armeria
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
line/armeria
|
annotatedService
|
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
|
df7f85824a62e997b910b5d6194a3335841065fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected PersistenceUnitModuleConfiguration bindPU(@Nonnull String puName, @Nullable Class<? extends Annotation> annotation, EntityManagerFactory
entityManagerFactory) {
PersistenceUnitModuleConfiguration conf;
if (annotation == null) {
conf = (PersistenceUnitModuleConfiguration) bindApplicationManagedPersistenceUnit(puName);
} else {
conf = (PersistenceUnitModuleConfiguration) bindApplicationManagedPersistenceUnit(puName).annotatedWith(annotation);
}
return conf;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindPU
File: src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java
Repository: KrailOrg/krail-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-15018
|
MEDIUM
| 5.2
|
KrailOrg/krail-jpa
|
bindPU
|
src/test/java/uk/q3c/krail/jpa/persist/TestJpaModule.java
|
c1e848665492e21ef6cc9be443205e36b9a1f6be
| 0
|
Analyze the following code function for security vulnerabilities
|
public long countScenarioByProjectIDAndCreatInThisWeek(String projectId) {
Map<String, Date> startAndEndDateInWeek = DateUtils.getWeedFirstTimeAndLastTime(new Date());
Date firstTime = startAndEndDateInWeek.get("firstTime");
Date lastTime = startAndEndDateInWeek.get("lastTime");
if (firstTime == null || lastTime == null) {
return 0;
} else {
return extApiScenarioMapper.countByProjectIDAndCreatInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: countScenarioByProjectIDAndCreatInThisWeek
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
countScenarioByProjectIDAndCreatInThisWeek
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateResultInTransaction(final Stage stage, final StageResult stageResult) {
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
stageDao.updateResult(stage, stageResult, null);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateResultInTransaction
File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-697"
] |
CVE-2022-39308
|
MEDIUM
| 5.9
|
gocd
|
updateResultInTransaction
|
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
|
236d4baf92e6607f2841c151c855adcc477238b8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase) {
return headers.contains(name, value, ignoreCase ? CASE_INSENSITIVE_HASHER : CASE_SENSITIVE_HASHER);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: contains
File: codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2021-43797
|
MEDIUM
| 4.3
|
netty
|
contains
|
codec-http/src/main/java/io/netty/handler/codec/http/DefaultHttpHeaders.java
|
07aa6b5938a8b6ed7a6586e066400e2643897323
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.