instruction string | input string | output string | cwe_ids list | cve_id string | severity string | cvss_score float64 | repo_name string | func_name string | file_path string | commit_hash string | is_vulnerable int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities | @Override
public String getVoiceInteractorPackageName(IBinder callingVoiceInteractor) {
return LocalServices.getService(VoiceInteractionManagerInternal.class)
.getVoiceInteractorPackageName(callingVoiceInteractor);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVoiceInteractorPackageName
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 | getVoiceInteractorPackageName | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 1120bc7e511710b1b774adf29ba47106292365e7 | 0 |
Analyze the following code function for security vulnerabilities | private void migrate105(File dataDir, Stack<Integer> versions) {
for (File file: dataDir.listFiles()) {
if (file.getName().startsWith("Settings.xml")) {
VersionedXmlDoc dom = VersionedXmlDoc.fromFile(file);
for (Element element: dom.getRootElement().elements()) {
String key = element.elementTextTrim("key");
if (key.equals("JOB_EXECUTORS")) {
Element valueElement = element.element("value");
if (valueElement != null) {
for (Element executorElement: valueElement.elements())
executorElement.addElement("sitePublishEnabled").setText("false");
}
}
}
dom.writeToFile(file, false);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: migrate105
File: server-core/src/main/java/io/onedev/server/migration/DataMigrator.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-338"
] | CVE-2023-24828 | HIGH | 8.8 | theonedev/onedev | migrate105 | server-core/src/main/java/io/onedev/server/migration/DataMigrator.java | d67dd9686897fe5e4ab881d749464aa7c06a68e5 | 0 |
Analyze the following code function for security vulnerabilities | public String getTempFolderPath() {
return tempFolderPath;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTempFolderPath
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | getTempFolderPath | samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setOrganizationColorForUser(int color, int userId) {
if (!mHasFeature) {
return;
}
Preconditions.checkArgumentNonnegative(userId, "Invalid userId");
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userId));
Preconditions.checkCallAuthorization(canManageUsers(caller));
Preconditions.checkCallAuthorization(isManagedProfile(userId), "You can not "
+ "set organization color outside a managed profile, userId = %d", userId);
synchronized (getLockObject()) {
ActiveAdmin admin = getProfileOwnerAdminLocked(userId);
admin.organizationColor = color;
saveSettingsLocked(userId);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setOrganizationColorForUser
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 | setOrganizationColorForUser | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public void setRequestForPermission(boolean requestForPermission) {
this.requestForPermission = requestForPermission;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequestForPermission
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 | setRequestForPermission | Ports/Android/src/com/codename1/impl/android/CodenameOneActivity.java | dad49c9ef26a598619fc48d2697151a02987d478 | 0 |
Analyze the following code function for security vulnerabilities | private CWLElement getDetails(JsonNode inputOutput) {
if (inputOutput != null) {
CWLElement details = new CWLElement();
// Shorthand notation "id: type" - no label/doc/other params
if (inputOutput.getClass() == TextNode.class) {
details.setType(inputOutput.asText());
} else {
details.setLabel(extractLabel(inputOutput));
details.setDoc(extractDoc(inputOutput));
extractSource(inputOutput).forEach(details::addSourceID);
details.setDefaultVal(extractDefault(inputOutput));
// Type is only for inputs
if (inputOutput.has(TYPE)) {
details.setType(extractTypes(inputOutput.get(TYPE)));
}
}
return details;
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDetails
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2021-41110 | HIGH | 7.5 | common-workflow-language/cwlviewer | getDetails | src/main/java/org/commonwl/view/cwl/CWLService.java | f6066f09edb70033a2ce80200e9fa9e70a5c29de | 0 |
Analyze the following code function for security vulnerabilities | private boolean refreshSimState(int subId, int slotId) {
// This is awful. It exists because there are two APIs for getting the SIM status
// that don't return the complete set of values and have different types. In Keyguard we
// need IccCardConstants, but TelephonyManager would only give us
// TelephonyManager.SIM_STATE*, so we retrieve it manually.
final TelephonyManager tele = TelephonyManager.from(mContext);
int simState = tele.getSimState(slotId);
State state;
try {
state = State.intToState(simState);
} catch(IllegalArgumentException ex) {
Log.w(TAG, "Unknown sim state: " + simState);
state = State.UNKNOWN;
}
SimData data = mSimDatas.get(subId);
final boolean changed;
if (data == null) {
data = new SimData(state, slotId, subId);
mSimDatas.put(subId, data);
changed = true; // no data yet; force update
} else {
changed = data.simState != state;
data.simState = state;
}
return changed;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: refreshSimState
File: packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3917 | HIGH | 7.2 | android | refreshSimState | packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java | f5334952131afa835dd3f08601fb3bced7b781cd | 0 |
Analyze the following code function for security vulnerabilities | private void deleteItem(Context c, String myhandle) throws Exception
{
// bit of a hack - to remove an item, you must remove it
// from all collections it's a part of, then it will be removed
Item myitem = (Item) HandleManager.resolveToObject(c, myhandle);
if (myitem == null)
{
System.out.println("Error - cannot locate item - already deleted?");
}
else
{
deleteItem(c, myitem);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteItem
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java
Repository: DSpace
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2022-31195 | HIGH | 7.2 | DSpace | deleteItem | dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java | 56e76049185bbd87c994128a9d77735ad7af0199 | 0 |
Analyze the following code function for security vulnerabilities | protected void activateConversationContext(HttpServletRequest request) {
HttpConversationContext conversationContext = httpConversationContext();
/*
* Don't try to reactivate the ConversationContext if we have already activated it for this request WELD-877
*/
if (!isContextActivatedInRequest(request)) {
setContextActivatedInRequest(request);
activate(conversationContext, request);
} else {
/*
* We may have previously been associated with a ConversationContext, but the reference to that context may have been lost during a Servlet forward
* WELD-877
*/
conversationContext.dissociate(request);
conversationContext.associate(request);
activate(conversationContext, request);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activateConversationContext
File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
Repository: weld/core
The code follows secure coding practices. | [
"CWE-362"
] | CVE-2014-8122 | MEDIUM | 4.3 | weld/core | activateConversationContext | impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java | 8e413202fa1af08c09c580f444e4fd16874f9c65 | 0 |
Analyze the following code function for security vulnerabilities | public List<String> getDevelopmentFolderNames() {
return developmentFolderNames;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDevelopmentFolderNames
File: api/src/main/java/org/openmrs/ui/framework/resource/ModuleResourceProvider.java
Repository: openmrs/openmrs-module-uiframework
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2020-24621 | MEDIUM | 6.5 | openmrs/openmrs-module-uiframework | getDevelopmentFolderNames | api/src/main/java/org/openmrs/ui/framework/resource/ModuleResourceProvider.java | 0422fa52c7eba3d96cce2936cb92897dca4b680a | 0 |
Analyze the following code function for security vulnerabilities | public String getFormKey(String procDefId, String taskDefKey){
String formKey = "";
if (StringUtils.isNotBlank(procDefId)){
if (StringUtils.isNotBlank(taskDefKey)){
try{
formKey = formService.getTaskFormKey(procDefId, taskDefKey);
}catch (Exception e) {
formKey = "";
}
}
if (StringUtils.isBlank(formKey)){
formKey = formService.getStartFormKey(procDefId);
}
if (StringUtils.isBlank(formKey)){
formKey = "/404";
}
}
logger.debug("getFormKey: {}", formKey);
return formKey;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFormKey
File: src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java
Repository: thinkgem/jeesite
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2023-34601 | CRITICAL | 9.8 | thinkgem/jeesite | getFormKey | src/main/java/com/thinkgem/jeesite/modules/act/service/ActTaskService.java | 30750011b49f7c8d45d0f3ab13ed3a1a422655bb | 0 |
Analyze the following code function for security vulnerabilities | protected void setNextEnabled(boolean enabled) {
mNextButton.setEnabled(enabled);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNextEnabled
File: src/com/android/settings/password/ChooseLockPassword.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40117 | HIGH | 7.8 | android | setNextEnabled | src/com/android/settings/password/ChooseLockPassword.java | 11815817de2f2d70fe842b108356a1bc75d44ffb | 0 |
Analyze the following code function for security vulnerabilities | private ScanRequest prepareInitialScanRequest(@NonNull ParsedPackage parsedPackage,
@ParsingPackageUtils.ParseFlags int parseFlags,
@PackageManagerService.ScanFlags int scanFlags,
@Nullable UserHandle user, String cpuAbiOverride)
throws PackageManagerException {
final AndroidPackage platformPackage;
final String realPkgName;
final PackageSetting disabledPkgSetting;
final PackageSetting installedPkgSetting;
final PackageSetting originalPkgSetting;
final SharedUserSetting sharedUserSetting;
SharedUserSetting oldSharedUserSetting = null;
synchronized (mPm.mLock) {
platformPackage = mPm.getPlatformPackage();
final String renamedPkgName = mPm.mSettings.getRenamedPackageLPr(
AndroidPackageUtils.getRealPackageOrNull(parsedPackage));
realPkgName = ScanPackageUtils.getRealPackageName(parsedPackage, renamedPkgName);
if (realPkgName != null) {
ScanPackageUtils.ensurePackageRenamed(parsedPackage, renamedPkgName);
}
originalPkgSetting = getOriginalPackageLocked(parsedPackage, renamedPkgName);
installedPkgSetting = mPm.mSettings.getPackageLPr(parsedPackage.getPackageName());
if (mPm.mTransferredPackages.contains(parsedPackage.getPackageName())) {
Slog.w(TAG, "Package " + parsedPackage.getPackageName()
+ " was transferred to another, but its .apk remains");
}
disabledPkgSetting = mPm.mSettings.getDisabledSystemPkgLPr(
parsedPackage.getPackageName());
boolean ignoreSharedUserId = false;
if (installedPkgSetting == null) {
// We can directly ignore sharedUserSetting for new installs
ignoreSharedUserId = parsedPackage.isLeavingSharedUid();
}
if (!ignoreSharedUserId && parsedPackage.getSharedUserId() != null) {
sharedUserSetting = mPm.mSettings.getSharedUserLPw(
parsedPackage.getSharedUserId(),
0 /*pkgFlags*/, 0 /*pkgPrivateFlags*/, true /*create*/);
} else {
sharedUserSetting = null;
}
if (DEBUG_PACKAGE_SCANNING
&& (parseFlags & ParsingPackageUtils.PARSE_CHATTY) != 0
&& sharedUserSetting != null) {
Log.d(TAG, "Shared UserID " + parsedPackage.getSharedUserId()
+ " (uid=" + sharedUserSetting.mAppId + "):"
+ " packages=" + sharedUserSetting.getPackageStates());
}
if (installedPkgSetting != null) {
oldSharedUserSetting = mPm.mSettings.getSharedUserSettingLPr(installedPkgSetting);
}
}
final boolean isPlatformPackage = platformPackage != null
&& platformPackage.getPackageName().equals(parsedPackage.getPackageName());
return new ScanRequest(parsedPackage, oldSharedUserSetting,
installedPkgSetting == null ? null : installedPkgSetting.getPkg() /* oldPkg */,
installedPkgSetting /* packageSetting */,
sharedUserSetting,
disabledPkgSetting /* disabledPackageSetting */,
originalPkgSetting /* originalPkgSetting */,
realPkgName, parseFlags, scanFlags, isPlatformPackage, user, cpuAbiOverride);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prepareInitialScanRequest
File: services/core/java/com/android/server/pm/InstallPackageHelper.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21257 | HIGH | 7.8 | android | prepareInitialScanRequest | services/core/java/com/android/server/pm/InstallPackageHelper.java | 1aec7feaf07e6d4568ca75d18158445dbeac10f6 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public HttpData touch(Object hint) {
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: touch
File: codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java
Repository: netty
The code follows secure coding practices. | [
"CWE-378",
"CWE-379"
] | CVE-2021-21290 | LOW | 1.9 | netty | touch | codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractDiskHttpData.java | c735357bf29d07856ad171c6611a2e1a0e0000ec | 0 |
Analyze the following code function for security vulnerabilities | public void setInitialDistributionPort(int initialPort) {
prop.setProperty(TS_INITIAL_DISTRIBUTION_PORT, String.valueOf(initialPort));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setInitialDistributionPort
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices. | [
"CWE-918"
] | CVE-2023-43654 | CRITICAL | 9.8 | pytorch/serve | setInitialDistributionPort | frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java | 391bdec3348e30de173fbb7c7277970e0b53c8ad | 0 |
Analyze the following code function for security vulnerabilities | private String getPersonalAppSuspensionSoonText(String date, String time, int maxDays) {
return getUpdatableString(
PERSONAL_APP_SUSPENSION_SOON_MESSAGE, R.string.personal_apps_suspension_soon_text,
date, time, maxDays);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPersonalAppSuspensionSoonText
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 | getPersonalAppSuspensionSoonText | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public void setValidationEventHandler(ValidationEventHandler validationEventHandler) {
this.validationEventHandler = validationEventHandler;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setValidationEventHandler
File: spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
Repository: spring-projects/spring-framework
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2013-4152 | MEDIUM | 6.8 | spring-projects/spring-framework | setValidationEventHandler | spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java | 2843b7d2ee12e3f9c458f6f816befd21b402e3b9 | 0 |
Analyze the following code function for security vulnerabilities | private ServiceDTO[] getServerAddress(String metaServerAddress, String path) {
String url = metaServerAddress + path;
return restTemplate.getForObject(url, ServiceDTO[].class);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getServerAddress
File: apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java
Repository: apolloconfig/apollo
The code follows secure coding practices. | [
"CWE-918"
] | CVE-2019-10686 | HIGH | 7.5 | apolloconfig/apollo | getServerAddress | apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SystemInfoController.java | 70d250458e1baab95415807f0de7d2af10b344ae | 0 |
Analyze the following code function for security vulnerabilities | public Object getPropertyDefault(String propertyId) {
int length = RECOGNIZED_PROPERTIES != null ? RECOGNIZED_PROPERTIES.length : 0;
for (int i = 0; i < length; i++) {
if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
return RECOGNIZED_PROPERTIES_DEFAULTS[i];
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPropertyDefault
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2022-24839 | MEDIUM | 5 | sparklemotion/nekohtml | getPropertyDefault | src/org/cyberneko/html/HTMLScanner.java | a800fce3b079def130ed42a408ff1d09f89e773d | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void backupAgentCreated(String agentPackageName, IBinder agent, int userId) {
// Resolve the target user id and enforce permissions.
userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, /* allowAll */ false, ALLOW_FULL_ONLY, "backupAgentCreated", null);
if (DEBUG_BACKUP) {
Slog.v(TAG_BACKUP, "backupAgentCreated: " + agentPackageName + " = " + agent
+ " callingUserId = " + UserHandle.getCallingUserId() + " userId = " + userId
+ " callingUid = " + Binder.getCallingUid() + " uid = " + Process.myUid());
}
synchronized(this) {
final BackupRecord backupTarget = mBackupTargets.get(userId);
String backupAppName = backupTarget == null ? null : backupTarget.appInfo.packageName;
if (!agentPackageName.equals(backupAppName)) {
Slog.e(TAG, "Backup agent created for " + agentPackageName + " but not requested!");
return;
}
}
final long oldIdent = Binder.clearCallingIdentity();
try {
IBackupManager bm = IBackupManager.Stub.asInterface(
ServiceManager.getService(Context.BACKUP_SERVICE));
bm.agentConnectedForUser(userId, agentPackageName, agent);
} catch (RemoteException e) {
// can't happen; the backup manager service is local
} catch (Exception e) {
Slog.w(TAG, "Exception trying to deliver BackupAgent binding: ");
e.printStackTrace();
} finally {
Binder.restoreCallingIdentity(oldIdent);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: backupAgentCreated
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | backupAgentCreated | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated
public WearableExtender setCustomContentHeight(int height) {
mCustomContentHeight = height;
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCustomContentHeight
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | setCustomContentHeight | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | public int getCode() {
return code;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCode
File: server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java
Repository: orientechnologies/orientdb
The code follows secure coding practices. | [
"CWE-352"
] | CVE-2015-2912 | MEDIUM | 6.8 | orientechnologies/orientdb | getCode | server/src/main/java/com/orientechnologies/orient/server/network/protocol/http/OHttpResponse.java | d5a45e608ba8764fd817c1bdd7cf966564e828e9 | 0 |
Analyze the following code function for security vulnerabilities | void grantUriPermissionLocked(int callingUid, String targetPkg, GrantUri grantUri,
final int modeFlags, UriPermissionOwner owner, int targetUserId) {
if (targetPkg == null) {
throw new NullPointerException("targetPkg");
}
int targetUid;
final IPackageManager pm = AppGlobals.getPackageManager();
try {
targetUid = pm.getPackageUid(targetPkg, MATCH_DEBUG_TRIAGED_MISSING, targetUserId);
} catch (RemoteException ex) {
return;
}
targetUid = checkGrantUriPermissionLocked(callingUid, targetPkg, grantUri, modeFlags,
targetUid);
if (targetUid < 0) {
return;
}
grantUriPermissionUncheckedLocked(targetUid, targetPkg, grantUri, modeFlags,
owner);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: grantUriPermissionLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3912 | HIGH | 9.3 | android | grantUriPermissionLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 6c049120c2d749f0c0289d822ec7d0aa692f55c5 | 0 |
Analyze the following code function for security vulnerabilities | void postFinishBooting(boolean finishBooting, boolean enableScreen) {
mH.post(() -> {
if (finishBooting) {
mAmInternal.finishBooting();
}
if (enableScreen) {
mInternal.enableScreenAfterBoot(isBooted());
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: postFinishBooting
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 | postFinishBooting | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 1120bc7e511710b1b774adf29ba47106292365e7 | 0 |
Analyze the following code function for security vulnerabilities | @JsonIgnore
public User getUser() {
if (user == null) {
user = client().read(getCreatorid() == null
? StringUtils.removeEnd(getId(), Para.getConfig().separator() + "profile") : getCreatorid());
}
return user;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUser
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getUser | src/main/java/com/erudika/scoold/core/Profile.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | protected void filterConferences(String needle) {
this.conferences.clear();
for (Account account : xmppConnectionService.getAccounts()) {
if (account.getStatus() != Account.State.DISABLED) {
for (Bookmark bookmark : account.getBookmarks()) {
if (bookmark.match(this, needle)) {
this.conferences.add(bookmark);
}
}
}
}
Collections.sort(this.conferences);
mConferenceAdapter.notifyDataSetChanged();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: filterConferences
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | filterConferences | src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | private void cancelEnrollment() {
if (mService != null) try {
mService.cancelEnrollment(mToken);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelEnrollment
File: core/java/android/hardware/fingerprint/FingerprintManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3917 | HIGH | 7.2 | android | cancelEnrollment | core/java/android/hardware/fingerprint/FingerprintManager.java | f5334952131afa835dd3f08601fb3bced7b781cd | 0 |
Analyze the following code function for security vulnerabilities | public static VaadinResponse getCurrentResponse() {
return VaadinResponse.getCurrent();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentResponse
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices. | [
"CWE-203"
] | CVE-2021-31403 | LOW | 1.9 | vaadin/framework | getCurrentResponse | server/src/main/java/com/vaadin/server/VaadinService.java | d852126ab6f0c43f937239305bd0e9594834fe34 | 0 |
Analyze the following code function for security vulnerabilities | public void execute(AsyncResult<SQLConnection> conn, String sql, List<JsonArray> params,
Handler<AsyncResult<List<UpdateResult>>> replyHandler) {
try {
SQLConnection sqlConnection = conn.result();
List<UpdateResult> results = new ArrayList<>(params.size());
Iterator<JsonArray> iterator = params.iterator();
Runnable task = new Runnable() {
@Override
public void run() {
if (! iterator.hasNext()) {
replyHandler.handle(Future.succeededFuture(results));
return;
}
sqlConnection.updateWithParams(sql, iterator.next(), query -> {
if (query.failed()) {
replyHandler.handle(Future.failedFuture(query.cause()));
return;
}
results.add(query.result());
this.run();
});
}
};
task.run();
} catch (Exception e) {
log.error(e.getMessage(), e);
replyHandler.handle(Future.failedFuture(e));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execute
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 | execute | domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | Configuration initConfig(ServletConfig pConfig) {
Configuration config = new Configuration(
ConfigKey.AGENT_ID, NetworkUtil.getAgentId(hashCode(),"servlet"));
// From ServletContext ....
config.updateGlobalConfiguration(new ServletConfigFacade(pConfig));
// ... and ServletConfig
config.updateGlobalConfiguration(new ServletContextFacade(getServletContext()));
// Set type last and overwrite anything written
config.updateGlobalConfiguration(Collections.singletonMap(ConfigKey.AGENT_TYPE.getKeyValue(),"servlet"));
return config;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: initConfig
File: agent/core/src/main/java/org/jolokia/http/AgentServlet.java
Repository: jolokia
The code follows secure coding practices. | [
"CWE-352"
] | CVE-2014-0168 | MEDIUM | 6.8 | jolokia | initConfig | agent/core/src/main/java/org/jolokia/http/AgentServlet.java | 2d9b168cfbbf5a6d16fa6e8a5b34503e3dc42364 | 0 |
Analyze the following code function for security vulnerabilities | private void throwIfNotOpenLocked() {
if (mConnectionPoolLocked == null) {
throw new IllegalStateException("The database '" + mConfigurationLocked.label
+ "' is not open.");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: throwIfNotOpenLocked
File: core/java/android/database/sqlite/SQLiteDatabase.java
Repository: android
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2018-9493 | LOW | 2.1 | android | throwIfNotOpenLocked | core/java/android/database/sqlite/SQLiteDatabase.java | ebc250d16c747f4161167b5ff58b3aea88b37acf | 0 |
Analyze the following code function for security vulnerabilities | private RestException topicNotFoundReason(TopicName topicName) {
if (!topicName.isPartitioned()) {
return new RestException(Status.NOT_FOUND, "Topic not found");
}
PartitionedTopicMetadata partitionedTopicMetadata = getPartitionedTopicMetadata(
TopicName.get(topicName.getPartitionedTopicName()), false, false);
if (partitionedTopicMetadata == null || partitionedTopicMetadata.partitions == 0) {
final String topicErrorType = partitionedTopicMetadata
== null ? "has no metadata" : "has zero partitions";
return new RestException(Status.NOT_FOUND, String.format(
"Partitioned Topic not found: %s %s", topicName.toString(), topicErrorType));
} else if (!internalGetList().contains(topicName.toString())) {
return new RestException(Status.NOT_FOUND, "Topic partitions were not yet created");
}
return new RestException(Status.NOT_FOUND, "Partitioned Topic not found");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: topicNotFoundReason
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-41571 | MEDIUM | 4 | apache/pulsar | topicNotFoundReason | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java | 5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52 | 0 |
Analyze the following code function for security vulnerabilities | public void removeAnnotations() {
pageRefs.resetReleasePage();
for (int k = 1; k <= pageRefs.size(); ++k) {
PdfDictionary page = pageRefs.getPageN(k);
if (page.get(PdfName.ANNOTS) == null)
pageRefs.releasePage(k);
else
page.remove(PdfName.ANNOTS);
}
catalog.remove(PdfName.ACROFORM);
pageRefs.resetReleasePage();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeAnnotations
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 | removeAnnotations | java/com/gitlab/pdftk_java/com/lowagie/text/pdf/PdfReader.java | 9b0cbb76c8434a8505f02ada02a94263dcae9247 | 0 |
Analyze the following code function for security vulnerabilities | void startRunningVoiceLocked(IVoiceInteractionSession session, int targetUid) {
mVoiceWakeLock.setWorkSource(new WorkSource(targetUid));
if (mRunningVoice == null || mRunningVoice.asBinder() != session.asBinder()) {
boolean wasRunningVoice = mRunningVoice != null;
mRunningVoice = session;
if (!wasRunningVoice) {
mVoiceWakeLock.acquire();
updateSleepIfNeededLocked();
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startRunningVoiceLocked
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 | startRunningVoiceLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 9878bb99b77c3681f0fda116e2964bac26f349c3 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new InstantDeserializer<T>(this, dtf);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: withDateFormat
File: datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2018-1000873 | MEDIUM | 4.3 | FasterXML/jackson-modules-java8 | withDateFormat | datetime/src/main/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeserializer.java | ba27ce5909dfb49bcaf753ad3e04ecb980010b0b | 0 |
Analyze the following code function for security vulnerabilities | @RequiresPermission(anyOf = {SET_TIME_ZONE, QUERY_ADMIN_POLICY}, conditional = true)
public boolean getAutoTimeZoneEnabled(@Nullable ComponentName admin) {
throwIfParentInstance("getAutoTimeZone");
if (mService != null) {
try {
return mService.getAutoTimeZoneEnabled(admin, mContext.getPackageName());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAutoTimeZoneEnabled
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-40089 | HIGH | 7.8 | android | getAutoTimeZoneEnabled | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | private VFSStatus deleteBasefile() {
VFSStatus status = VFSConstants.NO;
try {
// walk tree make sure the directory is deleted once all files,
// versions files and others are properly deleted
Files.walkFileTree(getBasefile().toPath(), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
Files.delete(dir);
return FileVisitResult.CONTINUE;
}
});
status = VFSConstants.YES;
} catch(IOException e) {
log.error("Cannot delete base file: " + this, e);
}
return status;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteBasefile
File: src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java
Repository: OpenOLAT
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2021-41242 | HIGH | 7.9 | OpenOLAT | deleteBasefile | src/main/java/org/olat/core/util/vfs/LocalFolderImpl.java | 336d5ce80681be61a0bbf4f73d2af5d1ff67e93a | 0 |
Analyze the following code function for security vulnerabilities | public ApiClient setUsername(String username) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBasicAuth) {
((HttpBasicAuth) auth).setUsername(username);
return this;
}
}
throw new RuntimeException("No HTTP basic authentication configured!");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUsername
File: samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | setUsername | samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | public static void checkPermission(AccessControlled object, Permission permission) throws IOException, ServletException {
if (permission != null) {
object.checkPermission(permission);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkPermission
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-310"
] | CVE-2014-2061 | MEDIUM | 5 | jenkinsci/jenkins | checkPermission | core/src/main/java/hudson/Functions.java | bf539198564a1108b7b71a973bf7de963a6213ef | 0 |
Analyze the following code function for security vulnerabilities | public String getXMPPAddress(final String userID) throws IOException {
update();
m_readLock.lock();
try {
final User user = m_users.get(userID);
return _getXMPPAddress(user);
} finally {
m_readLock.unlock();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getXMPPAddress
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices. | [
"CWE-352"
] | CVE-2021-25931 | MEDIUM | 6.8 | OpenNMS/opennms | getXMPPAddress | opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java | 607151ea8f90212a3fb37c977fa57c7d58d26a84 | 0 |
Analyze the following code function for security vulnerabilities | public static void reinitializeSession(VaadinRequest request) {
WrappedSession oldSession = request.getWrappedSession();
// Stores all attributes (security key, reference to this context
// instance) so they can be added to the new session
Set<String> attributeNames = oldSession.getAttributeNames();
Map<String, Object> attrs = new HashMap<>(attributeNames.size() * 2);
for (String name : attributeNames) {
Object value = oldSession.getAttribute(name);
if (value instanceof VaadinSession) {
// set flag to avoid cleanup
VaadinSession serviceSession = (VaadinSession) value;
serviceSession.setAttribute(PRESERVE_UNBOUND_SESSION_ATTRIBUTE,
Boolean.TRUE);
}
attrs.put(name, value);
}
// Invalidate the current session
oldSession.invalidate();
// Create a new session
WrappedSession newSession = request.getWrappedSession();
// Restores all attributes (security key, reference to this context
// instance)
for (String name : attrs.keySet()) {
Object value = attrs.get(name);
newSession.setAttribute(name, value);
// Ensure VaadinServiceSession knows where it's stored
if (value instanceof VaadinSession) {
VaadinSession serviceSession = (VaadinSession) value;
VaadinService service = serviceSession.getService();
// Use the same lock instance in the new session
service.setSessionLock(newSession,
serviceSession.getLockInstance());
service.storeSession(serviceSession, newSession);
serviceSession.setAttribute(PRESERVE_UNBOUND_SESSION_ATTRIBUTE,
null);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reinitializeSession
File: server/src/main/java/com/vaadin/server/VaadinService.java
Repository: vaadin/framework
The code follows secure coding practices. | [
"CWE-203"
] | CVE-2021-31403 | LOW | 1.9 | vaadin/framework | reinitializeSession | server/src/main/java/com/vaadin/server/VaadinService.java | d852126ab6f0c43f937239305bd0e9594834fe34 | 0 |
Analyze the following code function for security vulnerabilities | private void addConfigDataSerializableFactories(Map<Integer, DataSerializableFactory> dataSerializableFactories,
SerializationConfig config, ClassLoader cl) {
registerDataSerializableFactories(dataSerializableFactories, config);
buildDataSerializableFactories(dataSerializableFactories, config, cl);
for (DataSerializableFactory f : dataSerializableFactories.values()) {
if (f instanceof HazelcastInstanceAware) {
((HazelcastInstanceAware) f).setHazelcastInstance(hazelcastInstance);
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addConfigDataSerializableFactories
File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | addConfigDataSerializableFactories | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/DefaultSerializationServiceBuilder.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | void handoverFailed(final Call call, final int reason) {
Log.d(this, "handoverFailed(%s) via %s.", call, getComponentName());
BindCallback callback = new BindCallback() {
@Override
public void onSuccess() {
final String callId = mCallIdMapper.getCallId(call);
// If still bound, tell the connection service create connection has failed.
if (callId != null && isServiceValid("handoverFailed")) {
Log.addEvent(call, LogUtils.Events.HANDOVER_FAILED,
Log.piiHandle(call.getHandle()));
try {
mServiceInterface.handoverFailed(
callId,
new ConnectionRequest(
call.getTargetPhoneAccount(),
call.getHandle(),
call.getIntentExtras(),
call.getVideoState(),
callId,
false),
reason,
Log.getExternalSession(TELECOM_ABBREVIATION));
} catch (RemoteException e) {
}
}
}
@Override
public void onFailure() {
// Binding failed.
Log.w(this, "onFailure - could not bind to CS for call %s",
call.getId());
}
};
mBinder.bind(callback, call);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handoverFailed
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 | handoverFailed | src/com/android/server/telecom/ConnectionServiceWrapper.java | 9b41a963f352fdb3da1da8c633d45280badfcb24 | 0 |
Analyze the following code function for security vulnerabilities | void setFields(ObjectStreamField[] f) {
fields = f;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setFields
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2014-7911 | HIGH | 7.2 | android | setFields | luni/src/main/java/java/io/ObjectStreamClass.java | 738c833d38d41f8f76eb7e77ab39add82b1ae1e2 | 0 |
Analyze the following code function for security vulnerabilities | public ModuleLocation getExpandedLocation(AbstractBuild<?, ?> build) {
EnvVars env = new EnvVars(EnvVars.masterEnvVars);
env.putAll(build.getBuildVariables());
return getExpandedLocation(env);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExpandedLocation
File: src/main/java/hudson/scm/SubversionSCM.java
Repository: jenkinsci/subversion-plugin
The code follows secure coding practices. | [
"CWE-255"
] | CVE-2013-6372 | LOW | 2.1 | jenkinsci/subversion-plugin | getExpandedLocation | src/main/java/hudson/scm/SubversionSCM.java | 7d4562d6f7e40de04bbe29577b51c79f07d05ba6 | 0 |
Analyze the following code function for security vulnerabilities | public static List<String> getValidUsagesList() {
List<String> list = new ArrayList<>();
list.add(DERIVE);
list.add(SIGN);
list.add(DECRYPT);
list.add(ENCRYPT);
list.add(WRAP);
list.add(UNWRAP);
list.add(SIGN_RECOVER);
list.add(VERIFY);
list.add(VERIFY_RECOVER);
return list;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getValidUsagesList
File: base/common/src/main/java/com/netscape/certsrv/key/AsymKeyGenerationRequest.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | getValidUsagesList | base/common/src/main/java/com/netscape/certsrv/key/AsymKeyGenerationRequest.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean stopBinderTrackingAndDump(final ParcelFileDescriptor fd) throws RemoteException {
// TODO: hijacking SET_ACTIVITY_WATCHER, but should be changed to its own
// permission (same as profileControl).
if (checkCallingPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException("Requires permission "
+ android.Manifest.permission.SET_ACTIVITY_WATCHER);
}
boolean closeFd = true;
try {
synchronized (mProcLock) {
if (fd == null) {
throw new IllegalArgumentException("null fd");
}
mBinderTransactionTrackingEnabled = false;
PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd.getFileDescriptor()));
pw.println("Binder transaction traces for all processes.\n");
mProcessList.forEachLruProcessesLOSP(true, process -> {
final IApplicationThread thread = process.getThread();
if (!processSanityChecksLPr(process, thread)) {
return;
}
pw.println("Traces for process: " + process.processName);
pw.flush();
try {
TransferPipe tp = new TransferPipe();
try {
thread.stopBinderTrackingAndDump(tp.getWriteFd());
tp.go(fd.getFileDescriptor());
} finally {
tp.kill();
}
} catch (IOException e) {
pw.println("Failure while dumping IPC traces from " + process +
". Exception: " + e);
pw.flush();
} catch (RemoteException e) {
pw.println("Got a RemoteException while dumping IPC traces from " +
process + ". Exception: " + e);
pw.flush();
}
});
closeFd = false;
return true;
}
} finally {
if (fd != null && closeFd) {
try {
fd.close();
} catch (IOException e) {
}
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: stopBinderTrackingAndDump
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | stopBinderTrackingAndDump | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | void killAppAtUsersRequest(ProcessRecord app) {
synchronized (this) {
mAppErrors.killAppAtUserRequestLocked(app);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: killAppAtUsersRequest
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | killAppAtUsersRequest | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | Object newInstance(Class<?> instantiationClass) throws InvalidClassException {
resolveConstructorClass(instantiationClass);
return newInstance(instantiationClass, resolvedConstructorMethodId);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newInstance
File: luni/src/main/java/java/io/ObjectStreamClass.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2014-7911 | HIGH | 7.2 | android | newInstance | luni/src/main/java/java/io/ObjectStreamClass.java | 738c833d38d41f8f76eb7e77ab39add82b1ae1e2 | 0 |
Analyze the following code function for security vulnerabilities | public void run() {
mLockPatternView.clearPattern();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40117 | HIGH | 7.8 | android | run | src/com/android/settings/password/ChooseLockPattern.java | 11815817de2f2d70fe842b108356a1bc75d44ffb | 0 |
Analyze the following code function for security vulnerabilities | private int jjMoveStringLiteralDfa9_2(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_2(7, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_2(8, active0);
return 9;
}
switch(curChar)
{
case 102:
if ((active0 & 0x400000000000L) != 0L)
return jjStartNfaWithStates_2(9, 46, 6);
break;
default :
break;
}
return jjStartNfa_2(8, active0);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjMoveStringLiteralDfa9_2
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices. | [
"CWE-917"
] | CVE-2021-28170 | MEDIUM | 5 | jakartaee/expression-language | jjMoveStringLiteralDfa9_2 | impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java | b6a3943ac5fba71cbc6719f092e319caa747855b | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onBootPhase(int phase) {
if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
mLockSettingsService.maybeShowEncryptionNotifications();
} else if (phase == SystemService.PHASE_BOOT_COMPLETED) {
// TODO
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onBootPhase
File: services/core/java/com/android/server/LockSettingsService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3908 | MEDIUM | 4.3 | android | onBootPhase | services/core/java/com/android/server/LockSettingsService.java | 96daf7d4893f614714761af2d53dfb93214a32e4 | 0 |
Analyze the following code function for security vulnerabilities | public String getString(int index) throws JSONException {
return get(index).toString();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getString
File: src/main/java/org/codehaus/jettison/json/JSONArray.java
Repository: jettison-json/jettison
The code follows secure coding practices. | [
"CWE-674",
"CWE-787"
] | CVE-2022-45693 | HIGH | 7.5 | jettison-json/jettison | getString | src/main/java/org/codehaus/jettison/json/JSONArray.java | cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8 | 0 |
Analyze the following code function for security vulnerabilities | public String getAttachmentRevisionURL(AttachmentReference attachmentReference, String revision, String queryString,
XWikiContext context)
{
DocumentReference documentReference = attachmentReference.getDocumentReference();
SpaceReference spaceReference = documentReference.getLastSpaceReference();
WikiReference wikiReference = spaceReference.getWikiReference();
// We need to serialize the space reference because the old URLFactory has no method to create an Attachment URL
// from an AttachmentReference...
String serializedSpace = getLocalStringEntityReferenceSerializer().serialize(spaceReference);
URL url = context.getURLFactory().createAttachmentRevisionURL(attachmentReference.getName(), serializedSpace,
documentReference.getName(), revision, queryString, wikiReference.getName(), context);
return context.getURLFactory().getURL(url, context);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttachmentRevisionURL
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 | getAttachmentRevisionURL | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java | f9a677408ffb06f309be46ef9d8df1915d9099a4 | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated
public void setPasswordMinimumNumeric(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
mService.setPasswordMinimumNumeric(admin, length, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPasswordMinimumNumeric
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-40089 | HIGH | 7.8 | android | setPasswordMinimumNumeric | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | void startTimeTrackingFocusedActivityLocked() {
if (!mSleeping && mCurAppTimeTracker != null && mFocusedActivity != null) {
mCurAppTimeTracker.start(mFocusedActivity.packageName);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startTimeTrackingFocusedActivityLocked
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 | startTimeTrackingFocusedActivityLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 9878bb99b77c3681f0fda116e2964bac26f349c3 | 0 |
Analyze the following code function for security vulnerabilities | public byte[] toByteArray()
{
/* index || secretKeySeed || secretKeyPRF || publicSeed || root */
int n = params.getDigestSize();
int indexSize = (params.getHeight() + 7) / 8;
int secretKeySize = n;
int secretKeyPRFSize = n;
int publicSeedSize = n;
int rootSize = n;
int totalSize = indexSize + secretKeySize + secretKeyPRFSize + publicSeedSize + rootSize;
byte[] out = new byte[totalSize];
int position = 0;
/* copy index */
byte[] indexBytes = XMSSUtil.toBytesBigEndian(index, indexSize);
XMSSUtil.copyBytesAtOffset(out, indexBytes, position);
position += indexSize;
/* copy secretKeySeed */
XMSSUtil.copyBytesAtOffset(out, secretKeySeed, position);
position += secretKeySize;
/* copy secretKeyPRF */
XMSSUtil.copyBytesAtOffset(out, secretKeyPRF, position);
position += secretKeyPRFSize;
/* copy publicSeed */
XMSSUtil.copyBytesAtOffset(out, publicSeed, position);
position += publicSeedSize;
/* copy root */
XMSSUtil.copyBytesAtOffset(out, root, position);
/* concatenate bdsState */
byte[] bdsStateOut = null;
try
{
bdsStateOut = XMSSUtil.serialize(bdsState);
}
catch (IOException e)
{
e.printStackTrace();
throw new RuntimeException("error serializing bds state");
}
return Arrays.concatenate(out, bdsStateOut);
} | Vulnerability Classification:
- CWE: CWE-470
- CVE: CVE-2018-1000613
- Severity: HIGH
- CVSS Score: 7.5
Description: added additional checking to XMSS BDS tree parsing. Failures now mostly cause IOException
Function: toByteArray
File: core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
Repository: bcgit/bc-java
Fixed Code:
public byte[] toByteArray()
{
/* index || secretKeySeed || secretKeyPRF || publicSeed || root */
int n = params.getDigestSize();
int indexSize = (params.getHeight() + 7) / 8;
int secretKeySize = n;
int secretKeyPRFSize = n;
int publicSeedSize = n;
int rootSize = n;
int totalSize = indexSize + secretKeySize + secretKeyPRFSize + publicSeedSize + rootSize;
byte[] out = new byte[totalSize];
int position = 0;
/* copy index */
byte[] indexBytes = XMSSUtil.toBytesBigEndian(index, indexSize);
XMSSUtil.copyBytesAtOffset(out, indexBytes, position);
position += indexSize;
/* copy secretKeySeed */
XMSSUtil.copyBytesAtOffset(out, secretKeySeed, position);
position += secretKeySize;
/* copy secretKeyPRF */
XMSSUtil.copyBytesAtOffset(out, secretKeyPRF, position);
position += secretKeyPRFSize;
/* copy publicSeed */
XMSSUtil.copyBytesAtOffset(out, publicSeed, position);
position += publicSeedSize;
/* copy root */
XMSSUtil.copyBytesAtOffset(out, root, position);
/* concatenate bdsState */
try
{
return Arrays.concatenate(out, XMSSUtil.serialize(bdsState));
}
catch (IOException e)
{
throw new IllegalStateException("error serializing bds state: " + e.getMessage(), e);
}
} | [
"CWE-470"
] | CVE-2018-1000613 | HIGH | 7.5 | bcgit/bc-java | toByteArray | core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java | 4092ede58da51af9a21e4825fbad0d9a3ef5a223 | 1 |
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-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-21430 | LOW | 2.1 | OpenAPITools/openapi-generator | getJSON | samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | private void updateBasePath() {
if (serverIndex != null) {
setBasePath(servers.get(serverIndex).URL(serverVariables));
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateBasePath
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 | updateBasePath | 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 | private String[] findPackagesPerVisibility(@Nullable Map<String, Integer> accountVisibility) {
Map<Integer, Set<String>> packagesPerVisibility = new HashMap<>();
if (accountVisibility != null) {
for (Entry<String, Integer> entry : accountVisibility.entrySet()) {
if (!packagesPerVisibility.containsKey(entry.getValue())) {
packagesPerVisibility.put(entry.getValue(), new HashSet<>());
}
packagesPerVisibility.get(entry.getValue()).add(entry.getKey());
}
}
String[] packagesPerVisibilityStr = new String[5];
packagesPerVisibilityStr[AccountManager.VISIBILITY_UNDEFINED] = getPackagesForVisibilityStr(
AccountManager.VISIBILITY_UNDEFINED, packagesPerVisibility);
packagesPerVisibilityStr[AccountManager.VISIBILITY_VISIBLE] = getPackagesForVisibilityStr(
AccountManager.VISIBILITY_VISIBLE, packagesPerVisibility);
packagesPerVisibilityStr[AccountManager.VISIBILITY_USER_MANAGED_VISIBLE] =
getPackagesForVisibilityStr(
AccountManager.VISIBILITY_USER_MANAGED_VISIBLE, packagesPerVisibility);
packagesPerVisibilityStr[AccountManager.VISIBILITY_NOT_VISIBLE] =
getPackagesForVisibilityStr(
AccountManager.VISIBILITY_NOT_VISIBLE, packagesPerVisibility);
packagesPerVisibilityStr[AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE] =
getPackagesForVisibilityStr(
AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE, packagesPerVisibility);
return packagesPerVisibilityStr;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findPackagesPerVisibility
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other",
"CWE-502"
] | CVE-2023-45777 | HIGH | 7.8 | android | findPackagesPerVisibility | services/core/java/com/android/server/accounts/AccountManagerService.java | f810d81839af38ee121c446105ca67cb12992fc6 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void skipToQueueItem(String packageName, long id) {
mSessionCb.skipToTrack(packageName, Binder.getCallingPid(), Binder.getCallingUid(), id);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: skipToQueueItem
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-21280 | MEDIUM | 5.5 | android | skipToQueueItem | services/core/java/com/android/server/media/MediaSessionRecord.java | 06e772e05514af4aa427641784c5eec39a892ed3 | 0 |
Analyze the following code function for security vulnerabilities | private PendingIntent pendingBroadcast(String action) {
return PendingIntent.getBroadcastAsUser(mContext,
0, new Intent(action), 0, UserHandle.CURRENT);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pendingBroadcast
File: packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
Repository: android
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2015-3854 | MEDIUM | 5 | android | pendingBroadcast | packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java | 05e0705177d2078fa9f940ce6df723312cfab976 | 0 |
Analyze the following code function for security vulnerabilities | public AppOpsService getAppOpsService(File file, Handler handler) {
return new AppOpsService(file, handler);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppOpsService
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 | getAppOpsService | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void restoreDefaultApps(byte[] backup, int userId) {
if (Binder.getCallingUid() != Process.SYSTEM_UID) {
throw new SecurityException("Only the system may call restoreDefaultApps()");
}
try {
final XmlPullParser parser = Xml.newPullParser();
parser.setInput(new ByteArrayInputStream(backup), StandardCharsets.UTF_8.name());
restoreFromXml(parser, userId, TAG_DEFAULT_APPS,
new BlobXmlRestorer() {
@Override
public void apply(XmlPullParser parser, int userId)
throws XmlPullParserException, IOException {
synchronized (mPackages) {
mSettings.readDefaultAppsLPw(parser, userId);
}
}
} );
} catch (Exception e) {
if (DEBUG_BACKUP) {
Slog.e(TAG, "Exception restoring default apps: " + e.getMessage());
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: restoreDefaultApps
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-119"
] | CVE-2016-2497 | HIGH | 7.5 | android | restoreDefaultApps | services/core/java/com/android/server/pm/PackageManagerService.java | a75537b496e9df71c74c1d045ba5569631a16298 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public String toString() {
return "GsaConfigParser [labelList=" + labelList + ", webConfig=" + webConfig + ", fileConfig=" + fileConfig + "]";
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: src/main/java/org/codelibs/fess/util/GsaConfigParser.java
Repository: codelibs/fess
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2018-1000822 | HIGH | 7.5 | codelibs/fess | toString | src/main/java/org/codelibs/fess/util/GsaConfigParser.java | faa265b8d8f1c71e1bf3229fba5f8cc58a5611b7 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
boolean batteryPresent = Utils.isBatteryPresent(intent);
if (mBatteryPresent != batteryPresent) {
mBatteryPresent = batteryPresent;
updateTilesList();
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onReceive
File: src/com/android/settings/SettingsActivity.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2018-9501 | HIGH | 7.2 | android | onReceive | src/com/android/settings/SettingsActivity.java | 5e43341b8c7eddce88f79c9a5068362927c05b54 | 0 |
Analyze the following code function for security vulnerabilities | public void updateResources() {
int newOrientation = getResources().getConfiguration().orientation;
if (newOrientation != mLastOrientation) {
mLastOrientation = newOrientation;
configureMode();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateResources
File: packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21245 | HIGH | 7.8 | android | updateResources | packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java | a33159e8cb297b9eee6fa5c63c0e343d05fad622 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int setVrMode(IBinder token, boolean enabled, ComponentName packageName) {
if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_VR_MODE)) {
throw new UnsupportedOperationException("VR mode not supported on this device!");
}
final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class);
ActivityRecord r;
synchronized (this) {
r = ActivityRecord.isInStackLocked(token);
}
if (r == null) {
throw new IllegalArgumentException();
}
int err;
if ((err = vrService.hasVrPackage(packageName, r.userId)) !=
VrManagerInternal.NO_ERROR) {
return err;
}
synchronized(this) {
r.requestedVrComponent = (enabled) ? packageName : null;
// Update associated state if this activity is currently focused
if (r == mFocusedActivity) {
applyUpdateVrModeLocked(r);
}
return 0;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setVrMode
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3912 | HIGH | 9.3 | android | setVrMode | services/core/java/com/android/server/am/ActivityManagerService.java | 6c049120c2d749f0c0289d822ec7d0aa692f55c5 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean clearApplicationUserData(final String packageName,
final IPackageDataObserver observer, int userId) {
enforceNotIsolatedCaller("clearApplicationUserData");
if (packageName != null && packageName.equals(mDeviceOwnerName)) {
throw new SecurityException("Clearing DeviceOwner data is forbidden.");
}
int uid = Binder.getCallingUid();
int pid = Binder.getCallingPid();
userId = handleIncomingUser(pid, uid,
userId, false, ALLOW_FULL_ONLY, "clearApplicationUserData", null);
long callingId = Binder.clearCallingIdentity();
try {
IPackageManager pm = AppGlobals.getPackageManager();
int pkgUid = -1;
synchronized(this) {
try {
pkgUid = pm.getPackageUid(packageName, userId);
} catch (RemoteException e) {
}
if (pkgUid == -1) {
Slog.w(TAG, "Invalid packageName: " + packageName);
if (observer != null) {
try {
observer.onRemoveCompleted(packageName, false);
} catch (RemoteException e) {
Slog.i(TAG, "Observer no longer exists.");
}
}
return false;
}
if (uid == pkgUid || checkComponentPermission(
android.Manifest.permission.CLEAR_APP_USER_DATA,
pid, uid, -1, true)
== PackageManager.PERMISSION_GRANTED) {
forceStopPackageLocked(packageName, pkgUid, "clear data");
} else {
throw new SecurityException("PID " + pid + " does not have permission "
+ android.Manifest.permission.CLEAR_APP_USER_DATA + " to clear data"
+ " of package " + packageName);
}
// Remove all tasks match the cleared application package and user
for (int i = mRecentTasks.size() - 1; i >= 0; i--) {
final TaskRecord tr = mRecentTasks.get(i);
final String taskPackageName =
tr.getBaseIntent().getComponent().getPackageName();
if (tr.userId != userId) continue;
if (!taskPackageName.equals(packageName)) continue;
removeTaskByIdLocked(tr.taskId, false);
}
}
try {
// Clear application user data
pm.clearApplicationUserData(packageName, observer, userId);
synchronized(this) {
// Remove all permissions granted from/to this package
removeUriPermissionsForPackageLocked(packageName, userId, true);
}
Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED,
Uri.fromParts("package", packageName, null));
intent.putExtra(Intent.EXTRA_UID, pkgUid);
broadcastIntentInPackage("android", Process.SYSTEM_UID, intent,
null, null, 0, null, null, null, null, false, false, userId);
} catch (RemoteException e) {
}
} finally {
Binder.restoreCallingIdentity(callingId);
}
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearApplicationUserData
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 | clearApplicationUserData | services/core/java/com/android/server/am/ActivityManagerService.java | 9878bb99b77c3681f0fda116e2964bac26f349c3 | 0 |
Analyze the following code function for security vulnerabilities | public void visitUris(@NonNull Consumer<Uri> visitor) {
visitor.accept(sound);
if (tickerView != null) tickerView.visitUris(visitor);
if (contentView != null) contentView.visitUris(visitor);
if (bigContentView != null) bigContentView.visitUris(visitor);
if (headsUpContentView != null) headsUpContentView.visitUris(visitor);
visitIconUri(visitor, mSmallIcon);
visitIconUri(visitor, mLargeIcon);
if (actions != null) {
for (Action action : actions) {
visitIconUri(visitor, action.getIcon());
}
}
if (extras != null) {
visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class));
visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class));
// NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a
// String representation of a Uri, but the previous implementation (and unit test) of
// this method has always treated it as a Uri object. Given the inconsistency,
// supporting both going forward is the safest choice.
Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI);
if (audioContentsUri instanceof Uri) {
visitor.accept((Uri) audioContentsUri);
} else if (audioContentsUri instanceof String) {
visitor.accept(Uri.parse((String) audioContentsUri));
}
if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) {
visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI)));
}
ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST);
if (people != null && !people.isEmpty()) {
for (Person p : people) {
visitor.accept(p.getIconUri());
}
}
final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
if (person != null) {
visitor.accept(person.getIconUri());
}
final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS);
if (history != null) {
for (int i = 0; i < history.length; i++) {
RemoteInputHistoryItem item = history[i];
if (item.getUri() != null) {
visitor.accept(item.getUri());
}
}
}
}
if (isStyle(MessagingStyle.class) && extras != null) {
final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
if (!ArrayUtils.isEmpty(messages)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(messages)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
if (!ArrayUtils.isEmpty(historic)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(historic)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON));
}
if (isStyle(CallStyle.class) & extras != null) {
Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON);
if (callPerson != null) {
visitor.accept(callPerson.getIconUri());
}
visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON));
}
if (mBubbleMetadata != null) {
visitIconUri(visitor, mBubbleMetadata.getIcon());
}
} | Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2023-21288
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Check URIs in notification public version.
Bug: 276294099
Test: atest NotificationManagerServiceTest NotificationVisitUrisTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:67cd169d073486c7c047b80ab83843cdee69bf53)
Merged-In: I670198b213abb2cb29a9865eb9d1e897700508b4
Change-Id: I670198b213abb2cb29a9865eb9d1e897700508b4
Function: visitUris
File: core/java/android/app/Notification.java
Repository: android
Fixed Code:
public void visitUris(@NonNull Consumer<Uri> visitor) {
if (publicVersion != null) {
publicVersion.visitUris(visitor);
}
visitor.accept(sound);
if (tickerView != null) tickerView.visitUris(visitor);
if (contentView != null) contentView.visitUris(visitor);
if (bigContentView != null) bigContentView.visitUris(visitor);
if (headsUpContentView != null) headsUpContentView.visitUris(visitor);
visitIconUri(visitor, mSmallIcon);
visitIconUri(visitor, mLargeIcon);
if (actions != null) {
for (Action action : actions) {
visitIconUri(visitor, action.getIcon());
}
}
if (extras != null) {
visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class));
visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class));
// NOTE: The documentation of EXTRA_AUDIO_CONTENTS_URI explicitly says that it is a
// String representation of a Uri, but the previous implementation (and unit test) of
// this method has always treated it as a Uri object. Given the inconsistency,
// supporting both going forward is the safest choice.
Object audioContentsUri = extras.get(EXTRA_AUDIO_CONTENTS_URI);
if (audioContentsUri instanceof Uri) {
visitor.accept((Uri) audioContentsUri);
} else if (audioContentsUri instanceof String) {
visitor.accept(Uri.parse((String) audioContentsUri));
}
if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) {
visitor.accept(Uri.parse(extras.getString(EXTRA_BACKGROUND_IMAGE_URI)));
}
ArrayList<Person> people = extras.getParcelableArrayList(EXTRA_PEOPLE_LIST);
if (people != null && !people.isEmpty()) {
for (Person p : people) {
visitor.accept(p.getIconUri());
}
}
final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
if (person != null) {
visitor.accept(person.getIconUri());
}
final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS);
if (history != null) {
for (int i = 0; i < history.length; i++) {
RemoteInputHistoryItem item = history[i];
if (item.getUri() != null) {
visitor.accept(item.getUri());
}
}
}
}
if (isStyle(MessagingStyle.class) && extras != null) {
final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
if (!ArrayUtils.isEmpty(messages)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(messages)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
final Parcelable[] historic = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES);
if (!ArrayUtils.isEmpty(historic)) {
for (MessagingStyle.Message message : MessagingStyle.Message
.getMessagesFromBundleArray(historic)) {
visitor.accept(message.getDataUri());
Person senderPerson = message.getSenderPerson();
if (senderPerson != null) {
visitor.accept(senderPerson.getIconUri());
}
}
}
visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON));
}
if (isStyle(CallStyle.class) & extras != null) {
Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON);
if (callPerson != null) {
visitor.accept(callPerson.getIconUri());
}
visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON));
}
if (mBubbleMetadata != null) {
visitIconUri(visitor, mBubbleMetadata.getIcon());
}
} | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | visitUris | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 1 |
Analyze the following code function for security vulnerabilities | @Deprecated
public void setAutoTimeRequired(@NonNull ComponentName admin, boolean required) {
throwIfParentInstance("setAutoTimeRequired");
if (mService != null) {
try {
mService.setAutoTimeRequired(admin, required);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAutoTimeRequired
File: core/java/android/app/admin/DevicePolicyManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-40089 | HIGH | 7.8 | android | setAutoTimeRequired | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | public void loadDataAsync(final AwContents awContents, final String data,
final String mimeType, final boolean isBase64Encoded)
throws Exception {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
awContents.loadData(data, mimeType, isBase64Encoded ? "base64" : null);
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadDataAsync
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-254"
] | CVE-2016-5155 | MEDIUM | 4.3 | chromium | loadDataAsync | android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java | b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6 | 0 |
Analyze the following code function for security vulnerabilities | String onValueEdited(String value); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onValueEdited
File: src/main/java/eu/siacs/conversations/ui/XmppActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | onValueEdited | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | public void setUsageLimitUsageTimePeriodInMinutes(long usageLimitUsageTimePeriodInMinutes) {
mUsageLimitUsageTimePeriodInMinutes = usageLimitUsageTimePeriodInMinutes;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUsageLimitUsageTimePeriodInMinutes
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices. | [
"CWE-120"
] | CVE-2023-21243 | MEDIUM | 5.5 | android | setUsageLimitUsageTimePeriodInMinutes | framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java | 5b49b8711efaadadf5052ba85288860c2d7ca7a6 | 0 |
Analyze the following code function for security vulnerabilities | static JsonNumber getJsonNumber(BigInteger value, int bigIntegerScaleLimit) {
if (value == null) {
throw new NullPointerException("Value is null");
}
return new JsonBigDecimalNumber(new BigDecimal(value), bigIntegerScaleLimit);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getJsonNumber
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 | getJsonNumber | impl/src/main/java/org/eclipse/parsson/JsonNumberImpl.java | 84764ffbe3d0376da242b27a9a526138d0dfb8e6 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void run() {
sendGoAway(ERROR_NO_ERROR);
//just to make sure the connection is actually closed we give it 2 seconds
//then we forcibly kill the connection
getIoThread().executeAfter(new Runnable() {
@Override
public void run() {
IoUtils.safeClose(Http2Channel.this);
}
}, 2, TimeUnit.SECONDS);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: run
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 | run | core/src/main/java/io/undertow/protocols/http2/Http2Channel.java | e43f0ada3f4da6e8579e0020cec3cb1a81e487c2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void onFinishInflate() {
super.onFinishInflate();
mLockPatternUtils = new LockPatternUtils(mContext);
mPreviewContainer = findViewById(R.id.preview_container);
mRightAffordanceView = findViewById(R.id.camera_button);
mLeftAffordanceView = findViewById(R.id.left_button);
mLockIcon = findViewById(R.id.lock_icon);
mIndicationArea = findViewById(R.id.keyguard_indication_area);
mEnterpriseDisclosure = findViewById(
R.id.keyguard_indication_enterprise_disclosure);
mIndicationText = findViewById(R.id.keyguard_indication_text);
watchForCameraPolicyChanges();
updateCameraVisibility();
mUnlockMethodCache = UnlockMethodCache.getInstance(getContext());
mUnlockMethodCache.addListener(this);
mLockIcon.update();
setClipChildren(false);
setClipToPadding(false);
mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext));
inflateCameraPreview();
mLockIcon.setOnClickListener(this);
mLockIcon.setOnLongClickListener(this);
mRightAffordanceView.setOnClickListener(this);
mLeftAffordanceView.setOnClickListener(this);
initAccessibility();
mActivityStarter = Dependency.get(ActivityStarter.class);
mFlashlightController = Dependency.get(FlashlightController.class);
mAccessibilityController = Dependency.get(AccessibilityController.class);
mAssistManager = Dependency.get(AssistManager.class);
updateLeftAffordance();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFinishInflate
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 | onFinishInflate | packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java | c574568aaede7f652432deb7707f20ae54bbdf9a | 0 |
Analyze the following code function for security vulnerabilities | public void clearConfigAttributes() {
configAttrs.clear();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clearConfigAttributes
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 | clearConfigAttributes | base/common/src/main/java/com/netscape/certsrv/profile/ProfileInput.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | private String getOriginalMetadataAuthorReference()
{
if (this.getAuthors().getOriginalMetadataAuthor() == null
|| this.getAuthors().getOriginalMetadataAuthor() == GuestUserReference.INSTANCE) {
return "";
} else {
return userReferenceToString(this.getAuthors().getOriginalMetadataAuthor());
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOriginalMetadataAuthorReference
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2023-29523 | HIGH | 8.8 | xwiki/xwiki-platform | getOriginalMetadataAuthorReference | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | 0d547181389f7941e53291af940966413823f61c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void updateUser(Account user){
Driver driver = new SQLServerDriver();
String connectionUrl = "jdbc:sqlserver://n8bu1j6855.database.windows.net:1433;database=VoyagerDB;user=VoyageLogin@n8bu1j6855;password={GroupP@ssword};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;";
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("UPDATE UserTable "
+ "SET userPassword='" + user.getPassword() + "', userEmail='" + user.getEmail() + "', userRole='" + user.getRole().toString() + "'"
+ "WHERE userName='" + user.getUsername() + "'");
statement.execute();
System.out.println("Update successful");
} catch (SQLException e) {
e.printStackTrace();
}
} | Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2014-125074
- Severity: MEDIUM
- CVSS Score: 5.2
Description: fixed problems in register controller, and worked at preventing sql-injection in database access
Function: updateUser
File: Voyager/src/models/DatabaseAccess.java
Repository: Nayshlok/Voyager
Fixed Code:
@Override
public void updateUser(Account user){
Driver driver = new SQLServerDriver();
try {
Connection con = driver.connect(connectionUrl, new Properties());
PreparedStatement statement = con.prepareStatement("UPDATE UserTable "
+ "SET userPassword=?, userEmail=?, userRole=?"
+ "WHERE userName=?");
statement.setString(1, user.getPassword());
statement.setString(2, user.getEmail());
statement.setString(3, user.getRole().toString());
statement.setString(4, user.getUsername());
statement.execute();
System.out.println("Update successful");
} catch (SQLException e) {
e.printStackTrace();
}
} | [
"CWE-89"
] | CVE-2014-125074 | MEDIUM | 5.2 | Nayshlok/Voyager | updateUser | Voyager/src/models/DatabaseAccess.java | f1249f438cd8c39e7ef2f6c8f2ab76b239a02fae | 1 |
Analyze the following code function for security vulnerabilities | String getImsi() {
// TODO: When RUIM is enabled, IMSI will come from RUIM not build-time props.
String operatorNumeric = ((TelephonyManager) mPhone.getContext().
getSystemService(Context.TELEPHONY_SERVICE)).
getSimOperatorNumericForPhone(mPhoneBase.getPhoneId());
if (!TextUtils.isEmpty(operatorNumeric) && getCdmaMin() != null) {
return (operatorNumeric + getCdmaMin());
} else {
return null;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getImsi
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2016-3831 | MEDIUM | 5 | android | getImsi | src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058 | 0 |
Analyze the following code function for security vulnerabilities | protected <K,V> Map<K, V> generifyMap(final Map<Object, Object> map, final Class<K> keyType, final Class<V> valueType) {
if (keyType == String.class) {
// only value type is changed, we can make value replacements
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object value = entry.getValue();
Object newValue = convert(value, valueType);
if (value != newValue) {
entry.setValue(newValue);
}
}
return (Map<K, V>) map;
}
// key is changed too, we need a new map
Map<K, V> newMap = new HashMap<>(map.size());
for (Map.Entry<Object, Object> entry : map.entrySet()) {
Object key = entry.getKey();
Object newKey = convert(key, keyType);
Object value = entry.getValue();
Object newValue = convert(value, valueType);
newMap.put((K)newKey, (V)newValue);
}
return newMap;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generifyMap
File: jodd-json/src/main/java/jodd/json/MapToBean.java
Repository: oblac/jodd
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2018-21234 | HIGH | 7.5 | oblac/jodd | generifyMap | jodd-json/src/main/java/jodd/json/MapToBean.java | 9bffc3913aeb8472c11bb543243004b4b4376f16 | 0 |
Analyze the following code function for security vulnerabilities | private void sendBroadcastNewDownload(DownloadFileOperation download,
String linkedToRemotePath) {
Intent added = new Intent(getDownloadAddedMessage());
added.putExtra(ACCOUNT_NAME, download.getAccount().name);
added.putExtra(EXTRA_REMOTE_PATH, download.getRemotePath());
added.putExtra(EXTRA_LINKED_TO_PATH, linkedToRemotePath);
added.setPackage(getPackageName());
localBroadcastManager.sendBroadcast(added);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendBroadcastNewDownload
File: src/main/java/com/owncloud/android/files/services/FileDownloader.java
Repository: nextcloud/android
The code follows secure coding practices. | [
"CWE-732"
] | CVE-2022-24886 | LOW | 2.1 | nextcloud/android | sendBroadcastNewDownload | src/main/java/com/owncloud/android/files/services/FileDownloader.java | 27559efb79d45782e000b762860658d49e9c35e9 | 0 |
Analyze the following code function for security vulnerabilities | public boolean isInDeleteMode()
{
return getDriver().getCurrentUrl().contains("/delete/");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInDeleteMode
File: xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2023-35166 | HIGH | 8.8 | xwiki/xwiki-platform | isInDeleteMode | xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java | 98208c5bb1e8cdf3ff1ac35d8b3d1cb3c28b3263 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
new DevicePolicyManagerServiceShellCommand(DevicePolicyManagerService.this).exec(
this, in, out, err, args, callback, resultReceiver);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onShellCommand
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 | onShellCommand | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void addOneTimeSyncCallback(final StanzaListener callback, final StanzaFilter packetFilter) {
final StanzaListener packetListener = new StanzaListener() {
@Override
public void processPacket(Stanza packet) throws NotConnectedException, InterruptedException {
try {
callback.processPacket(packet);
} finally {
removeSyncStanzaListener(this);
}
}
};
addSyncStanzaListener(packetListener, packetFilter);
removeCallbacksService.schedule(new Runnable() {
@Override
public void run() {
removeSyncStanzaListener(packetListener);
}
}, getPacketReplyTimeout(), TimeUnit.MILLISECONDS);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addOneTimeSyncCallback
File: smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
Repository: igniterealtime/Smack
The code follows secure coding practices. | [
"CWE-362"
] | CVE-2016-10027 | MEDIUM | 4.3 | igniterealtime/Smack | addOneTimeSyncCallback | smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java | a9d5cd4a611f47123f9561bc5a81a4555fe7cb04 | 0 |
Analyze the following code function for security vulnerabilities | public Intent getAppLaunchIntent(String pkg, UserHandle user) {
List<LauncherActivityInfo> activities = mLauncherApps.getActivityList(pkg, user);
return activities.isEmpty() ? null :
AppInfo.makeLaunchIntent(activities.get(0));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAppLaunchIntent
File: src/com/android/launcher3/util/PackageManagerHelper.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2023-40097 | HIGH | 7.8 | android | getAppLaunchIntent | src/com/android/launcher3/util/PackageManagerHelper.java | 6c9a41117d5a9365cf34e770bbb00138f6bf997e | 0 |
Analyze the following code function for security vulnerabilities | private boolean hasPaired(int userHandle) {
if (!mHasFeature) {
return true;
}
return getUserData(userHandle).mPaired;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasPaired
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 | hasPaired | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | public void connectNetwork(NetworkUpdateResult result, ActionListenerWrapper wrapper,
int callingUid, @NonNull String packageName) {
Message message =
obtainMessage(CMD_CONNECT_NETWORK,
new ConnectNetworkMessage(result, wrapper, packageName));
message.sendingUid = callingUid;
sendMessage(message);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: connectNetwork
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 | connectNetwork | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | private boolean isDefaultRoleHolder(String packageName) {
String defaultRoleHolder = getDefaultRoleHolderPackageName();
if (packageName == null || defaultRoleHolder == null) {
return false;
}
if (!defaultRoleHolder.equals(packageName)) {
return false;
}
return hasSigningCertificate(
packageName, getDefaultRoleHolderPackageSignature());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isDefaultRoleHolder
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 | isDefaultRoleHolder | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | void reset(int increment, Object[] spans) {
this.mIncrement = increment;
int ns = 0;
if (spans != null) {
int[] stops = this.mStops;
for (Object o : spans) {
if (o instanceof TabStopSpan) {
if (stops == null) {
stops = new int[10];
} else if (ns == stops.length) {
int[] nstops = new int[ns * 2];
for (int i = 0; i < ns; ++i) {
nstops[i] = stops[i];
}
stops = nstops;
}
stops[ns++] = ((TabStopSpan) o).getTabStop();
}
}
if (ns > 1) {
Arrays.sort(stops, 0, ns);
}
if (stops != this.mStops) {
this.mStops = stops;
}
}
this.mNumStops = ns;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: reset
File: core/java/android/text/Layout.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2018-9452 | MEDIUM | 4.3 | android | reset | core/java/android/text/Layout.java | 3b6f84b77c30ec0bab5147b0cffc192c86ba2634 | 0 |
Analyze the following code function for security vulnerabilities | protected void handleProperties(Node node, BeanDefinitionBuilder beanDefinitionBuilder) {
ManagedMap properties = parseProperties(node);
beanDefinitionBuilder.addPropertyValue("properties", properties);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleProperties
File: hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java
Repository: hazelcast
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2016-10750 | MEDIUM | 6.8 | hazelcast | handleProperties | hazelcast-spring/src/main/java/com/hazelcast/spring/AbstractHazelcastBeanDefinitionParser.java | c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9 | 0 |
Analyze the following code function for security vulnerabilities | public ServerBuilder clientAddressSources(Iterable<ClientAddressSource> clientAddressSources) {
this.clientAddressSources = ImmutableList.copyOf(
requireNonNull(clientAddressSources, "clientAddressSources"));
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: clientAddressSources
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 | clientAddressSources | core/src/main/java/com/linecorp/armeria/server/ServerBuilder.java | df7f85824a62e997b910b5d6194a3335841065fd | 0 |
Analyze the following code function for security vulnerabilities | @Override
public XMLBuilder2 elem(String name) {
return element(name);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: elem
File: src/main/java/com/jamesmurty/utils/XMLBuilder2.java
Repository: jmurty/java-xmlbuilder
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2014-125087 | MEDIUM | 5.2 | jmurty/java-xmlbuilder | elem | src/main/java/com/jamesmurty/utils/XMLBuilder2.java | e6fddca201790abab4f2c274341c0bb8835c3e73 | 0 |
Analyze the following code function for security vulnerabilities | public ItemDataFlag findByItemDataPath(int tag_id , String itemDataPath ) {
String query = " from " + getDomainClassName() + " where "
+ " tag_id= " + tag_id + " and path= '" + itemDataPath +"'" ;
org.hibernate.Query q = getCurrentSession().createQuery(query);
return (ItemDataFlag) q.uniqueResult();
} | Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2022-24831
- Severity: HIGH
- CVSS Score: 7.5
Description: OC-17141: fix reported SQL injection issues
Function: findByItemDataPath
File: core/src/main/java/org/akaza/openclinica/dao/hibernate/ItemDataFlagDao.java
Repository: OpenClinica
Fixed Code:
public ItemDataFlag findByItemDataPath(int tag_id , String itemDataPath ) {
String query = " from " + getDomainClassName() + " where "
+ " tag_id= :tag_id and path= :itemDataPath ";
org.hibernate.Query q = getCurrentSession().createQuery(query);
q.setInteger("tag_id", tag_id);
q.setString("itemDataPath", itemDataPath);
return (ItemDataFlag) q.uniqueResult();
} | [
"CWE-89"
] | CVE-2022-24831 | HIGH | 7.5 | OpenClinica | findByItemDataPath | core/src/main/java/org/akaza/openclinica/dao/hibernate/ItemDataFlagDao.java | b152cc63019230c9973965a98e4386ea5322c18f | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void notifyLockedProfile(@UserIdInt int userId) {
mAtmInternal.notifyLockedProfile(userId, mUserController.getCurrentUserId());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: notifyLockedProfile
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21292 | MEDIUM | 5.5 | android | notifyLockedProfile | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | public int clone(ConsoleOutputStreamConsumer outputStreamConsumer, UrlArgument repositoryUrl) {
CommandLine hg = createCommandLine("hg").withArgs("clone").withArg("-b").withArg(branch).withArg(repositoryUrl)
.withArg(workingDir.getAbsolutePath()).withNonArgSecrets(secrets).withEncoding("utf-8");
return execute(hg, outputStreamConsumer);
} | Vulnerability Classification:
- CWE: CWE-77
- CVE: CVE-2022-29184
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Improve escaping of arguments when constructing Hg command calls
Function: clone
File: domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java
Repository: gocd
Fixed Code:
public int clone(ConsoleOutputStreamConsumer outputStreamConsumer, UrlArgument repositoryUrl) {
CommandLine hg = createCommandLine("hg")
.withArgs("clone")
.withArg(branchArg())
.withArg("--")
.withArg(repositoryUrl)
.withArg(workingDir.getAbsolutePath())
.withNonArgSecrets(secrets)
.withEncoding("UTF-8");
return execute(hg, outputStreamConsumer);
} | [
"CWE-77"
] | CVE-2022-29184 | MEDIUM | 6.5 | gocd | clone | domain/src/main/java/com/thoughtworks/go/domain/materials/mercurial/HgCommand.java | 37d35115db2ada2190173f9413cfe1bc6c295ecb | 1 |
Analyze the following code function for security vulnerabilities | @Override
public DefaultJpaInstanceConfiguration ddlGeneration(Ddl ddl) {
put(PersistenceUnitProperties.DDL_GENERATION, ddl.getAction());
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ddlGeneration
File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
Repository: KrailOrg/krail-jpa
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-15018 | MEDIUM | 5.2 | KrailOrg/krail-jpa | ddlGeneration | src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java | c1e848665492e21ef6cc9be443205e36b9a1f6be | 0 |
Analyze the following code function for security vulnerabilities | public void hideWithAnimation(IRemoteAnimationRunner runner) {
if (!mKeyguardDonePending) {
return;
}
mKeyguardExitAnimationRunner = runner;
mViewMediatorCallback.readyForKeyguardDone();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideWithAnimation
File: packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21267 | MEDIUM | 5.5 | android | hideWithAnimation | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | d18d8b350756b0e89e051736c1f28744ed31e93a | 0 |
Analyze the following code function for security vulnerabilities | private void openSearch() {
if (mMenuSearchView != null) {
mMenuSearchView.expandActionView();
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openSearch
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | openSearch | src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.