instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public void reportActivityFullyDrawn(IBinder token) { synchronized (this) { ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { return; } r.reportFullyDrawnLocked(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportActivityFullyDrawn 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
reportActivityFullyDrawn
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private void appendChar( XMLStringBuffer str, int value ) { if ( value > Character.MAX_VALUE ) { char[] chars = Character.toChars( value ); str.append( chars, 0, chars.length ); } else { str.append( (char) value ); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: appendChar File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
appendChar
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
private void sendProvisioningCompletedBroadcast( int user, String action, boolean leaveAllSystemAppsEnabled) { final Intent intent = new Intent(DevicePolicyManager.ACTION_PROVISIONING_COMPLETED) .putExtra(Intent.EXTRA_USER_HANDLE, user) .putExtra(Intent.EXTRA_USER, UserHandle.of(user)) .putExtra( DevicePolicyManager.EXTRA_PROVISIONING_LEAVE_ALL_SYSTEM_APPS_ENABLED, leaveAllSystemAppsEnabled) .putExtra(DevicePolicyManager.EXTRA_PROVISIONING_ACTION, action) .setPackage(getManagedProvisioningPackage(mContext)) .addFlags(Intent.FLAG_RECEIVER_FOREGROUND); mContext.sendBroadcastAsUser(intent, UserHandle.SYSTEM); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendProvisioningCompletedBroadcast 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
sendProvisioningCompletedBroadcast
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public void setUrl(String url) { this.url = url; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUrl File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-18927
LOW
3.5
sanluan/PublicCMS
setUrl
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java
2b411dc2821c69539138aaf7632b938b659a58fa
0
Analyze the following code function for security vulnerabilities
@Nullable public String getChatId() { return chatId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChatId File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getChatId
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/TelegramNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
public void deleteActivityContainer(IActivityContainer container) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteActivityContainer File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
deleteActivityContainer
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
String[] getCachePutNames(AnnotationValue<CachePut> cacheConfig) { return getCacheNames(cacheConfig.get(MEMBER_CACHE_NAMES, String[].class).orElse(StringUtils.EMPTY_STRING_ARRAY)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCachePutNames File: runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
getCachePutNames
runtime/src/main/java/io/micronaut/cache/interceptor/CacheInterceptor.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
protected Object checkoutFieldValue(Field field, Cell cell, boolean validate) { final DisplayType dt = EasyMetaFactory.getDisplayType(field); if (dt == DisplayType.NUMBER) { return cell.asLong(); } else if (dt == DisplayType.DECIMAL) { return cell.asDouble(); } else if (dt == DisplayType.DATE || dt == DisplayType.DATETIME) { return checkoutDateValue(cell); } else if (dt == DisplayType.TIME) { return checkoutTimeValue(cell); } else if (dt == DisplayType.PICKLIST) { return checkoutPickListValue(field, cell); } else if (dt == DisplayType.CLASSIFICATION) { return checkoutClassificationValue(field, cell); } else if (dt == DisplayType.REFERENCE) { return checkoutReferenceValue(field, cell); } else if (dt == DisplayType.N2NREFERENCE) { return checkoutN2NReferenceValue(field, cell); } else if (dt == DisplayType.BOOL) { return cell.asBool() || "是".equals(cell.asString()) || "Y".equalsIgnoreCase(cell.asString()); } else if (dt == DisplayType.STATE) { return checkoutStateValue(field, cell); } else if (dt == DisplayType.MULTISELECT) { return checkoutMultiSelectValue(field, cell); } else if (dt == DisplayType.FILE || dt == DisplayType.IMAGE) { return checkoutFileOrImage(cell); } else if (dt == DisplayType.TAG) { return checkoutTagValue(cell); } String text = cell.asString(); if (text != null) text = text.trim(); // 格式验证 if (validate) { if (dt == DisplayType.EMAIL) { return EasyEmail.isEmail(text) ? text : null; } else if (dt == DisplayType.URL || dt == DisplayType.AVATAR) { return EasyUrl.isUrl(text) ? text : null; } else if (dt == DisplayType.PHONE) { return EasyPhone.isPhone(text) ? text : null; } } return text; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkoutFieldValue File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
checkoutFieldValue
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
Context createContextAsUser(UserHandle user) throws PackageManager.NameNotFoundException { final String packageName = mContext.getPackageName(); return mContext.createPackageContextAsUser(packageName, 0, user); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createContextAsUser 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
createContextAsUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public String getString() throws SQLException { try { debugCodeCall("getString"); checkReadable(); return value.getString(); } catch (Exception e) { throw logAndConvert(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getString File: h2/src/main/org/h2/jdbc/JdbcSQLXML.java Repository: h2database The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-23463
MEDIUM
6.4
h2database
getString
h2/src/main/org/h2/jdbc/JdbcSQLXML.java
d83285fd2e48fb075780ee95badee6f5a15ea7f8
0
Analyze the following code function for security vulnerabilities
@Override public void onStopSocketKeepalive(int slot) { if (!isThisCallbackActive()) return; ClientModeImpl.this.sendMessage(CMD_STOP_IP_PACKET_OFFLOAD, slot); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onStopSocketKeepalive File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onStopSocketKeepalive
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void stopShellPermissionIdentityDelegation() { stopShellPermissionIdentityDelegationInternal(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopShellPermissionIdentityDelegation File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-281" ]
CVE-2023-21249
MEDIUM
5.5
android
stopShellPermissionIdentityDelegation
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
public void setChildrenVisible(TOCElement element) throws PresentationException, IndexUnreachableException, DAOException, ViewerConfigurationException { if (getToc() != null) { synchronized (getToc()) { getToc().setChildVisible(element.getID()); getToc().getActiveElement(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setChildrenVisible 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
setChildrenVisible
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
@BeforeEach public void setUp(TestReference testReference, TestUtils testUtils, LogCaptureConfiguration logCaptureConfiguration) { logCaptureConfiguration.registerExpected("WikiComponentException: Registering UI " + "extensions at wiki level requires wiki administration rights"); testUtils.login(USERNAME, PASSWORD); this.appName = testReference.getLastSpaceReference().getName(); appWithinMinutesHomePage = createApplication(appName); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUp File: xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29515
MEDIUM
5.4
xwiki/xwiki-platform
setUp
xwiki-platform-core/xwiki-platform-appwithinminutes/xwiki-platform-appwithinminutes-test/xwiki-platform-appwithinminutes-test-docker/src/test/it/org/xwiki/appwithinminutes/test/ui/AppsLiveTableIT.java
e73b890623efa604adc484ad82f37e31596fe1a6
0
Analyze the following code function for security vulnerabilities
@Override public void dismissSplitScreenMode(boolean toTop) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "dismissSplitScreenMode()"); final long ident = Binder.clearCallingIdentity(); try { synchronized (this) { final ActivityStack stack = mStackSupervisor.getDefaultDisplay().getSplitScreenPrimaryStack(); if (stack == null) { Slog.w(TAG, "dismissSplitScreenMode: primary split-screen stack not found."); return; } if (toTop) { // Caller wants the current split-screen primary stack to be the top stack after // it goes fullscreen, so move it to the front. stack.moveToFront("dismissSplitScreenMode"); } else if (mStackSupervisor.isFocusedStack(stack)) { // In this case the current split-screen primary stack shouldn't be the top // stack after it goes fullscreen, but it current has focus, so we move the // focus to the top-most split-screen secondary stack next to it. final ActivityStack otherStack = stack.getDisplay().getTopStackInWindowingMode( WINDOWING_MODE_SPLIT_SCREEN_SECONDARY); if (otherStack != null) { otherStack.moveToFront("dismissSplitScreenMode_other"); } } stack.setWindowingMode(WINDOWING_MODE_FULLSCREEN); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dismissSplitScreenMode 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
dismissSplitScreenMode
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
static public File getFile(ImportingJob job, String location) { return new File(job.getRawDataDir(), location); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFile File: main/src/com/google/refine/importing/ImportingUtilities.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-19859
MEDIUM
4
OpenRefine
getFile
main/src/com/google/refine/importing/ImportingUtilities.java
e243e73e4064de87a913946bd320fbbe246da656
0
Analyze the following code function for security vulnerabilities
@Override public synchronized SSLEngineResult.HandshakeStatus getHandshakeStatus() { // Check if we are in the initial handshake phase or shutdown phase return needPendingStatus() ? pendingStatus(SSL.pendingWrittenBytesInBIO(networkBIO)) : NOT_HANDSHAKING; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getHandshakeStatus File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
getHandshakeStatus
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
public void visitUris(@NonNull Consumer<Uri> visitor) { visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); if (contentView != null) contentView.visitUris(visitor); if (bigContentView != null) bigContentView.visitUris(visitor); if (headsUpContentView != null) headsUpContentView.visitUris(visitor); visitIconUri(visitor, mSmallIcon); visitIconUri(visitor, mLargeIcon); if (actions != null) { for (Action action : actions) { visitIconUri(visitor, action.getIcon()); } } if (extras != null) { visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class)); visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class)); // NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a // String representation of a Uri, but the previous implementation (and unit test) of // this method has always treated it as a Uri object. Given the inconsistency, // supporting both going forward is the safest choice. Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI); if (audioContentsUri instanceof Uri) { visitor.accept((Uri) audioContentsUri); } else if (audioContentsUri instanceof String) { visitor.accept(Uri.parse((String) audioContentsUri)); } if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) { visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI))); } ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST); if (people != null && !people.isEmpty()) { for (Person p : people) { visitor.accept(p.getIconUri()); } } final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class); if (person != null) { visitor.accept(person.getIconUri()); } final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[]) extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS); if (history != null) { for (int i = 0; i < history.length; i++) { RemoteInputHistoryItem item = history[i]; if (item.getUri() != null) { visitor.accept(item.getUri()); } } } } if (isStyle(MessagingStyle.class) && extras != null) { final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (!ArrayUtils.isEmpty(messages)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(messages)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (!ArrayUtils.isEmpty(historic)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(historic)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } } if (isStyle(CallStyle.class) & extras != null) { Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON); if (callPerson != null) { visitor.accept(callPerson.getIconUri()); } visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON)); } if (mBubbleMetadata != null) { visitIconUri(visitor, mBubbleMetadata.getIcon()); } }
Vulnerability Classification: - CWE: CWE-862 - CVE: CVE-2023-21291 - Severity: MEDIUM - CVSS Score: 5.5 Description: Verify URI permissions for notification shortcutIcon. Bug: 277593270 Test: atest NotificationManagerServiceTest (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:936b58b12851269b878b44cc8df790b3afe9c3f5) Merged-In: Iaf2a9a82f18e018e60e6cdc020da6ebf7267e8b1 Change-Id: Iaf2a9a82f18e018e60e6cdc020da6ebf7267e8b1 Function: visitUris File: core/java/android/app/Notification.java Repository: android Fixed Code: public void visitUris(@NonNull Consumer<Uri> visitor) { visitor.accept(sound); if (tickerView != null) tickerView.visitUris(visitor); if (contentView != null) contentView.visitUris(visitor); if (bigContentView != null) bigContentView.visitUris(visitor); if (headsUpContentView != null) headsUpContentView.visitUris(visitor); visitIconUri(visitor, mSmallIcon); visitIconUri(visitor, mLargeIcon); if (actions != null) { for (Action action : actions) { visitIconUri(visitor, action.getIcon()); } } if (extras != null) { visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class)); visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class)); // NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a // String representation of a Uri, but the previous implementation (and unit test) of // this method has always treated it as a Uri object. Given the inconsistency, // supporting both going forward is the safest choice. Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI); if (audioContentsUri instanceof Uri) { visitor.accept((Uri) audioContentsUri); } else if (audioContentsUri instanceof String) { visitor.accept(Uri.parse((String) audioContentsUri)); } if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) { visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI))); } ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST); if (people != null && !people.isEmpty()) { for (Person p : people) { visitor.accept(p.getIconUri()); } } final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class); if (person != null) { visitor.accept(person.getIconUri()); } final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[]) extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS); if (history != null) { for (int i = 0; i < history.length; i++) { RemoteInputHistoryItem item = history[i]; if (item.getUri() != null) { visitor.accept(item.getUri()); } } } } if (isStyle(MessagingStyle.class) && extras != null) { final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (!ArrayUtils.isEmpty(messages)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(messages)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (!ArrayUtils.isEmpty(historic)) { for (MessagingStyle.Message message : MessagingStyle.Message .getMessagesFromBundleArray(historic)) { visitor.accept(message.getDataUri()); Person senderPerson = message.getSenderPerson(); if (senderPerson != null) { visitor.accept(senderPerson.getIconUri()); } } } visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON)); } if (isStyle(CallStyle.class) & extras != null) { Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON); if (callPerson != null) { visitor.accept(callPerson.getIconUri()); } visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON)); } if (mBubbleMetadata != null) { visitIconUri(visitor, mBubbleMetadata.getIcon()); } }
[ "CWE-862" ]
CVE-2023-21291
MEDIUM
5.5
android
visitUris
core/java/android/app/Notification.java
cb6282e8970f4c9db5497889699e68fb2038566e
1
Analyze the following code function for security vulnerabilities
boolean deviceIsProvisioned() { final ContentResolver resolver = mContext.getContentResolver(); return (Settings.Global.getInt(resolver, Settings.Global.DEVICE_PROVISIONED, 0) != 0); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deviceIsProvisioned 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
deviceIsProvisioned
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
public boolean isTurningOn() { return mIsTurningOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isTurningOn File: src/com/android/bluetooth/btservice/AdapterState.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
isTurningOn
src/com/android/bluetooth/btservice/AdapterState.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public void setId(Long id) { this.id = id; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setId File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java Repository: sanluan/PublicCMS The code follows secure coding practices.
[ "CWE-79" ]
CVE-2020-21333
LOW
3.5
sanluan/PublicCMS
setId
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogLogin.java
b4d5956e65b14347b162424abb197a180229b3db
0
Analyze the following code function for security vulnerabilities
public void setWallpaperSupportsAmbientMode(boolean supportsAmbientMode) { mWallpaperSupportsAmbientMode = supportsAmbientMode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setWallpaperSupportsAmbientMode File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
setWallpaperSupportsAmbientMode
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private void saveStateLocked(int userId) { tagProvidersAndHosts(); final int[] profileIds = mSecurityPolicy.getEnabledGroupProfileIds(userId); final int profileCount = profileIds.length; for (int i = 0; i < profileCount; i++) { final int profileId = profileIds[i]; AtomicFile file = getSavedStateFile(profileId); FileOutputStream stream; try { stream = file.startWrite(); if (writeProfileStateToFileLocked(stream, profileId)) { file.finishWrite(stream); } else { file.failWrite(stream); Slog.w(TAG, "Failed to save state, restoring backup."); } } catch (IOException e) { Slog.w(TAG, "Failed open state file for write: " + e); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: saveStateLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
saveStateLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private void initExclusionRestrictions() { final long now = SystemClock.uptimeMillis(); mLastExclusionLogUptimeMillis[EXCLUSION_LEFT] = now; mLastExclusionLogUptimeMillis[EXCLUSION_RIGHT] = now; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initExclusionRestrictions 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
initExclusionRestrictions
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
private int getConsumerCount(ConnectionId connectionId) { int result = 0; TransportConnectionState cs = lookupConnectionState(connectionId); if (cs != null) { for (SessionId sessionId : cs.getSessionIds()) { SessionState sessionState = cs.getSessionState(sessionId); if (sessionState != null) { result += sessionState.getConsumerIds().size(); } } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConsumerCount File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
getConsumerCount
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
private static void checkManageUsersPermission(String message) { if (ActivityManager.checkComponentPermission( android.Manifest.permission.MANAGE_USERS, Binder.getCallingUid(), -1, true) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("You need MANAGE_USERS permission to: " + message); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkManageUsersPermission File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
checkManageUsersPermission
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
protected boolean getUseClientMode() { return client_mode; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUseClientMode File: src/main/java/org/conscrypt/SSLParametersImpl.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3840
HIGH
10
android
getUseClientMode
src/main/java/org/conscrypt/SSLParametersImpl.java
5af5e93463f4333187e7e35f3bd2b846654aa214
0
Analyze the following code function for security vulnerabilities
public void verifySigFileAgainstManifest( byte[] manifestBytes, ManifestParser.Section manifestMainSection, Map<String, ManifestParser.Section> entryNameToManifestSection, Map<Integer, String> supportedApkSigSchemeNames, Set<Integer> foundApkSigSchemeIds, int minSdkVersion, int maxSdkVersion) throws NoSuchAlgorithmException { // Inspect the main section of the .SF file. ManifestParser sf = new ManifestParser(mSigFileBytes); ManifestParser.Section sfMainSection = sf.readSection(); if (sfMainSection.getAttributeValue(Attributes.Name.SIGNATURE_VERSION) == null) { mResult.addError( Issue.JAR_SIG_MISSING_VERSION_ATTR_IN_SIG_FILE, mSignatureFileEntry.getName()); setIgnored(); return; } if (maxSdkVersion >= AndroidSdkVersion.N) { // Android N and newer rejects APKs whose .SF file says they were supposed to be // signed with APK Signature Scheme v2 (or newer) and yet no such signature was // found. checkForStrippedApkSignatures( sfMainSection, supportedApkSigSchemeNames, foundApkSigSchemeIds); if (mResult.containsErrors()) { return; } } boolean createdBySigntool = false; String createdBy = sfMainSection.getAttributeValue("Created-By"); if (createdBy != null) { createdBySigntool = createdBy.indexOf("signtool") != -1; } boolean manifestDigestVerified = verifyManifestDigest( sfMainSection, createdBySigntool, manifestBytes, minSdkVersion, maxSdkVersion); if (!createdBySigntool) { verifyManifestMainSectionDigest( sfMainSection, manifestMainSection, manifestBytes, minSdkVersion, maxSdkVersion); } if (mResult.containsErrors()) { return; } // Inspect per-entry sections of .SF file. Technically, if the digest of JAR manifest // verifies, per-entry sections should be ignored. However, most Android platform // implementations require that such sections exist. List<ManifestParser.Section> sfSections = sf.readAllSections(); Set<String> sfEntryNames = new HashSet<>(sfSections.size()); int sfSectionNumber = 0; for (ManifestParser.Section sfSection : sfSections) { sfSectionNumber++; String entryName = sfSection.getName(); if (entryName == null) { mResult.addError( Issue.JAR_SIG_UNNNAMED_SIG_FILE_SECTION, mSignatureFileEntry.getName(), sfSectionNumber); setIgnored(); return; } if (!sfEntryNames.add(entryName)) { mResult.addError( Issue.JAR_SIG_DUPLICATE_SIG_FILE_SECTION, mSignatureFileEntry.getName(), entryName); setIgnored(); return; } if (manifestDigestVerified) { // No need to verify this entry's corresponding JAR manifest entry because the // JAR manifest verifies in full. continue; } // Whole-file digest of JAR manifest hasn't been verified. Thus, we need to verify // the digest of the JAR manifest section corresponding to this .SF section. ManifestParser.Section manifestSection = entryNameToManifestSection.get(entryName); if (manifestSection == null) { mResult.addError( Issue.JAR_SIG_NO_ZIP_ENTRY_DIGEST_IN_SIG_FILE, entryName, mSignatureFileEntry.getName()); setIgnored(); continue; } verifyManifestIndividualSectionDigest( sfSection, createdBySigntool, manifestSection, manifestBytes, minSdkVersion, maxSdkVersion); } mSigFileEntryNames = sfEntryNames; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: verifySigFileAgainstManifest File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
verifySigFileAgainstManifest
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
41d882324288085fd32ae0bb70dc85f5fd0e2be7
0
Analyze the following code function for security vulnerabilities
static final void dumpMemItems(PrintWriter pw, String prefix, String tag, ArrayList<MemItem> items, boolean sort, boolean isCompact, boolean dumpSwapPss) { if (sort && !isCompact) { sortMemItems(items); } for (int i=0; i<items.size(); i++) { MemItem mi = items.get(i); if (!isCompact) { if (dumpSwapPss) { pw.printf("%s%s: %-60s (%s in swap)\n", prefix, stringifyKBSize(mi.pss), mi.label, stringifyKBSize(mi.swapPss)); } else { pw.printf("%s%s: %s\n", prefix, stringifyKBSize(mi.pss), mi.label); } } else if (mi.isProc) { pw.print("proc,"); pw.print(tag); pw.print(","); pw.print(mi.shortLabel); pw.print(","); pw.print(mi.id); pw.print(","); pw.print(mi.pss); pw.print(","); pw.print(dumpSwapPss ? mi.swapPss : "N/A"); pw.println(mi.hasActivities ? ",a" : ",e"); } else { pw.print(tag); pw.print(","); pw.print(mi.shortLabel); pw.print(","); pw.print(mi.pss); pw.print(","); pw.println(dumpSwapPss ? mi.swapPss : "N/A"); } if (mi.subitems != null) { dumpMemItems(pw, prefix + " ", mi.shortLabel, mi.subitems, true, isCompact, dumpSwapPss); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpMemItems 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
dumpMemItems
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public List<StackInfo> getAllStackInfos() { enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS, "getAllStackInfos()"); long ident = Binder.clearCallingIdentity(); try { synchronized (this) { return mStackSupervisor.getAllStackInfosLocked(); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllStackInfos 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
getAllStackInfos
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
private static Logger getLogger() { return Logger.getLogger(Grid.class.getName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLogger 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
getLogger
server/src/main/java/com/vaadin/ui/Grid.java
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
0
Analyze the following code function for security vulnerabilities
@Override public void onCreate(Bundle savedInstanceState) { Log.i(TAG, "onCreate()"); super.onCreate(savedInstanceState); setContentView(R.layout.prompt_passphrase_activity); initializeResources(); // Start and bind to the KeyCachingService instance. Intent bindIntent = new Intent(this, KeyCachingService.class); startService(bindIntent); bindService(bindIntent, new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { keyCachingService = ((KeyCachingService.KeySetBinder)service).getService(); } @Override public void onServiceDisconnected(ComponentName name) { keyCachingService.setMasterSecret(new Object()); keyCachingService = null; } }, Context.BIND_AUTO_CREATE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreate File: app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java Repository: oxen-io/session-android The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-1955
LOW
2.1
oxen-io/session-android
onCreate
app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
c69b49e676dd8f619418cf296d6fdad9ce5a9510
0
Analyze the following code function for security vulnerabilities
@Override public int getUidForSharedUser(String sharedUserName) { if(sharedUserName == null) { return -1; } // reader synchronized (mPackages) { final SharedUserSetting suid = mSettings.getSharedUserLPw(sharedUserName, 0, 0, false); if (suid == null) { return -1; } return suid.userId; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidForSharedUser File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
getUidForSharedUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
protected boolean _hasTextualNull(String value) { return "null".equals(value); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: _hasTextualNull File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2022-42003
HIGH
7.5
FasterXML/jackson-databind
_hasTextualNull
src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
d78d00ee7b5245b93103fef3187f70543d67ca33
0
Analyze the following code function for security vulnerabilities
void setName(String newName) { className = newName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setName File: luni/src/main/java/java/io/ObjectStreamClass.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
setName
luni/src/main/java/java/io/ObjectStreamClass.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
@Override public Bundle getAssistContextExtras(int requestType) { PendingAssistExtras pae = enqueueAssistContext(requestType, null, null, null, null, null, true /* checkActivityIsTop */, true /* newSessionId */, UserHandle.getCallingUserId(), null, PENDING_ASSIST_EXTRAS_TIMEOUT, 0); if (pae == null) { return null; } synchronized (pae) { while (!pae.haveResult) { try { pae.wait(); } catch (InterruptedException e) { } } } synchronized (mGlobalLock) { buildAssistBundleLocked(pae, pae.result); mPendingAssistExtras.remove(pae); mUiHandler.removeCallbacks(pae); } return pae.extras; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAssistContextExtras 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
getAssistContextExtras
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public void requestAccountAccess(@NonNull Account account, @NonNull String packageName, @IntRange(from = 0) int userId, @NonNull RemoteCallback callback) { if (account == null) { Slog.w(TAG, "account cannot be null"); return; } if (packageName == null) { Slog.w(TAG, "packageName cannot be null"); return; } if (userId < UserHandle.USER_SYSTEM) { Slog.w(TAG, "user id must be concrete"); return; } if (callback == null) { Slog.w(TAG, "callback cannot be null"); return; } int visibility = resolveAccountVisibility(account, packageName, getUserAccounts(userId)); if (visibility == AccountManager.VISIBILITY_NOT_VISIBLE) { Slog.w(TAG, "requestAccountAccess: account is hidden"); return; } if (AccountManagerService.this.hasAccountAccess(account, packageName, new UserHandle(userId))) { Bundle result = new Bundle(); result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, true); callback.sendResult(result); return; } final int uid; try { final long identityToken = clearCallingIdentity(); try { uid = mPackageManager.getPackageUidAsUser(packageName, userId); } finally { restoreCallingIdentity(identityToken); } } catch (NameNotFoundException e) { Slog.e(TAG, "Unknown package " + packageName); return; } Intent intent = newRequestAccountAccessIntent(account, packageName, uid, callback); final UserAccounts userAccounts; synchronized (mUsers) { userAccounts = mUsers.get(userId); } SystemNotificationChannels.createAccountChannelForPackage(packageName, uid, mContext); doNotification(userAccounts, account, null, intent, packageName, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: requestAccountAccess 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
requestAccountAccess
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Override public boolean startUserInForegroundWithListener(final int userId, @Nullable IProgressListener unlockListener) { // Permission check done inside UserController. return mUserController.startUser(userId, /* foreground */ true, unlockListener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startUserInForegroundWithListener File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
startUserInForegroundWithListener
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public List<String> getSettingsNamesLocked(int type, int userId) { final int key = makeKey(type, userId); SettingsState settingsState = peekSettingsStateLocked(key); return settingsState.getSettingNamesLocked(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSettingsNamesLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
getSettingsNamesLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@Override public void setSplitScreenResizing(boolean resizing) { enforceTaskPermission("setSplitScreenResizing()"); final long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { mTaskSupervisor.setSplitScreenResizing(resizing); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSplitScreenResizing 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
setSplitScreenResizing
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
public void unregister(IPackageMoveObserver callback) { mCallbacks.unregister(callback); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unregister File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
unregister
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private ByteBuf encodeBodyAsByteBuf(Object body, MediaTypeCodec codec, ChannelHandlerContext context, AtomicReference<HttpRequest<?>> requestReference) { ByteBuf byteBuf; if (body instanceof ByteBuf) { byteBuf = (ByteBuf) body; } else if (body instanceof ByteBuffer) { ByteBuffer byteBuffer = (ByteBuffer) body; Object nativeBuffer = byteBuffer.asNativeBuffer(); if (nativeBuffer instanceof ByteBuf) { byteBuf = (ByteBuf) nativeBuffer; } else { byteBuf = Unpooled.wrappedBuffer(byteBuffer.asNioBuffer()); } } else if (body instanceof byte[]) { byteBuf = Unpooled.wrappedBuffer((byte[]) body); } else if (body instanceof Writable) { byteBuf = context.alloc().ioBuffer(128); ByteBufOutputStream outputStream = new ByteBufOutputStream(byteBuf); Writable writable = (Writable) body; try { writable.writeTo(outputStream, requestReference.get().getCharacterEncoding()); } catch (IOException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getMessage()); } } } else { if (LOG.isDebugEnabled()) { LOG.debug("Encoding emitted response object [{}] using codec: {}", body, codec); } byteBuf = (ByteBuf) codec.encode(body, new NettyByteBufferFactory(context.alloc())).asNativeBuffer(); } return byteBuf; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: encodeBodyAsByteBuf File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
encodeBodyAsByteBuf
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
private int getMediaControllerPlaybackState(MediaController controller) { if (controller != null) { final PlaybackState playbackState = controller.getPlaybackState(); if (playbackState != null) { return playbackState.getState(); } } return PlaybackState.STATE_NONE; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMediaControllerPlaybackState 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
getMediaControllerPlaybackState
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public void setAutoUpdate(boolean value) { autoUpdate = value; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAutoUpdate File: config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java Repository: gocd The code follows secure coding practices.
[ "CWE-77" ]
CVE-2021-43286
MEDIUM
6.5
gocd
setAutoUpdate
config/config-api/src/main/java/com/thoughtworks/go/config/materials/ScmMaterialConfig.java
6fa9fb7a7c91e760f1adc2593acdd50f2d78676b
0
Analyze the following code function for security vulnerabilities
public ApiClient setDebugging(boolean debugging) { this.debugging = debugging; // Rebuild HTTP Client according to the new "debugging" value. this.httpClient = buildHttpClient(); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDebugging 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
setDebugging
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
public static boolean isUnaligned() { return PlatformDependent0.isUnaligned(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnaligned File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
isUnaligned
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private void resumeAsyncResponse(AsyncResponse asyncResponse, Set<String> subscriptions, List<CompletableFuture<Object>> subscriptionFutures) { FutureUtil.waitForAll(subscriptionFutures).whenComplete((r, ex) -> { if (ex != null) { log.warn("[{}] Failed to get list of subscriptions for {}: {}", clientAppId(), topicName, ex.getMessage()); if (ex instanceof PulsarAdminException) { PulsarAdminException pae = (PulsarAdminException) ex; if (pae.getStatusCode() == Status.NOT_FOUND.getStatusCode()) { asyncResponse.resume(new RestException(Status.NOT_FOUND, "Internal topics have not been generated yet")); return; } else { asyncResponse.resume(new RestException(pae)); return; } } else { asyncResponse.resume(new RestException(ex)); return; } } else { asyncResponse.resume(new ArrayList<>(subscriptions)); } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeAsyncResponse 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
resumeAsyncResponse
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // to get values from the login page String userName = request.getParameter("aname"); String password = sha.getSHA(request.getParameter("pass")); // String password = request.getParameter("pass"); String rememberMe = request.getParameter("remember-me"); // validation if (adminDao.loginValidate(userName, password)) { if (rememberMe != null) { Cookie cookie1 = new Cookie("uname", userName); Cookie cookie2 = new Cookie("pass", password); cookie1.setMaxAge(24 * 60 * 60); cookie2.setMaxAge(24 * 60 * 60); response.addCookie(cookie1); response.addCookie(cookie2); } // to display the name of logged-in person in home page HttpSession session = request.getSession(); session.setAttribute("username", userName); /* * RequestDispatcher rd = * request.getRequestDispatcher("AdminController?actions=admin_list"); * rd.forward(request, response); */ response.sendRedirect("AdminController?actions=admin_list"); } else { RequestDispatcher rd = request.getRequestDispatcher("adminlogin.jsp"); request.setAttribute("loginFailMsg", "Invalid Username or Password !!"); rd.include(request, response); } }
Vulnerability Classification: - CWE: CWE-916 - CVE: CVE-2021-21253 - Severity: MEDIUM - CVSS Score: 5.0 Description: Add a salt to SHA-256 hash Function: doPost File: src/com/bijay/onlinevotingsystem/controller/AdminLoginController.java Repository: bijaythapaa/OnlineVotingSystem Fixed Code: protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // to get values from the login page String userName = request.getParameter("aname"); String password = request.getParameter("pass"); // String password = request.getParameter("pass"); String rememberMe = request.getParameter("remember-me"); // validation if (adminDao.loginValidate(userName, password)) { if (rememberMe != null) { Cookie cookie1 = new Cookie("uname", userName); Cookie cookie2 = new Cookie("pass", password); cookie1.setMaxAge(24 * 60 * 60); cookie2.setMaxAge(24 * 60 * 60); response.addCookie(cookie1); response.addCookie(cookie2); } // to display the name of logged-in person in home page HttpSession session = request.getSession(); session.setAttribute("username", userName); /* * RequestDispatcher rd = * request.getRequestDispatcher("AdminController?actions=admin_list"); * rd.forward(request, response); */ response.sendRedirect("AdminController?actions=admin_list"); } else { RequestDispatcher rd = request.getRequestDispatcher("adminlogin.jsp"); request.setAttribute("loginFailMsg", "Invalid Username or Password !!"); rd.include(request, response); } }
[ "CWE-916" ]
CVE-2021-21253
MEDIUM
5
bijaythapaa/OnlineVotingSystem
doPost
src/com/bijay/onlinevotingsystem/controller/AdminLoginController.java
0181cb0272857696c8eb3e44fcf6cb014ff90f09
1
Analyze the following code function for security vulnerabilities
@Override public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint) { canvas.drawText(ELLIPSIS, x, y, paint); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: draw File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
draw
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
@Nullable @VisibleForTesting ActivityInfo injectGetActivityInfoWithMetadataWithUninstalled( ComponentName activity, @UserIdInt int userId) { final long start = getStatStartTime(); final long token = injectClearCallingIdentity(); try { return mIPackageManager.getActivityInfo(activity, PACKAGE_MATCH_FLAGS | PackageManager.GET_META_DATA, userId); } catch (RemoteException e) { // Shouldn't happen. Slog.wtf(TAG, "RemoteException", e); return null; } finally { injectRestoreCallingIdentity(token); logDurationStat(Stats.GET_ACTIVITY_WITH_METADATA, start); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectGetActivityInfoWithMetadataWithUninstalled File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40079
HIGH
7.8
android
injectGetActivityInfoWithMetadataWithUninstalled
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
@Override public boolean bindDeviceAdminServiceAsUser( @NonNull ComponentName admin, @NonNull IApplicationThread caller, @Nullable IBinder activtiyToken, @NonNull Intent serviceIntent, @NonNull IServiceConnection connection, long flags, @UserIdInt int targetUserId) { if (!mHasFeature) { return false; } Objects.requireNonNull(admin); Objects.requireNonNull(caller); Objects.requireNonNull(serviceIntent); Preconditions.checkArgument( serviceIntent.getComponent() != null || serviceIntent.getPackage() != null, "Service intent must be explicit (with a package name or component): " + serviceIntent); Objects.requireNonNull(connection); Preconditions.checkArgument(mInjector.userHandleGetCallingUserId() != targetUserId, "target user id must be different from the calling user id"); if (!getBindDeviceAdminTargetUsers(admin).contains(UserHandle.of(targetUserId))) { throw new SecurityException("Not allowed to bind to target user id"); } final String targetPackage; synchronized (getLockObject()) { targetPackage = getOwnerPackageNameForUserLocked(targetUserId); } final long callingIdentity = mInjector.binderClearCallingIdentity(); try { // Validate and sanitize the incoming service intent. final Intent sanitizedIntent = createCrossUserServiceIntent(serviceIntent, targetPackage, targetUserId); if (sanitizedIntent == null) { // Fail, cannot lookup the target service. return false; } // Ask ActivityManager to bind it. Notice that we are binding the service with the // caller app instead of DevicePolicyManagerService. return mInjector.getIActivityManager().bindService( caller, activtiyToken, serviceIntent, serviceIntent.resolveTypeIfNeeded(mContext.getContentResolver()), connection, flags, mContext.getOpPackageName(), targetUserId) != 0; } catch (RemoteException ex) { // Same process, should not happen. } finally { mInjector.binderRestoreCallingIdentity(callingIdentity); } // Failed to bind. return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bindDeviceAdminServiceAsUser File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
bindDeviceAdminServiceAsUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public final int getChargingSpeed(int slowThreshold, int fastThreshold) { return maxChargingWattage <= 0 ? CHARGING_UNKNOWN : maxChargingWattage < slowThreshold ? CHARGING_SLOWLY : maxChargingWattage > fastThreshold ? CHARGING_FAST : CHARGING_REGULAR; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChargingSpeed File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3917
HIGH
7.2
android
getChargingSpeed
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
f5334952131afa835dd3f08601fb3bced7b781cd
0
Analyze the following code function for security vulnerabilities
public XWikiDocument getDocument(PageReference reference, XWikiContext context) throws XWikiException { DocumentReference documentReference = getCurrentReferenceDocumentReferenceResolver().resolve(reference); XWikiDocument document = getDocument(documentReference, context); if (document.isNew() && documentReference.getParent().getParent().getType() == EntityType.SPACE) { // Try final page XWikiDocument finalDocument = getDocument(new DocumentReference(documentReference.getParent().getName(), documentReference.getParent().getParent(), documentReference.getParameters()), context); if (!finalDocument.isNew()) { document = finalDocument; } } return document; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDocument File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-32620
MEDIUM
4
xwiki/xwiki-platform
getDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private boolean equalsSlow(HttpHeaderGetters that) { HeaderEntry e = head.after; while (e != head) { final AsciiString name = e.getKey(); if (!Iterators.elementsEqual(valueIterator(name), that.valueIterator(name))) { return false; } e = e.after; } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: equalsSlow File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
equalsSlow
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
private static void deleteRecording(String id, String path) { String[] format = getPlaybackFormats(path); for (String aFormat : format) { List<File> recordings = getDirectories(path + File.separatorChar + aFormat); for (File recording : recordings) { if (recording.getName().equals(id)) { deleteDirectory(recording); createDirectory(recording); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: deleteRecording File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java Repository: bigbluebutton The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-12443
HIGH
7.5
bigbluebutton
deleteRecording
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
b21ca8355a57286a1e6df96984b3a4c57679a463
0
Analyze the following code function for security vulnerabilities
@Override public Certificate getPublisher(CertPath cPath) { if (cPath != null) { currentlyUsed = cPath; } if (currentlyUsed != null) { List<? extends Certificate> certList = currentlyUsed .getCertificates(); if (certList.size() > 0) { return certList.get(0); } else { return null; } } else { return null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPublisher File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getPublisher
core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java
2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99
0
Analyze the following code function for security vulnerabilities
public void setConnected(boolean connected) { this.connected = connected; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setConnected File: activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java Repository: apache/activemq The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-3576
MEDIUM
5
apache/activemq
setConnected
activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java
00921f2
0
Analyze the following code function for security vulnerabilities
public static void dumpCurrentRow(Cursor cursor, PrintStream stream) { String[] cols = cursor.getColumnNames(); stream.println("" + cursor.getPosition() + " {"); int length = cols.length; for (int i = 0; i< length; i++) { String value; try { value = cursor.getString(i); } catch (SQLiteException e) { // assume that if the getString threw this exception then the column is not // representable by a string, e.g. it is a BLOB. value = "<unprintable>"; } stream.println(" " + cols[i] + '=' + value); } stream.println("}"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dumpCurrentRow File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
dumpCurrentRow
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
protected void setPermission(Context c, Group g, int actionID, Bitstream bs) throws SQLException, AuthorizeException { if (!isTest) { // remove the default policy authorizeService.removeAllPolicies(c, bs); // add the policy ResourcePolicy rp = resourcePolicyService.create(c); rp.setdSpaceObject(bs); rp.setAction(actionID); rp.setGroup(g); resourcePolicyService.update(c, rp); } else { if (actionID == Constants.READ) { System.out.println("\t\tpermissions: READ for " + g.getName()); } else if (actionID == Constants.WRITE) { System.out.println("\t\tpermissions: WRITE for " + g.getName()); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPermission File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
setPermission
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
0
Analyze the following code function for security vulnerabilities
public void onRoleChanged() { ClientRole role = mClientModeManager.getRole(); if (role == ROLE_CLIENT_PRIMARY) { applyCachedPacketFilter(); if (mScreenOn) { // Start RSSI polling for the new primary network to enable scoring. enableRssiPolling(true); } } else { if (mScreenOn && !isSecondaryInternet()) { // Stop RSSI polling (if enabled) for the secondary network. enableRssiPolling(false); } } WifiConfiguration connectedNetwork = getConnectedWifiConfiguration(); if (connectedNetwork != null) { updateWifiInfoWhenConnected(connectedNetwork); // Update capabilities after a role change. updateCapabilities(connectedNetwork); } mWifiScoreReport.onRoleChanged(role); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onRoleChanged File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
onRoleChanged
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference(new ProjectBlobResourceReference())); String callback = ajaxBehavior.getCallbackFunction(explicit("action")).toString(); String script = String.format("onedev.server.projectBlob.onDomReady(%s);", callback); response.render(OnDomReadyHeaderItem.forScript(script)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: renderHead File: server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-434" ]
CVE-2021-21245
HIGH
7.5
theonedev/onedev
renderHead
server-core/src/main/java/io/onedev/server/web/page/project/blob/ProjectBlobPage.java
0c060153fb97c0288a1917efdb17cc426934dacb
0
Analyze the following code function for security vulnerabilities
public static String extractXmlEncoding(String content) { String result = null; Matcher xmlHeadMatcher = XML_HEAD_REGEX.matcher(content); if (xmlHeadMatcher.find()) { String xmlHead = xmlHeadMatcher.group(); Matcher encodingMatcher = XML_ENCODING_REGEX.matcher(xmlHead); if (encodingMatcher.find()) { String encoding = encodingMatcher.group(); int pos1 = encoding.indexOf('=') + 2; String charset = encoding.substring(pos1, encoding.length() - 1); if (Charset.isSupported(charset)) { result = charset; } } } return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: extractXmlEncoding File: src/org/opencms/util/CmsStringUtil.java Repository: alkacon/opencms-core The code follows secure coding practices.
[ "CWE-79" ]
CVE-2013-4600
MEDIUM
4.3
alkacon/opencms-core
extractXmlEncoding
src/org/opencms/util/CmsStringUtil.java
72a05e3ea1cf692e2efce002687272e63f98c14a
0
Analyze the following code function for security vulnerabilities
private void parseProperties(final Node root) throws GameParseException { final GameProperties properties = data.getProperties(); for (final Element current : getChildren("property", root)) { final String editable = current.getAttribute("editable"); final String property = current.getAttribute("name"); String value = current.getAttribute("value"); if (value == null || value.length() == 0) { final List<Element> valueChildren = getChildren("value", current); if (!valueChildren.isEmpty()) { final Element valueNode = valueChildren.get(0); if (valueNode != null) { value = valueNode.getTextContent(); } } } if (editable != null && editable.equalsIgnoreCase("true")) { parseEditableProperty(current, property, value); } else { final List<Node> children2 = getNonTextNodesIgnoring(current, "value"); if (children2.size() == 0) { // we don't know what type this property is!!, it appears like only numbers and string may be represented // without proper type definition try { // test if it is an integer final int integer = Integer.parseInt(value); properties.set(property, integer); } catch (final NumberFormatException e) { // then it must be a string properties.set(property, value); } } else { final String type = children2.get(0).getNodeName(); switch (type) { case "boolean": properties.set(property, Boolean.valueOf(value)); break; case "file": properties.set(property, new File(value)); break; case "number": int intValue = 0; if (value != null) { try { intValue = Integer.parseInt(value); } catch (final NumberFormatException e) { // value already 0 } } properties.set(property, intValue); break; default: properties.set(property, value); break; } } } } data.getPlayerList().forEach(playerId -> data.getProperties().addPlayerProperty( new NumberProperty(Constants.getIncomePercentageFor(playerId), null, 999, 0, 100))); data.getPlayerList().forEach(playerId -> data.getProperties().addPlayerProperty( new NumberProperty(Constants.getPuIncomeBonus(playerId), null, 999, 0, 0))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseProperties File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
parseProperties
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
private int updateProfileOffDeadlineLocked( int profileUserId, ActiveAdmin profileOwner, boolean off) { final long now = mInjector.systemCurrentTimeMillis(); if (profileOwner.mProfileOffDeadline != 0 && now > profileOwner.mProfileOffDeadline) { Slogf.i(LOG_TAG, "Profile off deadline has been reached, off: " + off); if (profileOwner.mProfileOffDeadline != -1) { // Move the deadline far to the past so that it cannot be rolled back by TZ change. profileOwner.mProfileOffDeadline = -1; saveSettingsLocked(profileUserId); } return off ? PROFILE_OFF_NOTIFICATION_SUSPENDED : PROFILE_OFF_NOTIFICATION_NONE; } boolean shouldSaveSettings = false; if (profileOwner.mSuspendPersonalApps) { // When explicit suspension is active, deadline shouldn't be set. if (profileOwner.mProfileOffDeadline != 0) { profileOwner.mProfileOffDeadline = 0; shouldSaveSettings = true; } } else if (profileOwner.mProfileOffDeadline != 0 && (profileOwner.mProfileMaximumTimeOffMillis == 0)) { // There is a deadline but either there is no policy -> clear // the deadline. Slogf.i(LOG_TAG, "Profile off deadline is reset to zero"); profileOwner.mProfileOffDeadline = 0; shouldSaveSettings = true; } else if (profileOwner.mProfileOffDeadline == 0 && (profileOwner.mProfileMaximumTimeOffMillis != 0 && off)) { // There profile is locked and there is a policy, but the deadline is not set -> set the // deadline. Slogf.i(LOG_TAG, "Profile off deadline is set."); profileOwner.mProfileOffDeadline = now + profileOwner.mProfileMaximumTimeOffMillis; shouldSaveSettings = true; } if (shouldSaveSettings) { saveSettingsLocked(profileUserId); } final long alarmTime; final int notificationState; if (!off || profileOwner.mProfileOffDeadline == 0) { alarmTime = 0; notificationState = PROFILE_OFF_NOTIFICATION_NONE; } else if (profileOwner.mProfileOffDeadline - now < MANAGED_PROFILE_OFF_WARNING_PERIOD) { // The deadline is close, upon the alarm personal apps should be suspended. alarmTime = profileOwner.mProfileOffDeadline; notificationState = PROFILE_OFF_NOTIFICATION_WARNING; } else { // The deadline is quite far, upon the alarm we should warn the user first, so the // alarm is scheduled earlier than the actual deadline. alarmTime = profileOwner.mProfileOffDeadline - MANAGED_PROFILE_OFF_WARNING_PERIOD; notificationState = PROFILE_OFF_NOTIFICATION_NONE; } final AlarmManager am = mInjector.getAlarmManager(); final Intent intent = new Intent(ACTION_PROFILE_OFF_DEADLINE); intent.setPackage(mContext.getPackageName()); // Broadcast alarms sent by system are immutable final PendingIntent pi = mInjector.pendingIntentGetBroadcast( mContext, REQUEST_PROFILE_OFF_DEADLINE, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); if (alarmTime == 0) { Slogf.i(LOG_TAG, "Profile off deadline alarm is removed."); am.cancel(pi); } else { Slogf.i(LOG_TAG, "Profile off deadline alarm is set."); am.set(AlarmManager.RTC, alarmTime, pi); } return notificationState; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateProfileOffDeadlineLocked File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
updateProfileOffDeadlineLocked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
void sendOrSaveFinished(SendOrSaveMessage message, boolean success);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendOrSaveFinished File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
sendOrSaveFinished
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
boolean isLockedTask(TaskRecord task) { return mLockTaskModeTasks.contains(task); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isLockedTask File: services/core/java/com/android/server/am/ActivityStackSupervisor.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3838
MEDIUM
4.3
android
isLockedTask
services/core/java/com/android/server/am/ActivityStackSupervisor.java
468651c86a8adb7aa56c708d2348e99022088af3
0
Analyze the following code function for security vulnerabilities
public Builder setSpdyInitialWindowSize(int spdyInitialWindowSize) { this.spdyInitialWindowSize = spdyInitialWindowSize; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSpdyInitialWindowSize File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7397
MEDIUM
4.3
AsyncHttpClient/async-http-client
setSpdyInitialWindowSize
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java
df6ed70e86c8fc340ed75563e016c8baa94d7e72
0
Analyze the following code function for security vulnerabilities
@Override protected void onInitialize() { super.onInitialize(); Form<?> form = new Form<Void>("form"); form.add(new FencedFeedbackPanel("feedback", form)); form.add(new TextField<String>("loginNameOrEmail", new IModel<String>() { @Override public void detach() { } @Override public String getObject() { return loginNameOrEmail; } @Override public void setObject(String object) { loginNameOrEmail = object; } }).setLabel(Model.of("Login name or email")).setRequired(true)); form.add(new TaskButton("resettingPassword") { @Override protected void onCompleted(AjaxRequestTarget target, boolean successful) { super.onCompleted(target, successful); if (successful) setResponsePage(LoginPage.class); } @Override protected String runTask(TaskLogger logger) { OneDev.getInstance(SessionManager.class).openSession(); try { UserManager userManager = OneDev.getInstance(UserManager.class); User user = userManager.findByName(loginNameOrEmail); if (user == null) user = userManager.findByVerifiedEmailAddress(loginNameOrEmail); if (user == null) { throw new ExplicitException("No user found with login name or verified email: " + loginNameOrEmail); } else { SettingManager settingManager = OneDev.getInstance(SettingManager.class); if (settingManager.getMailSetting() != null) { String password = RandomStringUtils.random(10, true, true); user.setPassword(AppLoader.getInstance(PasswordService.class).encryptPassword(password)); userManager.save(user); MailManager mailManager = OneDev.getInstance(MailManager.class); String serverUrl = settingManager.getSystemSetting().getServerUrl(); String htmlBody = String.format("Dear %s, " + "<p style='margin: 16px 0;'>" + "Per your request, password of your login \"%s\" at <a href=\"%s\">%s</a> has been reset to:<br>" + "%s<br><br>" + "Please login and change the password in your earliest convenience.", user.getDisplayName(), user.getName(), serverUrl, serverUrl, password); String textBody = String.format("Dear %s,\n\n" + "Per your request, password of account \"%s\" at %s has been reset to:\n" + "%s", user.getDisplayName(), user.getName(), serverUrl, password); String emailAddressValue; if (loginNameOrEmail.contains("@")) { emailAddressValue = loginNameOrEmail; } else { EmailAddress emailAddress = user.getPrimaryEmailAddress(); if (emailAddress == null) throw new ExplicitException("Primary email address not specified"); else if (!emailAddress.isVerified()) throw new ExplicitException("Your primary email address is not verified"); else emailAddressValue = emailAddress.getValue(); } mailManager.sendMail( settingManager.getMailSetting().getSendSetting(), Arrays.asList(emailAddressValue), Lists.newArrayList(), Lists.newArrayList(), "[Password Reset] Your OneDev Password Has Been Reset", htmlBody, textBody, null, null); return "Please check your email " + emailAddressValue + " for the reset password"; } else { throw new ExplicitException("Unable to send password reset email as smtp settings are not defined"); } } } finally { OneDev.getInstance(SessionManager.class).closeSession(); } } }); form.add(new Link<Void>("cancel") { @Override public void onClick() { setResponsePage(LoginPage.class); } }); add(form); }
Vulnerability Classification: - CWE: CWE-338 - CVE: CVE-2023-24828 - Severity: HIGH - CVSS Score: 8.8 Description: Fix issue #1179 - OneDev should use crypto strong random string for access token and password reset Function: onInitialize File: server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java Repository: theonedev/onedev Fixed Code: @Override protected void onInitialize() { super.onInitialize(); Form<?> form = new Form<Void>("form"); form.add(new FencedFeedbackPanel("feedback", form)); form.add(new TextField<String>("loginNameOrEmail", new IModel<String>() { @Override public void detach() { } @Override public String getObject() { return loginNameOrEmail; } @Override public void setObject(String object) { loginNameOrEmail = object; } }).setLabel(Model.of("Login name or email")).setRequired(true)); form.add(new TaskButton("resettingPassword") { @Override protected void onCompleted(AjaxRequestTarget target, boolean successful) { super.onCompleted(target, successful); if (successful) setResponsePage(LoginPage.class); } @Override protected String runTask(TaskLogger logger) { OneDev.getInstance(SessionManager.class).openSession(); try { UserManager userManager = OneDev.getInstance(UserManager.class); User user = userManager.findByName(loginNameOrEmail); if (user == null) user = userManager.findByVerifiedEmailAddress(loginNameOrEmail); if (user == null) { throw new ExplicitException("No user found with login name or verified email: " + loginNameOrEmail); } else { SettingManager settingManager = OneDev.getInstance(SettingManager.class); if (settingManager.getMailSetting() != null) { String password = CryptoUtils.generateSecret(); user.setPassword(AppLoader.getInstance(PasswordService.class).encryptPassword(password)); userManager.save(user); MailManager mailManager = OneDev.getInstance(MailManager.class); String serverUrl = settingManager.getSystemSetting().getServerUrl(); String htmlBody = String.format("Dear %s, " + "<p style='margin: 16px 0;'>" + "Per your request, password of your login \"%s\" at <a href=\"%s\">%s</a> has been reset to:<br>" + "%s<br><br>" + "Please login and change the password in your earliest convenience.", user.getDisplayName(), user.getName(), serverUrl, serverUrl, password); String textBody = String.format("Dear %s,\n\n" + "Per your request, password of account \"%s\" at %s has been reset to:\n" + "%s", user.getDisplayName(), user.getName(), serverUrl, password); String emailAddressValue; if (loginNameOrEmail.contains("@")) { emailAddressValue = loginNameOrEmail; } else { EmailAddress emailAddress = user.getPrimaryEmailAddress(); if (emailAddress == null) throw new ExplicitException("Primary email address not specified"); else if (!emailAddress.isVerified()) throw new ExplicitException("Your primary email address is not verified"); else emailAddressValue = emailAddress.getValue(); } mailManager.sendMail( settingManager.getMailSetting().getSendSetting(), Arrays.asList(emailAddressValue), Lists.newArrayList(), Lists.newArrayList(), "[Password Reset] Your OneDev Password Has Been Reset", htmlBody, textBody, null, null); return "Please check your email " + emailAddressValue + " for the reset password"; } else { throw new ExplicitException("Unable to send password reset email as smtp settings are not defined"); } } } finally { OneDev.getInstance(SessionManager.class).closeSession(); } } }); form.add(new Link<Void>("cancel") { @Override public void onClick() { setResponsePage(LoginPage.class); } }); add(form); }
[ "CWE-338" ]
CVE-2023-24828
HIGH
8.8
theonedev/onedev
onInitialize
server-core/src/main/java/io/onedev/server/web/page/simple/security/PasswordResetPage.java
d67dd9686897fe5e4ab881d749464aa7c06a68e5
1
Analyze the following code function for security vulnerabilities
public Object logs(String id) { ExecutionLogDetailsExample e = new ExecutionLogDetailsExample(); e.createCriteria().andLogIdEqualTo(id); e.setOrderByClause("create_time asc"); return executionLogDetailsMapper.selectByExampleWithBLOBs(e); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logs File: rackshift-server/src/main/java/io/rackshift/service/TaskService.java Repository: fit2cloud/rackshift The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-42405
CRITICAL
9.8
fit2cloud/rackshift
logs
rackshift-server/src/main/java/io/rackshift/service/TaskService.java
305aea3b20d36591d519f7d04e0a25be05a51e93
0
Analyze the following code function for security vulnerabilities
public String getPageUrl(String pageType, String pageOrderRange) throws IndexUnreachableException { StringBuilder sbUrl = new StringBuilder(); if (StringUtils.isBlank(pageType)) { if (navigationHelper != null) { pageType = navigationHelper.getCurrentView(); if (pageType == null) { pageType = PageType.viewObject.name(); } } if (StringUtils.isBlank(pageType)) { pageType = PageType.viewObject.name(); } // logger.trace("current view: {}", pageType); } int[] pages = StringTools.getIntegerRange(pageOrderRange); int page = pages[0]; int page2 = pages[1]; if (viewManager != null) { page = Math.max(page, viewManager.getPageLoader().getFirstPageOrder()); page = Math.min(page, viewManager.getPageLoader().getLastPageOrder()); if (page2 != Integer.MAX_VALUE) { page2 = Math.max(page2, viewManager.getPageLoader().getFirstPageOrder()); page2 = Math.min(page2, viewManager.getPageLoader().getLastPageOrder()); } } // if (page == page2) { // page2 = Integer.MAX_VALUE; // } String range = page + (page2 != Integer.MAX_VALUE ? "-" + page2 : ""); // logger.trace("final range: {}", range); sbUrl.append(BeanUtils.getServletPathWithHostAsUrlFromJsfContext()) .append('/') .append(PageType.getByName(pageType).getName()) .append('/') .append(getPersistentIdentifier()) .append('/') .append(range) .append('/'); return sbUrl.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPageUrl 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
getPageUrl
goobi-viewer-core/src/main/java/io/goobi/viewer/managedbeans/ActiveDocumentBean.java
c29efe60e745a94d03debc17681c4950f3917455
0
Analyze the following code function for security vulnerabilities
private void enforceWriteSettingsPermission(String func) { int uid = Binder.getCallingUid(); if (uid == ROOT_UID) { return; } if (Settings.checkAndNoteWriteSettingsOperation(mContext, uid, Settings.getPackageNameForUid(mContext, uid), false)) { return; } String msg = "Permission Denial: " + func + " from pid=" + Binder.getCallingPid() + ", uid=" + uid + " requires " + android.Manifest.permission.WRITE_SETTINGS; Slog.w(TAG, msg); throw new SecurityException(msg); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: enforceWriteSettingsPermission 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
enforceWriteSettingsPermission
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void setKeepUninstalledPackages(@Nullable ComponentName admin, @NonNull List<String> packageNames) { throwIfParentInstance("setKeepUninstalledPackages"); if (mService != null) { try { mService.setKeepUninstalledPackages(admin, mContext.getPackageName(), packageNames); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setKeepUninstalledPackages File: core/java/android/app/admin/DevicePolicyManager.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setKeepUninstalledPackages
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public static XMLBuilder2 parse(String xmlString) { return XMLBuilder2.parse(new InputSource(new StringReader(xmlString))); }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2014-125087 - Severity: MEDIUM - CVSS Score: 5.2 Description: Disable external entities by default to prevent XXE injection attacks, re #6 XML Builder classes now explicitly enable or disable 'external-general-entities' and 'external-parameter-entities' features of the DocumentBuilderFactory when #create or #parse methods are used. To prevent XML External Entity (XXE) injection attacks, these features are disabled by default. They can only be enabled by passing a true boolean value to new versions of the #create and #parse methods that accept a flag for this feature. Function: parse File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java Repository: jmurty/java-xmlbuilder Fixed Code: public static XMLBuilder2 parse(String xmlString) { return XMLBuilder2.parse(xmlString, false); }
[ "CWE-611" ]
CVE-2014-125087
MEDIUM
5.2
jmurty/java-xmlbuilder
parse
src/main/java/com/jamesmurty/utils/XMLBuilder2.java
e6fddca201790abab4f2c274341c0bb8835c3e73
1
Analyze the following code function for security vulnerabilities
@Override public final boolean isPrimitive() { return _class.isPrimitive(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPrimitive File: src/main/java/com/fasterxml/jackson/databind/JavaType.java Repository: FasterXML/jackson-databind The code follows secure coding practices.
[ "CWE-502" ]
CVE-2019-16942
HIGH
7.5
FasterXML/jackson-databind
isPrimitive
src/main/java/com/fasterxml/jackson/databind/JavaType.java
54aa38d87dcffa5ccc23e64922e9536c82c1b9c8
0
Analyze the following code function for security vulnerabilities
private boolean checkIfZip64ExtraDataRecordPresentInLFH(List<ExtraDataRecord> extraDataRecords) { if (extraDataRecords == null) { return false; } for (ExtraDataRecord extraDataRecord : extraDataRecords) { if (extraDataRecord.getHeader() == HeaderSignature.ZIP64_EXTRA_FIELD_SIGNATURE.getValue()) { return true; } } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkIfZip64ExtraDataRecordPresentInLFH File: src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java Repository: srikanth-lingala/zip4j The code follows secure coding practices.
[ "CWE-346" ]
CVE-2023-22899
MEDIUM
5.9
srikanth-lingala/zip4j
checkIfZip64ExtraDataRecordPresentInLFH
src/main/java/net/lingala/zip4j/io/inputstream/ZipInputStream.java
ddd8fdc8ad0583eb4a6172dc86c72c881485c55b
0
Analyze the following code function for security vulnerabilities
protected B frameListener(Http2FrameListener frameListener) { this.frameListener = checkNotNull(frameListener, "frameListener"); return self(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: frameListener File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java Repository: netty The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
netty
frameListener
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
58f75f665aa81a8cbcf6ffa74820042a285c5e61
0
Analyze the following code function for security vulnerabilities
private void switchUser(TestUtils testUtils, boolean isModal) { // The test of the standard registration for must be done with the guest user. // The test of the user creation in a modal from the administration must be done with an user that // has admin rights. if (!isModal) { // Fast Logout. testUtils.forceGuestUser(); } else { testUtils.loginAsSuperAdmin(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: switchUser File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2024-21650
CRITICAL
9.8
xwiki/xwiki-platform
switchUser
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
0
Analyze the following code function for security vulnerabilities
@Deprecated public static final boolean supportsProcesses() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: supportsProcesses File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
supportsProcesses
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
public synchronized void updateByte(@Positive int columnIndex, byte x) throws SQLException { updateValue(columnIndex, String.valueOf(x)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateByte 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
updateByte
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
final void add(CharSequence name, String value) { final AsciiString normalizedName = normalizeName(name); requireNonNull(value, "value"); final int h = normalizedName.hashCode(); final int i = index(h); add0(h, i, normalizedName, value); }
Vulnerability Classification: - CWE: CWE-74 - CVE: CVE-2019-16771 - Severity: MEDIUM - CVSS Score: 5.0 Description: Merge pull request from GHSA-35fr-h7jr-hh86 Motivation: An `HttpService` can produce a malformed HTTP response when a user specified a malformed HTTP header values, such as: ResponseHeaders.of(HttpStatus.OK "my-header", "foo\r\nbad-header: bar"); Modification: - Add strict header value validation to `HttpHeadersBase` - Add strict header name validation to `HttpHeaderNames.of()`, which is used by `HttpHeadersBase`. Result: - It is not possible anymore to send a bad header value which can be misused for sending additional headers or injecting arbitrary content. Function: add File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria Fixed Code: final void add(CharSequence name, String value) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(value, "value"); final int h = normalizedName.hashCode(); final int i = index(h); add0(h, i, normalizedName, value); }
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
add
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
1
Analyze the following code function for security vulnerabilities
@Nonnull default Config config() { return ConfigFactory.empty(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: config File: jooby/src/main/java/org/jooby/Jooby.java Repository: jooby-project/jooby The code follows secure coding practices.
[ "CWE-22" ]
CVE-2020-7647
MEDIUM
5
jooby-project/jooby
config
jooby/src/main/java/org/jooby/Jooby.java
34f526028e6cd0652125baa33936ffb6a8a4a009
0
Analyze the following code function for security vulnerabilities
private void setLastSelectedNetwork(int networkId) { if (mVerboseLoggingEnabled) { Log.v(TAG, "Setting last selected network to " + networkId); } mLastSelectedNetworkId = networkId; mLastSelectedTimeStamp = mClock.getElapsedSinceBootMillis(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setLastSelectedNetwork File: service/java/com/android/server/wifi/WifiConfigManager.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
setLastSelectedNetwork
service/java/com/android/server/wifi/WifiConfigManager.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
protected abstract ExecutionResult execute(File gitDir, Map<String, String> gitEnvs);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute File: server-core/src/main/java/io/onedev/server/git/GitSshCommand.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-287" ]
CVE-2022-39205
CRITICAL
9.8
theonedev/onedev
execute
server-core/src/main/java/io/onedev/server/git/GitSshCommand.java
f1e97688e4e19d6de1dfa1d00e04655209d39f8e
0
Analyze the following code function for security vulnerabilities
public void readMapEnd() throws TException {}
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readMapEnd 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
readMapEnd
thrift/lib/java/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java
08c2d412adb214c40bb03be7587057b25d053030
0
Analyze the following code function for security vulnerabilities
public static String normalizedOs() { return NORMALIZED_OS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: normalizedOs File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
normalizedOs
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
public String selectHeaderContentType(String[] contentTypes) { if (contentTypes.length == 0) { return "application/json"; } for (String contentType : contentTypes) { if (isJsonMime(contentType)) { return contentType; } } return contentTypes[0]; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: selectHeaderContentType File: samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
selectHeaderContentType
samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public void setAaaServerTrustedNames(@Nullable String[] aaaServerTrustedNames) { mAaaServerTrustedNames = aaaServerTrustedNames; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAaaServerTrustedNames 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
setAaaServerTrustedNames
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
protected void recurseRolesSearch(LdapContext searchContext, String roleDN) throws LoginException { if (recurseRoles) { if (processedRoleDNs.contains(roleDN) == false) { processedRoleDNs.add(roleDN); if (trace) { log.trace("Recursive search for '" + roleDN + "'"); } rolesSearch(searchContext, roleDN); } else { if (trace) { log.trace("Already visited role '" + roleDN + "' ending recursion."); } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: recurseRolesSearch File: jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java Repository: wildfly-security/jboss-negotiation The code follows secure coding practices.
[ "CWE-200" ]
CVE-2015-1849
MEDIUM
4.3
wildfly-security/jboss-negotiation
recurseRolesSearch
jboss-negotiation-extras/src/main/java/org/jboss/security/negotiation/AdvancedLdapLoginModule.java
0dc9d191b6eb1d13b8f0189c5b02ba6576f4722e
0
Analyze the following code function for security vulnerabilities
private int findIdxBasedOnAppTokens(WindowState win) { WindowList windows = win.getWindowList(); for(int j = windows.size() - 1; j >= 0; j--) { WindowState wentry = windows.get(j); if(wentry.mAppToken == win.mAppToken) { return j; } } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: findIdxBasedOnAppTokens File: services/core/java/com/android/server/wm/WindowManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3875
HIGH
7.2
android
findIdxBasedOnAppTokens
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public List<String> getExternalStyles() { String extStyles = CONF.externalStyles(); if (!StringUtils.isBlank(extStyles)) { String[] styles = extStyles.split("\\s*,\\s*"); if (!StringUtils.isBlank(extStyles) && styles != null && styles.length > 0) { ArrayList<String> list = new ArrayList<String>(); for (String style : styles) { if (!StringUtils.isBlank(style)) { list.add(style); } } return list; } } return Collections.emptyList(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getExternalStyles 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
getExternalStyles
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public void grantDefaultPermissionsToDefaultSimCallManager(String packageName, int userId) { synchronized (mPackages) { mDefaultPermissionPolicy.grantDefaultPermissionsToDefaultSimCallManagerLPr( packageName, userId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: grantDefaultPermissionsToDefaultSimCallManager File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
grantDefaultPermissionsToDefaultSimCallManager
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Test public void closeClientGetInstance(TestContext context) { PostgresClient c = PostgresClient.getInstance(vertx, TENANT); context.assertNotNull(c.getClient(), "getClient()"); c.closeClient(context.asyncAssertSuccess()); context.assertNull(c.getClient(), "getClient()"); c = PostgresClient.getInstance(vertx, TENANT); context.assertNotNull(c.getClient(), "getClient()"); c.closeClient(context.asyncAssertSuccess()); context.assertNull(c.getClient(), "getClient()"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: closeClientGetInstance File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
closeClientGetInstance
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public static void retryFailedUploads( @NonNull final Context context, @NonNull final UploadsStorageManager uploadsStorageManager, @NonNull final ConnectivityService connectivityService, @NonNull final UserAccountManager accountManager, @NonNull final PowerManagementService powerManagementService ) { OCUpload[] failedUploads = uploadsStorageManager.getFailedUploads(); if(failedUploads == null || failedUploads.length == 0) { return; //nothing to do } final Connectivity connectivity = connectivityService.getConnectivity(); final boolean gotNetwork = connectivity.isConnected(); final boolean gotWifi = connectivity.isWifi(); final BatteryStatus batteryStatus = powerManagementService.getBattery(); final boolean charging = batteryStatus.isCharging() || batteryStatus.isFull(); final boolean isPowerSaving = powerManagementService.isPowerSavingEnabled(); Optional<User> uploadUser = Optional.empty(); for (OCUpload failedUpload : failedUploads) { // 1. extract failed upload owner account and cache it between loops (expensive query) if (!uploadUser.isPresent() || !uploadUser.get().nameEquals(failedUpload.getAccountName())) { uploadUser = accountManager.getUser(failedUpload.getAccountName()); } final boolean isDeleted = !new File(failedUpload.getLocalPath()).exists(); if (isDeleted) { // 2A. for deleted files, mark as permanently failed if (failedUpload.getLastResult() != UploadResult.FILE_NOT_FOUND) { failedUpload.setLastResult(UploadResult.FILE_NOT_FOUND); uploadsStorageManager.updateUpload(failedUpload); } } else if (!isPowerSaving && gotNetwork && canUploadBeRetried(failedUpload, gotWifi, charging) && !connectivityService.isInternetWalled()) { // 2B. for existing local files, try restarting it if possible retryUpload(context, uploadUser.get(), failedUpload); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retryFailedUploads File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-39210
MEDIUM
5.5
nextcloud/android
retryFailedUploads
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
cd3bd0845a97e1d43daa0607a122b66b0068c751
0
Analyze the following code function for security vulnerabilities
public void setPackagePreserveVersion(boolean packagePreserveVersion) { this.packagePreserveVersion = packagePreserveVersion; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPackagePreserveVersion File: xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-611" ]
CVE-2023-27480
HIGH
7.7
xwiki/xwiki-platform
setPackagePreserveVersion
xwiki-platform-core/xwiki-platform-xar/xwiki-platform-xar-model/src/main/java/org/xwiki/xar/XarPackage.java
e3527b98fdd8dc8179c24dc55e662b2c55199434
0
Analyze the following code function for security vulnerabilities
public boolean isPatternEverChosen(int userId) { return getBoolean(PATTERN_EVER_CHOSEN_KEY, false, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isPatternEverChosen File: core/java/com/android/internal/widget/LockPatternUtils.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
isPatternEverChosen
core/java/com/android/internal/widget/LockPatternUtils.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
@Override public void beginFormat(Format format, Map<String, String> parameters) { switch (format) { case BOLD: getXHTMLWikiPrinter().printXMLStartElement("strong"); break; case ITALIC: getXHTMLWikiPrinter().printXMLStartElement("em"); break; case STRIKEDOUT: getXHTMLWikiPrinter().printXMLStartElement("del"); break; case UNDERLINED: getXHTMLWikiPrinter().printXMLStartElement("ins"); break; case SUPERSCRIPT: getXHTMLWikiPrinter().printXMLStartElement("sup"); break; case SUBSCRIPT: getXHTMLWikiPrinter().printXMLStartElement("sub"); break; case MONOSPACE: getXHTMLWikiPrinter().printXMLStartElement("tt"); break; case NONE: break; // Unsupported format default: break; } if (!parameters.isEmpty()) { getXHTMLWikiPrinter().printXMLStartElement("span", parameters); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginFormat File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java Repository: xwiki/xwiki-rendering The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-32070
MEDIUM
6.1
xwiki/xwiki-rendering
beginFormat
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
0
Analyze the following code function for security vulnerabilities
public String getValidationScript() { return getDoc().getValidationScript(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValidationScript 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
getValidationScript
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
public boolean userAllowsPrivateNotificationsInPublic(int userHandle) { if (userHandle == UserHandle.USER_ALL) { return true; } if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) { final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0, userHandle); final boolean allowedByDpm = adminAllowsUnredactedNotifications(userHandle); final boolean allowed = allowedByUser && allowedByDpm; mUsersAllowingPrivateNotifications.append(userHandle, allowed); return allowed; } return mUsersAllowingPrivateNotifications.get(userHandle); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: userAllowsPrivateNotificationsInPublic 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
userAllowsPrivateNotificationsInPublic
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void updateWifiInfoWhenConnected(@NonNull WifiConfiguration config) { mWifiInfo.setEphemeral(config.ephemeral); mWifiInfo.setTrusted(config.trusted); mWifiInfo.setOemPaid(config.oemPaid); mWifiInfo.setOemPrivate(config.oemPrivate); mWifiInfo.setCarrierMerged(config.carrierMerged); mWifiInfo.setSubscriptionId(config.subscriptionId); mWifiInfo.setOsuAp(config.osu); mWifiInfo.setRestricted(config.restricted); if (config.fromWifiNetworkSpecifier || config.fromWifiNetworkSuggestion) { mWifiInfo.setRequestingPackageName(config.creatorName); } mWifiInfo.setIsPrimary(isPrimary()); SecurityParams securityParams = config.getNetworkSelectionStatus() .getLastUsedSecurityParams(); if (securityParams != null) { mWifiInfo.setCurrentSecurityType(securityParams.getSecurityType()); } else { mWifiInfo.clearCurrentSecurityType(); Log.e(TAG, "Network connection candidate with no security parameters"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateWifiInfoWhenConnected File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateWifiInfoWhenConnected
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
private String getRenderedContent(Syntax targetSyntax, boolean transformationContextIsolated, boolean transformationContextRestricted, XWikiContext context, boolean retrieveTranslation) throws XWikiException { // Make sure the context secure document is the current document so that it's executed with its own // rights Object currentSdoc = context.get("sdoc"); try { XWikiDocument sdoc; if (retrieveTranslation) { sdoc = getTranslatedDocument(context); } else { sdoc = this; } context.put("sdoc", sdoc); return display(targetSyntax, false, transformationContextIsolated, transformationContextRestricted, retrieveTranslation); } finally { context.put("sdoc", currentSdoc); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRenderedContent 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
getRenderedContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0