instruction string | input string | output string | cwe_ids list | cve_id string | severity string | cvss_score float64 | repo_name string | func_name string | file_path string | commit_hash string | is_vulnerable int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities | public ApiTestEnvironment getEnvironment(String id) {
return apiTestEnvironmentMapper.selectByPrimaryKey(id);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEnvironment
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2021-45789 | MEDIUM | 6.5 | metersphere | getEnvironment | backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java | d74e02cdff47cdf7524d305d098db6ffb7f61b47 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void removeRootTasksWithActivityTypes(int[] activityTypes) {
enforceTaskPermission("removeRootTasksWithActivityTypes()");
synchronized (mGlobalLock) {
final long ident = Binder.clearCallingIdentity();
try {
mRootWindowContainer.removeRootTasksWithActivityTypes(activityTypes);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeRootTasksWithActivityTypes
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 | removeRootTasksWithActivityTypes | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 1120bc7e511710b1b774adf29ba47106292365e7 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case MSG_PERMISSIONS_CHANGED: {
final int uid = msg.arg1;
mListener.onPermissionsChanged(uid);
return true;
}
default:
return false;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleMessage
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-281"
] | CVE-2023-21249 | MEDIUM | 5.5 | android | handleMessage | core/java/android/permission/PermissionManager.java | c00b7e7dbc1fa30339adef693d02a51254755d7f | 0 |
Analyze the following code function for security vulnerabilities | private int getControllerHolderIndexForCb(ISessionControllerCallback cb) {
IBinder binder = cb.asBinder();
for (int i = mControllerCallbackHolders.size() - 1; i >= 0; i--) {
if (binder.equals(mControllerCallbackHolders.get(i).mCallback.asBinder())) {
return i;
}
}
return -1;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getControllerHolderIndexForCb
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-21280 | MEDIUM | 5.5 | android | getControllerHolderIndexForCb | services/core/java/com/android/server/media/MediaSessionRecord.java | 06e772e05514af4aa427641784c5eec39a892ed3 | 0 |
Analyze the following code function for security vulnerabilities | public void stopCurrentAccessibilityNotifications() {
mAccessibilityInjector.onPageLostFocus();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopCurrentAccessibilityNotifications
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | stopCurrentAccessibilityNotifications | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | @NonNull
public static PersistableBundle readFromStream(@NonNull InputStream inputStream)
throws IOException {
try {
TypedXmlPullParser parser = Xml.newFastPullParser();
parser.setInput(inputStream, UTF_8.name());
parser.next();
return PersistableBundle.restoreFromXml(parser);
} catch (XmlPullParserException e) {
throw new IOException(e);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readFromStream
File: core/java/android/os/PersistableBundle.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40074 | MEDIUM | 5.5 | android | readFromStream | core/java/android/os/PersistableBundle.java | 40e4ea759743737958dde018f3606d778f7a53f3 | 0 |
Analyze the following code function for security vulnerabilities | private boolean isOpaqueDrawn() {
// When there is keyguard, wallpaper could be placed over the secure app
// window but invisible. We need to check wallpaper visibility explicitly
// to determine if it's occluding apps.
final boolean isWallpaper = mToken.asWallpaperToken() != null;
return ((!isWallpaper && mAttrs.format == PixelFormat.OPAQUE)
|| (isWallpaper && mToken.isVisible()))
&& isDrawn() && !isAnimating(TRANSITION | PARENTS);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isOpaqueDrawn
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 | isOpaqueDrawn | services/core/java/com/android/server/wm/WindowState.java | 7428962d3b064ce1122809d87af65099d1129c9e | 0 |
Analyze the following code function for security vulnerabilities | void addListener(CallsManagerListener listener) {
mListeners.add(listener);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addListener
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-2423 | MEDIUM | 6.6 | android | addListener | src/com/android/server/telecom/CallsManager.java | a06c9a4aef69ae27b951523cf72bf72412bf48fa | 0 |
Analyze the following code function for security vulnerabilities | @Override
public ApplicationBasicInfo getApplicationBasicInfoByResourceId(String resourceId,
String tenantDomain)
throws IdentityApplicationManagementException {
Collection<ApplicationResourceManagementListener> listeners =
ApplicationMgtListenerServiceComponent.getApplicationResourceMgtListeners();
for (ApplicationResourceManagementListener listener : listeners) {
if (listener.isEnabled() &&
!listener.doPreGetApplicationBasicInfoByResourceId(resourceId, tenantDomain)) {
throw buildServerException("Error executing doPreGetApplicationBasicInfoByResourceId operation of " +
"listener: " + getName(listener) + " for application resourceId: " + resourceId);
}
}
ApplicationBasicInfo basicAppInfo = getApplicationBasicInfo(resourceId, tenantDomain);
for (ApplicationResourceManagementListener listener : listeners) {
if (listener.isEnabled() &&
!listener.doPostGetApplicationBasicInfoByResourceId(basicAppInfo, resourceId, tenantDomain)) {
throw buildServerException("Error executing doPostGetApplicationBasicInfoByResourceId operation of " +
"listener: " + getName(listener) + " for application resourceId: " + resourceId);
}
}
return basicAppInfo;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApplicationBasicInfoByResourceId
File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
Repository: wso2/carbon-identity-framework
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2021-42646 | MEDIUM | 6.4 | wso2/carbon-identity-framework | getApplicationBasicInfoByResourceId | components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java | e9119883ee02a884f3c76c7bbc4022a4f4c58fc0 | 0 |
Analyze the following code function for security vulnerabilities | protected JsonDeserializer<?> findOptionalStdDeserializer(DeserializationContext ctxt,
JavaType type, BeanDescription beanDesc)
throws JsonMappingException
{
return OptionalHandlerFactory.instance.findDeserializer(type, ctxt.getConfig(), beanDesc);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findOptionalStdDeserializer
File: src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2019-16942 | HIGH | 7.5 | FasterXML/jackson-databind | findOptionalStdDeserializer | src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java | 54aa38d87dcffa5ccc23e64922e9536c82c1b9c8 | 0 |
Analyze the following code function for security vulnerabilities | public String dialogButtonsCloseDetails(String closeAttribute, String detailsAttribute) {
return dialogButtons(new int[] {BUTTON_CLOSE, BUTTON_DETAILS}, new String[] {closeAttribute, detailsAttribute});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dialogButtonsCloseDetails
File: src/org/opencms/workplace/CmsDialog.java
Repository: alkacon/opencms-core
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2013-4600 | MEDIUM | 4.3 | alkacon/opencms-core | dialogButtonsCloseDetails | src/org/opencms/workplace/CmsDialog.java | 72a05e3ea1cf692e2efce002687272e63f98c14a | 0 |
Analyze the following code function for security vulnerabilities | @RequiresPermission(value = SET_TIME, conditional = true)
public boolean setTime(@Nullable ComponentName admin, long millis) {
throwIfParentInstance("setTime");
if (mService != null) {
try {
return mService.setTime(admin, mContext.getPackageName(), millis);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setTime
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 | setTime | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | void requestTraversalLocked() {
if (!mTraversalScheduled) {
mTraversalScheduled = true;
mH.sendEmptyMessage(H.DO_TRAVERSAL);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: requestTraversalLocked
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 | requestTraversalLocked | services/core/java/com/android/server/wm/WindowManagerService.java | 69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int getIntValue() throws IOException
{
if ((_numTypesValid & NR_INT) == 0) {
if (_numTypesValid == NR_UNKNOWN) { // not parsed at all
_checkNumericValue(NR_INT); // will also check event type
}
if ((_numTypesValid & NR_INT) == 0) { // wasn't an int natively?
convertNumberToInt(); // let's make it so, if possible
}
}
return _numberInt;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getIntValue
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices. | [
"CWE-770"
] | CVE-2020-28491 | MEDIUM | 5 | FasterXML/jackson-dataformats-binary | getIntValue | cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java | de072d314af8f5f269c8abec6930652af67bc8e6 | 0 |
Analyze the following code function for security vulnerabilities | public String getAdClientId()
{
return this.xwiki.getAdClientId(getXWikiContext());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAdClientId
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2023-37911 | MEDIUM | 6.5 | xwiki/xwiki-platform | getAdClientId | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java | f471f2a392aeeb9e51d59fdfe1d76fccf532523f | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void startRemoteControl() {
super.startRemoteControl();
getActivity().runOnUiThread(new Runnable() {
public void run() {
mMediaBrowserCompat = new MediaBrowserCompat(getActivity(), new ComponentName(getActivity(), BackgroundAudioService.class),
mMediaBrowserCompatConnectionCallback, getActivity().getIntent().getExtras());
mMediaBrowserCompat.connect();
AndroidNativeUtil.addLifecycleListener(new LifecycleListener() {
@Override
public void onCreate(Bundle savedInstanceState) {
}
@Override
public void onResume() {
}
@Override
public void onPause() {
}
@Override
public void onDestroy() {
if (mMediaBrowserCompat != null) {
if( MediaControllerCompat.getMediaController(getActivity()).getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING ) {
MediaControllerCompat.getMediaController(getActivity()).getTransportControls().pause();
}
mMediaBrowserCompat.disconnect();
mMediaBrowserCompat = null;
}
}
@Override
public void onSaveInstanceState(Bundle b) {
}
@Override
public void onLowMemory() {
}
});
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startRemoteControl
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | startRemoteControl | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean equals(Object otherObj) {
if (otherObj == null) {
return false;
}
try {
Key other = (Key)otherObj;
if (type != other.type) {
return false;
}
if (userId != other.userId){
return false;
}
if (!Objects.equals(packageName, other.packageName)) {
return false;
}
if (!Objects.equals(featureId, other.featureId)) {
return false;
}
if (activity != other.activity) {
return false;
}
if (!Objects.equals(who, other.who)) {
return false;
}
if (requestCode != other.requestCode) {
return false;
}
if (requestIntent != other.requestIntent) {
if (requestIntent != null) {
if (!requestIntent.filterEquals(other.requestIntent)) {
return false;
}
} else if (other.requestIntent != null) {
return false;
}
}
if (!Objects.equals(requestResolvedType, other.requestResolvedType)) {
return false;
}
if (flags != other.flags) {
return false;
}
return true;
} catch (ClassCastException e) {
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: services/core/java/com/android/server/am/PendingIntentRecord.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-20918 | CRITICAL | 9.8 | android | equals | services/core/java/com/android/server/am/PendingIntentRecord.java | 8418e3a017428683d173c0c82b0eb02d5b923a4e | 0 |
Analyze the following code function for security vulnerabilities | private String getServerUrl() {
return OneDev.getInstance(SettingManager.class).getSystemSetting().getServerUrl().toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerUrl
File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-610"
] | CVE-2022-39206 | CRITICAL | 9.9 | theonedev/onedev | getServerUrl | server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java | 0052047a5b5095ac6a6b4a73a522d0272fec3a22 | 0 |
Analyze the following code function for security vulnerabilities | private Setting getConfigSetting(String name) {
if (DEBUG) {
Slog.v(LOG_TAG, "getConfigSetting(" + name + ")");
}
DeviceConfig.enforceReadPermission(getContext(), /*namespace=*/name.split("/")[0]);
// Get the value.
synchronized (mLock) {
return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_CONFIG,
UserHandle.USER_SYSTEM, name);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConfigSetting
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40117 | HIGH | 7.8 | android | getConfigSetting | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | ff86ff28cf82124f8e65833a2dd8c319aea08945 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int getNearbyNotificationStreamingPolicy(final int userId) {
if (!mHasFeature) {
return NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller)
|| hasCallingOrSelfPermission(permission.READ_NEARBY_STREAMING_POLICY));
Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId));
synchronized (getLockObject()) {
final ActiveAdmin admin = getDeviceOrProfileOwnerAdminLocked(userId);
return admin != null
? admin.mNearbyNotificationStreamingPolicy
: NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNearbyNotificationStreamingPolicy
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 | getNearbyNotificationStreamingPolicy | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | boolean stopProfileServices() {
Class[] supportedProfileServices = Config.getSupportedProfiles();
if (mProfilesStarted && supportedProfileServices.length>0) {
setProfileServiceState(supportedProfileServices,BluetoothAdapter.STATE_OFF);
return true;
}
debugLog("stopProfileServices() - No profiles services to stop or already stopped.");
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopProfileServices
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices. | [
"CWE-362",
"CWE-20"
] | CVE-2016-3760 | MEDIUM | 5.4 | android | stopProfileServices | src/com/android/bluetooth/btservice/AdapterService.java | 122feb9a0b04290f55183ff2f0384c6c53756bd8 | 0 |
Analyze the following code function for security vulnerabilities | private IStatusBarService getStatusBarService() {
synchronized (mService) {
if (mStatusBarService == null) {
mStatusBarService = IStatusBarService.Stub.asInterface(
ServiceManager.checkService(Context.STATUS_BAR_SERVICE));
if (mStatusBarService == null) {
Slog.w("StatusBarManager", "warning: no STATUS_BAR_SERVICE");
}
}
return mStatusBarService;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStatusBarService
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 | getStatusBarService | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 468651c86a8adb7aa56c708d2348e99022088af3 | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated
public long ParamAsLong(String key)
{
return getConfiguration().getProperty(key, long.class);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ParamAsLong
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 | ParamAsLong | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java | f9a677408ffb06f309be46ef9d8df1915d9099a4 | 0 |
Analyze the following code function for security vulnerabilities | public AsyncHttpClientConfigBean setRequestTimeoutInMs(int requestTimeoutInMs) {
this.requestTimeoutInMs = requestTimeoutInMs;
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequestTimeoutInMs
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices. | [
"CWE-345"
] | CVE-2013-7397 | MEDIUM | 4.3 | AsyncHttpClient/async-http-client | setRequestTimeoutInMs | api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java | df6ed70e86c8fc340ed75563e016c8baa94d7e72 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String getOrderBySQL(Select select) {
StringBuilder sql = new StringBuilder();
List<SortColumn> orderBys = select.getOrderBys();
boolean first = true;
for (SortColumn column : orderBys) {
if (first) {
sql.append(getOrderByStatement(select)).append(" ");
} else {
sql.append(", ");
}
Column aliasColumn = allowAliasInStatements() ? getAliasStatement(select, column.getSource()) : null;
if (aliasColumn != null) {
column = new SortColumn(aliasColumn, column.getOrder());
}
String str = getSortColumnSQL(column);
sql.append(str);
first = false;
}
return sql.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrderBySQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-4999 | HIGH | 7.5 | dashbuilder | getOrderBySQL | dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java | 8574899e3b6455547b534f570b2330ff772e524b | 0 |
Analyze the following code function for security vulnerabilities | @NonNull
public BubbleMetadata.Builder setSuppressableBubble(boolean suppressBubble) {
setFlag(FLAG_SUPPRESSABLE_BUBBLE, suppressBubble);
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSuppressableBubble
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | setSuppressableBubble | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public BufferedReader getReader() throws IOException {
if (bufferedInputStream == null) {
return super.getReader();
}
if (reader == null) {
// use character encoding as said in the API
final String characterEncoding = this.getCharacterEncoding();
if (characterEncoding == null) {
reader = new BufferedReader(new InputStreamReader(this.getInputStream()));
} else {
reader = new BufferedReader(
new InputStreamReader(this.getInputStream(), characterEncoding));
}
}
return reader;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getReader
File: javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java
Repository: javamelody
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-15531 | HIGH | 7.5 | javamelody | getReader | javamelody-core/src/main/java/net/bull/javamelody/PayloadNameRequestWrapper.java | ef111822562d0b9365bd3e671a75b65bd0613353 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onPackageInstalled(String packageName, int returnCode,
String msg, Bundle extras) {
synchronized (mDone) {
mResult = returnCode;
mPackageName = packageName;
mDone.set(true);
mDone.notifyAll();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onPackageInstalled
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 | onPackageInstalled | services/backup/java/com/android/server/backup/BackupManagerService.java | 9b8c6d2df35455ce9e67907edded1e4a2ecb9e28 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onUserUnlocking(@NonNull TargetUser user) {
if (user.isPreCreated()) return;
mService.handleUnlockUser(user.getUserIdentifier());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserUnlocking
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 | onUserUnlocking | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public void setWorkspaceUpdater(WorkspaceUpdater workspaceUpdater) {
this.workspaceUpdater = workspaceUpdater;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setWorkspaceUpdater
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices. | [
"CWE-255"
] | CVE-2013-6372 | LOW | 2.1 | jenkinsci/subversion-plugin | setWorkspaceUpdater | src/main/java/hudson/scm/SubversionSCM.java | 7d4562d6f7e40de04bbe29577b51c79f07d05ba6 | 0 |
Analyze the following code function for security vulnerabilities | public int getHLen() {
return hLen;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getHLen
File: src/main/java/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java
Repository: srikanth-lingala/zip4j
The code follows secure coding practices. | [
"CWE-346"
] | CVE-2023-22899 | MEDIUM | 5.9 | srikanth-lingala/zip4j | getHLen | src/main/java/net/lingala/zip4j/crypto/PBKDF2/MacBasedPRF.java | ddd8fdc8ad0583eb4a6172dc86c72c881485c55b | 0 |
Analyze the following code function for security vulnerabilities | @CalledByNative
private void setNativePtr(long nativePtr) {
assert mNativeTabAndroid == 0;
mNativeTabAndroid = nativePtr;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNativePtr
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | setNativePtr | chrome/android/java/src/org/chromium/chrome/browser/Tab.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | public WikiResource createWiki() {
WikiResource resource = new WikiResource();
createFolders(resource);
OLATResourceManager rm = getResourceManager();
OLATResource ores = rm.createOLATResourceInstance(resource);
rm.saveOLATResource(ores);
return resource;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createWiki
File: src/main/java/org/olat/modules/wiki/WikiManager.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-39180 | HIGH | 9 | OpenOLAT | createWiki | src/main/java/org/olat/modules/wiki/WikiManager.java | 699490be8e931af0ef1f135c55384db1f4232637 | 0 |
Analyze the following code function for security vulnerabilities | public Result getThreshold() {
if(threshold==null)
return Result.SUCCESS;
else
return threshold;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getThreshold
File: core/src/main/java/hudson/tasks/BuildTrigger.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2013-7330 | MEDIUM | 4 | jenkinsci/jenkins | getThreshold | core/src/main/java/hudson/tasks/BuildTrigger.java | 36342d71e29e0620f803a7470ce96c61761648d8 | 0 |
Analyze the following code function for security vulnerabilities | private void maybeUpdateUsageStatsLocked(ProcessRecord app, long nowElapsed) {
if (DEBUG_USAGE_STATS) {
Slog.d(TAG, "Checking proc [" + Arrays.toString(app.getPackageList())
+ "] state changes: old = " + app.setProcState + ", new = "
+ app.curProcState);
}
if (mUsageStatsService == null) {
return;
}
boolean isInteraction;
// To avoid some abuse patterns, we are going to be careful about what we consider
// to be an app interaction. Being the top activity doesn't count while the display
// is sleeping, nor do short foreground services.
if (app.curProcState <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
isInteraction = true;
app.fgInteractionTime = 0;
} else if (app.curProcState <= ActivityManager.PROCESS_STATE_TOP_SLEEPING) {
if (app.fgInteractionTime == 0) {
app.fgInteractionTime = nowElapsed;
isInteraction = false;
} else {
isInteraction = nowElapsed > app.fgInteractionTime + SERVICE_USAGE_INTERACTION_TIME;
}
} else {
isInteraction = app.curProcState
<= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND;
app.fgInteractionTime = 0;
}
if (isInteraction && (!app.reportedInteraction
|| (nowElapsed-app.interactionEventTime) > USAGE_STATS_INTERACTION_INTERVAL)) {
app.interactionEventTime = nowElapsed;
String[] packages = app.getPackageList();
if (packages != null) {
for (int i = 0; i < packages.length; i++) {
mUsageStatsService.reportEvent(packages[i], app.userId,
UsageEvents.Event.SYSTEM_INTERACTION);
}
}
}
app.reportedInteraction = isInteraction;
if (!isInteraction) {
app.interactionEventTime = 0;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeUpdateUsageStatsLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2016-2500 | MEDIUM | 4.3 | android | maybeUpdateUsageStatsLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 9878bb99b77c3681f0fda116e2964bac26f349c3 | 0 |
Analyze the following code function for security vulnerabilities | @Exported
public WorkspaceUpdater getWorkspaceUpdater() {
if (workspaceUpdater!=null)
return workspaceUpdater;
// data must have been read from old configuration.
if (useUpdate!=null && !useUpdate)
return new CheckoutUpdater();
if (doRevert!=null && doRevert)
return new UpdateWithRevertUpdater();
return new UpdateUpdater();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWorkspaceUpdater
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices. | [
"CWE-255"
] | CVE-2013-6372 | LOW | 2.1 | jenkinsci/subversion-plugin | getWorkspaceUpdater | src/main/java/hudson/scm/SubversionSCM.java | 7d4562d6f7e40de04bbe29577b51c79f07d05ba6 | 0 |
Analyze the following code function for security vulnerabilities | void setRelativeUrl(Object relativeUrl) {
this.relativeUrl = relativeUrl.toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRelativeUrl
File: retrofit/src/main/java/retrofit2/RequestBuilder.java
Repository: square/retrofit
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2018-1000850 | MEDIUM | 6.4 | square/retrofit | setRelativeUrl | retrofit/src/main/java/retrofit2/RequestBuilder.java | b9a7f6ad72073ddd40254c0058710e87a073047d | 0 |
Analyze the following code function for security vulnerabilities | private List<S3PluginActifactDto> parseReleaseFile(String releaseFileUrl) throws IOException {
byte[] contents = restTemplate.getForObject(releaseFileUrl, byte[].class);
ByteArrayInputStream bais = new ByteArrayInputStream(contents);
BufferedReader br = new BufferedReader(new InputStreamReader(bais));
String line = null;
List<S3PluginActifactDto> results = new ArrayList<>();
while ((line = br.readLine()) != null) {
S3PluginActifactDto dto = new S3PluginActifactDto();
dto.setBucketName(line);
dto.setKeyName(line);
results.add(dto);
}
return results;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseReleaseFile
File: platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java
Repository: WeBankPartners/wecube-platform
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-45746 | MEDIUM | 5 | WeBankPartners/wecube-platform | parseReleaseFile | platform-core/src/main/java/com/webank/wecube/platform/core/service/plugin/PluginArtifactsMgmtService.java | 1164dae43c505f8a0233cc049b2689d6ca6d0c37 | 0 |
Analyze the following code function for security vulnerabilities | private native void nativeFlingCancel(long nativeContentViewCoreImpl, long timeMs); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeFlingCancel
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | nativeFlingCancel | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public byte[] read() throws IOException {
Closer closer = Closer.create();
try {
FileInputStream in = closer.register(openStream());
return ByteStreams.toByteArray(in, in.getChannel().size());
} catch (Throwable e) {
throw closer.rethrow(e);
} finally {
closer.close();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: read
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices. | [
"CWE-552"
] | CVE-2023-2976 | HIGH | 7.1 | google/guava | read | guava/src/com/google/common/io/Files.java | feb83a1c8fd2e7670b244d5afd23cba5aca43284 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void warning(SAXParseException exception) {
log.warn(makeBetterErrorString("Warning", exception));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: warning
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-0239 | HIGH | 7.5 | stanfordnlp/CoreNLP | warning | src/edu/stanford/nlp/util/XMLUtils.java | 1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd | 0 |
Analyze the following code function for security vulnerabilities | public HttpURLConnection prepareConnection(String path, String method)
throws IOException {
URL uri = new URL(WEBPACK_HOST + ":" + getPort() + path);
HttpURLConnection connection = (HttpURLConnection) uri.openConnection();
connection.setRequestMethod(method);
connection.setReadTimeout(DEFAULT_TIMEOUT);
connection.setConnectTimeout(DEFAULT_TIMEOUT);
return connection;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepareConnection
File: flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java
Repository: vaadin/flow
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2020-36321 | MEDIUM | 5 | vaadin/flow | prepareConnection | flow-server/src/main/java/com/vaadin/flow/server/DevModeHandler.java | 6ae6460ca4f3a9b50bd46fbf49c807fe67718307 | 0 |
Analyze the following code function for security vulnerabilities | private int jjMoveStringLiteralDfa5_1(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_1(3, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_1(4, active0);
return 5;
}
switch(curChar)
{
case 110:
return jjMoveStringLiteralDfa6_1(active0, 0x400000000000L);
default :
break;
}
return jjStartNfa_1(4, active0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjMoveStringLiteralDfa5_1
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices. | [
"CWE-917"
] | CVE-2021-28170 | MEDIUM | 5 | jakartaee/expression-language | jjMoveStringLiteralDfa5_1 | impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java | b6a3943ac5fba71cbc6719f092e319caa747855b | 0 |
Analyze the following code function for security vulnerabilities | private void updateLockscreenNotificationSetting() {
final boolean show = Settings.Secure.getIntForUser(mContext.getContentResolver(),
Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS,
1,
mCurrentUserId) != 0;
final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(
null /* admin */, mCurrentUserId);
final boolean allowedByDpm = (dpmFlags
& DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) == 0;
setShowLockscreenNotifications(show && allowedByDpm);
if (ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT) {
final boolean remoteInput = Settings.Secure.getIntForUser(mContext.getContentResolver(),
Settings.Secure.LOCK_SCREEN_ALLOW_REMOTE_INPUT,
0,
mCurrentUserId) != 0;
final boolean remoteInputDpm =
(dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_REMOTE_INPUT) == 0;
setLockScreenAllowRemoteInput(remoteInput && remoteInputDpm);
} else {
setLockScreenAllowRemoteInput(false);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateLockscreenNotificationSetting
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 | updateLockscreenNotificationSetting | packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean onRemoved(int fingerId, int groupId) {
if (DEBUG) Slog.w(TAG, "onRemoved() called for authenticate!");
return true; // Invalid for Authenticate
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onRemoved
File: services/core/java/com/android/server/fingerprint/AuthenticationClient.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3917 | HIGH | 7.2 | android | onRemoved | services/core/java/com/android/server/fingerprint/AuthenticationClient.java | f5334952131afa835dd3f08601fb3bced7b781cd | 0 |
Analyze the following code function for security vulnerabilities | public String[] getAddressesFromList(RecipientEditTextView list) {
if (list == null) {
return new String[0];
}
Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(list.getText());
int count = tokens.length;
String[] result = new String[count];
for (int i = 0; i < count; i++) {
result[i] = tokens[i].toString();
}
return result;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAddressesFromList
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 | getAddressesFromList | src/com/android/mail/compose/ComposeActivity.java | 0d9dfd649bae9c181e3afc5d571903f1eb5dc46f | 0 |
Analyze the following code function for security vulnerabilities | public void enableJavaScriptOnUiThread(final AwContents awContents) {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
awContents.getSettings().setJavaScriptEnabled(true);
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enableJavaScriptOnUiThread
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-254"
] | CVE-2016-5155 | MEDIUM | 4.3 | chromium | enableJavaScriptOnUiThread | android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java | b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6 | 0 |
Analyze the following code function for security vulnerabilities | private String resolveCallingPackage() {
switch (Binder.getCallingUid()) {
case Process.ROOT_UID: {
return "root";
}
case Process.SHELL_UID: {
return "com.android.shell";
}
default: {
return getCallingPackage();
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolveCallingPackage
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40117 | HIGH | 7.8 | android | resolveCallingPackage | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | ff86ff28cf82124f8e65833a2dd8c319aea08945 | 0 |
Analyze the following code function for security vulnerabilities | public int bindService(IApplicationThread caller, IBinder token,
Intent service, String resolvedType, IServiceConnection connection,
int flags, String callingPackage, int userId) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(caller != null ? caller.asBinder() : null);
data.writeStrongBinder(token);
service.writeToParcel(data, 0);
data.writeString(resolvedType);
data.writeStrongBinder(connection.asBinder());
data.writeInt(flags);
data.writeString(callingPackage);
data.writeInt(userId);
mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
reply.readException();
int res = reply.readInt();
data.recycle();
reply.recycle();
return res;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindService
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | bindService | core/java/android/app/ActivityManagerNative.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | private boolean isPermittedShellBroadcast(Intent intent) {
// remote bugreport should always be allowed to be taken
return INTENT_REMOTE_BUGREPORT_FINISHED.equals(intent.getAction());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isPermittedShellBroadcast
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 | isPermittedShellBroadcast | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @VisibleForTesting
List<PlayerId> parsePlayersFromIsDisplayedFor(final String encodedPlayerNames) throws GameParseException {
final List<PlayerId> players = new ArrayList<>();
for (final String playerName : Splitter.on(':').split(encodedPlayerNames)) {
final @Nullable PlayerId player = data.getPlayerList().getPlayerId(playerName);
if (player == null) {
throw newGameParseException("Parse resources could not find player: " + playerName);
}
players.add(player);
}
return players;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parsePlayersFromIsDisplayedFor
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 | parsePlayersFromIsDisplayedFor | game-core/src/main/java/games/strategy/engine/data/GameParser.java | 0f23875a4c6e166218859a63c884995f15c53895 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onUserRemoved(int userId) {
synchronized (ActivityManagerService.this) {
ActivityManagerService.this.onUserStoppedLocked(userId);
}
mBatteryStatsService.onUserRemoved(userId);
mUserController.onUserRemoved(userId);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUserRemoved
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 | onUserRemoved | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | private void checkAllUsersAreAffiliatedWithDevice() {
Preconditions.checkCallAuthorization(areAllUsersAffiliatedWithDeviceLocked(),
"operation not allowed when device has unaffiliated users");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAllUsersAreAffiliatedWithDevice
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 | checkAllUsersAreAffiliatedWithDevice | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public String getFullNameSQL(boolean newFullName)
{
if (newFullName) {
return "doc.fullName";
}
if (this.fullNameSQL == null) {
if (isMySQL()) {
this.fullNameSQL = "CONCAT(doc.space,'.',doc.name)";
} else {
this.fullNameSQL = "doc.space||'.'||doc.name";
}
}
return this.fullNameSQL;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFullNameSQL
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 | getFullNameSQL | 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 int getBigBaseLayoutResource() {
return R.layout.notification_template_material_big_base;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBigBaseLayoutResource
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | getBigBaseLayoutResource | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | public int getCustomEnterResId() {
return mCustomEnterResId;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCustomEnterResId
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-20918 | CRITICAL | 9.8 | android | getCustomEnterResId | core/java/android/app/ActivityOptions.java | 51051de4eb40bb502db448084a83fd6cbfb7d3cf | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean runsModal() {
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runsModal
File: src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-41152 | MEDIUM | 4 | OpenOLAT | runsModal | src/main/java/org/olat/core/commons/modules/bc/commands/CmdDownloadZip.java | 418bb509ffcb0e25ab4390563c6c47f0458583eb | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log_OC.d(TAG, "Starting command with id " + startId);
startForeground(FOREGROUND_SERVICE_ID, mNotification);
if (intent == null) {
Log_OC.e(TAG, "Intent is null");
return Service.START_NOT_STICKY;
}
if (!intent.hasExtra(KEY_ACCOUNT)) {
Log_OC.e(TAG, "Not enough information provided in intent");
return Service.START_NOT_STICKY;
}
final Account account = intent.getParcelableExtra(KEY_ACCOUNT);
if (account == null) {
return Service.START_NOT_STICKY;
}
Optional<User> optionalUser = accountManager.getUser(account.name);
if (!optionalUser.isPresent()) {
return Service.START_NOT_STICKY;
}
final User user = optionalUser.get();
boolean retry = intent.getBooleanExtra(KEY_RETRY, false);
List<String> requestedUploads = new ArrayList<>();
boolean onWifiOnly = intent.getBooleanExtra(KEY_WHILE_ON_WIFI_ONLY, false);
boolean whileChargingOnly = intent.getBooleanExtra(KEY_WHILE_CHARGING_ONLY, false);
if (!retry) { // Start new uploads
if (!(intent.hasExtra(KEY_LOCAL_FILE) || intent.hasExtra(KEY_FILE))) {
Log_OC.e(TAG, "Not enough information provided in intent");
return Service.START_NOT_STICKY;
}
Integer error = gatherAndStartNewUploads(intent, user, requestedUploads, onWifiOnly, whileChargingOnly);
if (error != null) {
return error;
}
} else { // Retry uploads
if (!intent.hasExtra(KEY_ACCOUNT) || !intent.hasExtra(KEY_RETRY_UPLOAD)) {
Log_OC.e(TAG, "Not enough information provided in intent: no KEY_RETRY_UPLOAD_KEY");
return START_NOT_STICKY;
}
retryUploads(intent, user, requestedUploads);
}
if (requestedUploads.size() > 0) {
Message msg = mServiceHandler.obtainMessage();
msg.arg1 = startId;
msg.obj = requestedUploads;
mServiceHandler.sendMessage(msg);
sendBroadcastUploadsAdded();
}
return Service.START_NOT_STICKY;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStartCommand
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 | onStartCommand | app/src/main/java/com/owncloud/android/files/services/FileUploader.java | cd3bd0845a97e1d43daa0607a122b66b0068c751 | 0 |
Analyze the following code function for security vulnerabilities | public boolean getSimpleMode() {
return simpleMode;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSimpleMode
File: src/main/java/emissary/pickup/WorkBundle.java
Repository: NationalSecurityAgency/emissary
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2021-32634 | MEDIUM | 6.5 | NationalSecurityAgency/emissary | getSimpleMode | src/main/java/emissary/pickup/WorkBundle.java | 40260b1ec1f76cc92361702cc14fa1e4388e19d7 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException {
LocalServices.getService(VoiceInteractionManagerInternal.class)
.stopLocalVoiceInteraction(callingActivity);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopLocalVoiceInteraction
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 | stopLocalVoiceInteraction | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | private static boolean staleCacheFile(final HttpQuery query,
final long end_time,
final long max_age,
final File cachedfile) throws Exception {
PowerMockito.mockStatic(System.class);
PowerMockito.when(System.getProperty(anyString(), anyString())).thenReturn("");
PowerMockito.when(System.getProperty(anyString())).thenReturn("");
PowerMockito.spy(GraphHandler.class);
PowerMockito.doReturn("").when(GraphHandler.class, "findGnuplotHelperScript");
return Whitebox.<Boolean>invokeMethod(GraphHandler.class, "staleCacheFile",
query, end_time / 1000, max_age,
cachedfile);
//return (Boolean)sm.invoke(null, query, end_time / 1000, max_age, cachedfile);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: staleCacheFile
File: test/tsd/TestGraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices. | [
"CWE-78"
] | CVE-2023-25826 | CRITICAL | 9.8 | OpenTSDB/opentsdb | staleCacheFile | test/tsd/TestGraphHandler.java | 26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25 | 0 |
Analyze the following code function for security vulnerabilities | private String constructResumedTraceName(String packageName) {
return "focused app: " + packageName;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: constructResumedTraceName
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 | constructResumedTraceName | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | public ApiClient setApiKey(String apiKey) {
for (Authentication auth : authentications.values()) {
if (auth instanceof ApiKeyAuth) {
((ApiKeyAuth) auth).setApiKey(apiKey);
return this;
}
}
throw new RuntimeException("No API key authentication configured!");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setApiKey
File: samples/client/petstore/java/retrofit2-play26/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 | setApiKey | samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean loginValidate(String userName, String password, String email) {
String sql = "select * from voter_table where voter_name=? and password=? and email=?";
try {
ps = DbUtil.getConnection().prepareStatement(sql);
ps.setString(1, userName);
ps.setString(2, password);
ps.setString(3, email);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
return true;
}
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return false;
} | Vulnerability Classification:
- CWE: CWE-916
- CVE: CVE-2021-21253
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Add a salt to SHA-256 hash
Function: loginValidate
File: src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
Repository: bijaythapaa/OnlineVotingSystem
Fixed Code:
@Override
public boolean loginValidate(String userName, String password, String email) {
String sql = "select * from voter_table where voter_name=? and email=?";
try {
ps = DbUtil.getConnection().prepareStatement(sql);
ps.setString(1, userName);
ps.setString(2, email);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
String cipherText = rs.getString("password");
return SHA256.validatePassword(password, cipherText);
}
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return false;
} | [
"CWE-916"
] | CVE-2021-21253 | MEDIUM | 5 | bijaythapaa/OnlineVotingSystem | loginValidate | src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java | 0181cb0272857696c8eb3e44fcf6cb014ff90f09 | 1 |
Analyze the following code function for security vulnerabilities | private static void verifyPeerName(PGStream stream, Properties info, SSLSocket newConnection)
throws PSQLException {
HostnameVerifier hvn;
String sslhostnameverifier = PGProperty.SSL_HOSTNAME_VERIFIER.get(info);
if (sslhostnameverifier == null) {
hvn = PGjdbcHostnameVerifier.INSTANCE;
sslhostnameverifier = "PgjdbcHostnameVerifier";
} else {
try {
hvn = (HostnameVerifier) instantiate(sslhostnameverifier, info, false, null);
} catch (Exception e) {
throw new PSQLException(
GT.tr("The HostnameVerifier class provided {0} could not be instantiated.",
sslhostnameverifier),
PSQLState.CONNECTION_FAILURE, e);
}
}
if (hvn.verify(stream.getHostSpec().getHost(), newConnection.getSession())) {
return;
}
throw new PSQLException(
GT.tr("The hostname {0} could not be verified by hostnameverifier {1}.",
stream.getHostSpec().getHost(), sslhostnameverifier),
PSQLState.CONNECTION_FAILURE);
} | Vulnerability Classification:
- CWE: CWE-665
- CVE: CVE-2022-21724
- Severity: HIGH
- CVSS Score: 7.5
Description: Merge pull request from GHSA-v7wg-cpwc-24m4
This ensures arbitrary classes can't be passed instead of
AuthenticationPlugin, SocketFactory, SSLSocketFactory, CallbackHandler, HostnameVerifier
Function: verifyPeerName
File: pgjdbc/src/main/java/org/postgresql/ssl/MakeSSL.java
Repository: pgjdbc
Fixed Code:
private static void verifyPeerName(PGStream stream, Properties info, SSLSocket newConnection)
throws PSQLException {
HostnameVerifier hvn;
String sslhostnameverifier = PGProperty.SSL_HOSTNAME_VERIFIER.get(info);
if (sslhostnameverifier == null) {
hvn = PGjdbcHostnameVerifier.INSTANCE;
sslhostnameverifier = "PgjdbcHostnameVerifier";
} else {
try {
hvn = instantiate(HostnameVerifier.class, sslhostnameverifier, info, false, null);
} catch (Exception e) {
throw new PSQLException(
GT.tr("The HostnameVerifier class provided {0} could not be instantiated.",
sslhostnameverifier),
PSQLState.CONNECTION_FAILURE, e);
}
}
if (hvn.verify(stream.getHostSpec().getHost(), newConnection.getSession())) {
return;
}
throw new PSQLException(
GT.tr("The hostname {0} could not be verified by hostnameverifier {1}.",
stream.getHostSpec().getHost(), sslhostnameverifier),
PSQLState.CONNECTION_FAILURE);
} | [
"CWE-665"
] | CVE-2022-21724 | HIGH | 7.5 | pgjdbc | verifyPeerName | pgjdbc/src/main/java/org/postgresql/ssl/MakeSSL.java | f4d0ed69c0b3aae8531d83d6af4c57f22312c813 | 1 |
Analyze the following code function for security vulnerabilities | public static long allocateMemory(long size) {
return PlatformDependent0.allocateMemory(size);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: allocateMemory
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 | allocateMemory | common/src/main/java/io/netty/util/internal/PlatformDependent.java | 185f8b2756a36aaa4f973f1a2a025e7d981823f1 | 0 |
Analyze the following code function for security vulnerabilities | public static boolean isValidAudioCaptcha(HttpServletRequest request){
Boolean isResponseCorrect =Boolean.FALSE;
String captchaId = request.getSession().getId();
String audioCaptcha = request.getParameter("audioCaptcha");
if(UtilMethods.isSet(audioCaptcha) && UtilMethods.isSet(captchaId)){
try {
//isResponseCorrect = CaptchaServiceSingleton.getInstance().validateResponseForID(captchaId, audioCaptcha);
SoundCaptchaService soundCaptchaService = (SoundCaptchaService) request.getSession().getAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
isResponseCorrect = soundCaptchaService.validateResponseForID(captchaId, audioCaptcha);
request.getSession().removeAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
} catch (CaptchaServiceException e) {
Logger.error(CaptchaUtil.class, "An error ocurred trying to validate audio captcha", e);
}
}
return isResponseCorrect;
} | Vulnerability Classification:
- CWE: CWE-254, CWE-264
- CVE: CVE-2016-8600
- Severity: MEDIUM
- CVSS Score: 5.0
Description: #9330: Remove attribute after getting the info from session
Function: isValidAudioCaptcha
File: src/com/dotmarketing/util/CaptchaUtil.java
Repository: dotCMS/core
Fixed Code:
public static boolean isValidAudioCaptcha(HttpServletRequest request){
HttpSession session = request.getSession();
Captcha captcha = (Captcha) session.getAttribute(Captcha.NAME);
String captchaSession=captcha!=null ? captcha.getAnswer() : null;
Boolean isResponseCorrect = Boolean.FALSE;
String captchaId = request.getSession().getId();
String audioCaptcha = request.getParameter("captcha");
if(UtilMethods.isSet(audioCaptcha) && UtilMethods.isSet(captchaSession) && audioCaptcha.equals(captchaSession)){
isResponseCorrect = Boolean.TRUE;
session.removeAttribute(Captcha.NAME);
}else if(UtilMethods.isSet(audioCaptcha) && UtilMethods.isSet(captchaId)){
SoundCaptchaService soundCaptchaService = (SoundCaptchaService)session.getAttribute(WebKeys.SESSION_JCAPTCHA_SOUND_SERVICE);
try {
isResponseCorrect = soundCaptchaService.validateResponseForID(captchaId, audioCaptcha);
} catch (CaptchaServiceException e) {
Logger.error(CaptchaUtil.class, "An error ocurred trying to validate audio captcha", e);
}
}
return isResponseCorrect;
} | [
"CWE-254",
"CWE-264"
] | CVE-2016-8600 | MEDIUM | 5 | dotCMS/core | isValidAudioCaptcha | src/com/dotmarketing/util/CaptchaUtil.java | cb84b130065c9eed1d1df9e4770ffa5d4bd30569 | 1 |
Analyze the following code function for security vulnerabilities | public boolean renameFile (Contentlet fileAssetCont, String newName, User user, boolean respectFrontendRoles) throws DotStateException, DotDataException, DotSecurityException, IOException {
boolean isfileAssetContLive = false;
Identifier id = APILocator.getIdentifierAPI().find(fileAssetCont);
if(id!=null && InodeUtils.isSet(id.getId())){
Host host = APILocator.getHostAPI().find(id.getHostId(), user, respectFrontendRoles);
Folder folder = APILocator.getFolderAPI().findFolderByPath(id.getParentPath(), host, user, respectFrontendRoles);
FileAsset fa = fromContentlet(fileAssetCont);
String ext = fa.getExtension();
if(!fileNameExists(host, folder, newName+ "." +ext, id.getId())){
if(fa.isLive()) {
isfileAssetContLive = true;
}
File oldFile = fileAssetCont.getBinary(BINARY_FIELD);
File newFile = new File(oldFile.getPath().substring(0,oldFile.getPath().indexOf(oldFile.getName()))+newName+"."+ext);
try {
FileUtils.copyFile(oldFile, newFile);
fileAssetCont.setInode(null);
fileAssetCont.setFolder(folder.getInode());
fileAssetCont.setBinary(BINARY_FIELD, newFile);
final String newFileName=newName+"."+ext;
fileAssetCont.setStringProperty(FileAssetAPI.TITLE_FIELD, newFileName);
fileAssetCont.setStringProperty(FileAssetAPI.FILE_NAME_FIELD, newFileName);
fileAssetCont= APILocator.getContentletAPI().checkin(fileAssetCont, user, respectFrontendRoles);
if(isfileAssetContLive) {
APILocator.getVersionableAPI().setLive(fileAssetCont);
}
CacheLocator.getNavToolCache().removeNav(folder.getHostId(), folder.getInode());
CacheLocator.getIdentifierCache().removeFromCacheByVersionable(fileAssetCont);
} catch (Exception e) {
Logger.error(this, "Unable to rename file asset to "
+ newName + " for asset " + id.getId(), e);
throw e;
} finally {
if (newFile != null) {
FileUtils.deleteQuietly(newFile);
}
}
return true;
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renameFile
File: dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java
Repository: dotCMS/core
The code follows secure coding practices. | [
"CWE-434"
] | CVE-2017-11466 | HIGH | 9 | dotCMS/core | renameFile | dotCMS/src/main/java/com/dotmarketing/portlets/fileassets/business/FileAssetAPIImpl.java | ab2bb2e00b841d131b8734227f9106e3ac31bb99 | 0 |
Analyze the following code function for security vulnerabilities | @TestApi
public static @NonNull ActivityOptions makeCustomAnimation(@NonNull Context context,
int enterResId, int exitResId, int backgroundColor, @Nullable Handler handler,
@Nullable OnAnimationStartedListener startedListener,
@Nullable OnAnimationFinishedListener finishedListener) {
ActivityOptions opts = makeCustomAnimation(context, enterResId, exitResId, backgroundColor,
handler, startedListener);
opts.setOnAnimationFinishedListener(handler, finishedListener);
return opts;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeCustomAnimation
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-20918 | CRITICAL | 9.8 | android | makeCustomAnimation | core/java/android/app/ActivityOptions.java | 51051de4eb40bb502db448084a83fd6cbfb7d3cf | 0 |
Analyze the following code function for security vulnerabilities | public static boolean isExternalMediaDirectory(@NonNull String path) {
return isExternalMediaDirectory(path, PROP_CROSS_USER_ROOT);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isExternalMediaDirectory
File: src/com/android/providers/media/util/FileUtils.java
Repository: android
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2023-35670 | HIGH | 7.8 | android | isExternalMediaDirectory | src/com/android/providers/media/util/FileUtils.java | db3c69afcb0a45c8aa2f333fcde36217889899fe | 0 |
Analyze the following code function for security vulnerabilities | public String getWebhookUrl() {
return webhookUrl;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWebhookUrl
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices. | [
"CWE-94"
] | CVE-2022-46166 | CRITICAL | 9.8 | codecentric/spring-boot-admin | getWebhookUrl | spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java | c14c3ec12533f71f84de9ce3ce5ceb7991975f75 | 0 |
Analyze the following code function for security vulnerabilities | private void performPolicyVersionUpgrade() {
PolicyVersionUpgrader upgrader = new PolicyVersionUpgrader(
new DpmsUpgradeDataProvider(), mPathProvider);
upgrader.upgradePolicy(DPMS_VERSION);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: performPolicyVersionUpgrade
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 | performPolicyVersionUpgrade | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | final void addObject(CharSequence name, Object... values) {
final AsciiString normalizedName = normalizeName(name);
requireNonNull(values, "values");
for (Object v : values) {
requireNonNullElement(values, v);
addObject(normalizedName, v);
}
} | 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: addObject
File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
Repository: line/armeria
Fixed Code:
final void addObject(CharSequence name, Object... values) {
final AsciiString normalizedName = HttpHeaderNames.of(name);
requireNonNull(values, "values");
for (Object v : values) {
requireNonNullElement(values, v);
addObject(normalizedName, v);
}
} | [
"CWE-74"
] | CVE-2019-16771 | MEDIUM | 5 | line/armeria | addObject | core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java | b597f7a865a527a84ee3d6937075cfbb4470ed20 | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void resetViews() {
mIsLaunchTransitionFinished = false;
mBlockTouches = false;
mUnlockIconActive = false;
if (!mLaunchingAffordance) {
mAffordanceHelper.reset(false);
mLastCameraLaunchSource = KeyguardBottomAreaView.CAMERA_LAUNCH_SOURCE_AFFORDANCE;
}
closeQs();
mStatusBar.closeAndSaveGuts(true /* leavebehind */, true /* force */,
true /* controls */, -1 /* x */, -1 /* y */, true /* resetMenu */);
mNotificationStackScroller.setOverScrollAmount(0f, true /* onTop */, false /* animate */,
true /* cancelAnimators */);
mNotificationStackScroller.resetScrollPosition();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetViews
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2017-0822 | HIGH | 7.5 | android | resetViews | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | public SortedMap<String, Entry> getEntries() {
return entries;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEntries
File: src/main/java/com/gitblit/StoredUserConfig.java
Repository: gitblit-org/gitblit
The code follows secure coding practices. | [
"CWE-269"
] | CVE-2022-31267 | HIGH | 7.5 | gitblit-org/gitblit | getEntries | src/main/java/com/gitblit/StoredUserConfig.java | 9b4afad6f4be212474809533ec2c280cce86501a | 0 |
Analyze the following code function for security vulnerabilities | private void sendDirectoryListing(String dir, RoutingContext context) {
FileSystem fileSystem = context.vertx().fileSystem();
HttpServerRequest request = context.request();
fileSystem.readDir(dir, asyncResult -> {
if (asyncResult.failed()) {
context.fail(asyncResult.cause());
} else {
String accept = request.headers().get("accept");
if (accept == null) {
accept = "text/plain";
}
if (accept.contains("html")) {
String normalizedDir = context.normalisedPath();
if (!normalizedDir.endsWith("/")) {
normalizedDir += "/";
}
String file;
StringBuilder files = new StringBuilder("<ul id=\"files\">");
List<String> list = asyncResult.result();
Collections.sort(list);
for (String s : list) {
file = s.substring(s.lastIndexOf(File.separatorChar) + 1);
// skip dot files
if (!includeHidden && file.charAt(0) == '.') {
continue;
}
files.append("<li><a href=\"");
files.append(normalizedDir);
files.append(file);
files.append("\" title=\"");
files.append(file);
files.append("\">");
files.append(file);
files.append("</a></li>");
}
files.append("</ul>");
// link to parent dir
int slashPos = 0;
for (int i = normalizedDir.length() - 2; i > 0; i--) {
if (normalizedDir.charAt(i) == '/') {
slashPos = i;
break;
}
}
String parent = "<a href=\"" + normalizedDir.substring(0, slashPos + 1) + "\">..</a>";
request.response().putHeader("content-type", "text/html");
request.response().end(
directoryTemplate(context.vertx()).replace("{directory}", normalizedDir)
.replace("{parent}", parent)
.replace("{files}", files.toString()));
} else if (accept.contains("json")) {
String file;
JsonArray json = new JsonArray();
for (String s : asyncResult.result()) {
file = s.substring(s.lastIndexOf(File.separatorChar) + 1);
// skip dot files
if (!includeHidden && file.charAt(0) == '.') {
continue;
}
json.add(file);
}
request.response().putHeader("content-type", "application/json");
request.response().end(json.encode());
} else {
String file;
StringBuilder buffer = new StringBuilder();
for (String s : asyncResult.result()) {
file = s.substring(s.lastIndexOf(File.separatorChar) + 1);
// skip dot files
if (!includeHidden && file.charAt(0) == '.') {
continue;
}
buffer.append(file);
buffer.append('\n');
}
request.response().putHeader("content-type", "text/plain");
request.response().end(buffer.toString());
}
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendDirectoryListing
File: vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java
Repository: vert-x3/vertx-web
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2018-12542 | HIGH | 7.5 | vert-x3/vertx-web | sendDirectoryListing | vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java | 57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b | 0 |
Analyze the following code function for security vulnerabilities | public void killUid(int appId, int userId, String reason) throws RemoteException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killUid
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | killUid | core/java/android/app/IActivityManager.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | public DateFormat getDateFormat() {
return dateFormat;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDateFormat
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | getDateFormat | samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | public Builder setJsonFactory(JsonFactory jsonFactory) {
this.jsonFactory = Preconditions.checkNotNull(jsonFactory);
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setJsonFactory
File: google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Repository: googleapis/google-oauth-java-client
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2020-7692 | MEDIUM | 6.4 | googleapis/google-oauth-java-client | setJsonFactory | google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java | 13433cd7dd06267fc261f0b1d4764f8e3432c824 | 0 |
Analyze the following code function for security vulnerabilities | public void setGlobalRights(String groups, String users, String rights, boolean enabled)
{
EntityReference xwikiPreferencesReference = new EntityReference("XWikiPreferences", EntityType.DOCUMENT,
new EntityReference("XWiki", EntityType.SPACE));
setRights(xwikiPreferencesReference, "XWiki.XWikiGlobalRights", groups, users, rights, enabled);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setGlobalRights
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2023-35166 | HIGH | 8.8 | xwiki/xwiki-platform | setGlobalRights | xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java | 98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263 | 0 |
Analyze the following code function for security vulnerabilities | private void handleDiscoveryNodeFilter(Node node, BeanDefinitionBuilder discoveryConfigBuilder) {
NamedNodeMap attributes = node.getAttributes();
Node classNameNode = attributes.getNamedItem("class-name");
String className = getTextContent(classNameNode).trim();
Node implNode = attributes.getNamedItem("implementation");
String implementation = getTextContent(implNode).trim();
isTrue(!className.isEmpty() || !implementation.isEmpty(),
"One of 'class-name' or 'implementation' attributes is required to create NodeFilter!");
discoveryConfigBuilder.addPropertyValue("nodeFilterClass", className);
if (!implementation.isEmpty()) {
discoveryConfigBuilder.addPropertyReference("nodeFilter", implementation);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleDiscoveryNodeFilter
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | handleDiscoveryNodeFilter | hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | private void deleteNamespace(String namespace, TaskLogger jobLogger) {
try {
Commandline cmd = newKubeCtl();
cmd.timeout(NAMESPACE_DELETION_TIMEOUT).addArgs("delete", "namespace", namespace);
cmd.execute(new LineConsumer() {
@Override
public void consume(String line) {
logger.debug(line);
}
}, new LineConsumer() {
@Override
public void consume(String line) {
jobLogger.error("Kubernetes: " + line);
}
}).checkReturnCode();
} catch (Exception e) {
if (ExceptionUtils.find(e, TimeoutException.class) == null)
throw ExceptionUtils.unchecked(e);
else
jobLogger.error("Timed out deleting namespace");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteNamespace
File: server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-610"
] | CVE-2022-39206 | CRITICAL | 9.9 | theonedev/onedev | deleteNamespace | server-plugin/server-plugin-executor-kubernetes/src/main/java/io/onedev/server/plugin/executor/kubernetes/KubernetesExecutor.java | 0052047a5b5095ac6a6b4a73a522d0272fec3a22 | 0 |
Analyze the following code function for security vulnerabilities | public final void enterSafeMode() {
synchronized(this) {
// It only makes sense to do this before the system is ready
// and started launching other packages.
if (!mSystemReady) {
try {
AppGlobals.getPackageManager().enterSafeMode();
} catch (RemoteException e) {
}
}
mSafeMode = true;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enterSafeMode
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 | enterSafeMode | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onStart() {
super.onStart();
try {
cache.evictAll();
} catch (IOException e) {
Log.e(TAG, "Failed to evict cache");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onStart
File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
Repository: nextcloud/talk-android
The code follows secure coding practices. | [
"CWE-732",
"CWE-200"
] | CVE-2022-41926 | MEDIUM | 5.5 | nextcloud/talk-android | onStart | app/src/main/java/com/nextcloud/talk/activities/CallActivity.java | bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String ssid = intent.getStringExtra(EXTRA_PENDING_CERT_SSID);
// This is an onGoing notification, dismiss it once an action is sent.
dismissDialogAndNotification();
Log.d(TAG, "Received CertNotification: ssid=" + ssid + ", action=" + action);
if (TextUtils.equals(action, ACTION_CERT_NOTIF_TAP)) {
askForUserApprovalForCaCertificate();
} else if (TextUtils.equals(action, ACTION_CERT_NOTIF_ACCEPT)) {
handleAccept(ssid);
} else if (TextUtils.equals(action, ACTION_CERT_NOTIF_REJECT)) {
handleReject(ssid);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReceive
File: service/java/com/android/server/wifi/InsecureEapNetworkHandler.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21242 | CRITICAL | 9.8 | android | onReceive | service/java/com/android/server/wifi/InsecureEapNetworkHandler.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void verifyStates() {
super.verifyStates();
final boolean[] failed = new boolean[1];
final ShortcutService s = mShortcutUser.mService;
final ArrayMap<ComponentName, ArrayList<ShortcutInfo>> all =
sortShortcutsToActivities();
// Make sure each activity won't have more than max shortcuts.
for (int outer = all.size() - 1; outer >= 0; outer--) {
final ArrayList<ShortcutInfo> list = all.valueAt(outer);
if (list.size() > mShortcutUser.mService.getMaxActivityShortcuts()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": activity " + all.keyAt(outer)
+ " has " + all.valueAt(outer).size() + " shortcuts.");
}
// Sort by rank.
Collections.sort(list, (a, b) -> Integer.compare(a.getRank(), b.getRank()));
// Split into two arrays for each kind.
final ArrayList<ShortcutInfo> dynamicList = new ArrayList<>(list);
dynamicList.removeIf((si) -> !si.isDynamic());
final ArrayList<ShortcutInfo> manifestList = new ArrayList<>(list);
manifestList.removeIf((si) -> !si.isManifestShortcut());
verifyRanksSequential(dynamicList);
verifyRanksSequential(manifestList);
}
// Verify each shortcut's status.
forEachShortcut(si -> {
if (!(si.isDeclaredInManifest() || si.isDynamic() || si.isPinned() || si.isCached())) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " is not manifest, dynamic or pinned.");
}
if (si.isDeclaredInManifest() && si.isDynamic()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " is both dynamic and manifest at the same time.");
}
if (si.getActivity() == null && !si.isFloating()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has null activity, but not floating.");
}
if ((si.isDynamic() || si.isManifestShortcut()) && !si.isEnabled()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " is not floating, but is disabled.");
}
if (si.isFloating() && si.getRank() != 0) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " is floating, but has rank=" + si.getRank());
}
if (si.getIcon() != null) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " still has an icon");
}
if (si.hasAdaptiveBitmap() && !(si.hasIconFile() || si.hasIconUri())) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has adaptive bitmap but was not saved to a file nor has icon uri.");
}
if (si.hasIconFile() && si.hasIconResource()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has both resource and bitmap icons");
}
if (si.hasIconFile() && si.hasIconUri()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has both url and bitmap icons");
}
if (si.hasIconUri() && si.hasIconResource()) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has both url and resource icons");
}
if (si.isEnabled()
!= (si.getDisabledReason() == ShortcutInfo.DISABLED_REASON_NOT_DISABLED)) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " isEnabled() and getDisabledReason() disagree: "
+ si.isEnabled() + " vs " + si.getDisabledReason());
}
if ((si.getDisabledReason() == ShortcutInfo.DISABLED_REASON_VERSION_LOWER)
&& (getPackageInfo().getBackupSourceVersionCode()
== ShortcutInfo.VERSION_CODE_UNKNOWN)) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " RESTORED_VERSION_LOWER with no backup source version code.");
}
if (s.isDummyMainActivity(si.getActivity())) {
failed[0] = true;
Log.e(TAG_VERIFY, "Package " + getPackageName() + ": shortcut " + si.getId()
+ " has a dummy target activity");
}
});
if (failed[0]) {
throw new IllegalStateException("See logcat for errors");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyStates
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40075 | MEDIUM | 5.5 | android | verifyStates | services/core/java/com/android/server/pm/ShortcutPackage.java | ae768fbb9975fdab267f525831cb52f485ab0ecc | 0 |
Analyze the following code function for security vulnerabilities | public SerializationConfig addPortableFactoryClass(int factoryId, String portableFactoryClass) {
getPortableFactoryClasses().put(factoryId, portableFactoryClass);
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addPortableFactoryClass
File: hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | addPortableFactoryClass | hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Bundle getApplicationRestrictions(ComponentName who, String callerPackage,
String packageName) {
final CallerIdentity caller = getCallerIdentity(who, callerPackage);
Preconditions.checkCallAuthorization((caller.hasAdminComponent()
&& (isProfileOwner(caller) || isDefaultDeviceOwner(caller)))
|| (caller.hasPackage() && isCallerDelegate(caller, DELEGATION_APP_RESTRICTIONS)));
return mInjector.binderWithCleanCallingIdentity(() -> {
Bundle bundle = mUserManager.getApplicationRestrictions(packageName,
caller.getUserHandle());
// if no restrictions were saved, mUserManager.getApplicationRestrictions
// returns null, but DPM method should return an empty Bundle as per JavaDoc
return bundle != null ? bundle : Bundle.EMPTY;
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApplicationRestrictions
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 | getApplicationRestrictions | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public void setDeregisterActivitySubtitle(String deregisterActivitySubtitle) {
this.deregisterActivitySubtitle = parser.parseExpression(deregisterActivitySubtitle,
ParserContext.TEMPLATE_EXPRESSION);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDeregisterActivitySubtitle
File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java
Repository: codecentric/spring-boot-admin
The code follows secure coding practices. | [
"CWE-94"
] | CVE-2022-46166 | CRITICAL | 9.8 | codecentric/spring-boot-admin | setDeregisterActivitySubtitle | spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/MicrosoftTeamsNotifier.java | c14c3ec12533f71f84de9ce3ce5ceb7991975f75 | 0 |
Analyze the following code function for security vulnerabilities | @PUT
@Path("wiki")
@Operation(summary = "Attaches an wiki building block", description = "Attaches an wiki building block")
@ApiResponse(responseCode = "200", description = "The course node metadatas", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = CourseNodeVO.class)),
@Content(mediaType = "application/xml", schema = @Schema(implementation = CourseNodeVO.class)) })
@ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient")
@ApiResponse(responseCode = "404", description = "The course or parentNode not found")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response attachWiki(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId,
@QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle,
@QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives,
@QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules,
@QueryParam("wikiResourceableId") Long wikiResourceableId, @Context HttpServletRequest request) {
RepositoryManager rm = RepositoryManager.getInstance();
RepositoryEntry wikiRepoEntry = rm.lookupRepositoryEntry(wikiResourceableId);
if(wikiRepoEntry == null) {
return Response.serverError().status(Status.NOT_FOUND).build();
}
WikiCustomConfig config = new WikiCustomConfig(wikiRepoEntry);
return attach(courseId, parentNodeId, "wiki", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: attachWiki
File: src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-41242 | HIGH | 7.9 | OpenOLAT | attachWiki | src/main/java/org/olat/restapi/repository/course/CourseElementWebService.java | c450df7d7ffe6afde39ebca6da9136f1caa16ec4 | 0 |
Analyze the following code function for security vulnerabilities | public void setChannel(String channel) {
this.channel = channel;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setChannel
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java
Repository: sanluan/PublicCMS
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2020-21333 | LOW | 3.5 | sanluan/PublicCMS | setChannel | publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogOperate.java | b4d5956e65b14347b162424abb197a180229b3db | 0 |
Analyze the following code function for security vulnerabilities | public int startActivityIntentSender(IApplicationThread caller,
IntentSender intent, Intent fillInIntent, String resolvedType,
IBinder resultTo, String resultWho, int requestCode,
int flagsMask, int flagsValues, Bundle options) throws RemoteException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startActivityIntentSender
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | startActivityIntentSender | core/java/android/app/IActivityManager.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public int getPasswordMinimumNonLetter(@Nullable ComponentName admin, int userHandle) {
if (mService != null) {
try {
return mService.getPasswordMinimumNonLetter(admin, userHandle, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return 0;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordMinimumNonLetter
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 | getPasswordMinimumNonLetter | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | protected abstract String getJoinColumnName(); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJoinColumnName
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java
Repository: dhis2/dhis2-core
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2022-24848 | MEDIUM | 6.5 | dhis2/dhis2-core | getJoinColumnName | dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/association/AbstractOrganisationUnitAssociationsQueryBuilder.java | ef04483a9b177d62e48dcf4e498b302a11f95e7d | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String getConditionSQL(Condition condition) {
if (condition instanceof CoreCondition) {
return getCoreConditionSQL((CoreCondition) condition);
}
if (condition instanceof LogicalCondition) {
return getLogicalConditionSQL((LogicalCondition) condition);
}
throw new IllegalArgumentException("Condition type not supported: " + condition);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getConditionSQL
File: dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java
Repository: dashbuilder
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-4999 | HIGH | 7.5 | dashbuilder | getConditionSQL | dashbuilder-backend/dashbuilder-dataset-sql/src/main/java/org/dashbuilder/dataprovider/sql/dialect/DefaultDialect.java | 8574899e3b6455547b534f570b2330ff772e524b | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void revokePostNotificationPermissionWithoutKillForTest(String packageName, int userId) {
mPermissionManagerServiceImpl.revokePostNotificationPermissionWithoutKillForTest(
packageName, userId);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: revokePostNotificationPermissionWithoutKillForTest
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 | revokePostNotificationPermissionWithoutKillForTest | services/core/java/com/android/server/pm/permission/PermissionManagerService.java | c00b7e7dbc1fa30339adef693d02a51254755d7f | 0 |
Analyze the following code function for security vulnerabilities | public Mac getMac() {
return mac;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMac
File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
Repository: apache/mina-sshd
The code follows secure coding practices. | [
"CWE-354"
] | CVE-2023-48795 | MEDIUM | 5.9 | apache/mina-sshd | getMac | sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java | 6b0fd46f64bcb75eeeee31d65f10242660aad7c1 | 0 |
Analyze the following code function for security vulnerabilities | boolean shouldBackupApp(String packageName, int userId) {
return isApplicationFlagSet(packageName, userId, ApplicationInfo.FLAG_ALLOW_BACKUP);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldBackupApp
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 | shouldBackupApp | services/core/java/com/android/server/pm/ShortcutService.java | 96e0524c48c6e58af7d15a2caf35082186fc8de2 | 0 |
Analyze the following code function for security vulnerabilities | private void blockNativeFocusAll(boolean block) {
synchronized (this.nativePeers) {
final int size = this.nativePeers.size();
for (int i = 0; i < size; i++) {
AndroidImplementation.AndroidPeer next = (AndroidImplementation.AndroidPeer) this.nativePeers.get(i);
next.blockNativeFocus(block);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: blockNativeFocusAll
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-4903 | MEDIUM | 5.1 | codenameone/CodenameOne | blockNativeFocusAll | Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public XMLBuilder2 element(String name) {
String namespaceURI = super.lookupNamespaceURIImpl(name);
return element(name, namespaceURI);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: element
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2014-125087 | MEDIUM | 5.2 | jmurty/java-xmlbuilder | element | src/main/java/com/jamesmurty/utils/XMLBuilder2.java | e6fddca201790abab4f2c274341c0bb8835c3e73 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.