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
@SuppressWarnings("unchecked") @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { NettyHttpRequest nettyHttpRequest = NettyHttpRequest.remove(ctx); if (nettyHttpRequest == null) { if (LOG.isErrorEnabled()) { LOG.error("Micronaut Server Error - No request state present. Cause: " + cause.getMessage(), cause); } ctx.writeAndFlush(new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.INTERNAL_SERVER_ERROR)); return; } exceptionCaughtInternal(ctx, cause, nettyHttpRequest, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: exceptionCaught File: http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java Repository: micronaut-projects/micronaut-core The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-21700
MEDIUM
5
micronaut-projects/micronaut-core
exceptionCaught
http-server-netty/src/main/java/io/micronaut/http/server/netty/RoutingInBoundHandler.java
b8ec32c311689667c69ae7d9f9c3b3a8abc96fe3
0
Analyze the following code function for security vulnerabilities
public <T> T get(Object resourceURI, EntityReference reference) throws Exception { return get(resourceURI, reference, true); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get 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
get
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
public String getFullAppId() { return fullAppId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFullAppId File: flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-200" ]
CVE-2023-25499
MEDIUM
6.5
vaadin/flow
getFullAppId
flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java
428cc97eaa9c89b1124e39f0089bbb741b6b21cc
0
Analyze the following code function for security vulnerabilities
private boolean isUninitializedServlet(VaadinServlet servlet) { return servlet.getServletConfig() != null && servlet.getService() == null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUninitializedServlet File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java Repository: vaadin/osgi The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-31407
MEDIUM
5
vaadin/osgi
isUninitializedServlet
flow-osgi/src/main/java/com/vaadin/flow/osgi/support/AppConfigFactoryTracker.java
3e17674c2e3f88b6e682872c42b7d0ad7d9c4ad8
0
Analyze the following code function for security vulnerabilities
@Deprecated public String getAuthor() { return userReferenceToString(getAuthorReference()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAuthor File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
getAuthor
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
protected void internalDeleteTopic(boolean authoritative, boolean force, boolean deleteSchema) { if (force) { internalDeleteTopicForcefully(authoritative, deleteSchema); } else { internalDeleteTopic(authoritative, deleteSchema); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalDeleteTopic File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalDeleteTopic
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
@Nullable ComponentName injectGetDefaultMainActivity(@NonNull String packageName, int userId) { final long start = getStatStartTime(); try { final List<ResolveInfo> resolved = queryActivities(getMainActivityIntent(), packageName, null, userId); return resolved.size() == 0 ? null : resolved.get(0).activityInfo.getComponentName(); } finally { logDurationStat(Stats.GET_LAUNCHER_ACTIVITY, start); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: injectGetDefaultMainActivity 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
injectGetDefaultMainActivity
services/core/java/com/android/server/pm/ShortcutService.java
96e0524c48c6e58af7d15a2caf35082186fc8de2
0
Analyze the following code function for security vulnerabilities
void setSingleQuotedArgumentEscaped( boolean singleQuotedArgumentEscaped ) { this.singleQuotedArgumentEscaped = singleQuotedArgumentEscaped; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSingleQuotedArgumentEscaped File: src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java Repository: apache/maven-shared-utils The code follows secure coding practices.
[ "CWE-116" ]
CVE-2022-29599
HIGH
7.5
apache/maven-shared-utils
setSingleQuotedArgumentEscaped
src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
2735facbbbc2e13546328cb02dbb401b3776eea3
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("deprecation") protected void populateDeprecatedCommonHelperUtilities( Map<String, Object> variables) { try { variables.put( "dateFormats", FastDateFormatFactoryUtil.getFastDateFormatFactory()); } catch (SecurityException se) { _log.error(se, se); } try { variables.put( "imageToken", WebServerServletTokenUtil.getWebServerServletToken()); } catch (SecurityException se) { _log.error(se, se); } try { variables.put( "locationPermission", OrganizationPermissionUtil.getOrganizationPermission()); } catch (SecurityException se) { _log.error(se, se); } try { com.liferay.portal.kernel.util.Randomizer_IW randomizer = com.liferay.portal.kernel.util.Randomizer_IW.getInstance(); variables.put("randomizer", randomizer.getWrappedInstance()); } catch (SecurityException se) { _log.error(se, se); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: populateDeprecatedCommonHelperUtilities File: portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java Repository: samuelkong/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2963
MEDIUM
4.3
samuelkong/liferay-portal
populateDeprecatedCommonHelperUtilities
portal-impl/src/com/liferay/portal/template/TemplateContextHelper.java
5db1f7622e8e2c9a559ef0145a0f04c5854a1e8b
0
Analyze the following code function for security vulnerabilities
void handlePreDhcpSetup() { if (!mWifiGlobals.isBluetoothConnected()) { /* * There are problems setting the Wi-Fi driver's power * mode to active when bluetooth coexistence mode is * enabled or sense. * <p> * We set Wi-Fi to active mode when * obtaining an IP address because we've found * compatibility issues with some routers with low power * mode. * <p> * In order for this active power mode to properly be set, * we disable coexistence mode until we're done with * obtaining an IP address. One exception is if we * are currently connected to a headset, since disabling * coexistence would interrupt that connection. */ // Disable the coexistence mode mWifiNative.setBluetoothCoexistenceMode( mInterfaceName, WifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED); } // Disable power save and suspend optimizations during DHCP // Note: The order here is important for now. Brcm driver changes // power settings when we control suspend mode optimizations. // TODO: Remove this comment when the driver is fixed. setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, false); setPowerSave(POWER_SAVE_CLIENT_DHCP, false); // Update link layer stats getWifiLinkLayerStats(); if (mWifiP2pConnection.isConnected()) { // P2P discovery breaks DHCP, so shut it down in order to get through this. // Once P2P service receives this message and processes it accordingly, it is supposed // to send arg2 (i.e. CMD_PRE_DHCP_ACTION_COMPLETE) in a new Message.what back to // ClientModeImpl so that we can continue. // TODO(b/159060934): Need to ensure that CMD_PRE_DHCP_ACTION_COMPLETE is sent back to // the ClientModeImpl instance that originally sent it. Right now it is sent back to // all ClientModeImpl instances by WifiP2pConnection. mWifiP2pConnection.sendMessage( WifiP2pServiceImpl.BLOCK_DISCOVERY, WifiP2pServiceImpl.ENABLED, CMD_PRE_DHCP_ACTION_COMPLETE); } else { // If the p2p service is not running, we can proceed directly. sendMessage(CMD_PRE_DHCP_ACTION_COMPLETE); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handlePreDhcpSetup File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
handlePreDhcpSetup
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public BrowserRoot onGetRoot( String clientPackageName, int clientUid, Bundle rootHints) { if(TextUtils.equals(clientPackageName, getPackageName())) { return new BrowserRoot(Display.getInstance().getProperty("AppName", "CodenameOne"), null); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onGetRoot File: Ports/Android/src/com/codename1/media/BackgroundAudioService.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onGetRoot
Ports/Android/src/com/codename1/media/BackgroundAudioService.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public int getPasswordMaximumLength(int quality) { PackageManager pm = mContext.getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)) { return 0; } return MAX_PASSWORD_LENGTH; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPasswordMaximumLength 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
getPasswordMaximumLength
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public int startUserInBackground(ComponentName who, UserHandle userHandle) { Objects.requireNonNull(who, "ComponentName is null"); Objects.requireNonNull(userHandle, "UserHandle is null"); final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)); checkCanExecuteOrThrowUnsafe(DevicePolicyManager.OPERATION_START_USER_IN_BACKGROUND); final int userId = userHandle.getIdentifier(); if (isManagedProfile(userId)) { Slogf.w(LOG_TAG, "Managed profile cannot be started in background"); return UserManager.USER_OPERATION_ERROR_MANAGED_PROFILE; } final long id = mInjector.binderClearCallingIdentity(); try { if (!mInjector.getActivityManagerInternal().canStartMoreUsers()) { Slogf.w(LOG_TAG, "Cannot start user %d, too many users in background", userId); return UserManager.USER_OPERATION_ERROR_MAX_RUNNING_USERS; } Slogf.i(LOG_TAG, "Starting user %d in background", userId); if (mInjector.getIActivityManager().startUserInBackground(userId)) { return UserManager.USER_OPERATION_SUCCESS; } else { Slogf.w(LOG_TAG, "failed to start user %d in background", userId); return UserManager.USER_OPERATION_ERROR_UNKNOWN; } } catch (RemoteException e) { // Same process, should not happen. return UserManager.USER_OPERATION_ERROR_UNKNOWN; } finally { mInjector.binderRestoreCallingIdentity(id); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startUserInBackground 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
startUserInBackground
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public String getBaseURL() { String prefix; if (RestTestUtils.urlPrefix != null) { prefix = RestTestUtils.urlPrefix; } else { prefix = this.testUtils.getBaseURL(); } if (!prefix.endsWith("/")) { prefix = prefix + "/"; } return prefix + "rest"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getBaseURL 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
getBaseURL
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
public static String printThrowable(Throwable t) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); return sw.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: printThrowable File: core/src/main/java/hudson/Functions.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-310" ]
CVE-2014-2061
MEDIUM
5
jenkinsci/jenkins
printThrowable
core/src/main/java/hudson/Functions.java
bf539198564a1108b7b71a973bf7de963a6213ef
0
Analyze the following code function for security vulnerabilities
private @HiddenApiEnforcementPolicy int getValidEnforcementPolicy(String settingsKey) { int policy = Settings.Global.getInt(mContext.getContentResolver(), settingsKey, ApplicationInfo.HIDDEN_API_ENFORCEMENT_DEFAULT); if (ApplicationInfo.isValidHiddenApiEnforcementPolicy(policy)) { return policy; } else { return ApplicationInfo.HIDDEN_API_ENFORCEMENT_DEFAULT; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getValidEnforcementPolicy 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
getValidEnforcementPolicy
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void resumeAppSwitches() { if (checkCallingPermission(android.Manifest.permission.STOP_APP_SWITCHES) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.STOP_APP_SWITCHES); } synchronized(this) { // Note that we don't execute any pending app switches... we will // let those wait until either the timeout, or the next start // activity request. mAppSwitchesAllowedTime = 0; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resumeAppSwitches File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
resumeAppSwitches
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
void bind() { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "initiating bind to authenticator type " + mAccountType); } if (!bindToAuthenticator(mAccountType)) { Log.d(TAG, "bind attempt failed for " + toDebugString()); onError(AccountManager.ERROR_CODE_REMOTE_EXCEPTION, "bind failure"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: bind File: services/core/java/com/android/server/accounts/AccountManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-502" ]
CVE-2023-45777
HIGH
7.8
android
bind
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
private HttpConversationContext httpConversationContext() { if (httpConversationContextCache == null) { this.httpConversationContextCache = beanManager.instance().select(HttpConversationContext.class).get(); } return httpConversationContextCache; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: httpConversationContext File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java Repository: weld/core The code follows secure coding practices.
[ "CWE-362" ]
CVE-2014-8122
MEDIUM
4.3
weld/core
httpConversationContext
impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
8e413202fa1af08c09c580f444e4fd16874f9c65
0
Analyze the following code function for security vulnerabilities
public String getServletPath(String wikiName) { return this.xwiki.getServletPath(wikiName, this.context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServletPath 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
getServletPath
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
f471f2a392aeeb9e51d59fdfe1d76fccf532523f
0
Analyze the following code function for security vulnerabilities
public <T> void get(String table, T entity, String[] fields, boolean returnCount, boolean returnIdField, int offset, int limit, Handler<AsyncResult<Results<T>>> replyHandler) { boolean setId = true; if(returnIdField == false){ //if no id fields then cannot setId from extrnal column into json object setId = false; } StringBuilder sb = new StringBuilder(); if(offset != -1){ sb.append(SPACE).append(new Offset(offset).toString()).append(SPACE); } if(limit != -1){ sb.append(SPACE).append(new Limit(limit).toString()).append(SPACE); } String pojo = null; try { pojo = pojo2json(entity); } catch (Exception e) { replyHandler.handle(Future.failedFuture(e)); return; } String fieldsStr = Arrays.toString(fields); Class<T> clazz = (Class<T>) entity.getClass(); get(table, clazz, fieldsStr.substring(1, fieldsStr.length()-1), WHERE + DEFAULT_JSONB_FIELD_NAME + "@>'" + pojo + "' "+sb.toString(), returnCount, returnIdField, setId, replyHandler); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: get File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java Repository: folio-org/raml-module-builder The code follows secure coding practices.
[ "CWE-89" ]
CVE-2019-15534
HIGH
7.5
folio-org/raml-module-builder
get
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public static boolean defaultFollowRedirect() { return Boolean.getBoolean(ASYNC_CLIENT + "followRedirect"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultFollowRedirect File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java Repository: AsyncHttpClient/async-http-client The code follows secure coding practices.
[ "CWE-345" ]
CVE-2013-7398
MEDIUM
4.3
AsyncHttpClient/async-http-client
defaultFollowRedirect
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
a894583921c11c3b01f160ada36a8bb9d5158e96
0
Analyze the following code function for security vulnerabilities
public void setUnsecurePort(String unsecurePort) { this.unsecurePort = unsecurePort; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUnsecurePort File: base/server/src/main/java/com/netscape/cmscore/apps/ServerXml.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setUnsecurePort
base/server/src/main/java/com/netscape/cmscore/apps/ServerXml.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
protected CompletableFuture<Void> internalSetInactiveTopicPolicies(InactiveTopicPolicies inactiveTopicPolicies) { return getTopicPoliciesAsyncWithRetry(topicName) .thenCompose(op -> { TopicPolicies topicPolicies = op.orElseGet(TopicPolicies::new); topicPolicies.setInactiveTopicPolicies(inactiveTopicPolicies); return pulsar().getTopicPoliciesService().updateTopicPoliciesAsync(topicName, topicPolicies); }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: internalSetInactiveTopicPolicies File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java Repository: apache/pulsar The code follows secure coding practices.
[ "CWE-863" ]
CVE-2021-41571
MEDIUM
4
apache/pulsar
internalSetInactiveTopicPolicies
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
0
Analyze the following code function for security vulnerabilities
void phoneAccountSelected(Call call, PhoneAccountHandle account, boolean setDefault) { if (!mCalls.contains(call)) { Log.i(this, "Attempted to add account to unknown call %s", call); } else { // TODO: There is an odd race condition here. Since NewOutgoingCallIntentBroadcaster and // the PRE_DIAL_WAIT sequence run in parallel, if the user selects an account before the // NEW_OUTGOING_CALL sequence finishes, we'll start the call immediately without // respecting a rewritten number or a canceled number. This is unlikely since // NEW_OUTGOING_CALL sequence, in practice, runs a lot faster than the user selecting // a phone account from the in-call UI. call.setTargetPhoneAccount(account); // Note: emergency calls never go through account selection dialog so they never // arrive here. if (makeRoomForOutgoingCall(call, false /* isEmergencyCall */)) { call.startCreateConnection(mPhoneAccountRegistrar); } else { call.disconnect(); } if (setDefault) { mPhoneAccountRegistrar.setUserSelectedOutgoingPhoneAccount(account); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: phoneAccountSelected 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
phoneAccountSelected
src/com/android/server/telecom/CallsManager.java
a06c9a4aef69ae27b951523cf72bf72412bf48fa
0
Analyze the following code function for security vulnerabilities
public boolean inputDispatchingTimedOut(final ProcessRecord proc, final ActivityRecord activity, final ActivityRecord parent, final boolean aboveSystem, String reason) { if (checkCallingPermission(android.Manifest.permission.FILTER_EVENTS) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Requires permission " + android.Manifest.permission.FILTER_EVENTS); } final String annotation; if (reason == null) { annotation = "Input dispatching timed out"; } else { annotation = "Input dispatching timed out (" + reason + ")"; } if (proc != null) { synchronized (this) { if (proc.debugging) { return false; } if (proc.instr != null) { Bundle info = new Bundle(); info.putString("shortMsg", "keyDispatchingTimedOut"); info.putString("longMsg", annotation); finishInstrumentationLocked(proc, Activity.RESULT_CANCELED, info); return true; } } mHandler.post(new Runnable() { @Override public void run() { mAppErrors.appNotResponding(proc, activity, parent, aboveSystem, annotation); } }); } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: inputDispatchingTimedOut File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
inputDispatchingTimedOut
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public InputStream createInputStream(ByteBuffer existingData) { if (existingData == null) { return createInputStream(); } return new VertxInputStream(context, getDeployment().getRuntimeConfiguration().readTimeout().toMillis(), Unpooled.wrappedBuffer(existingData), this); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createInputStream File: independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java Repository: quarkusio/quarkus The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-0981
MEDIUM
6.5
quarkusio/quarkus
createInputStream
independent-projects/resteasy-reactive/server/vertx/src/main/java/org/jboss/resteasy/reactive/server/vertx/VertxResteasyReactiveRequestContext.java
96c64fd8f09c02a497e2db366c64dd9196582442
0
Analyze the following code function for security vulnerabilities
private static void retryConnection(Callable<Boolean> callable, int retryCount) { try { if (!callable.call()) { throw new Exception(); } else if (retryCount > 0) { logger.info("Connected to Para backend."); } } catch (Exception e) { int maxRetries = CONF.paraConnectionRetryAttempts(); int retryInterval = CONF.paraConnectionRetryIntervalSec(); int count = ++retryCount; logger.error("No connection to Para backend. Retrying connection in {}s (attempt {} of {})...", retryInterval, count, maxRetries); if (maxRetries < 0 || retryCount < maxRetries) { Para.asyncExecute(() -> { try { Thread.sleep(retryInterval * 1000L); } catch (InterruptedException ex) { logger.error(null, ex); Thread.currentThread().interrupt(); } retryConnection(callable, count); }); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: retryConnection File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
retryConnection
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
protected String getColumnsForSelectStatement(String whereSQL) { StringBuilder columns = new StringBuilder(); int orderByPos = whereSQL.toLowerCase().indexOf("order by"); if (orderByPos >= 0) { String orderByStatement = whereSQL.substring(orderByPos + "order by".length() + 1); StringTokenizer tokenizer = new StringTokenizer(orderByStatement, ","); while (tokenizer.hasMoreTokens()) { String column = tokenizer.nextToken().trim(); // Remove "desc" or "asc" from the column found column = StringUtils.removeEndIgnoreCase(column, " desc"); column = StringUtils.removeEndIgnoreCase(column, " asc"); columns.append(", ").append(column.trim()); } } return columns.toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getColumnsForSelectStatement File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
getColumnsForSelectStatement
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
private void putTraceLog(Cell cell, String log) { // A1 A2 ... int num = cell.getColumnNo(); StringBuilder name = new StringBuilder(); while (num >= 0) { int remainder = num % 26; name.insert(0, (char) (remainder + 65)); //noinspection IntegerDivisionInFloatingPointContext num = (int) Math.floor(num / 26) - 1; } name.append(cell.getRowNo() + 1); traceLogs.add(name + ":" + log); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: putTraceLog File: src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
putTraceLog
src/main/java/com/rebuild/core/service/dataimport/RecordCheckout.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
void beginBackup() { if (DEBUG_BACKUP_TRACE) { clearBackupTrace(); StringBuilder b = new StringBuilder(256); b.append("beginBackup: ["); for (BackupRequest req : mOriginalQueue) { b.append(' '); b.append(req.packageName); } b.append(" ]"); addBackupTrace(b.toString()); } mAgentBinder = null; mStatus = BackupTransport.TRANSPORT_OK; // Sanity check: if the queue is empty we have no work to do. if (mOriginalQueue.isEmpty()) { Slog.w(TAG, "Backup begun with an empty queue - nothing to do."); addBackupTrace("queue empty at begin"); executeNextState(BackupState.FINAL); return; } // We need to retain the original queue contents in case of transport // failure, but we want a working copy that we can manipulate along // the way. mQueue = (ArrayList<BackupRequest>) mOriginalQueue.clone(); // The app metadata pseudopackage might also be represented in the // backup queue if apps have been added/removed since the last time // we performed a backup. Drop it from the working queue now that // we're committed to evaluating it for backup regardless. for (int i = 0; i < mQueue.size(); i++) { if (PACKAGE_MANAGER_SENTINEL.equals(mQueue.get(i).packageName)) { if (MORE_DEBUG) { Slog.i(TAG, "Metadata in queue; eliding"); } mQueue.remove(i); break; } } if (DEBUG) Slog.v(TAG, "Beginning backup of " + mQueue.size() + " targets"); File pmState = new File(mStateDir, PACKAGE_MANAGER_SENTINEL); try { final String transportName = mTransport.transportDirName(); EventLog.writeEvent(EventLogTags.BACKUP_START, transportName); // If we haven't stored package manager metadata yet, we must init the transport. if (mStatus == BackupTransport.TRANSPORT_OK && pmState.length() <= 0) { Slog.i(TAG, "Initializing (wiping) backup state and transport storage"); addBackupTrace("initializing transport " + transportName); resetBackupState(mStateDir); // Just to make sure. mStatus = mTransport.initializeDevice(); addBackupTrace("transport.initializeDevice() == " + mStatus); if (mStatus == BackupTransport.TRANSPORT_OK) { EventLog.writeEvent(EventLogTags.BACKUP_INITIALIZE); } else { EventLog.writeEvent(EventLogTags.BACKUP_TRANSPORT_FAILURE, "(initialize)"); Slog.e(TAG, "Transport error in initializeDevice()"); } } // The package manager doesn't have a proper <application> etc, but since // it's running here in the system process we can just set up its agent // directly and use a synthetic BackupRequest. We always run this pass // because it's cheap and this way we guarantee that we don't get out of // step even if we're selecting among various transports at run time. if (mStatus == BackupTransport.TRANSPORT_OK) { PackageManagerBackupAgent pmAgent = new PackageManagerBackupAgent( mPackageManager); mStatus = invokeAgentForBackup(PACKAGE_MANAGER_SENTINEL, IBackupAgent.Stub.asInterface(pmAgent.onBind()), mTransport); addBackupTrace("PMBA invoke: " + mStatus); // Because the PMBA is a local instance, it has already executed its // backup callback and returned. Blow away the lingering (spurious) // pending timeout message for it. mBackupHandler.removeMessages(MSG_TIMEOUT); } if (mStatus == BackupTransport.TRANSPORT_NOT_INITIALIZED) { // The backend reports that our dataset has been wiped. Note this in // the event log; the no-success code below will reset the backup // state as well. EventLog.writeEvent(EventLogTags.BACKUP_RESET, mTransport.transportDirName()); } } catch (Exception e) { Slog.e(TAG, "Error in backup thread", e); addBackupTrace("Exception in backup thread: " + e); mStatus = BackupTransport.TRANSPORT_ERROR; } finally { // If we've succeeded so far, invokeAgentForBackup() will have run the PM // metadata and its completion/timeout callback will continue the state // machine chain. If it failed that won't happen; we handle that now. addBackupTrace("exiting prelim: " + mStatus); if (mStatus != BackupTransport.TRANSPORT_OK) { // if things went wrong at this point, we need to // restage everything and try again later. resetBackupState(mStateDir); // Just to make sure. executeNextState(BackupState.FINAL); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: beginBackup 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
beginBackup
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
private static void replaceLang(JSONObject item) { String text = item.getString("text"); item.put("text", Language.L(text)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: replaceLang File: src/main/java/com/rebuild/core/configuration/NavBuilder.java Repository: getrebuild/rebuild The code follows secure coding practices.
[ "CWE-89" ]
CVE-2023-1495
MEDIUM
6.5
getrebuild/rebuild
replaceLang
src/main/java/com/rebuild/core/configuration/NavBuilder.java
c9474f84e5f376dd2ade2078e3039961a9425da7
0
Analyze the following code function for security vulnerabilities
void handleNotificationError(StatusBarNotification n, String message) { removeNotification(n.getKey(), null); try { mBarService.onNotificationError(n.getPackageName(), n.getTag(), n.getId(), n.getUid(), n.getInitialPid(), message, n.getUserId()); } catch (RemoteException ex) { // The end is nigh. } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleNotificationError 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
handleNotificationError
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
@Override public String getPrefix(){ return parser.getPrefix(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPrefix File: main/src/com/google/refine/importers/XmlImporter.java Repository: OpenRefine The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-20157
MEDIUM
5
OpenRefine
getPrefix
main/src/com/google/refine/importers/XmlImporter.java
6a0d7d56e4ffb420316ce7849fde881344fbf881
0
Analyze the following code function for security vulnerabilities
@Override public void freeStorageAndNotify(final String volumeUuid, final long freeStorageSize, final IPackageDataObserver observer) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.CLEAR_APP_CACHE, null); // Queue up an async operation since clearing cache may take a little while. mHandler.post(new Runnable() { public void run() { mHandler.removeCallbacks(this); int retCode = -1; synchronized (mInstallLock) { retCode = mInstaller.freeCache(volumeUuid, freeStorageSize); if (retCode < 0) { Slog.w(TAG, "Couldn't clear application caches"); } } if (observer != null) { try { observer.onRemoveCompleted(null, (retCode >= 0)); } catch (RemoteException e) { Slog.w(TAG, "RemoveException when invoking call back"); } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: freeStorageAndNotify File: services/core/java/com/android/server/pm/PackageManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-119" ]
CVE-2016-2497
HIGH
7.5
android
freeStorageAndNotify
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
public FilePath getRootPath() { return new FilePath(getRootDir()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRootPath File: core/src/main/java/jenkins/model/Jenkins.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-79" ]
CVE-2014-2065
MEDIUM
4.3
jenkinsci/jenkins
getRootPath
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public boolean isEnabled() { return enabled; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isEnabled File: core/src/main/java/apoc/util/FileUtils.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-23532
MEDIUM
6.5
neo4j-contrib/neo4j-apoc-procedures
isEnabled
core/src/main/java/apoc/util/FileUtils.java
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
0
Analyze the following code function for security vulnerabilities
public boolean doConnect(boolean create_account) throws YaximXMPPException { mRequestedState = ConnectionState.ONLINE; updateConnectionState(ConnectionState.CONNECTING); if (mXMPPConnection == null || mConfig.reconnect_required) initXMPPConnection(); tryToConnect(create_account); // actually, authenticated must be true now, or an exception must have // been thrown. if (isAuthenticated()) { updateConnectionState(ConnectionState.LOADING); registerMessageListener(); registerPresenceListener(); registerPongListener(); syncDbRooms(); sendOfflineMessages(); sendUserWatching(); // we need to "ping" the service to let it know we are actually // connected, even when no roster entries will come in updateConnectionState(ConnectionState.ONLINE); } else throw new YaximXMPPException("SMACK connected, but authentication failed"); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doConnect File: src/org/yaxim/androidclient/service/SmackableImp.java Repository: ge0rg/yaxim The code follows secure coding practices.
[ "CWE-20", "CWE-346" ]
CVE-2017-5589
MEDIUM
4.3
ge0rg/yaxim
doConnect
src/org/yaxim/androidclient/service/SmackableImp.java
65a38dc77545d9568732189e86089390f0ceaf9f
0
Analyze the following code function for security vulnerabilities
public static long parseContentLengthFromContentRange(String contentRange) { if (contentRange == null || contentRange.length() == 0) return -1; final String pattern = "bytes (\\d+)-(\\d+)/\\d+"; try { final Pattern r = Pattern.compile(pattern); final Matcher m = r.matcher(contentRange); if (m.find()) { final long rangeStart = Long.parseLong(m.group(1)); final long rangeEnd = Long.parseLong(m.group(2)); return rangeEnd - rangeStart + 1; } } catch (Exception e) { FileDownloadLog.e(FileDownloadUtils.class, e, "parse content length" + " from content range error"); } return -1; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseContentLengthFromContentRange File: library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java Repository: lingochamp/FileDownloader The code follows secure coding practices.
[ "CWE-22" ]
CVE-2018-11248
HIGH
7.5
lingochamp/FileDownloader
parseContentLengthFromContentRange
library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
0
Analyze the following code function for security vulnerabilities
public PublicKey generatePublic(SubjectPublicKeyInfo keyInfo) throws IOException { ASN1ObjectIdentifier algOid = keyInfo.getAlgorithm().getAlgorithm(); if (algOid.equals(PKCSObjectIdentifiers.dhKeyAgreement)) { return new BCDHPublicKey(keyInfo); } else if (algOid.equals(X9ObjectIdentifiers.dhpublicnumber)) { return new BCDHPublicKey(keyInfo); } else { throw new IOException("algorithm identifier " + algOid + " in key not recognised"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: generatePublic File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyFactorySpi.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-310" ]
CVE-2016-1000339
MEDIUM
5
bcgit/bc-java
generatePublic
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/dh/KeyFactorySpi.java
413b42f4d770456508585c830cfcde95f9b0e93b
0
Analyze the following code function for security vulnerabilities
private List<DocumentReference> searchDocumentReferencesInternal(String sql, int nb, int start, List<?> parameterValues, XWikiContext inputxcontext) throws XWikiException { XWikiContext context = getExecutionXContext(inputxcontext, true); try { List<DocumentReference> documentReferences = new ArrayList<>(); // Construct a reference, using the current wiki as the wiki reference name. This is because the wiki // name is not stored in the database for document references. WikiReference wikiReference = new WikiReference(context.getWikiId()); for (Object result : this.searchGenericInternal(sql, nb, start, parameterValues, context)) { // The select always contains several elements in case of order by so we have to support both Object[] // and // String String referenceString; if (result instanceof String) { referenceString = (String) result; } else { referenceString = (String) ((Object[]) result)[0]; } DocumentReference reference = this.defaultDocumentReferenceResolver.resolve(referenceString, wikiReference); documentReferences.add(reference); } return documentReferences; } finally { restoreExecutionXContext(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: searchDocumentReferencesInternal File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
searchDocumentReferencesInternal
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@VisibleForTesting List<LogFile> applyBundleSizeLogFileLimit(List<LogFile> allLogs) { final ImmutableList.Builder<LogFile> truncatedLogFileList = ImmutableList.builder(); // Always collect the in-memory log and the newest on-disk log file // Keep collecting until we pass LOG_COLLECTION_SIZE_LIMIT final AtomicBoolean oneFileAdded = new AtomicBoolean(false); final AtomicLong collectedSize = new AtomicLong(); allLogs.stream().sorted(Comparator.comparing(LogFile::lastModified).reversed()).forEach(logFile -> { if (logFile.id().equals(IN_MEMORY_LOGFILE_ID)) { truncatedLogFileList.add(logFile); } else if (!oneFileAdded.get() || collectedSize.get() < LOG_COLLECTION_SIZE_LIMIT) { truncatedLogFileList.add(logFile); oneFileAdded.set(true); collectedSize.addAndGet(logFile.size()); } }); return truncatedLogFileList.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: applyBundleSizeLogFileLimit File: graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-41044
LOW
3.8
Graylog2/graylog2-server
applyBundleSizeLogFileLimit
graylog2-server/src/main/java/org/graylog2/rest/resources/system/debug/bundle/SupportBundleService.java
02b8792e6f4b829f0c1d87fcbf2d58b73458b938
0
Analyze the following code function for security vulnerabilities
@Override public boolean getJMSRedelivered() throws JMSException { return this.getBooleanProperty(JMS_MESSAGE_REDELIVERED); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJMSRedelivered File: src/main/java/com/rabbitmq/jms/client/RMQMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
getJMSRedelivered
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@Column(name = "attached", length = 300) public String getAttached() { return this.attached; }
Vulnerability Classification: - CWE: CWE-79 - CVE: CVE-2018-18927 - Severity: LOW - CVSS Score: 3.5 Description: https://github.com/sanluan/PublicCMS/issues/22 Function: getAttached File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java Repository: sanluan/PublicCMS Fixed Code: @Column(name = "attached", length = 50) public String getAttached() { return this.attached; }
[ "CWE-79" ]
CVE-2018-18927
LOW
3.5
sanluan/PublicCMS
getAttached
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/sys/SysModule.java
2b411dc2821c69539138aaf7632b938b659a58fa
1
Analyze the following code function for security vulnerabilities
@Override public String toString() { return bigDecimalValue().toString(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toString File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
toString
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
84764ffbe3d0376da242b27a9a526138d0dfb8e6
0
Analyze the following code function for security vulnerabilities
private static byte[] getCollationKeyInBytes(String name) { if (mColl == null) { mColl = Collator.getInstance(); mColl.setStrength(Collator.PRIMARY); } return mColl.getCollationKey(name).toByteArray(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCollationKeyInBytes File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
getCollationKeyInBytes
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
public void addErrorToDropBox(String eventType, ProcessRecord process, String processName, ActivityRecord activity, ActivityRecord parent, String subject, final String report, final File logFile, final ApplicationErrorReport.CrashInfo crashInfo) { // NOTE -- this must never acquire the ActivityManagerService lock, // otherwise the watchdog may be prevented from resetting the system. final String dropboxTag = processClass(process) + "_" + eventType; final DropBoxManager dbox = (DropBoxManager) mContext.getSystemService(Context.DROPBOX_SERVICE); // Exit early if the dropbox isn't configured to accept this report type. if (dbox == null || !dbox.isTagEnabled(dropboxTag)) return; final StringBuilder sb = new StringBuilder(1024); appendDropBoxProcessHeaders(process, processName, sb); if (activity != null) { sb.append("Activity: ").append(activity.shortComponentName).append("\n"); } if (parent != null && parent.app != null && parent.app.pid != process.pid) { sb.append("Parent-Process: ").append(parent.app.processName).append("\n"); } if (parent != null && parent != activity) { sb.append("Parent-Activity: ").append(parent.shortComponentName).append("\n"); } if (subject != null) { sb.append("Subject: ").append(subject).append("\n"); } sb.append("Build: ").append(Build.FINGERPRINT).append("\n"); if (Debug.isDebuggerConnected()) { sb.append("Debugger: Connected\n"); } sb.append("\n"); // Do the rest in a worker thread to avoid blocking the caller on I/O // (After this point, we shouldn't access AMS internal data structures.) Thread worker = new Thread("Error dump: " + dropboxTag) { @Override public void run() { if (report != null) { sb.append(report); } if (logFile != null) { try { sb.append(FileUtils.readTextFile(logFile, DROPBOX_MAX_SIZE, "\n\n[[TRUNCATED]]")); } catch (IOException e) { Slog.e(TAG, "Error reading " + logFile, e); } } if (crashInfo != null && crashInfo.stackTrace != null) { sb.append(crashInfo.stackTrace); } String setting = Settings.Global.ERROR_LOGCAT_PREFIX + dropboxTag; int lines = Settings.Global.getInt(mContext.getContentResolver(), setting, 0); if (lines > 0) { sb.append("\n"); // Merge several logcat streams, and take the last N lines InputStreamReader input = null; try { java.lang.Process logcat = new ProcessBuilder("/system/bin/logcat", "-v", "time", "-b", "events", "-b", "system", "-b", "main", "-b", "crash", "-t", String.valueOf(lines)).redirectErrorStream(true).start(); try { logcat.getOutputStream().close(); } catch (IOException e) {} try { logcat.getErrorStream().close(); } catch (IOException e) {} input = new InputStreamReader(logcat.getInputStream()); int num; char[] buf = new char[8192]; while ((num = input.read(buf)) > 0) sb.append(buf, 0, num); } catch (IOException e) { Slog.e(TAG, "Error running logcat", e); } finally { if (input != null) try { input.close(); } catch (IOException e) {} } } dbox.addText(dropboxTag, sb.toString()); } }; if (process == null) { // If process is null, we are being called from some internal code // and may be about to die -- run this synchronously. worker.run(); } else { worker.start(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addErrorToDropBox File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-3833
MEDIUM
4.3
android
addErrorToDropBox
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
@Override public void setOverscan(int displayId, int left, int top, int right, int bottom) { if (mContext.checkCallingOrSelfPermission( android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Must hold permission " + android.Manifest.permission.WRITE_SECURE_SETTINGS); } final long ident = Binder.clearCallingIdentity(); try { synchronized(mWindowMap) { DisplayContent displayContent = getDisplayContentLocked(displayId); if (displayContent != null) { setOverscanLocked(displayContent, left, top, right, bottom); } } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setOverscan 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
setOverscan
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
public int engineUpdate( byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset) { buffer.write(input, inputOffset, inputLen); return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: engineUpdate File: prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java Repository: bcgit/bc-java The code follows secure coding practices.
[ "CWE-361" ]
CVE-2016-1000345
MEDIUM
4.3
bcgit/bc-java
engineUpdate
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/ec/IESCipher.java
21dcb3d9744c83dcf2ff8fcee06dbca7bfa4ef35
0
Analyze the following code function for security vulnerabilities
@Override public void resetBuffer() { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetBuffer File: h2/src/test/org/h2/test/server/TestWeb.java Repository: h2database The code follows secure coding practices.
[ "CWE-312" ]
CVE-2022-45868
HIGH
7.8
h2database
resetBuffer
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
private static boolean checkPermission(@NonNull Context context, @NonNull PermissionManagerServiceInternal permissionManagerServiceInt, @NonNull String permission, int uid, @NonNull Set<String> renouncedPermissions) { boolean permissionGranted = context.checkPermission(permission, /*pid*/ -1, uid) == PackageManager.PERMISSION_GRANTED; // Override certain permissions checks for the HotwordDetectionService. This service is // an isolated service, which ordinarily cannot hold permissions. // There's probably a cleaner, more generalizable way to do this. For now, this is // the only use case for this, so simply override here. if (!permissionGranted && Process.isIsolated(uid) // simple check which fails-fast for the common case && (permission.equals(RECORD_AUDIO) || permission.equals(CAPTURE_AUDIO_HOTWORD) || permission.equals(CAPTURE_AUDIO_OUTPUT))) { HotwordDetectionServiceProvider hotwordServiceProvider = permissionManagerServiceInt.getHotwordDetectionServiceProvider(); permissionGranted = hotwordServiceProvider != null && uid == hotwordServiceProvider.getUid(); } if (permissionGranted && renouncedPermissions.contains(permission) && context.checkPermission(Manifest.permission.RENOUNCE_PERMISSIONS, /*pid*/ -1, uid) == PackageManager.PERMISSION_GRANTED) { return false; } return permissionGranted; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkPermission 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
checkPermission
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
c00b7e7dbc1fa30339adef693d02a51254755d7f
0
Analyze the following code function for security vulnerabilities
@Override public void setVisible(boolean visible) { super.setVisible(visible); this.doSetVisibility(visible); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setVisible 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
setVisible
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private BufferedImage readWebp() throws IOException { try (InputStream is = openFile()) { final int riff = read32(is); if (riff != 0x46464952) return null; final int len1 = read32(is); final int webp = read32(is); if (webp != 0x50424557) return null; final int vp8_ = read32(is); if (vp8_ != 0x20385056) return null; final int len2 = read32(is); if (len1 != len2 + 12) return null; return getBufferedImageFromWebpButHeader(is); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readWebp File: src/net/sourceforge/plantuml/security/SFile.java Repository: plantuml The code follows secure coding practices.
[ "CWE-284" ]
CVE-2023-3431
MEDIUM
5.3
plantuml
readWebp
src/net/sourceforge/plantuml/security/SFile.java
fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e
0
Analyze the following code function for security vulnerabilities
public SerializationConfig setPortableVersion(int portableVersion) { if (portableVersion < 0) { throw new IllegalArgumentException("Portable version cannot be negative!"); } this.portableVersion = portableVersion; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPortableVersion 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
setPortableVersion
hazelcast/src/main/java/com/hazelcast/config/SerializationConfig.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
public abstract String getPropertyDef(Map<String, Integer> indexes);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPropertyDef File: server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java Repository: theonedev/onedev The code follows secure coding practices.
[ "CWE-94" ]
CVE-2021-21248
MEDIUM
6.5
theonedev/onedev
getPropertyDef
server-core/src/main/java/io/onedev/server/model/support/inputspec/InputSpec.java
39d95ab8122c5d9ed18e69dc024870cae08d2d60
0
Analyze the following code function for security vulnerabilities
@Deprecated public String displayForm(String className, String header, String format, XWikiContext context) { return displayForm(className, header, format, true, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: displayForm File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-26470
HIGH
7.5
xwiki/xwiki-platform
displayForm
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
db3d1c62fc5fb59fefcda3b86065d2d362f55164
0
Analyze the following code function for security vulnerabilities
void notifyAppStopped() { ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppStopped: %s", this); mAppStopped = true; firstWindowDrawn = false; // This is to fix the edge case that auto-enter-pip is finished in Launcher but app calls // setAutoEnterEnabled(false) and transitions to STOPPED state, see b/191930787. // Clear any surface transactions and content overlay in this case. if (task != null && task.mLastRecentsAnimationTransaction != null) { task.clearLastRecentsAnimationTransaction(true /* forceRemoveOverlay */); } // Reset the last saved PiP snap fraction on app stop. mDisplayContent.mPinnedTaskController.onActivityHidden(mActivityComponent); mDisplayContent.mUnknownAppVisibilityController.appRemovedOrHidden(this); if (isClientVisible()) { // Though this is usually unlikely to happen, still make sure the client is invisible. setClientVisible(false); } destroySurfaces(); // Remove any starting window that was added for this app if they are still around. removeStartingWindow(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: notifyAppStopped File: services/core/java/com/android/server/wm/ActivityRecord.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21145
HIGH
7.8
android
notifyAppStopped
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
@Override public void resetKeyStore(int userId) throws RemoteException { checkWritePermission(userId); if (DEBUG) Slog.v(TAG, "Reset keystore for user: " + userId); int managedUserId = -1; String managedUserDecryptedPassword = null; final List<UserInfo> profiles = mUserManager.getProfiles(userId); for (UserInfo pi : profiles) { // Unlock managed profile with unified lock if (pi.isManagedProfile() && !mLockPatternUtils.isSeparateProfileChallengeEnabled(pi.id) && mStorage.hasChildProfileLock(pi.id)) { try { if (managedUserId == -1) { managedUserDecryptedPassword = getDecryptedPasswordForTiedProfile(pi.id); managedUserId = pi.id; } else { // Should not happen Slog.e(TAG, "More than one managed profile, uid1:" + managedUserId + ", uid2:" + pi.id); } } catch (UnrecoverableKeyException | InvalidKeyException | KeyStoreException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | CertificateException | IOException e) { Slog.e(TAG, "Failed to decrypt child profile key", e); } } } try { // Clear all the users credentials could have been installed in for this user. for (int profileId : mUserManager.getProfileIdsWithDisabled(userId)) { for (int uid : SYSTEM_CREDENTIAL_UIDS) { mKeyStore.clearUid(UserHandle.getUid(profileId, uid)); } } } finally { if (managedUserId != -1 && managedUserDecryptedPassword != null) { if (DEBUG) Slog.v(TAG, "Restore tied profile lock"); tieProfileLockToParent(managedUserId, managedUserDecryptedPassword); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetKeyStore File: services/core/java/com/android/server/LockSettingsService.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3908
MEDIUM
4.3
android
resetKeyStore
services/core/java/com/android/server/LockSettingsService.java
96daf7d4893f614714761af2d53dfb93214a32e4
0
Analyze the following code function for security vulnerabilities
private XDOM displayTitle(DocumentModelBridge document, DocumentDisplayerParameters parameters) { // 1. Try to use the title provided by the user. String rawTitle = document.getTitle(); if (!StringUtils.isEmpty(rawTitle)) { try { String title = rawTitle; // Evaluate the title only if the document has script rights, otherwise use the raw title. if (authorizationManager.hasAccess(Right.SCRIPT, document.getContentAuthorReference(), document.getDocumentReference())) { title = evaluateTitle(rawTitle, document, parameters); } return parseTitle(title); } catch (Exception e) { logger.warn("Failed to interpret title of document [{}].", document.getDocumentReference(), e); } } // 2. Try to extract the title from the document content. if ("1".equals(this.xwikicfg.getProperty("xwiki.title.compatibility", "0"))) { try { XDOM title = extractTitleFromContent(document, parameters); if (title != null) { return title; } } catch (Exception e) { logger.warn("Failed to extract title from content of document [{}].", document.getDocumentReference(), e); } } // 3. The title was not specified or its evaluation failed. Use the document name as a fall-back. return getStaticTitle(document); }
Vulnerability Classification: - CWE: CWE-459 - CVE: CVE-2023-36468 - Severity: HIGH - CVSS Score: 8.8 Description: XWIKI-20594: Mark old revisions and deleted documents as restricted * Introduce a new "restricted" attribute on XWikiDocument * Mark any document that is restored from XML as restricted * Deny script right when the secure document is restricted * Make transformations restricted when the document is restricted * Do not execute Velocity in titles when the document is restricted * Make sure saved documents aren't restricted. * Add tests * Display a warning when a document is rendered in restricted mode and the user is advanced or there is actually an error in the output. Function: displayTitle File: xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/AbstractDocumentTitleDisplayer.java Repository: xwiki/xwiki-platform Fixed Code: private XDOM displayTitle(DocumentModelBridge document, DocumentDisplayerParameters parameters) { // 1. Try to use the title provided by the user. String rawTitle = document.getTitle(); if (!StringUtils.isEmpty(rawTitle)) { try { String title = rawTitle; // Evaluate the title only if the document is not restricted and its content's author has script // right, otherwise use the raw title. if (!document.isRestricted() && this.authorizationManager.hasAccess(Right.SCRIPT, document.getContentAuthorReference(), document.getDocumentReference())) { title = evaluateTitle(rawTitle, document, parameters); } return parseTitle(title); } catch (Exception e) { logger.warn("Failed to interpret title of document [{}].", document.getDocumentReference(), e); } } // 2. Try to extract the title from the document content. if ("1".equals(this.xwikicfg.getProperty("xwiki.title.compatibility", "0"))) { try { XDOM title = extractTitleFromContent(document, parameters); if (title != null) { return title; } } catch (Exception e) { logger.warn("Failed to extract title from content of document [{}].", document.getDocumentReference(), e); } } // 3. The title was not specified or its evaluation failed. Use the document name as a fall-back. return getStaticTitle(document); }
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
displayTitle
xwiki-platform-core/xwiki-platform-display/xwiki-platform-display-api/src/main/java/org/xwiki/display/internal/AbstractDocumentTitleDisplayer.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
1
Analyze the following code function for security vulnerabilities
private void loadMetadata(Context c, Item myitem, String path) throws SQLException, IOException, ParserConfigurationException, SAXException, TransformerException, AuthorizeException { // Load the dublin core metadata loadDublinCore(c, myitem, path + "dublin_core.xml"); // Load any additional metadata schemas File folder = new File(path); File file[] = folder.listFiles(metadataFileFilter); for (int i = 0; i < file.length; i++) { loadDublinCore(c, myitem, file[i].getAbsolutePath()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadMetadata File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java Repository: DSpace The code follows secure coding practices.
[ "CWE-22" ]
CVE-2022-31195
HIGH
7.2
DSpace
loadMetadata
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
56e76049185bbd87c994128a9d77735ad7af0199
0
Analyze the following code function for security vulnerabilities
@Override public void onPerform(CommandEvent commandEvent) { if (commandEvent.isSlashCommand()) { OptionMapping optionMapping = commandEvent.getSlashCommandInteractionEvent().getOption("bot"); commandEvent.getArguments()[0] = optionMapping.getAsString(); } if (commandEvent.getArguments().length == 1) { switch (commandEvent.getArguments()[0]) { case "mee6" -> importFromMee6(commandEvent); default -> commandEvent.reply("Unknown Bot!", 5); } } else { commandEvent.reply("Please provide a Bot you which to Import data from!", 5); } }
Vulnerability Classification: - CWE: CWE-863 - CVE: CVE-2022-39302 - Severity: MEDIUM - CVSS Score: 5.4 Description: Removed News-Channel. Fixed Cross-Server Channel Exploit. Fixed Temporal-Voice setup. Function: onPerform File: src/main/java/de/presti/ree6/commands/impl/mod/Import.java Repository: Ree6-Applications/Ree6 Fixed Code: @Override public void onPerform(CommandEvent commandEvent) { if (!commandEvent.getMember().hasPermission(Permission.MANAGE_SERVER)) { commandEvent.reply("You do not have the permission to do that!"); return; } if (commandEvent.isSlashCommand()) { OptionMapping optionMapping = commandEvent.getSlashCommandInteractionEvent().getOption("bot"); commandEvent.getArguments()[0] = optionMapping.getAsString(); } if (commandEvent.getArguments().length == 1) { switch (commandEvent.getArguments()[0]) { case "mee6" -> importFromMee6(commandEvent); default -> commandEvent.reply("Unknown Bot!", 5); } } else { commandEvent.reply("Please provide a Bot you which to Import data from!", 5); } }
[ "CWE-863" ]
CVE-2022-39302
MEDIUM
5.4
Ree6-Applications/Ree6
onPerform
src/main/java/de/presti/ree6/commands/impl/mod/Import.java
459b5bc24f0ea27e50031f563373926e94b9aa0a
1
Analyze the following code function for security vulnerabilities
protected void readXref() throws IOException { hybridXref = false; newXrefType = false; tokens.seek(tokens.getStartxref()); tokens.nextToken(); if (!tokens.getStringValue().equals("startxref")) throw new InvalidPdfException("startxref not found."); tokens.nextToken(); if (tokens.getTokenType() != PRTokeniser.TK_NUMBER) throw new InvalidPdfException("startxref is not followed by a number."); int startxref = tokens.intValue(); lastXref = startxref; eofPos = tokens.getFilePointer(); try { if (readXRefStream(startxref)) { newXrefType = true; return; } } catch (Exception e) {} xref = null; tokens.seek(startxref); trailer = readXrefSection(); PdfDictionary trailer2 = trailer; while (true) { PdfNumber prev = (PdfNumber)trailer2.get(PdfName.PREV); if (prev == null) break; tokens.seek(prev.intValue()); trailer2 = readXrefSection(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readXref File: java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java Repository: pdftk-java/pdftk The code follows secure coding practices.
[ "CWE-835" ]
CVE-2021-37819
HIGH
7.5
pdftk-java/pdftk
readXref
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
protected Class<?> loadClass(String className) throws ClassNotFoundException { Class<?> clazz; ClassLoader classLoader = this.classLoader; if (classLoader == null) { classLoader = Classes.getDefaultClassLoader(); } if (classLoader != null) { clazz = classLoader.loadClass(className); } else { clazz = Class.forName(className); } return clazz; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadClass File: src/main/java/org/elasticsearch/common/io/ThrowableObjectInputStream.java Repository: elastic/elasticsearch The code follows secure coding practices.
[ "CWE-74" ]
CVE-2015-5377
HIGH
7.5
elastic/elasticsearch
loadClass
src/main/java/org/elasticsearch/common/io/ThrowableObjectInputStream.java
bf3052d14c874aead7da8855c5fcadf5428a43f2
0
Analyze the following code function for security vulnerabilities
public void evaluateInputSource(XMLInputSource inputSource) { final Scanner previousScanner = fScanner; final short previousScannerState = fScannerState; final CurrentEntity previousEntity = fCurrentEntity; final Reader reader = getReader(inputSource); String encoding = inputSource.getEncoding(); String publicId = inputSource.getPublicId(); String baseSystemId = inputSource.getBaseSystemId(); String literalSystemId = inputSource.getSystemId(); String expandedSystemId = expandSystemId(literalSystemId, baseSystemId); fCurrentEntity = new CurrentEntity(reader, encoding, publicId, baseSystemId, literalSystemId, expandedSystemId); setScanner(fContentScanner); setScannerState(STATE_CONTENT); try { do { fScanner.scan(false); } while (fScannerState != STATE_END_DOCUMENT); } catch (final IOException e) { // ignore } setScanner(previousScanner); setScannerState(previousScannerState); fCurrentEntity = previousEntity; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: evaluateInputSource File: src/org/cyberneko/html/HTMLScanner.java Repository: sparklemotion/nekohtml The code follows secure coding practices.
[ "CWE-400" ]
CVE-2022-24839
MEDIUM
5
sparklemotion/nekohtml
evaluateInputSource
src/org/cyberneko/html/HTMLScanner.java
a800fce3b079def130ed42a408ff1d09f89e773d
0
Analyze the following code function for security vulnerabilities
private native void nativeOnShow(long nativeContentViewCoreImpl);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeOnShow 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
nativeOnShow
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
public boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, boolean reset, XWikiContext context) throws XWikiException { return copyDocument(sourceDocumentReference, targetDocumentReference, wikilocale, reset, false, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: copyDocument 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
copyDocument
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@CalledByNative public void handleKeyboardEvent(KeyEvent event) { // TODO(bulach): we probably want to re-inject the KeyEvent back into // the system. Investigate if this is at all possible. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleKeyboardEvent File: components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2014-3159
MEDIUM
6.4
chromium
handleKeyboardEvent
components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java
98a50b76141f0b14f292f49ce376e6554142d5e2
0
Analyze the following code function for security vulnerabilities
private void resetCrossProfileIntentFiltersIfNeeded( int userId, Bundle newRestrictions, Bundle prevRestrictions) { if (UserRestrictionsUtils.restrictionsChanged(prevRestrictions, newRestrictions, UserManager.DISALLOW_SHARE_INTO_MANAGED_PROFILE)) { final int parentId = mUserManagerInternal.getProfileParentId(userId); if (parentId == userId) { return; } // Always reset filters on the parent user, which handles cross profile intent // filters between the parent and its profiles. Slogf.i(LOG_TAG, "Resetting cross-profile intent filters on restriction " + "change"); mDpms.resetDefaultCrossProfileIntentFilters(parentId); mContext.sendBroadcastAsUser( new Intent(DevicePolicyManager.ACTION_DATA_SHARING_RESTRICTION_APPLIED), UserHandle.of(userId)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resetCrossProfileIntentFiltersIfNeeded 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
resetCrossProfileIntentFiltersIfNeeded
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public byte[] getURLContentAsBytes(String surl, String username, String password, XWikiContext context) throws IOException { return getURLContentAsBytes(surl, username, password, getHttpTimeout(context), getHttpUserAgent(context)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getURLContentAsBytes 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
getURLContentAsBytes
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 void dismissProgress() { if (progressBar != null && progressBar.isShowing()) { progressBar.dismiss(); Display.getInstance().callSerially(new Runnable() { public void run() { setVisible(true); repaint(); } }); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dismissProgress 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
dismissProgress
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
private boolean proceedReader(XMLStreamReader reader) throws XMLStreamException { if (reader.hasNext()) { do { reader.next(); } while (reader.isWhiteSpace()); return true; } else { return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: proceedReader File: src/main/java/apoc/load/Xml.java Repository: neo4j-contrib/neo4j-apoc-procedures The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000820
HIGH
7.5
neo4j-contrib/neo4j-apoc-procedures
proceedReader
src/main/java/apoc/load/Xml.java
45bc09c8bd7f17283e2a7e85ce3f02cb4be4fd1a
0
Analyze the following code function for security vulnerabilities
private HandshakeStatus handshake() throws SSLException { if (handshakeState == HandshakeState.FINISHED) { return FINISHED; } checkEngineClosed(); // Check if we have a pending handshakeException and if so see if we need to consume all pending data from the // BIO first or can just shutdown and throw it now. // This is needed so we ensure close_notify etc is correctly send to the remote peer. // See https://github.com/netty/netty/issues/3900 SSLHandshakeException exception = handshakeException; if (exception != null) { if (SSL.pendingWrittenBytesInBIO(networkBIO) > 0) { // There is something pending, we need to consume it first via a WRAP so we not loose anything. return NEED_WRAP; } // No more data left to send to the remote peer, so null out the exception field, shutdown and throw // the exception. handshakeException = null; shutdown(); throw exception; } // Adding the OpenSslEngine to the OpenSslEngineMap so it can be used in the AbstractCertificateVerifier. engineMap.add(this); int code = SSL.doHandshake(ssl); if (code <= 0) { // Check if we have a pending exception that was created during the handshake and if so throw it after // shutdown the connection. if (handshakeException != null) { exception = handshakeException; handshakeException = null; shutdown(); throw exception; } int sslError = SSL.getError(ssl, code); switch (sslError) { case SSL.SSL_ERROR_WANT_READ: case SSL.SSL_ERROR_WANT_WRITE: return pendingStatus(SSL.pendingWrittenBytesInBIO(networkBIO)); default: // Everything else is considered as error throw shutdownWithError("SSL_do_handshake"); } } // if SSL_do_handshake returns > 0 or sslError == SSL.SSL_ERROR_NAME it means the handshake was finished. session.handshakeFinished(); return FINISHED; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handshake File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java Repository: netty The code follows secure coding practices.
[ "CWE-835" ]
CVE-2016-4970
HIGH
7.8
netty
handshake
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public BubbleMetadata createFromParcel(Parcel source) { return new BubbleMetadata(source); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createFromParcel File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
createFromParcel
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public void dump(PrintWriter pw, String prefix) { pw.println(prefix + "from=" + mFrom + " to=" + mTo + " duration=" + mDuration); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dump 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
dump
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
0
Analyze the following code function for security vulnerabilities
@Override public double getDoubleValue() throws IOException { if ((_numTypesValid & NR_DOUBLE) == 0) { if (_numTypesValid == NR_UNKNOWN) { _checkNumericValue(NR_DOUBLE); } if ((_numTypesValid & NR_DOUBLE) == 0) { convertNumberToDouble(); } } return _numberDouble; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDoubleValue 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
getDoubleValue
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
de072d314af8f5f269c8abec6930652af67bc8e6
0
Analyze the following code function for security vulnerabilities
@Override public void dispose() throws ComponentLifecycleException { this.observation.removeListener(this.listener.getName()); this.observation.removeListener(this.wikilistener.getName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dispose File: xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-74" ]
CVE-2023-29510
HIGH
8.8
xwiki/xwiki-platform
dispose
xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/src/main/java/org/xwiki/localization/wiki/internal/DocumentTranslationBundleFactory.java
d06ff8a58480abc7f63eb1d4b8b366024d990643
0
Analyze the following code function for security vulnerabilities
public void executeRunnableDismissingKeyguard(final Runnable runnable, final Runnable cancelAction, final boolean dismissShade, final boolean afterKeyguardGone, final boolean deferred) { dismissKeyguardThenExecute(() -> { if (runnable != null) { if (mStatusBarKeyguardViewManager.isShowing() && mStatusBarKeyguardViewManager.isOccluded()) { mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable); } else { AsyncTask.execute(runnable); } } if (dismissShade) { if (mExpandedVisible) { animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */, true /* delayed*/); } else { // Do it after DismissAction has been processed to conserve the needed ordering. mHandler.post(this::runPostCollapseRunnables); } } else if (isInLaunchTransition() && mNotificationPanel.isLaunchTransitionFinished()) { // We are not dismissing the shade, but the launch transition is already finished, // so nobody will call readyForKeyguardDone anymore. Post it such that // keyguardDonePending gets called first. mHandler.post(mStatusBarKeyguardViewManager::readyForKeyguardDone); } return deferred; }, cancelAction, afterKeyguardGone); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executeRunnableDismissingKeyguard 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
executeRunnableDismissingKeyguard
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setStatus(String status) { this.status = status; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setStatus File: src/main/java/com/erudika/scoold/core/Profile.java Repository: Erudika/scoold The code follows secure coding practices.
[ "CWE-130" ]
CVE-2022-1543
MEDIUM
6.5
Erudika/scoold
setStatus
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private void setColumnOrder(Stream<Column<T, ?>> columns) { List<String> columnOrder = new ArrayList<>(); columns.forEach(column -> { if (columnSet.contains(column)) { columnOrder.add(column.getInternalId()); } else { throw new IllegalStateException( "setColumnOrder should not be called " + "with columns that are not in the grid."); } }); List<String> stateColumnOrder = getState().columnOrder; if (stateColumnOrder.size() != columnOrder.size()) { stateColumnOrder.removeAll(columnOrder); columnOrder.addAll(stateColumnOrder); } getState().columnOrder = columnOrder; fireColumnReorderEvent(false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setColumnOrder File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
setColumnOrder
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
public void setEapMethod(int eapMethod) { switch (eapMethod) { /** Valid methods */ case Eap.TLS: setPhase2Method(Phase2.NONE); /* fall through */ case Eap.PEAP: case Eap.PWD: case Eap.TTLS: case Eap.SIM: case Eap.AKA: case Eap.AKA_PRIME: mFields.put(EAP_KEY, Eap.strings[eapMethod]); mFields.put(OPP_KEY_CACHING, "1"); break; default: throw new IllegalArgumentException("Unknown EAP method"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setEapMethod File: wifi/java/android/net/wifi/WifiEnterpriseConfig.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-3897
MEDIUM
4.3
android
setEapMethod
wifi/java/android/net/wifi/WifiEnterpriseConfig.java
81be4e3aac55305cbb5c9d523cf5c96c66604b39
0
Analyze the following code function for security vulnerabilities
public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); reply.readException(); ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); reply.recycle(); data.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDeviceConfigurationInfo File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
getDeviceConfigurationInfo
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
private void sendResponse(HttpExchange pExchange, ParsedUri pParsedUri, JSONAware pJson) throws IOException { boolean streaming = configuration.getAsBoolean(ConfigKey.STREAMING); if (streaming) { JSONStreamAware jsonStream = (JSONStreamAware)pJson; sendStreamingResponse(pExchange, pParsedUri, jsonStream); } else { // Fallback, send as one object // TODO: Remove for 2.0 sendAllJSON(pExchange, pParsedUri, pJson); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendResponse File: agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java Repository: jolokia The code follows secure coding practices.
[ "CWE-79" ]
CVE-2018-1000129
MEDIUM
4.3
jolokia
sendResponse
agent/jvm/src/main/java/org/jolokia/jvmagent/handler/JolokiaHttpHandler.java
5895d5c137c335e6b473e9dcb9baf748851bbc5f
0
Analyze the following code function for security vulnerabilities
public static void performBackgroundFetch(boolean blocking) { if (Display.getInstance().isMinimized()) { // By definition, background fetch should only occur if the app is minimized. // This keeps it consistent with the iOS implementation that doesn't have a // choice final boolean[] complete = new boolean[1]; final Object lock = new Object(); final BackgroundFetch bgFetchListener = instance.getBackgroundFetchListener(); final long timeout = System.currentTimeMillis()+25000; if (bgFetchListener != null) { Display.getInstance().callSerially(new Runnable() { public void run() { bgFetchListener.performBackgroundFetch(timeout, new Callback<Boolean>() { @Override public void onSucess(Boolean value) { // On Android the OS doesn't care whether it worked or not // So we'll just consume this. synchronized (lock) { complete[0] = true; lock.notify(); } } @Override public void onError(Object sender, Throwable err, int errorCode, String errorMessage) { com.codename1.io.Log.e(err); synchronized (lock) { complete[0] = true; lock.notify(); } } }); } }); } while (blocking && !complete[0]) { synchronized(lock) { try { lock.wait(1000); } catch (Exception ex){} } if (!complete[0]) { System.out.println("Waiting for background fetch to complete. Make sure your background fetch handler calls onSuccess() or onError() in the callback when complete"); } if (System.currentTimeMillis() > timeout) { System.out.println("Background fetch exceeded time alotted. Not waiting for its completion"); break; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: performBackgroundFetch 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
performBackgroundFetch
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d(LOG_TAG, "onActivityResult: done"); if (resultCode != RESULT_OK) { Log.d(LOG_TAG, "onActivityResult: contact picker result not OK."); return; } Cursor cursor = null; try { cursor = getContentResolver().query(data.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { Log.d(LOG_TAG, "onActivityResult: bad contact data, no results found."); return; } switch (requestCode) { case CommandsInterface.CF_REASON_UNCONDITIONAL: mButtonCFU.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_BUSY: mButtonCFB.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_NO_REPLY: mButtonCFNRy.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_NOT_REACHABLE: mButtonCFNRc.onPickActivityResult(cursor.getString(0)); break; default: // TODO: may need exception here. } } finally { if (cursor != null) { cursor.close(); } } }
Vulnerability Classification: - CWE: CWE-Other, CWE-862 - CVE: CVE-2023-35665 - Severity: HIGH - CVSS Score: 7.8 Description: Fixed leak of cross user data in multiple settings. - Any app is allowed to receive GET_CONTENT intent. Using this, an user puts back in the intent an uri with data of another user. - Telephony service has INTERACT_ACROSS_USER permission. Using this, it reads and shows the deta to the evil user. Fix: When telephony service gets the intent result, it checks if the uri is from the current user or not. Bug: b/256591023 , b/256819787 Test: The malicious behaviour was not being reproduced. Unable to import contact from other users data. Test2: Able to import contact from the primary user or uri with no user id (These settings are not available for secondary users) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ab593467e900d4a6d25a34024a06195ae863f6dc) Merged-In: I1e3a643f17948153aecc1d0df9ffd9619ad678c1 Change-Id: I1e3a643f17948153aecc1d0df9ffd9619ad678c1 Function: onActivityResult File: src/com/android/phone/CdmaCallForwardOptions.java Repository: android Fixed Code: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d(LOG_TAG, "onActivityResult: done"); if (resultCode != RESULT_OK) { Log.d(LOG_TAG, "onActivityResult: contact picker result not OK."); return; } Cursor cursor = null; try { // check if the URI returned by the user belongs to the user final int currentUser = UserHandle.getUserId(Process.myUid()); if (currentUser != ContentProvider.getUserIdFromUri(data.getData(), currentUser)) { Log.w(LOG_TAG, "onActivityResult: Contact data of different user, " + "cannot access"); return; } cursor = getContentResolver().query(data.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { Log.d(LOG_TAG, "onActivityResult: bad contact data, no results found."); return; } switch (requestCode) { case CommandsInterface.CF_REASON_UNCONDITIONAL: mButtonCFU.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_BUSY: mButtonCFB.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_NO_REPLY: mButtonCFNRy.onPickActivityResult(cursor.getString(0)); break; case CommandsInterface.CF_REASON_NOT_REACHABLE: mButtonCFNRc.onPickActivityResult(cursor.getString(0)); break; default: // TODO: may need exception here. } } finally { if (cursor != null) { cursor.close(); } } }
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onActivityResult
src/com/android/phone/CdmaCallForwardOptions.java
674039e70e1c5bf29b808899ac80c709acc82290
1
Analyze the following code function for security vulnerabilities
@SuppressFBWarnings("ANDROID_WEB_VIEW_JAVASCRIPT") @SuppressLint("SetJavaScriptEnabled") private void initWebViewLogin(String baseURL, boolean useGenericUserAgent) { mLoginWebView.setVisibility(View.GONE); final ProgressBar progressBar = findViewById(R.id.login_webview_progress_bar); mLoginWebView.getSettings().setAllowFileAccess(false); mLoginWebView.getSettings().setJavaScriptEnabled(true); mLoginWebView.getSettings().setDomStorageEnabled(true); if (useGenericUserAgent) { mLoginWebView.getSettings().setUserAgentString(MainApp.getUserAgent()); } else { mLoginWebView.getSettings().setUserAgentString(getWebLoginUserAgent()); } mLoginWebView.getSettings().setSaveFormData(false); mLoginWebView.getSettings().setSavePassword(false); FidoDialogOptions.Builder dialogOptionsBuilder = FidoDialogOptions.builder(); dialogOptionsBuilder.setShowSdkLogo(true); dialogOptionsBuilder.setTheme(R.style.FidoDialog); webViewFidoU2fBridge = WebViewFidoBridge.createInstanceForWebView(this, mLoginWebView, dialogOptionsBuilder); WebauthnDialogOptions.Builder webauthnOptionsBuilder = WebauthnDialogOptions.builder(); webauthnOptionsBuilder.setShowSdkLogo(true); webauthnOptionsBuilder.setAllowSkipPin(true); webauthnOptionsBuilder.setTheme(R.style.FidoDialog); webViewWebauthnBridge = WebViewWebauthnBridge.createInstanceForWebView(this, mLoginWebView, webauthnOptionsBuilder); Map<String, String> headers = new HashMap<>(); headers.put(RemoteOperation.OCS_API_HEADER, RemoteOperation.OCS_API_HEADER_VALUE); String url; if (baseURL != null && !baseURL.isEmpty()) { url = baseURL; } else { url = getResources().getString(R.string.webview_login_url); } mLoginWebView.loadUrl(url, headers); setClient(progressBar); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initWebViewLogin File: src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java Repository: nextcloud/android The code follows secure coding practices.
[ "CWE-248" ]
CVE-2021-32694
MEDIUM
4.3
nextcloud/android
initWebViewLogin
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
9343bdd85d70625a90e0c952897957a102c2421b
0
Analyze the following code function for security vulnerabilities
public int getConnectTimeout() { return connectionTimeout; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConnectTimeout File: samples/client/petstore/java/resteasy/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
getConnectTimeout
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
void hideMenu(Runnable animationEndCallback) { hideMenu(animationEndCallback, true /* notifyMenuVisibility */, mDidLastShowMenuResize, ANIM_TYPE_HIDE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideMenu File: libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40123
MEDIUM
5.5
android
hideMenu
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
7212a4bec2d2f1a74fa54a12a04255d6a183baa9
0
Analyze the following code function for security vulnerabilities
protected PutMethod executePut(String uri, InputStream content, String mediaType, boolean release, int... expectedCodes) throws Exception { return assertStatusCodes(executePut(uri, content, mediaType), release, expectedCodes); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: executePut 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
executePut
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
public Page<E> setPageSizeZero(Boolean pageSizeZero) { if (this.pageSizeZero == null && pageSizeZero != null) { this.pageSizeZero = pageSizeZero; } return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setPageSizeZero File: src/main/java/com/github/pagehelper/Page.java Repository: pagehelper/Mybatis-PageHelper The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-28111
HIGH
7.5
pagehelper/Mybatis-PageHelper
setPageSizeZero
src/main/java/com/github/pagehelper/Page.java
554a524af2d2b30d09505516adc412468a84d8fa
0
Analyze the following code function for security vulnerabilities
@Override public boolean readBoolean() throws JMSException { return (Boolean)this.readPrimitiveType(Boolean.class); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readBoolean File: src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java Repository: rabbitmq/rabbitmq-jms-client The code follows secure coding practices.
[ "CWE-502" ]
CVE-2020-36282
HIGH
7.5
rabbitmq/rabbitmq-jms-client
readBoolean
src/main/java/com/rabbitmq/jms/client/message/RMQStreamMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
@TestApi @RequiresPermission(android.Manifest.permission.FORCE_DEVICE_POLICY_MANAGER_LOGS) public long forceNetworkLogs() { if (mService == null) { return -1; } try { return mService.forceNetworkLogs(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: forceNetworkLogs 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
forceNetworkLogs
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public IKeyguardDismissCallback getCallback() { return mCallback; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCallback File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21267
MEDIUM
5.5
android
getCallback
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
public void setDisablePkce(boolean disablePkce) { this.disablePkce = disablePkce; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDisablePkce File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
setDisablePkce
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
@Override public int delete(Uri uri, String selection, String[] selectionArgs) { int match = sURLMatcher.match(uri); if (LOCAL_LOGV) { Log.v(TAG, "Delete uri=" + uri + ", match=" + match); } String table, extraSelection = null; boolean notify = false; switch (match) { case MMS_ALL_ID: case MMS_INBOX_ID: case MMS_SENT_ID: case MMS_DRAFTS_ID: case MMS_OUTBOX_ID: notify = true; table = TABLE_PDU; extraSelection = Mms._ID + "=" + uri.getLastPathSegment(); break; case MMS_ALL: case MMS_INBOX: case MMS_SENT: case MMS_DRAFTS: case MMS_OUTBOX: notify = true; table = TABLE_PDU; if (match != MMS_ALL) { int msgBox = getMessageBoxByMatch(match); extraSelection = Mms.MESSAGE_BOX + "=" + msgBox; } break; case MMS_ALL_PART: table = TABLE_PART; break; case MMS_MSG_PART: table = TABLE_PART; extraSelection = Part.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_PART_ID: table = TABLE_PART; extraSelection = Part._ID + "=" + uri.getPathSegments().get(1); break; case MMS_MSG_ADDR: table = TABLE_ADDR; extraSelection = Addr.MSG_ID + "=" + uri.getPathSegments().get(0); break; case MMS_DRM_STORAGE: table = TABLE_DRM; break; default: Log.w(TAG, "No match for URI '" + uri + "'"); return 0; } String finalSelection = concatSelections(selection, extraSelection); SQLiteDatabase db = mOpenHelper.getWritableDatabase(); int deletedRows = 0; if (TABLE_PDU.equals(table)) { deletedRows = deleteMessages(getContext(), db, finalSelection, selectionArgs, uri); } else if (TABLE_PART.equals(table)) { deletedRows = deleteParts(db, finalSelection, selectionArgs); } else if (TABLE_DRM.equals(table)) { deletedRows = deleteTempDrmData(db, finalSelection, selectionArgs); } else { deletedRows = db.delete(table, finalSelection, selectionArgs); } if ((deletedRows > 0) && notify) { notifyChange(uri, null); } return deletedRows; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: src/com/android/providers/telephony/MmsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-22" ]
CVE-2023-21268
MEDIUM
5.5
android
delete
src/com/android/providers/telephony/MmsProvider.java
ca4c9a19635119d95900793e7a41b820cd1d94d9
0
Analyze the following code function for security vulnerabilities
protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { continue; } auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateParamsForAuth File: samples/client/petstore/java/resteasy/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
updateParamsForAuth
samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
private void handleListenerHintsChanged(int hints) { synchronized (mNotificationList) { mListeners.notifyListenerHintsChangedLocked(hints); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleListenerHintsChanged File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
handleListenerHintsChanged
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
private boolean associateRemote(String userId, SetiLocation location) { // There is a possibility that a remote Seti sends an association, // but immediately afterwards crashes. // This Seti may process the crash _before_ the association, leaving // this Seti with an association to a crashed Seti. // Here we check if, after the association, the other node is // still connected. If not, we disassociate. If so, and the other // node crashes just afterwards, the "comet left" event will take // care of disassociating the remote users. boolean associated = associate(userId, location); String oortURL = location._oortURL; if (associated && !_oort.isCometConnected(oortURL)) { if (_logger.isDebugEnabled()) { _logger.debug("Disassociating {} since comet {} is not connected", userId, oortURL); } disassociate(userId, location); return false; } return associated; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: associateRemote File: cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java Repository: cometd The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-24721
MEDIUM
5.5
cometd
associateRemote
cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Seti.java
bb445a143fbf320f17c62e340455cd74acfb5929
0
Analyze the following code function for security vulnerabilities
public static MappedByteBuffer map(File file) throws IOException { checkNotNull(file); return map(file, MapMode.READ_ONLY); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: map 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
map
guava/src/com/google/common/io/Files.java
feb83a1c8fd2e7670b244d5afd23cba5aca43284
0
Analyze the following code function for security vulnerabilities
public void keyguardGoingAway(boolean disableWindowAnimations, boolean keyguardGoingToNotificationShade) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: keyguardGoingAway File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
keyguardGoingAway
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@FlakyTest @LargeTest @Test public void testOutgoingCallSelectPhoneAccountNoVideo() throws Exception { startOutgoingPhoneCallPendingCreateConnection("650-555-1212", null, mConnectionServiceFixtureA, Process.myUserHandle(), VideoProfile.STATE_BIDIRECTIONAL); com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls() .iterator().next(); assert(call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_BIDIRECTIONAL, call.getVideoState()); // Change the phone account to one which does not support video calling. call.setTargetPhoneAccount(mPhoneAccountA2.getAccountHandle()); assert(!call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_AUDIO_ONLY, call.getVideoState()); }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-21283 - Severity: MEDIUM - CVSS Score: 5.5 Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634 Fixes: 285211549 Fixes: 280797684 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15) Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7 Function: testOutgoingCallSelectPhoneAccountNoVideo File: tests/src/com/android/server/telecom/tests/BasicCallTests.java Repository: android Fixed Code: @FlakyTest @LargeTest @Test public void testOutgoingCallSelectPhoneAccountNoVideo() throws Exception { startOutgoingPhoneCallPendingCreateConnection("650-555-1212", null, mConnectionServiceFixtureA, Process.myUserHandle(), VideoProfile.STATE_BIDIRECTIONAL, null); com.android.server.telecom.Call call = mTelecomSystem.getCallsManager().getCalls() .iterator().next(); assert(call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_BIDIRECTIONAL, call.getVideoState()); // Change the phone account to one which does not support video calling. call.setTargetPhoneAccount(mPhoneAccountA2.getAccountHandle()); assert(!call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_AUDIO_ONLY, call.getVideoState()); }
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
testOutgoingCallSelectPhoneAccountNoVideo
tests/src/com/android/server/telecom/tests/BasicCallTests.java
9b41a963f352fdb3da1da8c633d45280badfcb24
1