instruction
string
input
string
output
string
cwe_ids
list
cve_id
string
severity
string
cvss_score
float64
repo_name
string
func_name
string
file_path
string
commit_hash
string
is_vulnerable
int64
Analyze the following code function for security vulnerabilities
public static Document readDocumentFromFile(String filename) throws Exception { InputSource in = new InputSource(new FileReader(filename)); DocumentBuilderFactory factory = safeDocumentBuilderFactory(); factory.setNamespaceAware(false); DocumentBuilder db = factory.newDocumentBuilder(); db.setErrorHandler(new SAXErrorHandler()); return db.parse(in); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readDocumentFromFile File: src/edu/stanford/nlp/util/XMLUtils.java Repository: stanfordnlp/CoreNLP The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-0239
HIGH
7.5
stanfordnlp/CoreNLP
readDocumentFromFile
src/edu/stanford/nlp/util/XMLUtils.java
1940ffb938dc4f3f5bc5f2a2fd8b35aabbbae3dd
0
Analyze the following code function for security vulnerabilities
@Override public Point getAppTaskThumbnailSize() { synchronized (mGlobalLock) { return new Point(mThumbnailWidth, mThumbnailHeight); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppTaskThumbnailSize 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
getAppTaskThumbnailSize
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Override public long getSize(String fileName) throws DirectoryException { File file = new File(generatePath(fileName)); if (! file.isFile()) { throw new DirectoryException("file must be a file: " + file); } return file.length(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getSize File: brut.j.dir/src/main/java/brut/directory/FileDirectory.java Repository: iBotPeaches/Apktool The code follows secure coding practices.
[ "CWE-22" ]
CVE-2024-21633
HIGH
7.8
iBotPeaches/Apktool
getSize
brut.j.dir/src/main/java/brut/directory/FileDirectory.java
d348c43b24a9de350ff6e5bd610545a10c1fc712
0
Analyze the following code function for security vulnerabilities
public boolean insertSettingLocked(int type, int userId, String name, String value, String packageName, boolean forceNotify) { final int key = makeKey(type, userId); SettingsState settingsState = peekSettingsStateLocked(key); final boolean success = settingsState.insertSettingLocked(name, value, packageName); if (forceNotify || success) { notifyForSettingsChange(key, name); } return success; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: insertSettingLocked File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
insertSettingLocked
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
private boolean readFraction() throws IOException { if (!readIf('.')) { return false; } if (!readDigit()) { throw expected("digit"); } while (readDigit()) { } return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readFraction File: src/main/org/hjson/JsonParser.java Repository: hjson/hjson-java The code follows secure coding practices.
[ "CWE-787" ]
CVE-2023-34620
HIGH
7.5
hjson/hjson-java
readFraction
src/main/org/hjson/JsonParser.java
91bef056d56bf968451887421c89a44af1d692ff
0
Analyze the following code function for security vulnerabilities
private void updateLinkBandwidth(NetworkCapabilities.Builder networkCapabilitiesBuilder) { int txTputKbps = 0; int rxTputKbps = 0; int currRssi = mWifiInfo.getRssi(); if (currRssi != WifiInfo.INVALID_RSSI) { WifiScoreCard.PerNetwork network = mWifiScoreCard.lookupNetwork(mWifiInfo.getSSID()); txTputKbps = network.getTxLinkBandwidthKbps(); rxTputKbps = network.getRxLinkBandwidthKbps(); } else { // Fall back to max link speed. This should rarely happen if ever int maxTxLinkSpeedMbps = mWifiInfo.getMaxSupportedTxLinkSpeedMbps(); int maxRxLinkSpeedMbps = mWifiInfo.getMaxSupportedRxLinkSpeedMbps(); txTputKbps = maxTxLinkSpeedMbps * 1000; rxTputKbps = maxRxLinkSpeedMbps * 1000; } if (mVerboseLoggingEnabled) { logd("reported txKbps " + txTputKbps + " rxKbps " + rxTputKbps); } if (txTputKbps > 0) { networkCapabilitiesBuilder.setLinkUpstreamBandwidthKbps(txTputKbps); } if (rxTputKbps > 0) { networkCapabilitiesBuilder.setLinkDownstreamBandwidthKbps(rxTputKbps); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLinkBandwidth File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateLinkBandwidth
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public String[] getAllLocalClaimUris(String tenantDomain) throws IdentityApplicationManagementException { try { startTenantFlow(tenantDomain); String claimDialect = ApplicationMgtSystemConfig.getInstance().getClaimDialect(); List<String> claimUris = new ArrayList<>(); if (UserCoreConstants.DEFAULT_CARBON_DIALECT.equalsIgnoreCase(claimDialect)) { // Local claims are retrieved via ClaimMetadataManagement service for consistency. List<LocalClaim> localClaims = ApplicationManagementServiceComponentHolder.getInstance() .getClaimMetadataManagementService().getLocalClaims(tenantDomain); claimUris = getLocalClaimURIs(localClaims); } else { ClaimMapping[] claimMappings = CarbonContext.getThreadLocalCarbonContext().getUserRealm() .getClaimManager().getAllClaimMappings(claimDialect); for (ClaimMapping claimMap : claimMappings) { claimUris.add(claimMap.getClaim().getClaimUri()); } } String[] allLocalClaimUris = (claimUris.toArray(new String[claimUris.size()])); if (ArrayUtils.isNotEmpty(allLocalClaimUris)) { Arrays.sort(allLocalClaimUris); } return allLocalClaimUris; } catch (Exception e) { String error = "Error while reading system claims" + ". " + e.getMessage(); throw new IdentityApplicationManagementException(error, e); } finally { endTenantFlow(); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAllLocalClaimUris File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
getAllLocalClaimUris
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
public <P extends ParaObject> Map<String, String> validate(P pobj) { HashMap<String, String> error = new HashMap<String, String>(); if (pobj != null) { Set<ConstraintViolation<P>> errors = ValidationUtils.getValidator().validate(pobj); for (ConstraintViolation<P> err : errors) { error.put(err.getPropertyPath().toString(), err.getMessage()); } } return error; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validate 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
validate
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
@Override public int delete(Uri arg0, String arg1, String[] arg2) { // TODO Auto-generated method stub return 0; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: delete File: src/at/hgz/vocabletrainer/VocableTrainerProvider.java Repository: hgzojer/vocabletrainer The code follows secure coding practices.
[ "CWE-22" ]
CVE-2017-20181
MEDIUM
4.3
hgzojer/vocabletrainer
delete
src/at/hgz/vocabletrainer/VocableTrainerProvider.java
accf6838078f8eb105cfc7865aba5c705fb68426
0
Analyze the following code function for security vulnerabilities
public static int getUserIdFromKey(int key) { return key & ~SETTINGS_TYPE_MASK; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getUserIdFromKey File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3876
HIGH
7.2
android
getUserIdFromKey
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
91fc934bb2e5ea59929bb2f574de6db9b5100745
0
Analyze the following code function for security vulnerabilities
@Subscribe public void publishClusterEvent(Object event) { if (event instanceof DeadEvent) { LOG.debug("Skipping DeadEvent on cluster event bus"); return; } final String className = AutoValueUtils.getCanonicalName(event.getClass()); final ClusterEvent clusterEvent = ClusterEvent.create(nodeId.getNodeId(), className, Collections.singleton(nodeId.getNodeId()), event); try { final String id = dbCollection.save(clusterEvent, WriteConcern.JOURNALED).getSavedId(); // We are handling a locally generated event, so we can speed up processing by posting it to the local event // bus immediately. Due to having added the local node id to its list of consumers, it will not be picked up // by the db cursor again, avoiding double processing of the event. See #11263 for details. serverEventBus.post(event); LOG.debug("Published cluster event with ID <{}> and type <{}>", id, className); } catch (MongoException e) { LOG.error("Couldn't publish cluster event of type <" + className + ">", e); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: publishClusterEvent File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-863" ]
CVE-2024-24824
HIGH
8.8
Graylog2/graylog2-server
publishClusterEvent
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
0
Analyze the following code function for security vulnerabilities
private void tryRetrieveAndSendLocationUpdate(ActiveAdmin admin, AndroidFuture<Boolean> future, String[] providers, int index) { // None of the providers were able to get location, return false if (index == providers.length) { future.complete(false); return; } if (mInjector.getLocationManager().isProviderEnabled(providers[index])) { mInjector.getLocationManager().getCurrentLocation(providers[index], /* cancellationSignal= */ null, mContext.getMainExecutor(), location -> { if (location != null) { mContext.sendBroadcastAsUser( newLostModeLocationUpdateIntent(admin, location), admin.getUserHandle()); future.complete(true); } else { tryRetrieveAndSendLocationUpdate(admin, future, providers, index + 1); } } ); } else { tryRetrieveAndSendLocationUpdate(admin, future, providers, index + 1); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: tryRetrieveAndSendLocationUpdate 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
tryRetrieveAndSendLocationUpdate
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Deprecated public String buildUnionSubQuery( String typeDiscriminatorColumn, String[] unionColumns, Set<String> columnsPresentInTable, int computedColumnsOffset, String typeDiscriminatorValue, String selection, String[] selectionArgs, String groupBy, String having) { return buildUnionSubQuery( typeDiscriminatorColumn, unionColumns, columnsPresentInTable, computedColumnsOffset, typeDiscriminatorValue, selection, groupBy, having); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: buildUnionSubQuery File: core/java/android/database/sqlite/SQLiteQueryBuilder.java Repository: android The code follows secure coding practices.
[ "CWE-89" ]
CVE-2018-9493
LOW
2.1
android
buildUnionSubQuery
core/java/android/database/sqlite/SQLiteQueryBuilder.java
ebc250d16c747f4161167b5ff58b3aea88b37acf
0
Analyze the following code function for security vulnerabilities
public <T> ServerBuilder childChannelOption(ChannelOption<T> option, T value) { requireNonNull(option, "option"); checkArgument(!ChannelUtil.prohibitedOptions().contains(option), "prohibited socket option: %s", option); option.validate(value); childChannelOptions.put(option, value); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: childChannelOption File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
childChannelOption
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
public ServerBuilder http1MaxHeaderSize(int http1MaxHeaderSize) { this.http1MaxHeaderSize = validateNonNegative(http1MaxHeaderSize, "http1MaxHeaderSize"); return this; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: http1MaxHeaderSize File: core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-44487
HIGH
7.5
line/armeria
http1MaxHeaderSize
core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java
df7f85824a62e997b910b5d6194a3335841065fd
0
Analyze the following code function for security vulnerabilities
@Override protected long contentletCount() throws DotDataException { DotConnect dc = new DotConnect(); dc.setSQL("select count(*) as count from contentlet"); List<Map<String,String>> results = dc.loadResults(); long count = Long.parseLong(results.get(0).get("count")); return count; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: contentletCount File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java Repository: dotCMS/core The code follows secure coding practices.
[ "CWE-89" ]
CVE-2016-2355
HIGH
7.5
dotCMS/core
contentletCount
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
897f3632d7e471b7a73aabed5b19f6f53d4e5562
0
Analyze the following code function for security vulnerabilities
private final String checkContentProviderPermissionLocked( ProviderInfo cpi, ProcessRecord r, int userId, boolean checkUser) { final int callingPid = (r != null) ? r.pid : Binder.getCallingPid(); final int callingUid = (r != null) ? r.uid : Binder.getCallingUid(); boolean checkedGrants = false; if (checkUser) { // Looking for cross-user grants before enforcing the typical cross-users permissions int tmpTargetUserId = mUserController.unsafeConvertIncomingUser(userId); if (tmpTargetUserId != UserHandle.getUserId(callingUid)) { if (checkAuthorityGrants(callingUid, cpi, tmpTargetUserId, checkUser)) { return null; } checkedGrants = true; } userId = mUserController.handleIncomingUser(callingPid, callingUid, userId, false, ALLOW_NON_FULL, "checkContentProviderPermissionLocked " + cpi.authority, null); if (userId != tmpTargetUserId) { // When we actually went to determine the final targer user ID, this ended // up different than our initial check for the authority. This is because // they had asked for USER_CURRENT_OR_SELF and we ended up switching to // SELF. So we need to re-check the grants again. checkedGrants = false; } } if (checkComponentPermission(cpi.readPermission, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } if (checkComponentPermission(cpi.writePermission, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } PathPermission[] pps = cpi.pathPermissions; if (pps != null) { int i = pps.length; while (i > 0) { i--; PathPermission pp = pps[i]; String pprperm = pp.getReadPermission(); if (pprperm != null && checkComponentPermission(pprperm, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } String ppwperm = pp.getWritePermission(); if (ppwperm != null && checkComponentPermission(ppwperm, callingPid, callingUid, cpi.applicationInfo.uid, cpi.exported) == PackageManager.PERMISSION_GRANTED) { return null; } } } if (!checkedGrants && checkAuthorityGrants(callingUid, cpi, userId, checkUser)) { return null; } final String suffix; if (!cpi.exported) { suffix = " that is not exported from UID " + cpi.applicationInfo.uid; } else if (android.Manifest.permission.MANAGE_DOCUMENTS.equals(cpi.readPermission)) { suffix = " requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs"; } else { suffix = " requires " + cpi.readPermission + " or " + cpi.writePermission; } final String msg = "Permission Denial: opening provider " + cpi.name + " from " + (r != null ? r : "(null)") + " (pid=" + callingPid + ", uid=" + callingUid + ")" + suffix; Slog.w(TAG, msg); return msg; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkContentProviderPermissionLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
checkContentProviderPermissionLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
@Override public Entry<AsciiString, String> next() { current = current.after; if (current == head) { throw new NoSuchElementException(); } return current; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: next File: core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java Repository: line/armeria The code follows secure coding practices.
[ "CWE-74" ]
CVE-2019-16771
MEDIUM
5
line/armeria
next
core/src/main/java/com/linecorp/armeria/common/HttpHeadersBase.java
b597f7a865a527a84ee3d6937075cfbb4470ed20
0
Analyze the following code function for security vulnerabilities
boolean checkEnterPictureInPictureState(String caller, boolean beforeStopping) { if (!supportsPictureInPicture()) { return false; } // Check app-ops and see if PiP is supported for this package if (!checkEnterPictureInPictureAppOpsState()) { return false; } // Check to see if we are in VR mode, and disallow PiP if so if (mAtmService.shouldDisableNonVrUiLocked()) { return false; } // Check to see if PiP is supported for the display this container is on. if (mDisplayContent != null && !mDisplayContent.mDwpcHelper.isWindowingModeSupported( WINDOWING_MODE_PINNED)) { Slog.w(TAG, "Display " + mDisplayContent.getDisplayId() + " doesn't support enter picture-in-picture mode. caller = " + caller); return false; } boolean isCurrentAppLocked = mAtmService.getLockTaskModeState() != LOCK_TASK_MODE_NONE; final TaskDisplayArea taskDisplayArea = getDisplayArea(); boolean hasRootPinnedTask = taskDisplayArea != null && taskDisplayArea.hasPinnedTask(); // Don't return early if !isNotLocked, since we want to throw an exception if the activity // is in an incorrect state boolean isNotLockedOrOnKeyguard = !isKeyguardLocked() && !isCurrentAppLocked; // We don't allow auto-PiP when something else is already pipped. if (beforeStopping && hasRootPinnedTask) { return false; } switch (mState) { case RESUMED: // When visible, allow entering PiP if the app is not locked. If it is over the // keyguard, then we will prompt to unlock in the caller before entering PiP. return !isCurrentAppLocked && (supportsEnterPipOnTaskSwitch || !beforeStopping); case PAUSING: case PAUSED: // When pausing, then only allow enter PiP as in the resume state, and in addition, // require that there is not an existing PiP activity and that the current system // state supports entering PiP return isNotLockedOrOnKeyguard && !hasRootPinnedTask && supportsEnterPipOnTaskSwitch; case STOPPING: // When stopping in a valid state, then only allow enter PiP as in the pause state. // Otherwise, fall through to throw an exception if the caller is trying to enter // PiP in an invalid stopping state. if (supportsEnterPipOnTaskSwitch) { return isNotLockedOrOnKeyguard && !hasRootPinnedTask; } default: return false; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkEnterPictureInPictureState 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
checkEnterPictureInPictureState
services/core/java/com/android/server/wm/ActivityRecord.java
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
0
Analyze the following code function for security vulnerabilities
private static native boolean nativeContainsAllocatedTable(long ptr);
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: nativeContainsAllocatedTable 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
nativeContainsAllocatedTable
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
private TechAdvance getTechnology(final Element element, final String attribute, final boolean mustFind) throws GameParseException { return getValidatedObject(element, attribute, mustFind, this::getTechnology, "technology"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTechnology File: game-core/src/main/java/games/strategy/engine/data/GameParser.java Repository: triplea-game/triplea The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000546
MEDIUM
6.8
triplea-game/triplea
getTechnology
game-core/src/main/java/games/strategy/engine/data/GameParser.java
0f23875a4c6e166218859a63c884995f15c53895
0
Analyze the following code function for security vulnerabilities
public User addLdapUser(User user) { user.setCreateTime(System.currentTimeMillis()); user.setUpdateTime(System.currentTimeMillis()); user.setStatus(UserStatus.NORMAL); checkEmailIsExist(user.getEmail()); userMapper.insertSelective(user); return user; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addLdapUser File: framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java Repository: metersphere The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-32699
MEDIUM
6.5
metersphere
addLdapUser
framework/gateway/src/main/java/io/metersphere/gateway/service/UserLoginService.java
c59e381d368990214813085a1a4877c5ef865411
0
Analyze the following code function for security vulnerabilities
private void readCameraLensCoverState() { mCameraLensCoverState = mWindowManagerFuncs.getCameraLensCoverState(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: readCameraLensCoverState 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
readCameraLensCoverState
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
84669ca8de55d38073a0dcb01074233b0a417541
0
Analyze the following code function for security vulnerabilities
@Override public void onClick(View v) { if (v == mRightAffordanceView) { launchCamera(CAMERA_LAUNCH_SOURCE_AFFORDANCE); } else if (v == mLeftAffordanceView) { launchLeftAffordance(); } if (v == mLockIcon) { if (!mAccessibilityController.isAccessibilityEnabled()) { handleTrustCircleClick(); } else { mStatusBar.animateCollapsePanels( CommandQueue.FLAG_EXCLUDE_NONE, true /* force */); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onClick File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2017-0822
HIGH
7.5
android
onClick
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
private void initCipher(long packetSequenceNumber) throws Exception { if (key != null) { if (cipher.getAlgorithm().startsWith("ChaCha")) { BufferUtils.putLong(packetSequenceNumber, iv, 0, iv.length); } cipher.init(mode, key, iv); key = null; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: initCipher 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
initCipher
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
6b0fd46f64bcb75eeeee31d65f10242660aad7c1
0
Analyze the following code function for security vulnerabilities
int getResourceArraySize(@ArrayRes int resId) { synchronized (this) { ensureValidLocked(); return nativeGetResourceArraySize(mObject, resId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getResourceArraySize 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
getResourceArraySize
core/java/android/content/res/AssetManager.java
c3bc12c484ef3bbca4cec19234437c45af5e584d
0
Analyze the following code function for security vulnerabilities
public ProfileOutput getOutputByName(String name) { for (ProfileOutput output : outputs) { if (output.getName().equals(name)) return output; } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getOutputByName File: base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getOutputByName
base/common/src/main/java/com/netscape/certsrv/cert/CertEnrollmentRequest.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private void setServiceIcon(View decor, Drawable serviceIcon) { if (serviceIcon == null) { return; } final ImageView iconView = decor.findViewById(R.id.autofill_service_icon); final int actualWidth = serviceIcon.getMinimumWidth(); final int actualHeight = serviceIcon.getMinimumHeight(); if (sDebug) { Slog.d(TAG, "Adding service icon " + "(" + actualWidth + "x" + actualHeight + ")"); } iconView.setImageDrawable(serviceIcon); iconView.setVisibility(View.VISIBLE); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setServiceIcon File: services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
setServiceIcon
services/autofill/java/com/android/server/autofill/ui/DialogFillUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public static void runOnUiThreadAndBlock(final Runnable r) { if (getActivity() == null) { throw new RuntimeException("Cannot run on UI thread because getActivity() is null. This generally means we are running inside a service in the background so UI access is disabled."); } final boolean[] completed = new boolean[1]; getActivity().runOnUiThread(new Runnable() { @Override public void run() { try { r.run(); } catch(Throwable t) { com.codename1.io.Log.e(t); } synchronized(completed) { completed[0] = true; completed.notify(); } } }); Display.getInstance().invokeAndBlock(new Runnable() { @Override public void run() { synchronized(completed) { while(!completed[0]) { try { completed.wait(); } catch(InterruptedException err) {} } } } }); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: runOnUiThreadAndBlock 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
runOnUiThreadAndBlock
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public void updateClob(@Positive int columnIndex, @Nullable Reader reader, long length) throws SQLException { throw org.postgresql.Driver.notImplemented(this.getClass(), "updateClob(int, Reader, long)"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateClob File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
updateClob
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
private void cleanupLoggingSocket() { if (debug_port > 0) { try { s_socket.close(); } catch (Exception e) {} try { c_socket.close(); } catch (Exception e) {} try { ss_socket.close(); } catch (Exception e) {} } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: cleanupLoggingSocket File: src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java Repository: dogtagpki/jss The code follows secure coding practices.
[ "CWE-401" ]
CVE-2021-4213
HIGH
7.5
dogtagpki/jss
cleanupLoggingSocket
src/main/java/org/mozilla/jss/ssl/javax/JSSEngineReferenceImpl.java
5922560a78d0dee61af8a33cc9cfbf4cfa291448
0
Analyze the following code function for security vulnerabilities
@Override protected void onResume() { super.onResume(); mForeground = true; if (mSubMenuVoicemailSettings != null) { mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this); mSubMenuVoicemailSettings.setDialogOnClosedListener(this); mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label); if (!getBooleanCarrierConfig( CarrierConfigManager.KEY_EDITABLE_VOICEMAIL_NUMBER_SETTING_BOOL)) { mSubMenuVoicemailSettings.setEnabled(false); } } mVoicemailProviders = (VoicemailProviderListPreference) findPreference( BUTTON_VOICEMAIL_PROVIDER_KEY); mVoicemailProviders.init(mPhone, getIntent()); mVoicemailProviders.setOnPreferenceChangeListener(this); mPreviousVMProviderKey = mVoicemailProviders.getValue(); mVoicemailSettings = (PreferenceScreen) findPreference(BUTTON_VOICEMAIL_SETTING_KEY); maybeHidePublicSettings(); updateVMPreferenceWidgets(mVoicemailProviders.getValue()); // check the intent that started this activity and pop up the voicemail // dialog if we've been asked to. // If we have at least one non default VM provider registered then bring up // the selection for the VM provider, otherwise bring up a VM number dialog. // We only bring up the dialog the first time we are called (not after orientation change) if (mShowVoicemailPreference) { if (DBG) log("ACTION_ADD_VOICEMAIL Intent is thrown"); if (mVoicemailProviders.hasMoreThanOneVoicemailProvider()) { if (DBG) log("Voicemail data has more than one provider."); simulatePreferenceClick(mVoicemailProviders); } else { onPreferenceChange(mVoicemailProviders, VoicemailProviderListPreference.DEFAULT_KEY); mVoicemailProviders.setValue(VoicemailProviderListPreference.DEFAULT_KEY); } mShowVoicemailPreference = false; } updateVoiceNumberField(); mVMProviderSettingsForced = false; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onResume File: src/com/android/phone/settings/VoicemailSettingsActivity.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-862" ]
CVE-2023-35665
HIGH
7.8
android
onResume
src/com/android/phone/settings/VoicemailSettingsActivity.java
674039e70e1c5bf29b808899ac80c709acc82290
0
Analyze the following code function for security vulnerabilities
@Override public void flush() throws IOException { _outputStream.flush(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: flush File: src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java Repository: rabbitmq/rabbitmq-java-client The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-46120
HIGH
7.5
rabbitmq/rabbitmq-java-client
flush
src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java
714aae602dcae6cb4b53cadf009323ebac313cc8
0
Analyze the following code function for security vulnerabilities
void reportGlobalUsageEventLocked(int event) { mUsageStatsService.reportEvent("android", mUserController.getCurrentUserId(), event); int[] profiles = mUserController.getCurrentProfileIds(); if (profiles != null) { for (int i = profiles.length - 1; i >= 0; i--) { mUsageStatsService.reportEvent((String)null, profiles[i], event); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: reportGlobalUsageEventLocked File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
reportGlobalUsageEventLocked
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
private void logPasswordQualitySetIfSecurityLogEnabled(ComponentName who, int userId, boolean parent, PasswordPolicy passwordPolicy) { if (SecurityLog.isLoggingEnabled()) { final int affectedUserId = parent ? getProfileParentId(userId) : userId; SecurityLog.writeEvent(SecurityLog.TAG_PASSWORD_COMPLEXITY_SET, who.getPackageName(), userId, affectedUserId, passwordPolicy.length, passwordPolicy.quality, passwordPolicy.letters, passwordPolicy.nonLetter, passwordPolicy.numeric, passwordPolicy.upperCase, passwordPolicy.lowerCase, passwordPolicy.symbols); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: logPasswordQualitySetIfSecurityLogEnabled 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
logPasswordQualitySetIfSecurityLogEnabled
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public static String priorityToString(@Priority int pri) { switch (pri) { case PRIORITY_MIN: return "MIN"; case PRIORITY_LOW: return "LOW"; case PRIORITY_DEFAULT: return "DEFAULT"; case PRIORITY_HIGH: return "HIGH"; case PRIORITY_MAX: return "MAX"; default: return "UNKNOWN(" + String.valueOf(pri) + ")"; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: priorityToString File: core/java/android/app/Notification.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21288
MEDIUM
5.5
android
priorityToString
core/java/android/app/Notification.java
726247f4f53e8cc0746175265652fa415a123c0c
0
Analyze the following code function for security vulnerabilities
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: doPost File: dspace-jspui/src/main/java/org/dspace/app/webui/servlet/InternalErrorServlet.java Repository: DSpace The code follows secure coding practices.
[ "CWE-209" ]
CVE-2022-31189
MEDIUM
5.3
DSpace
doPost
dspace-jspui/src/main/java/org/dspace/app/webui/servlet/InternalErrorServlet.java
afcc6c3389729b85d5c7b0230cbf9aaf7452f31a
0
Analyze the following code function for security vulnerabilities
@JsonProperty("RevokedOn") public Date getRevokedOn() { return revokedOn; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getRevokedOn File: base/common/src/main/java/com/netscape/certsrv/cert/CertData.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
getRevokedOn
base/common/src/main/java/com/netscape/certsrv/cert/CertData.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
private int incrementAndGetAppWidgetIdLocked(int userId) { final int appWidgetId = peekNextAppWidgetIdLocked(userId) + 1; mNextAppWidgetIds.put(userId, appWidgetId); return appWidgetId; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: incrementAndGetAppWidgetIdLocked File: services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2015-1541
MEDIUM
4.3
android
incrementAndGetAppWidgetIdLocked
services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
0b98d304c467184602b4c6bce76fda0b0274bc07
0
Analyze the following code function for security vulnerabilities
private ApkSigningBlockUtils.Result getApkContentDigests(DataSource apk, ApkUtils.ZipSections zipSections, Set<Integer> foundApkSigSchemeIds, Map<Integer, String> supportedSchemeNames, Map<Integer, Map<ContentDigestAlgorithm, byte[]>> sigSchemeApkContentDigests, int apkSigSchemeVersion, int minSdkVersion) throws IOException, NoSuchAlgorithmException { if (!(apkSigSchemeVersion == VERSION_APK_SIGNATURE_SCHEME_V2 || apkSigSchemeVersion == VERSION_APK_SIGNATURE_SCHEME_V3)) { return null; } ApkSigningBlockUtils.Result result = new ApkSigningBlockUtils.Result(apkSigSchemeVersion); SignatureInfo signatureInfo; try { int sigSchemeBlockId = apkSigSchemeVersion == VERSION_APK_SIGNATURE_SCHEME_V3 ? V3SchemeConstants.APK_SIGNATURE_SCHEME_V3_BLOCK_ID : V2SchemeConstants.APK_SIGNATURE_SCHEME_V2_BLOCK_ID; signatureInfo = ApkSigningBlockUtils.findSignature(apk, zipSections, sigSchemeBlockId, result); } catch (ApkSigningBlockUtils.SignatureNotFoundException e) { return null; } foundApkSigSchemeIds.add(apkSigSchemeVersion); Set<ContentDigestAlgorithm> contentDigestsToVerify = new HashSet<>(1); if (apkSigSchemeVersion == VERSION_APK_SIGNATURE_SCHEME_V2) { V2SchemeVerifier.parseSigners(signatureInfo.signatureBlock, contentDigestsToVerify, supportedSchemeNames, foundApkSigSchemeIds, minSdkVersion, mMaxSdkVersion, result); } else { V3SchemeVerifier.parseSigners(signatureInfo.signatureBlock, contentDigestsToVerify, result); } Map<ContentDigestAlgorithm, byte[]> apkContentDigests = new EnumMap<>( ContentDigestAlgorithm.class); for (ApkSigningBlockUtils.Result.SignerInfo signerInfo : result.signers) { for (ApkSigningBlockUtils.Result.SignerInfo.ContentDigest contentDigest : signerInfo.contentDigests) { SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.findById( contentDigest.getSignatureAlgorithmId()); if (signatureAlgorithm == null) { continue; } apkContentDigests.put(signatureAlgorithm.getContentDigestAlgorithm(), contentDigest.getValue()); } } sigSchemeApkContentDigests.put(apkSigSchemeVersion, apkContentDigests); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getApkContentDigests File: src/main/java/com/android/apksig/ApkVerifier.java Repository: android The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-21253
MEDIUM
5.5
android
getApkContentDigests
src/main/java/com/android/apksig/ApkVerifier.java
039f815895f62c9f8af23df66622b66246f3f61e
0
Analyze the following code function for security vulnerabilities
public JSON getJSON() { return json; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getJSON File: samples/client/petstore/java/okhttp-gson-parcelableModel/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
getJSON
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public KBTemplate fetchByGroupId_Last(long groupId, OrderByComparator<KBTemplate> orderByComparator) { int count = countByGroupId(groupId); if (count == 0) { return null; } List<KBTemplate> list = findByGroupId(groupId, count - 1, count, orderByComparator); if (!list.isEmpty()) { return list.get(0); } return null; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: fetchByGroupId_Last File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java Repository: brianchandotcom/liferay-portal The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-12647
MEDIUM
4.3
brianchandotcom/liferay-portal
fetchByGroupId_Last
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
0
Analyze the following code function for security vulnerabilities
@Deprecated public String parseContent(String content, XWikiContext context) { return getOldRendering().parseContent(content, context); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseContent 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
parseContent
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
f9a677408ffb06f309be46ef9d8df1915d9099a4
0
Analyze the following code function for security vulnerabilities
private static void createNightlyBuildMetaFile(Path nightlyBuildMetaFilePath) { try { Files.createFile(nightlyBuildMetaFilePath); } catch (Exception e) { createError("error occurred while creating nightly.build file."); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: createNightlyBuildMetaFile File: cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java Repository: ballerina-platform/ballerina-lang The code follows secure coding practices.
[ "CWE-306" ]
CVE-2021-32700
MEDIUM
5.8
ballerina-platform/ballerina-lang
createNightlyBuildMetaFile
cli/ballerina-cli-module/src/main/java/org/ballerinalang/cli/module/Pull.java
4609ffee1744ecd16aac09303b1783bf0a525816
0
Analyze the following code function for security vulnerabilities
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((attrs == null) ? 0 : attrs.hashCode()); result = prime * result + ((classId == null) ? 0 : classId.hashCode()); result = prime * result + ((configAttrs == null) ? 0 : configAttrs.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((text == null) ? 0 : text.hashCode()); return result; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hashCode File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java Repository: dogtagpki/pki The code follows secure coding practices.
[ "CWE-611" ]
CVE-2022-2414
HIGH
7.5
dogtagpki/pki
hashCode
base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java
16deffdf7548e305507982e246eb9fd1eac414fd
0
Analyze the following code function for security vulnerabilities
public boolean hideStatusBarIconsWhenExpanded() { return !isFullWidth() || !mShowIconsWhenExpanded; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: hideStatusBarIconsWhenExpanded 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
hideStatusBarIconsWhenExpanded
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
c574568aaede7f652432deb7707f20ae54bbdf9a
0
Analyze the following code function for security vulnerabilities
public static void checkServerHostkeyAlgorithmsList(String[] algos) { for (String algo : algos) { if (!HOSTKEY_ALGS.contains(algo)) throw new IllegalArgumentException("Unknown server host key algorithm '" + algo + "'"); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: checkServerHostkeyAlgorithmsList File: src/main/java/com/trilead/ssh2/transport/KexManager.java Repository: connectbot/sshlib The code follows secure coding practices.
[ "CWE-354" ]
CVE-2023-48795
MEDIUM
5.9
connectbot/sshlib
checkServerHostkeyAlgorithmsList
src/main/java/com/trilead/ssh2/transport/KexManager.java
5c8b534f6e97db7ac0e0e579331213aa25c173ab
0
Analyze the following code function for security vulnerabilities
private long calculateSuppressedEffects() { int hints = calculateHints(); long suppressedEffects = 0; if ((hints & HINT_HOST_DISABLE_EFFECTS) != 0) { suppressedEffects |= ZenModeHelper.SUPPRESSED_EFFECT_ALL; } if ((hints & HINT_HOST_DISABLE_NOTIFICATION_EFFECTS) != 0) { suppressedEffects |= ZenModeHelper.SUPPRESSED_EFFECT_NOTIFICATIONS; } if ((hints & HINT_HOST_DISABLE_CALL_EFFECTS) != 0) { suppressedEffects |= ZenModeHelper.SUPPRESSED_EFFECT_CALLS; } return suppressedEffects; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: calculateSuppressedEffects File: services/core/java/com/android/server/notification/NotificationManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-284" ]
CVE-2016-3884
MEDIUM
4.3
android
calculateSuppressedEffects
services/core/java/com/android/server/notification/NotificationManagerService.java
61e9103b5725965568e46657f4781dd8f2e5b623
0
Analyze the following code function for security vulnerabilities
@GuardedBy("mLock") long getNextResetTimeLocked() { updateTimesLocked(); return mRawLastResetTime + mResetInterval; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getNextResetTimeLocked File: services/core/java/com/android/server/pm/ShortcutService.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-40092
MEDIUM
5.5
android
getNextResetTimeLocked
services/core/java/com/android/server/pm/ShortcutService.java
a5e55363e69b3c84d3f4011c7b428edb1a25752c
0
Analyze the following code function for security vulnerabilities
@SuppressWarnings("AndroidFrameworkBinderIdentity") long binderClearCallingIdentity() { return Binder.clearCallingIdentity(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: binderClearCallingIdentity 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
binderClearCallingIdentity
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void setForceEphemeralUsers(ComponentName who, boolean forceEphemeralUsers) { throw new UnsupportedOperationException("This method was used by split system user only."); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setForceEphemeralUsers 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
setForceEphemeralUsers
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
public int getReceiveMaxConcurrentStreams() { return receiveMaxConcurrentStreams; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getReceiveMaxConcurrentStreams File: core/src/main/java/io/undertow/protocols/http2/Http2Channel.java Repository: undertow-io/undertow The code follows secure coding practices.
[ "CWE-214" ]
CVE-2021-3859
HIGH
7.5
undertow-io/undertow
getReceiveMaxConcurrentStreams
core/src/main/java/io/undertow/protocols/http2/Http2Channel.java
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
0
Analyze the following code function for security vulnerabilities
@Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onNewIntent File: Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java Repository: codenameone/CodenameOne The code follows secure coding practices.
[ "CWE-668" ]
CVE-2022-4903
MEDIUM
5.1
codenameone/CodenameOne
onNewIntent
Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getContentAuthor() { return this.doc.getContentAuthor(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getContentAuthor 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
getContentAuthor
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 static String popParam(final Map<String, List<String>> querystring, final String param) { final List<String> params = querystring.remove(param); if (params == null) { return null; } final String given = params.get(params.size() - 1); // TODO - far from perfect, should help a little. if (given.contains("`") || given.contains("%60") || given.contains("&#96;")) { throw new BadRequestException("Parameter " + param + " contained a " + "back-tick. That's a no-no."); } return given; }
Vulnerability Classification: - CWE: CWE-78 - CVE: CVE-2020-35476 - Severity: HIGH - CVSS Score: 7.5 Description: Fix remote code execution #2051 by adding regex validators for the Gnuplot params and introducting the tsd.gnuplot.options.allowlist setting that is a strict matching allow list of o= values from the query string that will be allowed through. By default tihs is empty so if folks are using this query param, they'll different graphs until they add the options they need. Function: popParam File: src/tsd/GraphHandler.java Repository: OpenTSDB/opentsdb Fixed Code: public static String popParam(final Map<String, List<String>> querystring, final String param) { final List<String> params = querystring.remove(param); if (params == null) { return null; } String given = params.get(params.size() - 1); if (given != null) { given = URLDecoder.decode(given.trim()); } // TODO - far from perfect, should help a little. if (given.contains("`") || given.contains("%60") || given.contains("&#96;")) { throw new BadRequestException("Parameter " + param + " contained a " + "back-tick. That's a no-no."); } return given; }
[ "CWE-78" ]
CVE-2020-35476
HIGH
7.5
OpenTSDB/opentsdb
popParam
src/tsd/GraphHandler.java
b762338664c3ee6e3f773bc04da2a8af24a5c486
1
Analyze the following code function for security vulnerabilities
private void setDemoDeviceStateUnchecked(@UserIdInt int userId, boolean isDemoDevice) { Slogf.d(LOG_TAG, "setDemoDeviceStateUnchecked(%d, %b)", userId, isDemoDevice); if (!isDemoDevice) { return; } synchronized (getLockObject()) { mInjector.settingsGlobalPutStringForUser( Settings.Global.DEVICE_DEMO_MODE, Integer.toString(/* value= */ 1), userId); } setUserProvisioningState(STATE_USER_SETUP_FINALIZED, userId); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setDemoDeviceStateUnchecked 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
setDemoDeviceStateUnchecked
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
private void parse(UserRequest ureq) { String[] sFiles = ureq.getHttpReq().getParameterValues(FORM_ID); if (sFiles == null || sFiles.length == 0) return; files = Arrays.asList(sFiles); }
Vulnerability Classification: - CWE: CWE-22 - CVE: CVE-2021-41152 - Severity: MEDIUM - CVSS Score: 4.0 Description: OO-5696: validate file selections against current container Function: parse File: src/main/java/org/olat/core/commons/modules/bc/FileSelection.java Repository: OpenOLAT Fixed Code: private void parse(UserRequest ureq) { String[] sFiles = ureq.getHttpReq().getParameterValues(FORM_ID); if (sFiles == null || sFiles.length == 0) { return; } List<VFSItem> items = currentContainer.getItems(); if(items != null && !items.isEmpty()) { Set<String> itemNames = items.stream() .map(VFSItem::getName) .collect(Collectors.toSet()); for(String sFile:sFiles) { if(itemNames.contains(sFile)) { files.add(sFile); } } } }
[ "CWE-22" ]
CVE-2021-41152
MEDIUM
4
OpenOLAT
parse
src/main/java/org/olat/core/commons/modules/bc/FileSelection.java
418bb509ffcb0e25ab4390563c6c47f0458583eb
1
Analyze the following code function for security vulnerabilities
@Override public int startActivityAsUser(IApplicationThread caller, String callerPacakge, Intent intent, Bundle options, int userId) { return ActivityManagerService.this.startActivityAsUser( caller, callerPacakge, intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, options, userId, false /*validateIncomingUser*/); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startActivityAsUser File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
startActivityAsUser
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public HeaderRow getDefaultHeaderRow() { return header.getDefaultRow(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDefaultHeaderRow File: server/src/main/java/com/vaadin/ui/Grid.java Repository: vaadin/framework The code follows secure coding practices.
[ "CWE-79" ]
CVE-2019-25028
MEDIUM
4.3
vaadin/framework
getDefaultHeaderRow
server/src/main/java/com/vaadin/ui/Grid.java
c40bed109c3723b38694ed160ea647fef5b28593
0
Analyze the following code function for security vulnerabilities
@Override public int stopUser(final int userId, final IStopUserCallback callback) { if (checkCallingPermission(INTERACT_ACROSS_USERS_FULL) != PackageManager.PERMISSION_GRANTED) { String msg = "Permission Denial: switchUser() from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid() + " requires " + INTERACT_ACROSS_USERS_FULL; Slog.w(TAG, msg); throw new SecurityException(msg); } if (userId < 0 || userId == UserHandle.USER_OWNER) { throw new IllegalArgumentException("Can't stop primary user " + userId); } enforceShellRestriction(UserManager.DISALLOW_DEBUGGING_FEATURES, userId); synchronized (this) { return stopUserLocked(userId, callback); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: stopUser File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-200" ]
CVE-2016-2500
MEDIUM
4.3
android
stopUser
services/core/java/com/android/server/am/ActivityManagerService.java
9878bb99b77c3681f0fda116e2964bac26f349c3
0
Analyze the following code function for security vulnerabilities
protected InputStream loadSchemaFile(String schemaLocation) { // is resource file InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(schemaLocation); // is URL if (inputStream == null) { try { inputStream = new URL(schemaLocation).openStream(); } catch (Exception e) { throw new InvalidConfigurationException("Your xsd schema couldn't be loaded"); } } return inputStream; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: loadSchemaFile File: hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
loadSchemaFile
hazelcast/src/main/java/com/hazelcast/config/AbstractXmlConfigHelper.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
private boolean mutateSecureSetting(String name, String value, String tag, boolean makeDefault, int requestingUserId, int operation, boolean forceNotify, int mode) { // overrideableByRestore = false as by default settings values shouldn't be overrideable by // restore. return mutateSecureSetting(name, value, tag, makeDefault, requestingUserId, operation, forceNotify, mode, /* overrideableByRestore */ false); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mutateSecureSetting 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
mutateSecureSetting
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
ff86ff28cf82124f8e65833a2dd8c319aea08945
0
Analyze the following code function for security vulnerabilities
@Subscribe public void handleUserChanged(UserChangedEvent event) { final User user = userService.loadById(event.userId()); if (user != null && SESSION_TERMINATION_STATUS.contains(user.getAccountStatus())) { terminateSessionsForUser(user); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: handleUserChanged File: graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java Repository: Graylog2/graylog2-server The code follows secure coding practices.
[ "CWE-613" ]
CVE-2023-41041
LOW
3.1
Graylog2/graylog2-server
handleUserChanged
graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
0
Analyze the following code function for security vulnerabilities
void onSurfaceShownChanged(boolean shown) { if (mLastShownChangedReported == shown) { return; } mLastShownChangedReported = shown; if (shown) { initExclusionRestrictions(); } else { logExclusionRestrictions(EXCLUSION_LEFT); logExclusionRestrictions(EXCLUSION_RIGHT); } // Exclude toast because legacy apps may show toast window by themselves, so the misused // apps won't always be considered as foreground state. // Exclude private presentations as they can only be shown on private virtual displays and // shouldn't be the cause of an app be considered foreground. if (mAttrs.type >= FIRST_SYSTEM_WINDOW && mAttrs.type != TYPE_TOAST && mAttrs.type != TYPE_PRIVATE_PRESENTATION) { mWmService.mAtmService.mActiveUids.onNonAppSurfaceVisibilityChanged(mOwnerUid, shown); } }
Vulnerability Classification: - CWE: CWE-Other - CVE: CVE-2023-35674 - Severity: HIGH - CVSS Score: 7.8 Description: Ignore virtual presentation windows - RESTRICT AUTOMERGE Windows of TYPE_PRESENTATION on virtual displays should not be counted as visible windows to determine if BAL is allowed. Test: manual test, atest BackgroundActivityLaunchTest Bug: 264029851, 205130886 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4c40b187cd5277c27d20758c675865bf89180c7a) (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5bf9607bec3f1224158cfcff7dd91ac558b46c0f) Merged-In: I08b16ba1c155e951286ddc22019180cbd6334dfa Change-Id: I08b16ba1c155e951286ddc22019180cbd6334dfa Function: onSurfaceShownChanged File: services/core/java/com/android/server/wm/WindowState.java Repository: android Fixed Code: void onSurfaceShownChanged(boolean shown) { if (mLastShownChangedReported == shown) { return; } mLastShownChangedReported = shown; if (shown) { initExclusionRestrictions(); } else { logExclusionRestrictions(EXCLUSION_LEFT); logExclusionRestrictions(EXCLUSION_RIGHT); } // Exclude toast because legacy apps may show toast window by themselves, so the misused // apps won't always be considered as foreground state. // Exclude private presentations as they can only be shown on private virtual displays and // shouldn't be the cause of an app be considered foreground. // Exclude presentations on virtual displays as they are not actually visible. if (mAttrs.type >= FIRST_SYSTEM_WINDOW && mAttrs.type != TYPE_TOAST && mAttrs.type != TYPE_PRIVATE_PRESENTATION && !(mAttrs.type == TYPE_PRESENTATION && isOnVirtualDisplay()) ) { mWmService.mAtmService.mActiveUids.onNonAppSurfaceVisibilityChanged(mOwnerUid, shown); } }
[ "CWE-Other" ]
CVE-2023-35674
HIGH
7.8
android
onSurfaceShownChanged
services/core/java/com/android/server/wm/WindowState.java
7428962d3b064ce1122809d87af65099d1129c9e
1
Analyze the following code function for security vulnerabilities
@Override protected void onSelectionChanged(int selStart, int selEnd) { if (!mInBatchEditMode) { int beforeTextLength = getText().length(); if (validateSelection(selStart, selEnd)) { boolean textDeleted = getText().length() < beforeTextLength; notifyAutocompleteTextStateChanged(textDeleted); } } else { mSelectionChangedInBatchMode = true; } super.onSelectionChanged(selStart, selEnd); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSelectionChanged 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
onSelectionChanged
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
3bd33fee094e863e5496ac24714c558bd58d28ef
0
Analyze the following code function for security vulnerabilities
private static void parseAllowedEmptyTags(Element allowedEmptyTagsListNode, List<String> allowedEmptyTags) throws PolicyException { if (allowedEmptyTagsListNode != null) { for (Element literalNode : getGrandChildrenByTagName(allowedEmptyTagsListNode, "literal-list", "literal")) { String value = getAttributeValue(literalNode, "value"); if (value != null && value.length() > 0) { allowedEmptyTags.add(value); } } } else { allowedEmptyTags.addAll(Constants.defaultAllowedEmptyTags); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: parseAllowedEmptyTags File: src/main/java/org/owasp/validator/html/Policy.java Repository: nahsra/antisamy The code follows secure coding practices.
[ "CWE-79" ]
CVE-2017-14735
MEDIUM
4.3
nahsra/antisamy
parseAllowedEmptyTags
src/main/java/org/owasp/validator/html/Policy.java
82da009e733a989a57190cd6aa1b6824724f6d36
0
Analyze the following code function for security vulnerabilities
public void denyPermission(TypePermission permission) { addPermission(new NoPermission(permission)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: denyPermission 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
denyPermission
xstream/src/java/com/thoughtworks/xstream/XStream.java
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
0
Analyze the following code function for security vulnerabilities
public static JNLPClassLoader getInstance(final URL location, final String uniqueKey, final VersionString version, final ParserSettings settings, final UpdatePolicy policy, final String mainName, boolean enableCodeBase) throws IOException, ParseException, LaunchException { JNLPClassLoader loader; synchronized (getUniqueKeyLock(uniqueKey)) { loader = uniqueKeyToLoader.get(uniqueKey); if (loader == null || !location.equals(loader.getJNLPFile().getFileLocation())) { final JNLPFile jnlpFile = new JNLPFile(location, uniqueKey, version, settings, policy); loader = getInstance(jnlpFile, policy, mainName, enableCodeBase); } } return loader; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getInstance File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Repository: AdoptOpenJDK/IcedTea-Web The code follows secure coding practices.
[ "CWE-345", "CWE-94", "CWE-22" ]
CVE-2019-10182
MEDIUM
5.8
AdoptOpenJDK/IcedTea-Web
getInstance
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
e0818f521a0711aeec4b913b49b5fc6a52815662
0
Analyze the following code function for security vulnerabilities
public StanzaListener addStanzaIdAcknowledgedListener(final String id, StanzaListener listener) throws StreamManagementNotEnabledException { // Prevent users from adding callbacks that will never get removed if (!smWasEnabledAtLeastOnce) { throw new StreamManagementException.StreamManagementNotEnabledException(); } // Remove the listener after max. 12 hours final int removeAfterSeconds = Math.min(getMaxSmResumptionTime(), 12 * 60 * 60); schedule(new Runnable() { @Override public void run() { stanzaIdAcknowledgedListeners.remove(id); } }, removeAfterSeconds, TimeUnit.SECONDS); return stanzaIdAcknowledgedListeners.put(id, listener); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addStanzaIdAcknowledgedListener File: smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java Repository: igniterealtime/Smack The code follows secure coding practices.
[ "CWE-362" ]
CVE-2016-10027
MEDIUM
4.3
igniterealtime/Smack
addStanzaIdAcknowledgedListener
smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
a9d5cd4a611f47123f9561bc5a81a4555fe7cb04
0
Analyze the following code function for security vulnerabilities
void unhold(Call call) { final String callId = mCallIdMapper.getCallId(call); if (callId != null && isServiceValid("unhold")) { try { logOutgoing("unhold %s", callId); mServiceInterface.unhold(callId, Log.getExternalSession(TELECOM_ABBREVIATION)); } catch (RemoteException e) { } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: unhold File: src/com/android/server/telecom/ConnectionServiceWrapper.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
unhold
src/com/android/server/telecom/ConnectionServiceWrapper.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
public DateFormat getDateFormat() { return dateFormat; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDateFormat File: samples/openapi3/client/petstore/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
getDateFormat
samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
@Override public void dismissKeyguard(IBinder token, IKeyguardDismissCallback callback, CharSequence message) throws RemoteException { if (message != null) { enforceCallingPermission(permission.SHOW_KEYGUARD_MESSAGE, "dismissKeyguard()"); } final long callingId = Binder.clearCallingIdentity(); try { mKeyguardController.dismissKeyguard(token, callback, message); } finally { Binder.restoreCallingIdentity(callingId); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: dismissKeyguard File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
dismissKeyguard
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0
Analyze the following code function for security vulnerabilities
public void waitForHandlerToClear() { mConnectionServiceDelegate.getHandler().removeCallbacksAndMessages(null); final CountDownLatch lock = new CountDownLatch(1); mConnectionServiceDelegate.getHandler().post(lock::countDown); while (lock.getCount() > 0) { try { lock.await(TelecomSystemTest.TEST_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // do nothing } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: waitForHandlerToClear File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21283
MEDIUM
5.5
android
waitForHandlerToClear
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
9b41a963f352fdb3da1da8c633d45280badfcb24
0
Analyze the following code function for security vulnerabilities
@Override public long value() { return get(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: value File: common/src/main/java/io/netty/util/internal/PlatformDependent.java Repository: netty The code follows secure coding practices.
[ "CWE-668", "CWE-378", "CWE-379" ]
CVE-2022-24823
LOW
1.9
netty
value
common/src/main/java/io/netty/util/internal/PlatformDependent.java
185f8b2756a36aaa4f973f1a2a025e7d981823f1
0
Analyze the following code function for security vulnerabilities
private void addBpmnDiInfo(Definitions def, String gpd) { try { Map<String, Bounds> _bounds = new HashMap<String, Bounds>(); XMLInputFactory factory = XMLInputFactory.newInstance(); XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(gpd)); while(reader.hasNext()) { if (reader.next() == XMLStreamReader.START_ELEMENT) { if ("node".equals(reader.getLocalName())) { Bounds b = DcFactory.eINSTANCE.createBounds(); String nodeName = null; String nodeX = null; String nodeY = null; String nodeWidth = null; String nodeHeight = null; for (int i = 0 ; i < reader.getAttributeCount() ; i++) { if ("name".equals(reader.getAttributeLocalName(i))) { nodeName = reader.getAttributeValue(i); } else if("x".equals(reader.getAttributeLocalName(i))) { nodeX = reader.getAttributeValue(i); } else if("y".equals(reader.getAttributeLocalName(i))) { nodeY = reader.getAttributeValue(i); } else if("width".equals(reader.getAttributeLocalName(i))) { nodeWidth = reader.getAttributeValue(i); } else if("height".equals(reader.getAttributeLocalName(i))) { nodeHeight = reader.getAttributeValue(i); } } b.setX(new Float(nodeX).floatValue()); b.setY(new Float(nodeY).floatValue()); b.setWidth(new Float(nodeWidth).floatValue()); b.setHeight(new Float(nodeHeight).floatValue()); _bounds.put(nodeName, b); } } } for (RootElement rootElement: def.getRootElements()) { if (rootElement instanceof Process) { Process process = (Process) rootElement; BpmnDiFactory diFactory = BpmnDiFactory.eINSTANCE; BPMNDiagram diagram = diFactory.createBPMNDiagram(); BPMNPlane plane = diFactory.createBPMNPlane(); plane.setBpmnElement(process); diagram.setPlane(plane); for (FlowElement flowElement: process.getFlowElements()) { if (flowElement instanceof FlowNode) { Bounds b = _bounds.get(flowElement.getId()); if (b != null) { BPMNShape shape = diFactory.createBPMNShape(); shape.setBpmnElement(flowElement); shape.setBounds(b); plane.getPlaneElement().add(shape); } } else if (flowElement instanceof SequenceFlow) { SequenceFlow sequenceFlow = (SequenceFlow) flowElement; BPMNEdge edge = diFactory.createBPMNEdge(); edge.setBpmnElement(flowElement); DcFactory dcFactory = DcFactory.eINSTANCE; Point point = dcFactory.createPoint(); if(sequenceFlow.getSourceRef() != null) { Bounds sourceBounds = _bounds.get(sequenceFlow.getSourceRef().getId()); point.setX(sourceBounds.getX() + (sourceBounds.getWidth()/2)); point.setY(sourceBounds.getY() + (sourceBounds.getHeight()/2)); } edge.getWaypoint().add(point); // List<Point> dockers = _dockers.get(sequenceFlow.getId()); // for (int i = 1; i < dockers.size() - 1; i++) { // edge.getWaypoint().add(dockers.get(i)); // } point = dcFactory.createPoint(); if(sequenceFlow.getTargetRef() != null) { Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId()); point.setX(targetBounds.getX() + (targetBounds.getWidth()/2)); point.setY(targetBounds.getY() + (targetBounds.getHeight()/2)); } edge.getWaypoint().add(point); plane.getPlaneElement().add(edge); } } def.getDiagrams().add(diagram); } } } catch (FactoryConfigurationError e) { _logger.error("Exception adding bpmndi info: " + e.getMessage()); } catch (Exception e) { _logger.error("Exception adding bpmndi info: " + e.getMessage()); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: addBpmnDiInfo File: jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java Repository: kiegroup/jbpm-designer The code follows secure coding practices.
[ "CWE-611" ]
CVE-2017-7545
MEDIUM
4
kiegroup/jbpm-designer
addBpmnDiInfo
jbpm-designer-backend/src/main/java/org/jbpm/designer/web/server/TransformerServlet.java
a143f3b92a6a5a527d929d68c02a0c5d914ab81d
0
Analyze the following code function for security vulnerabilities
public AcroFields getAcroFields() { AcroFields retVal = new AcroFields(this, null); return retVal; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAcroFields 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
getAcroFields
java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java
9b0cbb76c8434a8505f02ada02a94263dcae9247
0
Analyze the following code function for security vulnerabilities
@Override public ProcessorScope getScope() { return ProcessorScope.ADDING_BLOCKS; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getScope File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java Repository: IntellectualSites/FastAsyncWorldEdit The code follows secure coding practices.
[ "CWE-400" ]
CVE-2023-35925
MEDIUM
5.5
IntellectualSites/FastAsyncWorldEdit
getScope
worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
3a8dfb4f7b858a439c35f7af1d56d21f796f61f5
0
Analyze the following code function for security vulnerabilities
public double optDouble(String key, double defaultValue) { Number val = this.optNumber(key); if (val == null) { return defaultValue; } return val.doubleValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: optDouble File: src/main/java/org/json/JSONObject.java Repository: stleary/JSON-java The code follows secure coding practices.
[ "CWE-770" ]
CVE-2023-5072
HIGH
7.5
stleary/JSON-java
optDouble
src/main/java/org/json/JSONObject.java
661114c50dcfd53bb041aab66f14bb91e0a87c8a
0
Analyze the following code function for security vulnerabilities
private void validateAuthorization(String updatedAppName, String storedAppName, String username, String tenantDomain) throws IdentityApplicationManagementException { if (!ApplicationConstants.LOCAL_SP.equals(storedAppName) && !ApplicationMgtUtil.isUserAuthorized(storedAppName, username)) { String message = "Illegal Access! User: " + username + " does not have access to update the " + "application: '" + updatedAppName + "' in tenantDomain: " + tenantDomain; throw buildClientException(OPERATION_FORBIDDEN, message); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: validateAuthorization File: components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java Repository: wso2/carbon-identity-framework The code follows secure coding practices.
[ "CWE-611" ]
CVE-2021-42646
MEDIUM
6.4
wso2/carbon-identity-framework
validateAuthorization
components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/ApplicationManagementServiceImpl.java
e9119883ee02a884f3c76c7bbc4022a4f4c58fc0
0
Analyze the following code function for security vulnerabilities
@Override public ActivityManager.RecentTaskInfo getTaskInfo() { checkCaller(); synchronized (ActivityManagerService.this) { long origId = Binder.clearCallingIdentity(); try { TaskRecord tr = recentTaskForIdLocked(mTaskId); if (tr == null) { throw new IllegalArgumentException("Unable to find task ID " + mTaskId); } return createRecentTaskInfoFromTaskRecord(tr); } finally { Binder.restoreCallingIdentity(origId); } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getTaskInfo 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
getTaskInfo
services/core/java/com/android/server/am/ActivityManagerService.java
aaa0fee0d7a8da347a0c47cef5249c70efee209e
0
Analyze the following code function for security vulnerabilities
public String getWelcomeMessage(Profile authUser) { return authUser == null ? CONF.welcomeMessage() : ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getWelcomeMessage 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
getWelcomeMessage
src/main/java/com/erudika/scoold/utils/ScooldUtils.java
62a0e92e1486ddc17676a7ead2c07ff653d167ce
0
Analyze the following code function for security vulnerabilities
public Integer getServerIndex() { return serverIndex; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getServerIndex File: samples/client/petstore/java/okhttp-gson/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
getServerIndex
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
2c576483f26f85b3979c6948a131f585c237109a
0
Analyze the following code function for security vulnerabilities
static PostgresClient testClient() { return new PostgresClient(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: testClient 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
testClient
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
b7ef741133e57add40aa4cb19430a0065f378a94
0
Analyze the following code function for security vulnerabilities
public int broadcastIntent(IApplicationThread caller, Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle map, String[] requiredPermissions, int appOp, Bundle options, boolean serialized, boolean sticky, int userId) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); data.writeInterfaceToken(IActivityManager.descriptor); data.writeStrongBinder(caller != null ? caller.asBinder() : null); intent.writeToParcel(data, 0); data.writeString(resolvedType); data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); data.writeInt(resultCode); data.writeString(resultData); data.writeBundle(map); data.writeStringArray(requiredPermissions); data.writeInt(appOp); data.writeBundle(options); data.writeInt(serialized ? 1 : 0); data.writeInt(sticky ? 1 : 0); data.writeInt(userId); mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); reply.readException(); int res = reply.readInt(); reply.recycle(); data.recycle(); return res; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: broadcastIntent File: core/java/android/app/ActivityManagerNative.java Repository: android The code follows secure coding practices.
[ "CWE-264" ]
CVE-2016-3832
HIGH
8.3
android
broadcastIntent
core/java/android/app/ActivityManagerNative.java
e7cf91a198de995c7440b3b64352effd2e309906
0
Analyze the following code function for security vulnerabilities
@Override public List<String> getDisallowedSystemApps(ComponentName admin, int userId, String provisioningAction) throws RemoteException { Preconditions.checkCallAuthorization( hasCallingOrSelfPermission(permission.MANAGE_PROFILE_AND_DEVICE_OWNERS)); return new ArrayList<>( mOverlayPackagesProvider.getNonRequiredApps(admin, userId, provisioningAction)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDisallowedSystemApps 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
getDisallowedSystemApps
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
ed3f25b7222d4cff471f2b7d22d1150348146957
0
Analyze the following code function for security vulnerabilities
@Override public void drawString(Object graphics, String str, int x, int y) { ((AndroidGraphics) graphics).drawString(str, x, y); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: drawString 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
drawString
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
dad49c9ef26a598619fc48d2697151a02987d478
0
Analyze the following code function for security vulnerabilities
public String getDescription() { return ""; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getDescription File: wflow-core/src/main/java/org/joget/plugin/enterprise/UserProfileMenu.java Repository: jogetworkflow/jw-community The code follows secure coding practices.
[ "CWE-79" ]
CVE-2022-4859
MEDIUM
4
jogetworkflow/jw-community
getDescription
wflow-core/src/main/java/org/joget/plugin/enterprise/UserProfileMenu.java
9a77f508a2bf8cf661d588f37a4cc29ecaea4fc8
0
Analyze the following code function for security vulnerabilities
private void updateLayer2Information() { if (mIpClient != null) { Pair<String, String> p = mWifiScoreCard.getL2KeyAndGroupHint(mWifiInfo); if (!p.equals(mLastL2KeyAndGroupHint)) { final MacAddress currentBssid = getMacAddressFromBssidString(mWifiInfo.getBSSID()); final Layer2Information l2Information = new Layer2Information( p.first, p.second, currentBssid); // Update current BSSID on IpClient side whenever l2Key and groupHint // pair changes (i.e. the initial connection establishment or L2 roaming // happened). If we have COMPLETED the roaming to a different BSSID, start // doing DNAv4/DNAv6 -style probing for on-link neighbors of interest (e.g. // routers/DNS servers/default gateway). if (mIpClient.updateLayer2Information(l2Information)) { mLastL2KeyAndGroupHint = p; } else { mLastL2KeyAndGroupHint = null; } } } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: updateLayer2Information File: service/java/com/android/server/wifi/ClientModeImpl.java Repository: android The code follows secure coding practices.
[ "CWE-Other" ]
CVE-2023-21242
CRITICAL
9.8
android
updateLayer2Information
service/java/com/android/server/wifi/ClientModeImpl.java
72e903f258b5040b8f492cf18edd124b5a1ac770
0
Analyze the following code function for security vulnerabilities
@Override public void onSwitchChanged(Switch switchView, boolean isChecked) { if (isChecked != isChecked()) { setChecked(isChecked); } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onSwitchChanged File: src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java Repository: android The code follows secure coding practices.
[ "CWE-862" ]
CVE-2023-21247
HIGH
7.8
android
onSwitchChanged
src/com/android/settings/location/WifiScanningMainSwitchPreferenceController.java
edd4023805bc7fa54ae31de222cde02b9012bbc4
0
Analyze the following code function for security vulnerabilities
@Override public Number numberValue() { return bigDecimalValue(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: numberValue File: impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java Repository: eclipse-ee4j/parsson The code follows secure coding practices.
[ "CWE-834" ]
CVE-2023-4043
HIGH
7.5
eclipse-ee4j/parsson
numberValue
impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java
84764ffbe3d0376da242b27a9a526138d0dfb8e6
0
Analyze the following code function for security vulnerabilities
public void setRestTemplate(RestTemplate restTemplate) { this.restTemplate = restTemplate; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: setRestTemplate File: spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java Repository: codecentric/spring-boot-admin The code follows secure coding practices.
[ "CWE-94" ]
CVE-2022-46166
CRITICAL
9.8
codecentric/spring-boot-admin
setRestTemplate
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
c14c3ec12533f71f84de9ce3ce5ceb7991975f75
0
Analyze the following code function for security vulnerabilities
private void mcMutualAuthConfigXmlGenerator(XmlGenerator gen, ManagementCenterConfig mcConfig) { MCMutualAuthConfig mutualAuthConfig = mcConfig.getMutualAuthConfig(); gen.open("mutual-auth", "enabled", mutualAuthConfig != null && mutualAuthConfig.isEnabled()); if (mutualAuthConfig != null) { Properties props = new Properties(); props.putAll(mutualAuthConfig.getProperties()); if (maskSensitiveFields && props.containsKey("trustStorePassword")) { props.setProperty("trustStorePassword", MASK_FOR_SENSITIVE_DATA); } if (maskSensitiveFields && props.containsKey("keyStorePassword")) { props.setProperty("keyStorePassword", MASK_FOR_SENSITIVE_DATA); } gen.node("factory-class-name", classNameOrImplClass(mutualAuthConfig.getFactoryClassName(), mutualAuthConfig.getFactoryImplementation())) .appendProperties(props); } gen.close(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: mcMutualAuthConfigXmlGenerator File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
mcMutualAuthConfigXmlGenerator
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public StandardFileType getFileType() { return StandardFileType.XML; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getFileType File: src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java Repository: JabRef/jabref The code follows secure coding practices.
[ "CWE-611" ]
CVE-2018-1000652
HIGH
7.5
JabRef/jabref
getFileType
src/main/java/org/jabref/logic/importer/fileformat/MsBibImporter.java
89f855d76713b4cd25ac0830c719cd61c511851e
0
Analyze the following code function for security vulnerabilities
@Override public void onDestroy() { if (sDebug) Slog.d(TAG, "OneTimeListener.onDestroy(): " + mDone); if (mDone) { return; } mDone = true; mRealListener.onDestroy(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: onDestroy File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java Repository: android The code follows secure coding practices.
[ "CWE-Other", "CWE-610" ]
CVE-2023-40133
MEDIUM
5.5
android
onDestroy
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
08becc8c600f14c5529115cc1a1e0c97cd503f33
0
Analyze the following code function for security vulnerabilities
public static String toFileName(String name) { return name.replaceAll("[:\\\\/*\"?|<>',]", "_"); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: toFileName File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java Repository: hazelcast The code follows secure coding practices.
[ "CWE-502" ]
CVE-2016-10750
MEDIUM
6.8
hazelcast
toFileName
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
0
Analyze the following code function for security vulnerabilities
@Override public boolean needsToRunAfterFinalized() { return true; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: needsToRunAfterFinalized File: core/src/main/java/hudson/tasks/BuildTrigger.java Repository: jenkinsci/jenkins The code follows secure coding practices.
[ "CWE-264" ]
CVE-2013-7330
MEDIUM
4
jenkinsci/jenkins
needsToRunAfterFinalized
core/src/main/java/hudson/tasks/BuildTrigger.java
36342d71e29e0620f803a7470ce96c61761648d8
0
Analyze the following code function for security vulnerabilities
public void defaultDiscoveryURI(final String discoveryURI) { if (this.discoveryURI == null) { this.discoveryURI = discoveryURI; } }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: defaultDiscoveryURI File: pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java Repository: pac4j The code follows secure coding practices.
[ "CWE-347" ]
CVE-2021-44878
MEDIUM
5
pac4j
defaultDiscoveryURI
pac4j-oidc/src/main/java/org/pac4j/oidc/config/OidcConfiguration.java
22b82ffd702a132d9f09da60362fc6264fc281ae
0
Analyze the following code function for security vulnerabilities
ApplicationInfo getAppInfoForUser(ApplicationInfo info, int userId) { if (info == null) return null; ApplicationInfo newInfo = new ApplicationInfo(info); newInfo.initForUser(userId); return newInfo; }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAppInfoForUser 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
getAppInfoForUser
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
1120bc7e511710b1b774adf29ba47106292365e7
0
Analyze the following code function for security vulnerabilities
@Pure public @Nullable InputStream getAsciiStream(@Positive int columnIndex) throws SQLException { connection.getLogger().log(Level.FINEST, " getAsciiStream columnIndex: {0}", columnIndex); byte[] value = getRawValue(columnIndex); if (value == null) { return null; } // Version 7.2 supports AsciiStream for all the PG text types // As the spec/javadoc for this method indicate this is to be used for // large text values (i.e. LONGVARCHAR) PG doesn't have a separate // long string datatype, but with toast the text datatype is capable of // handling very large values. Thus the implementation ends up calling // getString() since there is no current way to stream the value from the server String stringValue = castNonNull(getString(columnIndex)); return new ByteArrayInputStream(stringValue.getBytes(StandardCharsets.US_ASCII)); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: getAsciiStream File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java Repository: pgjdbc The code follows secure coding practices.
[ "CWE-89" ]
CVE-2022-31197
HIGH
8
pgjdbc
getAsciiStream
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
739e599d52ad80f8dcd6efedc6157859b1a9d637
0
Analyze the following code function for security vulnerabilities
@Override public void startInPlaceAnimationOnFrontMostApplication(Bundle opts) throws RemoteException { final SafeActivityOptions safeOptions = SafeActivityOptions.fromBundle(opts); final ActivityOptions activityOptions = safeOptions != null ? safeOptions.getOptions(mStackSupervisor) : null; if (activityOptions == null || activityOptions.getAnimationType() != ActivityOptions.ANIM_CUSTOM_IN_PLACE || activityOptions.getCustomInPlaceResId() == 0) { throw new IllegalArgumentException("Expected in-place ActivityOption " + "with valid animation"); } mWindowManager.prepareAppTransition(TRANSIT_TASK_IN_PLACE, false); mWindowManager.overridePendingAppTransitionInPlace(activityOptions.getPackageName(), activityOptions.getCustomInPlaceResId()); mWindowManager.executeAppTransition(); }
No Vulnerability Detected: This code is secure and does not contain known vulnerabilities. Function: startInPlaceAnimationOnFrontMostApplication File: services/core/java/com/android/server/am/ActivityManagerService.java Repository: android The code follows secure coding practices.
[ "CWE-863" ]
CVE-2018-9492
HIGH
7.2
android
startInPlaceAnimationOnFrontMostApplication
services/core/java/com/android/server/am/ActivityManagerService.java
962fb40991f15be4f688d960aa00073683ebdd20
0