instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
@Override public void onUserRemoved(@UserIdInt int userId) { // Clean up any ActivityTaskManager state (by telling it the user is stopped) mAtmInternal.onUserStopped(userId); // Clean up various services by removing the user mBatteryStatsService.onUserRemoved(userId); mUserController.onUserRemoved(userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onUserRemoved File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
onUserRemoved
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
@Override public boolean hasManagedProfileCallerIdAccess(int userId, String packageName) { Preconditions.checkArgumentNonnegative(userId, "Invalid userId"); final CallerIdentity caller = getCallerIdentity(); Preconditions.checkCallAuthorization(hasCrossUsersPermission(caller, userId)); synchronized (getLockObject()) { ActiveAdmin admin = getProfileOwnerAdminLocked(userId); if (admin != null) { if (admin.mManagedProfileCallerIdAccess == null) { return !admin.disableCallerId; } return admin.mManagedProfileCallerIdAccess.isPackageAllowed(packageName, mContactSystemRoleHolders); } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hasManagedProfileCallerIdAccess File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
hasManagedProfileCallerIdAccess
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public void setAllowMdmExpansion(boolean theAllowMdmExpansion) { myModelConfig.setAllowMdmExpansion(theAllowMdmExpansion); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setAllowMdmExpansion File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
setAllowMdmExpansion
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
@Override public void moveTaskToFront(IApplicationThread appThread, String callingPackage, int taskId, int flags, Bundle bOptions) { mActivityTaskManager.moveTaskToFront(appThread, callingPackage, taskId, flags, bOptions); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: moveTaskToFront File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21292
MEDIUM
5.5
android
moveTaskToFront
services/core/java/com/android/server/am/ActivityManagerService.java
d10b27e539f7bc91c2360d429b9d05f05274670d
0
Analyze the following code function for security vulnerabilities
public AccessToken getToken() { return token; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getToken File: core/src/main/java/org/keycloak/KeycloakSecurityContext.java Repository: keycloak The code follows secure coding practices.
[ "CWE-20" ]
CVE-2020-1714
MEDIUM
6.5
keycloak
getToken
core/src/main/java/org/keycloak/KeycloakSecurityContext.java
d5483d884de797e2ef6e69f92085bc10bf87e864
0
Analyze the following code function for security vulnerabilities
private boolean createSnapshot(TaskSnapshot snapshot, int typeParams) { if (snapshot == null) { return false; } ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Creating SnapshotStartingData"); mStartingData = new SnapshotStartingData(mWmService, snapshot, typeParams); if (task.forAllLeafTaskFragments(TaskFragment::isEmbedded)) { // Associate with the task so if this activity is resized by task fragment later, the // starting window can keep the same bounds as the task. associateStartingDataWithTask(); } scheduleAddStartingWindow(); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createSnapshot 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
createSnapshot
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
public List<MaterialRevision> addDependencyRevisionModification(List<MaterialRevision> materialRevisions, DependencyMaterial dependencyMaterial, Pipeline... upstreams) { String stageName = CaseInsensitiveString.str(dependencyMaterial.getStageName()); String label = upstreams[0].getLabel(); List<Modification> modifications = new ArrayList<>(); for (Pipeline upstream : upstreams) { modifications.add(new Modification(new Date(), DependencyMaterialRevision.create(CaseInsensitiveString.str(dependencyMaterial.getPipelineName()), upstream.getCounter(), label, stageName, upstream.findStage(stageName ).getCounter()).getRevision(), label, upstream.getId())); } MaterialRevision depRev = addRevisionsWithModifications(dependencyMaterial, modifications.toArray(new Modification[0])); materialRevisions.add(depRev); return Arrays.asList(depRev); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addDependencyRevisionModification File: server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java Repository: gocd The code follows secure coding practices.
[ "CWE-697" ]
CVE-2022-39308
MEDIUM
5.9
gocd
addDependencyRevisionModification
server/src/test-shared/java/com/thoughtworks/go/server/dao/DatabaseAccessHelper.java
236d4baf92e6607f2841c151c855adcc477238b8
0
Analyze the following code function for security vulnerabilities
@Override public ByteBuf getByteBuf() throws IOException { if (file == null) { return EMPTY_BUFFER; } byte[] array = readFrom(file); return wrappedBuffer(array); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getByteBuf File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java Repository: netty The code follows secure coding practices.
[ "CWE-378", "CWE-379" ]
CVE-2021-21290
LOW
1.9
netty
getByteBuf
codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
c735357bf29d07856ad171c6611a2e1a0e0000ec
0
Analyze the following code function for security vulnerabilities
protected InternetResource createStaticResource(String path) throws ResourceNotFoundException, FacesException { FacesContext context = FacesContext.getCurrentInstance(); if (null != context) { if (context.getExternalContext().getContext() instanceof ServletContext) { ServletContext servletContext = (ServletContext) context .getExternalContext().getContext(); InputStream in = servletContext.getResourceAsStream(path); if (null != in) { InternetResourceBase res = new StaticResource(path); setRenderer(res, path); res.setLastModified(new Date(getStartTime())); addResource(path, res); try { in.close(); } catch (IOException e) { } return res; } } } throw new ResourceNotFoundException(Messages.getMessage( Messages.STATIC_RESOURCE_NOT_FOUND_ERROR, path)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createStaticResource File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java Repository: nuxeo/richfaces-3.3 The code follows secure coding practices.
[ "CWE-502" ]
CVE-2013-4521
HIGH
7.5
nuxeo/richfaces-3.3
createStaticResource
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
0
Analyze the following code function for security vulnerabilities
public static EndElement peekNextEndElement(XMLEventReader xmlEventReader) throws ParsingException { try { while (true) { XMLEvent xmlEvent = xmlEventReader.peek(); if (xmlEvent == null || xmlEvent.isEndElement()) return (EndElement) xmlEvent; else xmlEvent = xmlEventReader.nextEvent(); } } catch (XMLStreamException e) { throw logger.parserException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: peekNextEndElement File: saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java Repository: keycloak The code follows secure coding practices.
[ "CWE-200" ]
CVE-2017-2582
MEDIUM
4
keycloak
peekNextEndElement
saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java
0cb5ba0f6e83162d221681f47b470c3042eef237
0
Analyze the following code function for security vulnerabilities
@Override public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, boolean filterOnlyVisibleRecents, boolean keepIntentExtra) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); int flags = filterOnlyVisibleRecents ? RunningTasks.FLAG_FILTER_ONLY_VISIBLE_RECENTS : 0; flags |= (keepIntentExtra ? RunningTasks.FLAG_KEEP_INTENT_EXTRA : 0); final boolean crossUser = isCrossUserAllowed(callingPid, callingUid); flags |= (crossUser ? RunningTasks.FLAG_CROSS_USERS : 0); final int[] profileIds = getUserManager().getProfileIds( UserHandle.getUserId(callingUid), true); ArraySet<Integer> callingProfileIds = new ArraySet<>(); for (int i = 0; i < profileIds.length; i++) { callingProfileIds.add(profileIds[i]); } ArrayList<ActivityManager.RunningTaskInfo> list = new ArrayList<>(); synchronized (mGlobalLock) { if (DEBUG_ALL) Slog.v(TAG, "getTasks: max=" + maxNum); final boolean allowed = isGetTasksAllowed("getTasks", callingPid, callingUid); flags |= (allowed ? RunningTasks.FLAG_ALLOWED : 0); mRootWindowContainer.getRunningTasks( maxNum, list, flags, callingUid, callingProfileIds); } return list; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTasks File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
getTasks
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public Syntax getSyntax() { // Can't be initialized in the XWikiDocument constructor because #getDefaultDocumentSyntax() need to create a // XWikiDocument object to get preferences from wiki preferences pages and would thus generate an infinite loop if (isNew() && this.syntax == null) { this.syntax = getDefaultDocumentSyntax(); } return this.syntax; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSyntax 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
getSyntax
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
private void endAttachment() { this.entity.setAttachment(getXWikiAttachmentOutputFilterStream().getEntity()); // Reset attachment getXWikiAttachmentOutputFilterStream().setEntity(null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: endAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-459" ]
CVE-2023-36468
HIGH
8.8
xwiki/xwiki-platform
endAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/filter/output/XWikiDocumentOutputFilterStream.java
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
0
Analyze the following code function for security vulnerabilities
@Override public LoginProtocol create(KeycloakSession session) { return new SamlProtocol().setSession(session); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: create File: services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java Repository: keycloak The code follows secure coding practices.
[ "CWE-287" ]
CVE-2021-3827
MEDIUM
6.8
keycloak
create
services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java
44000caaf5051d7f218d1ad79573bd3d175cad0d
0
Analyze the following code function for security vulnerabilities
public static void doNotDeclareReplyToDestination(Message message) throws JMSException { if (message instanceof RMQMessage && message.getJMSReplyTo() != null && message.getJMSReplyTo() instanceof RMQDestination) { ((RMQDestination) message.getJMSReplyTo()).setDeclared(true); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doNotDeclareReplyToDestination 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
doNotDeclareReplyToDestination
src/main/java/com/rabbitmq/jms/client/RMQMessage.java
f647e5dbfe055a2ca8cbb16dd70f9d50d888b638
0
Analyze the following code function for security vulnerabilities
protected String primaryView() { return primaryView; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: primaryView 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
primaryView
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public boolean isFooterLinksEnabled() { return CONF.footerLinksEnabled(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isFooterLinksEnabled 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
isFooterLinksEnabled
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("unchecked") @Contract(pure = false) public static <T> T allocate(Class<T> klass) throws InstantiationException { return (T) getUnsafe().allocateInstance(klass); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allocate File: api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java Repository: Karlatemp/UnsafeAccessor The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-31139
MEDIUM
4.3
Karlatemp/UnsafeAccessor
allocate
api/src/main/java/io/github/karlatemp/unsafeaccessor/Root.java
4ef83000184e8f13239a1ea2847ee401d81585fd
0
Analyze the following code function for security vulnerabilities
public DropFileContainer setTooltip(final String title, final String content) { WicketUtils.addTooltip(main, title, content); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setTooltip File: src/main/java/org/projectforge/web/wicket/components/DropFileContainer.java Repository: micromata/projectforge-webapp The code follows secure coding practices.
[ "CWE-352" ]
CVE-2013-7251
MEDIUM
6.8
micromata/projectforge-webapp
setTooltip
src/main/java/org/projectforge/web/wicket/components/DropFileContainer.java
422de35e3c3141e418a73bfb39b430d5fd74077e
0
Analyze the following code function for security vulnerabilities
@Override public CompressionInformation getCompressionInformation(boolean incoming) { return incoming ? inCompression : outCompression; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCompressionInformation File: sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java Repository: apache/mina-sshd The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
apache/mina-sshd
getCompressionInformation
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
private boolean isUnsolicitedResponse(Request request) { return isNotNull(request.getParameter(JBossSAMLConstants.UNSOLICITED_RESPONSE_TARGET.get())); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isUnsolicitedResponse File: picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java Repository: picketlink/picketlink-bindings The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3158
MEDIUM
4
picketlink/picketlink-bindings
isUnsolicitedResponse
picketlink-tomcat-common/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/AbstractIDPValve.java
341a37aefd69e67b6b5f6d775499730d6ccaff0d
0
Analyze the following code function for security vulnerabilities
private void logGetAuthTokenMetrics(final String callerPackage, String accountType) { // Although this is not a 'device policy' API, enterprise is the current use case. DevicePolicyEventLogger .createEvent(DevicePolicyEnums.GET_ACCOUNT_AUTH_TOKEN) .setStrings( TextUtils.emptyIfNull(callerPackage), TextUtils.emptyIfNull(accountType)) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logGetAuthTokenMetrics 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
logGetAuthTokenMetrics
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
@Deprecated public List<String> getConfiguredSyntaxes() { return this.configuredSyntaxes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getConfiguredSyntaxes 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
getConfiguredSyntaxes
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
@Override public String getMethod() { return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getMethod 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
getMethod
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
@Override public Map<String, String> getParamMap(){ return request.getQueryParams().toSingleValueMap(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getParamMap File: sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java Repository: dromara/Sa-Token The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-44794
CRITICAL
9.8
dromara/Sa-Token
getParamMap
sa-token-starter/sa-token-reactor-spring-boot3-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
954efeb73277f924f836da2a25322ea35ee1bfa3
0
Analyze the following code function for security vulnerabilities
protected boolean startWorkChallengeIfNecessary(int userId, IntentSender intendSender, String notificationKey) { // Clear pending remote view, as we do not want to trigger pending remote input view when // it's called by other code mPendingWorkRemoteInputView = null; // Begin old BaseStatusBar.startWorkChallengeIfNecessary. final Intent newIntent = mKeyguardManager.createConfirmDeviceCredentialIntent(null, null, userId); if (newIntent == null) { return false; } final Intent callBackIntent = new Intent(NOTIFICATION_UNLOCKED_BY_WORK_CHALLENGE_ACTION); callBackIntent.putExtra(Intent.EXTRA_INTENT, intendSender); callBackIntent.putExtra(Intent.EXTRA_INDEX, notificationKey); callBackIntent.setPackage(mContext.getPackageName()); PendingIntent callBackPendingIntent = PendingIntent.getBroadcast( mContext, 0, callBackIntent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); newIntent.putExtra( Intent.EXTRA_INTENT, callBackPendingIntent.getIntentSender()); try { ActivityManager.getService().startConfirmDeviceCredentialIntent(newIntent, null /*options*/); } catch (RemoteException ex) { // ignore } return true; // End old BaseStatusBar.startWorkChallengeIfNecessary. }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startWorkChallengeIfNecessary 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
startWorkChallengeIfNecessary
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public SecretKey getSecretKeyAsAES128() { return Util.toAes128Key(secretKey); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecretKeyAsAES128 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
getSecretKeyAsAES128
core/src/main/java/jenkins/model/Jenkins.java
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
0
Analyze the following code function for security vulnerabilities
public void setValidityOperation(String validityOperation) { this.validityOperation = validityOperation; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setValidityOperation File: base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
setValidityOperation
base/common/src/main/java/com/netscape/certsrv/cert/CertSearchRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public static final ProcessStartResult start(final String processClass, final String niceName, int uid, int gid, int[] gids, int debugFlags, int mountExternal, int targetSdkVersion, String seInfo, String abi, String instructionSet, String appDataDir, String[] zygoteArgs) { try { return startViaZygote(processClass, niceName, uid, gid, gids, debugFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); throw new RuntimeException( "Starting VM process through Zygote failed", ex); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: start File: core/java/android/os/Process.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3911
HIGH
9.3
android
start
core/java/android/os/Process.java
2c7008421cb67f5d89f16911bdbe36f6c35311ad
0
Analyze the following code function for security vulnerabilities
@ResponseBody @RequestMapping("/machine") public Result<?> receiveHeartBeat(String app, @RequestParam(value = "app_type", required = false, defaultValue = "0") Integer appType, Long version, String v, String hostname, String ip, Integer port) { if (StringUtil.isBlank(app) || app.length() > 256) { return Result.ofFail(-1, "invalid appName"); } if (StringUtil.isBlank(ip) || ip.length() > 128) { return Result.ofFail(-1, "invalid ip: " + ip); } if (port == null || port < -1) { return Result.ofFail(-1, "invalid port"); } if (hostname != null && hostname.length() > 256) { return Result.ofFail(-1, "hostname too long"); } if (port == -1) { logger.warn("Receive heartbeat from " + ip + " but port not set yet"); return Result.ofFail(-1, "your port not set yet"); } String sentinelVersion = StringUtil.isBlank(v) ? "unknown" : v; version = version == null ? System.currentTimeMillis() : version; try { MachineInfo machineInfo = new MachineInfo(); machineInfo.setApp(app); machineInfo.setAppType(appType); machineInfo.setHostname(hostname); machineInfo.setIp(ip); machineInfo.setPort(port); machineInfo.setHeartbeatVersion(version); machineInfo.setLastHeartbeat(System.currentTimeMillis()); machineInfo.setVersion(sentinelVersion); appManagement.addMachine(machineInfo); return Result.ofSuccessMsg("success"); } catch (Exception e) { logger.error("Receive heartbeat error", e); return Result.ofFail(-1, e.getMessage()); } }
Vulnerability Classification: - CWE: CWE-918 - CVE: CVE-2021-44139 - Severity: MEDIUM - CVSS Score: 5.0 Description: dashboard: Add IP validation in MachineRegistryController * Fixes #2451 Signed-off-by: Eric Zhao <sczyh16@gmail.com> Function: receiveHeartBeat File: sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java Repository: alibaba/Sentinel Fixed Code: @ResponseBody @RequestMapping("/machine") public Result<?> receiveHeartBeat(String app, @RequestParam(value = "app_type", required = false, defaultValue = "0") Integer appType, Long version, String v, String hostname, String ip, Integer port) { if (StringUtil.isBlank(app) || app.length() > 256) { return Result.ofFail(-1, "invalid appName"); } if (StringUtil.isBlank(ip) || ip.length() > 128) { return Result.ofFail(-1, "invalid ip: " + ip); } if (!IPAddressUtil.isIPv4LiteralAddress(ip) && !IPAddressUtil.isIPv6LiteralAddress(ip)) { return Result.ofFail(-1, "invalid ip: " + ip); } if (port == null || port < -1) { return Result.ofFail(-1, "invalid port"); } if (hostname != null && hostname.length() > 256) { return Result.ofFail(-1, "hostname too long"); } if (port == -1) { logger.warn("Receive heartbeat from " + ip + " but port not set yet"); return Result.ofFail(-1, "your port not set yet"); } String sentinelVersion = StringUtil.isBlank(v) ? "unknown" : v; version = version == null ? System.currentTimeMillis() : version; try { MachineInfo machineInfo = new MachineInfo(); machineInfo.setApp(app); machineInfo.setAppType(appType); machineInfo.setHostname(hostname); machineInfo.setIp(ip); machineInfo.setPort(port); machineInfo.setHeartbeatVersion(version); machineInfo.setLastHeartbeat(System.currentTimeMillis()); machineInfo.setVersion(sentinelVersion); appManagement.addMachine(machineInfo); return Result.ofSuccessMsg("success"); } catch (Exception e) { logger.error("Receive heartbeat error", e); return Result.ofFail(-1, e.getMessage()); } }
[ "CWE-918" ]
CVE-2021-44139
MEDIUM
5
alibaba/Sentinel
receiveHeartBeat
sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/MachineRegistryController.java
d4ea89e978d44a0991c41e410c6f5b073655b56b
1
Analyze the following code function for security vulnerabilities
public String getContent() { return content; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContent File: src/main/java/cn/luischen/model/ContentDomain.java Repository: WinterChenS/my-site The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29638
MEDIUM
5.4
WinterChenS/my-site
getContent
src/main/java/cn/luischen/model/ContentDomain.java
d104f38aaae2f1b76c33fadfcf6b1ef1c6c340ed
0
Analyze the following code function for security vulnerabilities
public String addScenarioToPlan(SaveApiPlanRequest request) { if (CollectionUtils.isEmpty(request.getPlanIds())) { MSException.throwException(Translator.get("plan id is null ")); } Map<String, List<String>> mapping = request.getMapping(); Map<String, String> envMap = request.getEnvMap(); Set<String> set = mapping.keySet(); List<TestPlanDTO> list = extTestPlanMapper.selectByIds(request.getPlanIds()); SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); ExtTestPlanScenarioCaseMapper scenarioBatchMapper = sqlSession.getMapper(ExtTestPlanScenarioCaseMapper.class); ExtTestPlanApiCaseMapper apiCaseBatchMapper = sqlSession.getMapper(ExtTestPlanApiCaseMapper.class); String environmentType = request.getEnvironmentType(); String envGroupId = request.getEnvGroupId(); for (TestPlanDTO testPlan : list) { if (!set.isEmpty()) { set.forEach(id -> { TestPlanApiScenario testPlanApiScenario = new TestPlanApiScenario(); testPlanApiScenario.setId(UUID.randomUUID().toString()); testPlanApiScenario.setApiScenarioId(id); testPlanApiScenario.setTestPlanId(testPlan.getId()); testPlanApiScenario.setCreateTime(System.currentTimeMillis()); testPlanApiScenario.setUpdateTime(System.currentTimeMillis()); if (StringUtils.equals(environmentType, EnvironmentType.GROUP.name()) && StringUtils.isNotBlank(envGroupId)) { testPlanApiScenario.setEnvironmentType(EnvironmentType.GROUP.name()); testPlanApiScenario.setEnvironmentGroupId(envGroupId); } else if (StringUtils.equals(environmentType, EnvironmentType.JSON.name())) { Map<String, String> newEnvMap = new HashMap<>(16); if (envMap != null && !envMap.isEmpty()) { List<String> lt = mapping.get(id); lt.forEach(l -> { newEnvMap.put(l, envMap.get(l)); }); } testPlanApiScenario.setEnvironmentType(EnvironmentType.JSON.name()); testPlanApiScenario.setEnvironment(JSON.toJSONString(newEnvMap)); } if (StringUtils.isNotBlank(testPlanApiScenario.getEnvironmentType())) { Long nextScenarioOrder = ServiceUtils.getNextOrder(testPlan.getId(), extTestPlanScenarioCaseMapper::getLastOrder); testPlanApiScenario.setOrder(nextScenarioOrder); scenarioBatchMapper.insertIfNotExists(testPlanApiScenario); } }); } if (request.getApiIds() != null) { for (String caseId : request.getApiIds()) { TestPlanApiCase testPlanApiCase = new TestPlanApiCase(); testPlanApiCase.setId(UUID.randomUUID().toString()); testPlanApiCase.setApiCaseId(caseId); testPlanApiCase.setTestPlanId(testPlan.getId()); testPlanApiCase.setCreateTime(System.currentTimeMillis()); testPlanApiCase.setUpdateTime(System.currentTimeMillis()); apiCaseBatchMapper.insertIfNotExists(testPlanApiCase); } } } sqlSession.flushStatements(); if (sqlSession != null && sqlSessionFactory != null) { SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory); } return "success"; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addScenarioToPlan File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2021-45789
MEDIUM
6.5
metersphere
addScenarioToPlan
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
d74e02cdff47cdf7524d305d098db6ffb7f61b47
0
Analyze the following code function for security vulnerabilities
public static Secret decrypt(String data) { if(data==null) return null; try { byte[] in = Base64.decode(data.toCharArray()); Secret s = tryDecrypt(KEY.decrypt(), in); if (s!=null) return s; // try our historical key for backward compatibility Cipher cipher = getCipher("AES"); cipher.init(Cipher.DECRYPT_MODE, getLegacyKey()); return tryDecrypt(cipher, in); } catch (GeneralSecurityException e) { return null; } catch (UnsupportedEncodingException e) { throw new Error(e); // impossible } catch (IOException e) { return null; } }
Vulnerability Classification: - CWE: CWE-326 - CVE: CVE-2017-2598 - Severity: MEDIUM - CVSS Score: 4.0 Description: Merge pull request #105 from jenkinsci-cert/SECURITY-304-t3 [SECURITY-304] Encrypt new secrets with CBC and random IV instead of ECB Function: decrypt File: core/src/main/java/hudson/util/Secret.java Repository: jenkinsci/jenkins Fixed Code: public static Secret decrypt(String data) { if (data == null) return null; if (data.startsWith("{") && data.endsWith("}")) { //likely CBC encrypted/containing metadata but could be plain text byte[] payload; try { payload = Base64.decode(data.substring(1, data.length()-1).toCharArray()); } catch (IOException e) { return null; } switch (payload[0]) { case PAYLOAD_V1: // For PAYLOAD_V1 we use this byte shifting model, V2 probably will need DataOutput int ivLength = ((payload[1] & 0xff) << 24) | ((payload[2] & 0xff) << 16) | ((payload[3] & 0xff) << 8) | (payload[4] & 0xff); int dataLength = ((payload[5] & 0xff) << 24) | ((payload[6] & 0xff) << 16) | ((payload[7] & 0xff) << 8) | (payload[8] & 0xff); if (payload.length != 1 + 8 + ivLength + dataLength) { // not valid v1 return null; } byte[] iv = Arrays.copyOfRange(payload, 9, 9 + ivLength); byte[] code = Arrays.copyOfRange(payload, 9+ivLength, payload.length); String text; try { text = new String(KEY.decrypt(iv).doFinal(code), UTF_8); } catch (GeneralSecurityException e) { // it's v1 which cannot be historical, but not decrypting return null; } return new Secret(text, iv); default: return null; } } else { try { return HistoricalSecrets.decrypt(data, KEY); } catch (GeneralSecurityException e) { return null; } catch (UnsupportedEncodingException e) { throw new Error(e); // impossible } catch (IOException e) { return null; } } }
[ "CWE-326" ]
CVE-2017-2598
MEDIUM
4
jenkinsci/jenkins
decrypt
core/src/main/java/hudson/util/Secret.java
e6aa166246d1734f4798a9e31f78842f4c85c28b
1
Analyze the following code function for security vulnerabilities
private InputStream getInput() throws IOException { if(is == null) { if(socketInstance != null) { is = socketInstance.getInputStream(); } else { } } return is; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInput 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
getInput
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
@Override public KeyguardAffordanceView getLeftIcon() { return getLayoutDirection() == LAYOUT_DIRECTION_RTL ? mKeyguardBottomArea.getRightView() : mKeyguardBottomArea.getLeftView(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getLeftIcon File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
getLeftIcon
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public void setSentTo(String place) { this.sentTo = place; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setSentTo File: src/main/java/emissary/pickup/WorkBundle.java Repository: NationalSecurityAgency/emissary The code follows secure coding practices.
[ "CWE-502" ]
CVE-2021-32634
MEDIUM
6.5
NationalSecurityAgency/emissary
setSentTo
src/main/java/emissary/pickup/WorkBundle.java
40260b1ec1f76cc92361702cc14fa1e4388e19d7
0
Analyze the following code function for security vulnerabilities
private Setting getGlobalSetting(String name) { if (DEBUG) { Slog.v(LOG_TAG, "getGlobalSetting(" + name + ")"); } // Ensure the caller can access the setting. enforceSettingReadable(name, SETTINGS_TYPE_GLOBAL, UserHandle.getCallingUserId()); // Get the value. synchronized (mLock) { return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getGlobalSetting File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
getGlobalSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); Resources r = getResources(); // Added the icons to the context menu menu.add(0, MENU_IMPORT, 0, r.getString(R.string.importToFDNfromContacts)) .setIcon(R.drawable.ic_menu_contact); menu.add(0, MENU_DELETE, 0, r.getString(R.string.menu_delete)) .setIcon(android.R.drawable.ic_menu_delete); return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreateOptionsMenu File: src/com/android/phone/settings/fdn/EditFdnContactScreen.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onCreateOptionsMenu
src/com/android/phone/settings/fdn/EditFdnContactScreen.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
public static String genUri(final String domain, final int attemptNumber) { // Try the following uris in order, as per // http://msdn.microsoft.com/en-us/library/office/jj900169(v=exchg.150).aspx // TODO: That document also describes a fallback strategy to query DNS for an SRV record, // but this would require additional DNS lookup services that are not currently available // in the android platform, switch (attemptNumber) { case ATTEMPT_PRIMARY: return "https://" + domain + AUTO_DISCOVER_PAGE; case ATTEMPT_ALTERNATE: return "https://autodiscover." + domain + AUTO_DISCOVER_PAGE; case ATTEMPT_UNAUTHENTICATED_GET: return "http://autodiscover." + domain + AUTO_DISCOVER_PAGE; default: LogUtils.wtf(TAG, "Illegal attempt number %d", attemptNumber); return null; } }
Vulnerability Classification: - CWE: CWE-200 - CVE: CVE-2016-2415 - Severity: HIGH - CVSS Score: 7.1 Description: Patch Exchange Autodiscover Code for Security Issue The change removes the unauthenticated GET fallback attempt for the Autodiscover process. Given that the Autodiscover code is functionally broken and this fallback attempt wouldn't succeed unless an attacker faked a success response, a good way to patch the security issue is to disable the attempt. The change also updates the request content type, disables automatic redirects, and allows for parsing namespaces to help the first two attempts succeed. As this is not meant to be a functional patch but a security patch, there are no further changes to the Autodiscover code. BUG: 26488455 Change-Id: I0fc93c95e755c8fa60e94da5bec4b3b4c49cdfc1 Function: genUri File: src/com/android/exchange/eas/EasAutoDiscover.java Repository: android Fixed Code: public static String genUri(final String domain, final int attemptNumber) { // Try the following uris in order, as per // http://msdn.microsoft.com/en-us/library/office/jj900169(v=exchg.150).aspx // TODO: That document also describes a fallback strategy to query DNS for an SRV record, // but this would require additional DNS lookup services that are not currently available // in the android platform, switch (attemptNumber) { case ATTEMPT_PRIMARY: return "https://" + domain + AUTO_DISCOVER_PAGE; case ATTEMPT_ALTERNATE: return "https://autodiscover." + domain + AUTO_DISCOVER_PAGE; default: LogUtils.wtf(TAG, "Illegal attempt number %d", attemptNumber); return null; } }
[ "CWE-200" ]
CVE-2016-2415
HIGH
7.1
android
genUri
src/com/android/exchange/eas/EasAutoDiscover.java
0d1a38b1755efe7ed4e8d7302a24186616bba9b2
1
Analyze the following code function for security vulnerabilities
private void unloadMediaPackages(ArrayMap<AsecInstallArgs, String> processCids, int uidArr[], final boolean reportStatus) { if (DEBUG_SD_INSTALL) Log.i(TAG, "unloading media packages"); ArrayList<String> pkgList = new ArrayList<String>(); ArrayList<AsecInstallArgs> failedList = new ArrayList<AsecInstallArgs>(); final Set<AsecInstallArgs> keys = processCids.keySet(); for (AsecInstallArgs args : keys) { String pkgName = args.getPackageName(); if (DEBUG_SD_INSTALL) Log.i(TAG, "Trying to unload pkg : " + pkgName); // Delete package internally PackageRemovedInfo outInfo = new PackageRemovedInfo(); synchronized (mInstallLock) { boolean res = deletePackageLI(pkgName, null, false, null, null, PackageManager.DELETE_KEEP_DATA, outInfo, false); if (res) { pkgList.add(pkgName); } else { Slog.e(TAG, "Failed to delete pkg from sdcard : " + pkgName); failedList.add(args); } } } // reader synchronized (mPackages) { // We didn't update the settings after removing each package; // write them now for all packages. mSettings.writeLPr(); } // We have to absolutely send UPDATED_MEDIA_STATUS only // after confirming that all the receivers processed the ordered // broadcast when packages get disabled, force a gc to clean things up. // and unload all the containers. if (pkgList.size() > 0) { sendResourcesChangedBroadcast(false, false, pkgList, uidArr, new IIntentReceiver.Stub() { public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean ordered, boolean sticky, int sendingUser) throws RemoteException { Message msg = mHandler.obtainMessage(UPDATED_MEDIA_STATUS, reportStatus ? 1 : 0, 1, keys); mHandler.sendMessage(msg); } }); } else { Message msg = mHandler.obtainMessage(UPDATED_MEDIA_STATUS, reportStatus ? 1 : 0, -1, keys); mHandler.sendMessage(msg); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unloadMediaPackages 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
unloadMediaPackages
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
@Override public View onCreateView(ViewGroup parent) { return mInflater.inflate( com.android.internal.R.layout.resolve_grid_item, parent, false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onCreateView File: core/java/com/android/internal/app/ChooserActivity.java Repository: android The code follows secure coding practices.
[ "CWE-254", "CWE-19" ]
CVE-2016-3752
HIGH
7.5
android
onCreateView
core/java/com/android/internal/app/ChooserActivity.java
ddbf2db5b946be8fdc45c7b0327bf560b2a06988
0
Analyze the following code function for security vulnerabilities
public void close() { synchronized (mBlock) { if (mParseState != 0) { nativeDestroyParseState(mParseState); mParseState = 0; mBlock.decOpenCountLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: close File: core/java/android/content/res/XmlBlock.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
close
core/java/android/content/res/XmlBlock.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public char nextClean() throws JSONException { for (;;) { char c = next(); if (c == '/') { switch (next()) { case '/': do { c = next(); } while (c != '\n' && c != '\r' && c != 0); break; case '*': for (;;) { c = next(); if (c == 0) { throw syntaxError("Unclosed comment."); } if (c == '*') { if (next() == '/') { break; } } } break; default: if (!more()) { throw syntaxError("The JSON text is malformed"); } back(); return '/'; } } else if (c == '#') { do { c = next(); } while (c != '\n' && c != '\r' && c != 0); } else if (c == 0 || c > ' ') { return c; } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nextClean File: src/main/java/org/codehaus/jettison/json/JSONTokener.java Repository: jettison-json/jettison The code follows secure coding practices.
[ "CWE-674", "CWE-787" ]
CVE-2022-45693
HIGH
7.5
jettison-json/jettison
nextClean
src/main/java/org/codehaus/jettison/json/JSONTokener.java
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
0
Analyze the following code function for security vulnerabilities
@Override public UsedExtension getCacheResources(XWikiContext context) { return new CachedItem.UsedExtension(getPulledResources(context), new HashMap<String, Map<String, Object>>(getParametersMap(context))); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getCacheResources File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-29206
MEDIUM
5.4
xwiki/xwiki-platform
getCacheResources
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractSkinExtensionPlugin.java
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
0
Analyze the following code function for security vulnerabilities
int getUidForVerifier(VerifierInfo verifierInfo) { synchronized (mPm.mLock) { final AndroidPackage pkg = mPm.mPackages.get(verifierInfo.packageName); if (pkg == null) { return -1; } else if (pkg.getSigningDetails().getSignatures().length != 1) { Slog.i(TAG, "Verifier package " + verifierInfo.packageName + " has more than one signature; ignoring"); return -1; } /* * If the public key of the package's signature does not match * our expected public key, then this is a different package and * we should skip. */ final byte[] expectedPublicKey; try { final Signature verifierSig = pkg.getSigningDetails().getSignatures()[0]; final PublicKey publicKey = verifierSig.getPublicKey(); expectedPublicKey = publicKey.getEncoded(); } catch (CertificateException e) { return -1; } final byte[] actualPublicKey = verifierInfo.publicKey.getEncoded(); if (!Arrays.equals(actualPublicKey, expectedPublicKey)) { Slog.i(TAG, "Verifier package " + verifierInfo.packageName + " does not have the expected public key; ignoring"); return -1; } return pkg.getUid(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUidForVerifier File: services/core/java/com/android/server/pm/InstallPackageHelper.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21257
HIGH
7.8
android
getUidForVerifier
services/core/java/com/android/server/pm/InstallPackageHelper.java
1aec7feaf07e6d4568ca75d18158445dbeac10f6
0
Analyze the following code function for security vulnerabilities
public void setDownvotes(Long downvotes) { this.downvotes = downvotes; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDownvotes 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
setDownvotes
src/main/java/com/erudika/scoold/core/Profile.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
private AuthnRequestParseResult parseRequest(byte[] xmlBytes) throws SAMLException { String xml = new String(xmlBytes, StandardCharsets.UTF_8); if (logger.isDebugEnabled()) { logger.debug("SAMLRequest XML is\n{}", xml); } AuthnRequestParseResult result = new AuthnRequestParseResult(); result.document = parseFromBytes(xmlBytes); result.authnRequest = unmarshallFromDocument(result.document, AuthnRequestType.class); result.request = new AuthenticationRequest(); result.request.xml = xml; result.request.id = result.authnRequest.getID(); result.request.issuer = result.authnRequest.getIssuer().getValue(); result.request.issueInstant = result.authnRequest.getIssueInstant().toGregorianCalendar().toZonedDateTime(); NameIDPolicyType nameIdPolicyType = result.authnRequest.getNameIDPolicy(); if (nameIdPolicyType == null) { result.request.nameIdFormat = NameIDFormat.EmailAddress; } else { result.request.nameIdFormat = NameIDFormat.fromSAMLFormat(nameIdPolicyType.getFormat()); } result.request.version = result.authnRequest.getVersion(); return result; }
Vulnerability Classification: - CWE: CWE-611 - CVE: CVE-2021-27736 - Severity: MEDIUM - CVSS Score: 4.0 Description: Refactor utility methods into SAMLTools, add tests. Function: parseRequest File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java Repository: FusionAuth/fusionauth-samlv2 Fixed Code: private AuthnRequestParseResult parseRequest(byte[] xmlBytes) throws SAMLException { String xml = new String(xmlBytes, StandardCharsets.UTF_8); if (logger.isDebugEnabled()) { logger.debug("SAMLRequest XML is\n{}", xml); } AuthnRequestParseResult result = new AuthnRequestParseResult(); result.document = newDocumentFromBytes(xmlBytes); result.authnRequest = unmarshallFromDocument(result.document, AuthnRequestType.class); result.request = new AuthenticationRequest(); result.request.xml = xml; result.request.id = result.authnRequest.getID(); result.request.issuer = result.authnRequest.getIssuer().getValue(); result.request.issueInstant = result.authnRequest.getIssueInstant().toGregorianCalendar().toZonedDateTime(); NameIDPolicyType nameIdPolicyType = result.authnRequest.getNameIDPolicy(); if (nameIdPolicyType == null) { result.request.nameIdFormat = NameIDFormat.EmailAddress; } else { result.request.nameIdFormat = NameIDFormat.fromSAMLFormat(nameIdPolicyType.getFormat()); } result.request.version = result.authnRequest.getVersion(); return result; }
[ "CWE-611" ]
CVE-2021-27736
MEDIUM
4
FusionAuth/fusionauth-samlv2
parseRequest
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
c66fb689d50010662f705d5b585c6388ce555dbd
1
Analyze the following code function for security vulnerabilities
public void onDreamingStarted() { mUpdateMonitor.dispatchDreamingStarted(); synchronized (this) { if (mDeviceInteractive && mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())) { doKeyguardLaterLocked(); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDreamingStarted 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
onDreamingStarted
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
d18d8b350756b0e89e051736c1f28744ed31e93a
0
Analyze the following code function for security vulnerabilities
private CharSequence getVpnLabel() { try { return VpnConfig.getVpnLabel(this, mPackage); } catch (PackageManager.NameNotFoundException e) { throw new IllegalStateException(e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVpnLabel File: packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2023-21251
HIGH
7.3
android
getVpnLabel
packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java
57946e2bb73850e817b3c01fa5350d705e178e39
0
Analyze the following code function for security vulnerabilities
@UnsupportedAppUsage @Nullable String getResourceEntryName(@AnyRes int resId) { synchronized (this) { ensureValidLocked(); return nativeGetResourceEntryName(mObject, resId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceEntryName File: core/java/android/content/res/AssetManager.java Repository: android The code follows secure coding practices.
[ "CWE-415" ]
CVE-2023-40103
HIGH
7.8
android
getResourceEntryName
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private boolean readPlaceholderToken(PathTokenAppender appender) { if (!path.currentCharIs(OPEN_SQUARE_BRACKET)) { return false; } int questionmarkIndex = path.indexOfNextSignificantChar(BEGIN_FILTER); if (questionmarkIndex == -1) { return false; } char nextSignificantChar = path.nextSignificantChar(questionmarkIndex); if (nextSignificantChar != CLOSE_SQUARE_BRACKET && nextSignificantChar != COMMA) { return false; } int expressionBeginIndex = path.position() + 1; int expressionEndIndex = path.nextIndexOf(expressionBeginIndex, CLOSE_SQUARE_BRACKET); if (expressionEndIndex == -1) { return false; } String expression = path.subSequence(expressionBeginIndex, expressionEndIndex).toString(); String[] tokens = expression.split(","); if (filterStack.size() < tokens.length) { throw new InvalidPathException("Not enough predicates supplied for filter [" + expression + "] at position " + path.position()); } Collection<Predicate> predicates = new ArrayList<Predicate>(); for (String token : tokens) { token = token != null ? token.trim() : null; if (!"?".equals(token == null ? "" : token)) { throw new InvalidPathException("Expected '?' but found " + token); } predicates.add(filterStack.pop()); } appender.appendPathToken(PathTokenFactory.createPredicatePathToken(predicates)); path.setPosition(expressionEndIndex + 1); return path.currentIsTail() || readNextToken(appender); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readPlaceholderToken File: json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java Repository: json-path/JsonPath The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-51074
MEDIUM
5.3
json-path/JsonPath
readPlaceholderToken
json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java
f49ff25e3bad8c8a0c853058181f2c00b5beb305
0
Analyze the following code function for security vulnerabilities
public Attachment addAttachment(String fileName, InputStream iStream) { try { return new Attachment(this, this.getDoc().setAttachment(fileName, iStream, getXWikiContext()), getXWikiContext()); } catch (IOException e) { // TODO Log the error and let the user know about it } finally { updateAuthor(); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addAttachment File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-863" ]
CVE-2022-23615
MEDIUM
5.5
xwiki/xwiki-platform
addAttachment
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
0
Analyze the following code function for security vulnerabilities
private boolean isCallerDelegate(CallerIdentity caller) { Objects.requireNonNull(caller.getPackageName(), "callerPackage is null"); synchronized (getLockObject()) { // Retrieve user policy data. final DevicePolicyData policy = getUserData(caller.getUserId()); // Retrieve the list of delegation scopes granted to callerPackage. final List<String> scopes = policy.mDelegationMap.get(caller.getPackageName()); // Check callingUid only if callerPackage has the required scope delegation. return scopes != null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isCallerDelegate File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
isCallerDelegate
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public boolean isIms() { if (mImsSMSDispatcher != null) { return mImsSMSDispatcher.isIms(); } else { Rlog.e(TAG, mImsSMSDispatcher + " is null"); return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: isIms File: src/java/com/android/internal/telephony/SMSDispatcher.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2015-3858
HIGH
9.3
android
isIms
src/java/com/android/internal/telephony/SMSDispatcher.java
df31d37d285dde9911b699837c351aed2320b586
0
Analyze the following code function for security vulnerabilities
@Override protected void onActivityResult(int request, int result, Intent data) { if (request == RESULT_PICK_ATTACHMENT) { mAddingAttachment = false; if (result == RESULT_OK) { addAttachmentAndUpdateView(data); } } else if (request == RESULT_CREATE_ACCOUNT) { // We were waiting for the user to create an account if (result != RESULT_OK) { finish(); } else { // Watch for accounts to show up! // restart the loader to get the updated list of accounts getLoaderManager().initLoader(LOADER_ACCOUNT_CURSOR, null, this); showWaitFragment(null); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onActivityResult File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
onActivityResult
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
protected PdfDictionary readDictionary() throws IOException { PdfDictionary dic = new PdfDictionary(); while (true) { tokens.nextValidToken(); if (tokens.getTokenType() == PRTokeniser.TK_END_DIC) break; if (tokens.getTokenType() != PRTokeniser.TK_NAME) tokens.throwError("Dictionary key is not a name."); PdfName name = new PdfName(tokens.getStringValue(), false); PdfObject obj = readPRObject(); int type = obj.type(); if (-type == PRTokeniser.TK_END_DIC) tokens.throwError("Unexpected '>>'"); if (-type == PRTokeniser.TK_END_ARRAY) tokens.throwError("Unexpected ']'"); dic.put(name, obj); } return dic; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readDictionary 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
readDictionary
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public void screenTurningOn(final ScreenOnListener screenOnListener) { if (DEBUG_WAKEUP) Slog.i(TAG, "Screen turning on..."); synchronized (mLock) { mScreenOnEarly = true; mScreenOnFully = false; mWindowManagerDrawComplete = false; mScreenOnListener = screenOnListener; updateOrientationListenerLp(); } mWindowManagerInternal.waitForAllWindowsDrawn(mWindowManagerDrawCallback, WAITING_FOR_DRAWN_TIMEOUT); // ... eventually calls finishWindowsDrawn }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: screenTurningOn File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
screenTurningOn
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Test public void parseQueryMType() throws Exception { HttpQuery query = NettyMocks.getQuery(tsdb, "/api/query?start=1h-ago&m=sum:sys.cpu.0"); TSQuery tsq = (TSQuery) parseQuery.invoke(rpc, tsdb, query, expressions); assertNotNull(tsq); assertEquals("1h-ago", tsq.getStart()); assertNotNull(tsq.getQueries()); TSSubQuery sub = tsq.getQueries().get(0); assertNotNull(sub); assertEquals("sum", sub.getAggregator()); assertEquals("sys.cpu.0", sub.getMetric()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseQueryMType File: test/tsd/TestQueryRpc.java Repository: OpenTSDB/opentsdb The code follows secure coding practices.
[ "CWE-79" ]
CVE-2023-25827
MEDIUM
6.1
OpenTSDB/opentsdb
parseQueryMType
test/tsd/TestQueryRpc.java
ff02c1e95e60528275f69b31bcbf7b2ac625cea8
0
Analyze the following code function for security vulnerabilities
public Volume getVolume() { return this.volume; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getVolume File: src/main/java/com/github/junrar/Archive.java Repository: junrar The code follows secure coding practices.
[ "CWE-835" ]
CVE-2022-23596
MEDIUM
5
junrar
getVolume
src/main/java/com/github/junrar/Archive.java
7b16b3d90b91445fd6af0adfed22c07413d4fab7
0
Analyze the following code function for security vulnerabilities
public String getPackageName() { return mPackageName; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPackageName File: core/java/android/app/ActivityOptions.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-20918
CRITICAL
9.8
android
getPackageName
core/java/android/app/ActivityOptions.java
51051de4eb40bb502db448084a83fd6cbfb7d3cf
0
Analyze the following code function for security vulnerabilities
public SharedUserSetting getSharedUser() { return mSharedUser; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSharedUser 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
getSharedUser
services/core/java/com/android/server/pm/PackageManagerService.java
a75537b496e9df71c74c1d045ba5569631a16298
0
Analyze the following code function for security vulnerabilities
private Account obtainAccount(Intent intent) { Account account = null; Object accountExtra = null; if (intent != null && intent.getExtras() != null) { accountExtra = intent.getExtras().get(Utils.EXTRA_ACCOUNT); if (accountExtra instanceof Account) { return (Account) accountExtra; } else if (accountExtra instanceof String) { // This is the Account attached to the widget compose intent. account = Account.newInstance((String) accountExtra); if (account != null) { return account; } } accountExtra = intent.hasExtra(Utils.EXTRA_ACCOUNT) ? intent.getStringExtra(Utils.EXTRA_ACCOUNT) : intent.getStringExtra(EXTRA_SELECTED_ACCOUNT); } MailAppProvider provider = MailAppProvider.getInstance(); String lastAccountUri = provider.getLastSentFromAccount(); if (TextUtils.isEmpty(lastAccountUri)) { lastAccountUri = provider.getLastViewedAccount(); } if (!TextUtils.isEmpty(lastAccountUri)) { accountExtra = Uri.parse(lastAccountUri); } if (mAccounts != null && mAccounts.length > 0) { if (accountExtra instanceof String && !TextUtils.isEmpty((String) accountExtra)) { // For backwards compatibility, we need to check account // names. for (Account a : mAccounts) { if (a.getEmailAddress().equals(accountExtra)) { account = a; } } } else if (accountExtra instanceof Uri) { // The uri of the last viewed account is what is stored in // the current code base. for (Account a : mAccounts) { if (a.uri.equals(accountExtra)) { account = a; } } } if (account == null) { account = mAccounts[0]; } } return account; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: obtainAccount File: src/com/android/mail/compose/ComposeActivity.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2425
MEDIUM
4.3
android
obtainAccount
src/com/android/mail/compose/ComposeActivity.java
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
0
Analyze the following code function for security vulnerabilities
private Spannable getUrlConnectionMessage() { // Display the appropriate connection message. SpannableStringBuilder messageBuilder = new SpannableStringBuilder(); if (mDeprecatedSHA1Present) { messageBuilder.append( mContext.getResources().getString(R.string.page_info_connection_sha1)); } else if (mSecurityLevel != ToolbarModelSecurityLevel.SECURITY_ERROR) { messageBuilder.append(mContext.getResources().getString( getConnectionMessageId(mSecurityLevel, mIsInternalPage))); } else { String originToDisplay; try { URI parsedUrl = new URI(mFullUrl); originToDisplay = UrlUtilities.getOriginForDisplay(parsedUrl, false); } catch (URISyntaxException e) { // The URL is invalid - just display the full URL. originToDisplay = mFullUrl; } String leadingText = mContext.getResources().getString( R.string.page_info_connection_broken_leading_text); String followingText = mContext.getResources().getString( R.string.page_info_connection_broken_following_text, originToDisplay); messageBuilder.append(leadingText + " " + followingText); final ForegroundColorSpan redSpan = new ForegroundColorSpan(mContext.getResources() .getColor(R.color.website_settings_connection_broken_leading_text)); final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); messageBuilder.setSpan(redSpan, 0, leadingText.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); messageBuilder.setSpan(boldSpan, 0, leadingText.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE); } return messageBuilder; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUrlConnectionMessage File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java Repository: chromium The code follows secure coding practices.
[ "CWE-20" ]
CVE-2015-1261
MEDIUM
5
chromium
getUrlConnectionMessage
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
0
Analyze the following code function for security vulnerabilities
private byte[] readBlockData() throws IOException { byte[] result = new byte[input.readByte() & 0xff]; input.readFully(result); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readBlockData File: luni/src/main/java/java/io/ObjectInputStream.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2014-7911
HIGH
7.2
android
readBlockData
luni/src/main/java/java/io/ObjectInputStream.java
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
0
Analyze the following code function for security vulnerabilities
private void cancelNotification(NotificationId id, String packageName, UserHandle user) { final long identityToken = clearCallingIdentity(); try { INotificationManager service = mInjector.getNotificationManager(); service.cancelNotificationWithTag( packageName, "android", id.mTag, id.mId, user.getIdentifier()); } catch (RemoteException e) { /* ignore - local call */ } finally { restoreCallingIdentity(identityToken); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cancelNotification 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
cancelNotification
services/core/java/com/android/server/accounts/AccountManagerService.java
f810d81839af38ee121c446105ca67cb12992fc6
0
Analyze the following code function for security vulnerabilities
void sendUserSwitchBroadcastsLocked(int oldUserId, int newUserId) { long ident = Binder.clearCallingIdentity(); try { Intent intent; if (oldUserId >= 0) { // Send USER_BACKGROUND broadcast to all profiles of the outgoing user List<UserInfo> profiles = mUserManager.getProfiles(oldUserId, false); int count = profiles.size(); for (int i = 0; i < count; i++) { int profileUserId = profiles.get(i).id; intent = new Intent(Intent.ACTION_USER_BACKGROUND); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, profileUserId); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, MY_PID, Process.SYSTEM_UID, profileUserId); } } if (newUserId >= 0) { // Send USER_FOREGROUND broadcast to all profiles of the incoming user List<UserInfo> profiles = mUserManager.getProfiles(newUserId, false); int count = profiles.size(); for (int i = 0; i < count; i++) { int profileUserId = profiles.get(i).id; intent = new Intent(Intent.ACTION_USER_FOREGROUND); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, profileUserId); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null, AppOpsManager.OP_NONE, false, false, MY_PID, Process.SYSTEM_UID, profileUserId); } intent = new Intent(Intent.ACTION_USER_SWITCHED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(Intent.EXTRA_USER_HANDLE, newUserId); broadcastIntentLocked(null, null, intent, null, null, 0, null, null, android.Manifest.permission.MANAGE_USERS, AppOpsManager.OP_NONE, false, false, MY_PID, Process.SYSTEM_UID, UserHandle.USER_ALL); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendUserSwitchBroadcastsLocked 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
sendUserSwitchBroadcastsLocked
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
protected Client buildHttpClient() { // use the default client config if not yet initialized if (clientConfig == null) { clientConfig = getDefaultClientConfig(); } ClientBuilder clientBuilder = ClientBuilder.newBuilder(); customizeClientBuilder(clientBuilder); clientBuilder = clientBuilder.withConfig(clientConfig); return clientBuilder.build(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildHttpClient File: samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java Repository: OpenAPITools/openapi-generator The code follows secure coding practices.
[ "CWE-668" ]
CVE-2021-21430
LOW
2.1
OpenAPITools/openapi-generator
buildHttpClient
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
public XWikiDocument rollback(final XWikiDocument tdoc, String rev, boolean addRevision, XWikiContext xcontext) throws XWikiException { LOGGER.debug("Rolling back [{}] to version [{}]", tdoc, rev); // Clone the document before modifying to avoid concurrency issues XWikiDocument document = tdoc.clone(); XWikiDocument rolledbackDoc = getDocumentRevisionProvider().getRevision(tdoc, rev); // Restore attachments if ("1".equals(getConfiguration().getProperty("xwiki.store.rollbackattachmentwithdocuments", "1"))) { LOGGER.debug("Checking attachments"); for (XWikiAttachment rolledbackAttachment : rolledbackDoc.getAttachmentList()) { String filename = rolledbackAttachment.getFilename(); XWikiAttachment attachment = document.getAttachment(filename); if (attachment == null) { // The attachment has been deleted, search and restore it LOGGER.debug("Deleted attachment: [{}]", filename); // Restore content and archive from the recycle bin restoreDeletedAttachment(rolledbackAttachment, xcontext); } else { XWikiAttachment attachmentRevision = attachment.getAttachmentRevision(rolledbackAttachment.getVersion(), xcontext); // We compare the number of milliseconds instead of the date objects directly because Hibernate can // return java.sql.Timestamp for date fields and the JavaDoc says that Timestamp.equals(Object) // doesn't return true if the passed value is a java.util.Date object with the same number of // milliseconds because the nanoseconds component of the passed date is unknown. if (attachmentRevision == null || attachmentRevision.getDate().getTime() != rolledbackAttachment.getDate().getTime()) { // Recreated attachment LOGGER.debug("Recreated attachment: [{}]", filename); // Mark current attachment for deletion to not loose it document.removeAttachment(attachment); // Search and restore previously deleted one // If the attachment trash is not available, don't lose the existing attachment if (getAttachmentRecycleBinStore() != null) { // Restore in the right version restoreDeletedAttachment(rolledbackAttachment, xcontext); } } else { // Restore content and archive from the recycle bin rolledbackAttachment.apply(attachmentRevision); } } } } document.apply(rolledbackDoc); // Prepare the XWikiDocument before save document.setAuthorReference(xcontext.getUserReference()); document.setContentAuthorReference(xcontext.getUserReference()); // Make sure the history is not modified if addRevision is disabled String message; if (!addRevision) { document.setVersion(rev); document.setMetaDataDirty(false); document.setContentDirty(false); message = document.getComment(); } else { // Make sure to save a new version even if nothing changed document.setMetaDataDirty(true); message = localizePlainOrKey("core.comment.rollback", rev); } ObservationManager om = getObservationManager(); if (om != null) { // Notify listeners about the document that is going to be rolled back. // Note that for the moment the event being send is a bridge event, as we are still passing around // an XWikiDocument as source and an XWikiContext as data. om.notify(new DocumentRollingBackEvent(document.getDocumentReference(), rev), document, xcontext); } XWikiDocument originalDocument = document.getOriginalDocument(); saveDocument(document, message, xcontext); // Since XWiki#saveDocument resets the original document, we need to temporarily put it back to send // notifications. XWikiDocument newOriginalDocument = document.getOriginalDocument(); document.setOriginalDocument(originalDocument); try { if (om != null) { // Notify listeners about the document that was rolled back. // Note that for the moment the event being send is a bridge event, as we are still passing around an // XWikiDocument as source and an XWikiContext as data. om.notify(new DocumentRolledBackEvent(document.getDocumentReference(), rev), document, xcontext); } } finally { document.setOriginalDocument(newOriginalDocument); } return document; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: rollback 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
rollback
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
R apply(T t) throws E;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: apply 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
apply
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public static Text createTextNode(String text) { return document.createTextNode(text); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createTextNode File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-3869
MEDIUM
5
stanfordnlp/CoreNLP
createTextNode
src/edu/stanford/nlp/util/XMLUtils.java
5d83f1e8482ca304db8be726cad89554c88f136a
0
Analyze the following code function for security vulnerabilities
@Nullable public PersistableBundle getTransferOwnershipBundle() { throwIfParentInstance("getTransferOwnershipBundle"); try { return mService.getTransferOwnershipBundle(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTransferOwnershipBundle 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
getTransferOwnershipBundle
core/java/android/app/admin/DevicePolicyManager.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public int getPreExpandValueSetsDefaultCount() { return myPreExpandValueSetsDefaultCount; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPreExpandValueSetsDefaultCount File: hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java Repository: hapifhir/hapi-fhir The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-32053
MEDIUM
5
hapifhir/hapi-fhir
getPreExpandValueSetsDefaultCount
hapi-fhir-jpaserver-api/src/main/java/ca/uhn/fhir/jpa/api/config/DaoConfig.java
f2934b229c491235ab0e7782dea86b324521082a
0
Analyze the following code function for security vulnerabilities
private boolean shouldRestrictVisibility() { int callingUid = Binder.getCallingUid(); return Binder.getCallingPid() != Process.myPid() && callingUid != mSystemUid && callingUid != mDefContainerUid; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: shouldRestrictVisibility File: src/com/android/providers/downloads/DownloadProvider.java Repository: android The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-0848
HIGH
7.2
android
shouldRestrictVisibility
src/com/android/providers/downloads/DownloadProvider.java
bdc831357e7a116bc561d51bf2ddc85ff11c01a9
0
Analyze the following code function for security vulnerabilities
public void allowTypeHierarchy(Class type) { addPermission(new TypeHierarchyPermission(type)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: allowTypeHierarchy File: xstream/src/java/com/thoughtworks/xstream/XStream.java Repository: x-stream/xstream The code follows secure coding practices.
[ "CWE-400" ]
CVE-2021-43859
MEDIUM
5
x-stream/xstream
allowTypeHierarchy
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
@Nullable protected String getMessage(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); StandardEvaluationContext context = new StandardEvaluationContext(root); context.addPropertyAccessor(new MapAccessor()); return description.getValue(context, String.class); }
Vulnerability Classification: - CWE: CWE-94 - CVE: CVE-2022-46166 - Severity: CRITICAL - CVSS Score: 9.8 Description: feat: improve notifiers Function: getMessage File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java Repository: codecentric/spring-boot-admin Fixed Code: @Nullable protected String getMessage(InstanceEvent event, Instance instance) { Map<String, Object> root = new HashMap<>(); root.put("event", event); root.put("instance", instance); root.put("lastStatus", getLastStatus(event.getInstance())); SimpleEvaluationContext context = SimpleEvaluationContext .forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor()) .withRootObject(root).build(); return description.getValue(context, String.class); }
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
getMessage
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/HipchatNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
1
Analyze the following code function for security vulnerabilities
public static void cursorLongToContentValuesIfPresent(Cursor cursor, ContentValues values, String column) { final int index = cursor.getColumnIndex(column); if (index != -1 && !cursor.isNull(index)) { values.put(column, cursor.getLong(index)); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cursorLongToContentValuesIfPresent File: core/java/android/database/DatabaseUtils.java Repository: android The code follows secure coding practices.
[ "CWE-502" ]
CVE-2023-40121
MEDIUM
5.5
android
cursorLongToContentValuesIfPresent
core/java/android/database/DatabaseUtils.java
3287ac2d2565dc96bf6177967f8e3aed33954253
0
Analyze the following code function for security vulnerabilities
private void stopCallingSound() { if (mediaPlayer != null) { if (mediaPlayer.isPlaying()) { mediaPlayer.stop(); } mediaPlayer.release(); mediaPlayer = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopCallingSound File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java Repository: nextcloud/talk-android The code follows secure coding practices.
[ "CWE-732", "CWE-200" ]
CVE-2022-41926
MEDIUM
5.5
nextcloud/talk-android
stopCallingSound
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
0
Analyze the following code function for security vulnerabilities
public void initializeProvisioner(Looper looper) { mPasspointProvisioner.init(looper); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initializeProvisioner File: service/java/com/android/server/wifi/hotspot2/PasspointManager.java Repository: android The code follows secure coding practices.
[ "CWE-120" ]
CVE-2023-21243
MEDIUM
5.5
android
initializeProvisioner
service/java/com/android/server/wifi/hotspot2/PasspointManager.java
5b49b8711efaadadf5052ba85288860c2d7ca7a6
0
Analyze the following code function for security vulnerabilities
public void removeSession(WrappedSession wrappedSession) { assert VaadinSession.hasLock(this, wrappedSession); removeFromHttpSession(wrappedSession); wrappedSession.removeAttribute(getCsrfTokenAttributeName()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeSession File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java Repository: vaadin/flow The code follows secure coding practices.
[ "CWE-203" ]
CVE-2021-31404
LOW
1.9
vaadin/flow
removeSession
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
621ef1b322737d963bee624b2d2e38cd739903d9
0
Analyze the following code function for security vulnerabilities
private @UserIdInt int getSecurityLoggingEnabledUser() { synchronized (getLockObject()) { if (mOwners.hasDeviceOwner()) { return UserHandle.USER_ALL; } } return getOrganizationOwnedProfileUserId(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSecurityLoggingEnabledUser 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
getSecurityLoggingEnabledUser
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public boolean setUrl(String url, String formattedUrl) { if (!TextUtils.isEmpty(formattedUrl)) { try { URL javaUrl = new URL(url); mFormattedUrlLocation = getUrlContentsPrePath(formattedUrl, javaUrl.getHost()); mOriginalUrlLocation = getUrlContentsPrePath(url, javaUrl.getHost()); } catch (MalformedURLException mue) { mOriginalUrlLocation = null; mFormattedUrlLocation = null; } } else { mOriginalUrlLocation = null; mFormattedUrlLocation = null; formattedUrl = url; } Editable previousText = getEditableText(); setText(formattedUrl); if (!isFocused()) scrollToTLD(); return !TextUtils.equals(previousText, getEditableText()); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setUrl File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java Repository: chromium The code follows secure coding practices.
[ "CWE-254" ]
CVE-2016-5163
MEDIUM
4.3
chromium
setUrl
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
@Override public void execute(String url) { execute(url, null); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: execute 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
execute
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public int checkGrantUriPermission(int callingUid, String targetPkg, Uri uri, int modeFlags, int userId) throws RemoteException;
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkGrantUriPermission File: core/java/android/app/IActivityManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
checkGrantUriPermission
core/java/android/app/IActivityManager.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
void sendOnRestorePackage(String name) { if (mObserver != null) { if (mObserver != null) { try { mObserver.onUpdate(mCount, name); } catch (RemoteException e) { Slog.d(TAG, "Restore observer died in onUpdate"); mObserver = null; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: sendOnRestorePackage 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
sendOnRestorePackage
services/backup/java/com/android/server/backup/BackupManagerService.java
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
0
Analyze the following code function for security vulnerabilities
@ParameterizedTest @MethodSource("testsParameters") @Order(4) void registerDifferentPasswords(boolean useLiveValidation, boolean isModal, TestUtils testUtils) throws Exception { AbstractRegistrationPage registrationPage = setUp(testUtils, useLiveValidation, isModal); registrationPage.fillRegisterForm(null, null, null, null, "DifferentPassword", null); assertFalse(validateAndRegister(testUtils, useLiveValidation, isModal, registrationPage)); assertTrue(registrationPage.validationFailureMessagesInclude("The two passwords do not match.")); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: registerDifferentPasswords File: xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java Repository: xwiki/xwiki-platform The code follows secure coding practices.
[ "CWE-94" ]
CVE-2024-21650
CRITICAL
9.8
xwiki/xwiki-platform
registerDifferentPasswords
xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker/src/test/it/org/xwiki/administration/test/ui/RegisterIT.java
b290bfd573c6f7db6cc15a88dd4111d9fcad0d31
0
Analyze the following code function for security vulnerabilities
public TvExtender setDeleteIntent(PendingIntent intent) { mDeleteIntent = intent; return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDeleteIntent File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
setDeleteIntent
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
@Override public void setCommonCriteriaModeEnabled(ComponentName who, String callerPackageName, boolean enabled) { CallerIdentity caller; if (isPermissionCheckFlagEnabled()) { caller = getCallerIdentity(who, callerPackageName); } else { caller = getCallerIdentity(who); } final ActiveAdmin admin; if (isPermissionCheckFlagEnabled()) { EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin( who, MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE, caller.getPackageName(), caller.getUserId()); admin = enforcingAdmin.getActiveAdmin(); } else { Objects.requireNonNull(who, "ComponentName is null"); Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwnerOfOrganizationOwnedDevice(caller), "Common Criteria mode can only be controlled by a device owner or " + "a profile owner on an organization-owned device."); synchronized (getLockObject()) { admin = getProfileOwnerOrDeviceOwnerLocked(caller.getUserId()); } } synchronized (getLockObject()) { admin.mCommonCriteriaMode = enabled; saveSettingsLocked(caller.getUserId()); } DevicePolicyEventLogger .createEvent(DevicePolicyEnums.SET_COMMON_CRITERIA_MODE) .setAdmin(caller.getPackageName()) .setBoolean(enabled) .write(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setCommonCriteriaModeEnabled File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
setCommonCriteriaModeEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
public SparseBooleanArray getKnownUsersLocked() { SparseBooleanArray users = new SparseBooleanArray(); for (int i = mSettingsStates.size()-1; i >= 0; i--) { users.put(getUserIdFromKey(mSettingsStates.keyAt(i)), true); } return users; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getKnownUsersLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40117
HIGH
7.8
android
getKnownUsersLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
public File newFile(String fileName) throws IOException { File file = new File(getRoot(), fileName); if (!file.createNewFile()) { throw new IOException( "a file with the name \'" + fileName + "\' already exists in the test folder"); } return file; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: newFile File: src/main/java/org/junit/rules/TemporaryFolder.java Repository: junit-team/junit4 The code follows secure coding practices.
[ "CWE-732" ]
CVE-2020-15250
LOW
1.9
junit-team/junit4
newFile
src/main/java/org/junit/rules/TemporaryFolder.java
610155b8c22138329f0723eec22521627dbc52ae
0
Analyze the following code function for security vulnerabilities
@Override public void warning(final CSSParseException exception) throws CSSException { // ignore }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: warning File: src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java Repository: HtmlUnit/htmlunit The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-2798
HIGH
7.5
HtmlUnit/htmlunit
warning
src/main/java/com/gargoylesoftware/htmlunit/html/DomNode.java
940dc7fd
0
Analyze the following code function for security vulnerabilities
@Override public Channel getChannel() { if (ctx == null) { // Maybe we should better throw an IllegalStateException() ? return null; } else { return ctx.getChannel(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getChannel File: src/main/java/org/jboss/netty/handler/ssl/SslHandler.java Repository: netty The code follows secure coding practices.
[ "CWE-119" ]
CVE-2014-3488
MEDIUM
5
netty
getChannel
src/main/java/org/jboss/netty/handler/ssl/SslHandler.java
2fa9400a59d0563a66908aba55c41e7285a04994
0
Analyze the following code function for security vulnerabilities
@Override public boolean stopViewServer() { if (isSystemSecure()) { return false; } if (!checkCallingPermission(Manifest.permission.DUMP, "stopViewServer")) { return false; } if (mViewServer != null) { return mViewServer.stop(); } return false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopViewServer 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
stopViewServer
services/core/java/com/android/server/wm/WindowManagerService.java
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
0
Analyze the following code function for security vulnerabilities
static IAudioService getAudioService() { IAudioService audioService = IAudioService.Stub.asInterface( ServiceManager.checkService(Context.AUDIO_SERVICE)); if (audioService == null) { Log.w(TAG, "Unable to find IAudioService interface."); } return audioService; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAudioService File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-0812
MEDIUM
6.6
android
getAudioService
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
private void processInitProfilePriorities (BluetoothDevice device, ParcelUuid[] uuids){ HidService hidService = HidService.getHidService(); A2dpService a2dpService = A2dpService.getA2dpService(); HeadsetService headsetService = HeadsetService.getHeadsetService(); // Set profile priorities only for the profiles discovered on the remote device. // This avoids needless auto-connect attempts to profiles non-existent on the remote device if ((hidService != null) && (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hid) || BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hogp)) && (hidService.getPriority(device) == BluetoothProfile.PRIORITY_UNDEFINED)){ hidService.setPriority(device,BluetoothProfile.PRIORITY_ON); } // If we do not have a stored priority for A2DP then default to on. if ((a2dpService != null) && (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.AudioSink) || BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.AdvAudioDist)) && (a2dpService.getPriority(device) == BluetoothProfile.PRIORITY_UNDEFINED)){ a2dpService.setPriority(device,BluetoothProfile.PRIORITY_ON); } if ((headsetService != null) && ((BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.HSP) || BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Handsfree)) && (headsetService.getPriority(device) == BluetoothProfile.PRIORITY_UNDEFINED))){ headsetService.setPriority(device,BluetoothProfile.PRIORITY_ON); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: processInitProfilePriorities File: src/com/android/bluetooth/btservice/AdapterService.java Repository: android The code follows secure coding practices.
[ "CWE-362", "CWE-20" ]
CVE-2016-3760
MEDIUM
5.4
android
processInitProfilePriorities
src/com/android/bluetooth/btservice/AdapterService.java
122feb9a0b04290f55183ff2f0384c6c53756bd8
0
Analyze the following code function for security vulnerabilities
public void removeAuthority(EndPoint info) { synchronized (mAuthorities) { if (info.target_provider) { removeAuthorityLocked(info.account, info.userId, info.provider, true /* doWrite */); } else { SparseArray<AuthorityInfo> aInfos = mServices.get(info.service); if (aInfos != null) { AuthorityInfo authorityInfo = aInfos.get(info.userId); if (authorityInfo != null) { mAuthorities.remove(authorityInfo.ident); aInfos.delete(info.userId); writeAccountInfoLocked(); } } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: removeAuthority File: services/core/java/com/android/server/content/SyncStorageEngine.java Repository: android The code follows secure coding practices.
[ "CWE-20" ]
CVE-2016-2424
HIGH
7.1
android
removeAuthority
services/core/java/com/android/server/content/SyncStorageEngine.java
d3383d5bfab296ba3adbc121ff8a7b542bde4afb
0
Analyze the following code function for security vulnerabilities
private boolean areApplicationExemptionsValid(int[] exemptions) { for (int exemption : exemptions) { if (!APPLICATION_EXEMPTION_CONSTANTS_TO_APP_OPS.containsKey(exemption)) { return false; } } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: areApplicationExemptionsValid File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40089
HIGH
7.8
android
areApplicationExemptionsValid
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
e2e05f488da6abc765a62e7faf10cb74e729732e
0
Analyze the following code function for security vulnerabilities
@Override public long getDateHeader(String x) { return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDateHeader 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
getDateHeader
h2/src/test/org/h2/test/server/TestWeb.java
23ee3d0b973923c135fa01356c8eaed40b895393
0
Analyze the following code function for security vulnerabilities
public static void setDirectoryDirty(File dir, boolean isDirty) { File nomedia = new File(dir, ".nomedia"); if (nomedia.exists() && nomedia.isFile()) { try { writeString(nomedia, isDirty ? Optional.of("") : Optional.of(dir.getPath())); } catch (IOException e) { Log.w(TAG, "Failed to change directory dirty: " + dir + ". isDirty: " + isDirty); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDirectoryDirty File: src/com/android/providers/media/util/FileUtils.java Repository: android The code follows secure coding practices.
[ "CWE-22" ]
CVE-2023-35670
HIGH
7.8
android
setDirectoryDirty
src/com/android/providers/media/util/FileUtils.java
db3c69afcb0a45c8aa2f333fcde36217889899fe
0
Analyze the following code function for security vulnerabilities
@Override public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { synchronized (OpenSslEngine.this) { if (x509PeerCerts == null || x509PeerCerts.length == 0) { throw new SSLPeerUnverifiedException("peer not verified"); } return x509PeerCerts; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getPeerCertificateChain 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
getPeerCertificateChain
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
bc8291c80912a39fbd2303e18476d15751af0bf1
0
Analyze the following code function for security vulnerabilities
@Override public boolean resizeTask(int taskId, Rect bounds, int resizeMode) { enforceTaskPermission("resizeTask()"); final long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { final Task task = mRootWindowContainer.anyTaskForId(taskId, MATCH_ATTACHED_TASK_ONLY); if (task == null) { Slog.w(TAG, "resizeTask: taskId=" + taskId + " not found"); return false; } if (!task.getWindowConfiguration().canResizeTask()) { Slog.w(TAG, "resizeTask not allowed on task=" + task); return false; } // Reparent the task to the right root task if necessary boolean preserveWindow = (resizeMode & RESIZE_MODE_PRESERVE_WINDOW) != 0; // After reparenting (which only resizes the task to the root task bounds), // resize the task to the actual bounds provided return task.resize(bounds, resizeMode, preserveWindow); } } finally { Binder.restoreCallingIdentity(ident); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: resizeTask File: services/core/java/com/android/server/wm/ActivityTaskManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-40094
HIGH
7.8
android
resizeTask
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0