instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
@Override
public void registerRemoteAnimationsForDisplay(int displayId,
RemoteAnimationDefinition definition) {
mAmInternal.enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS,
"registerRemoteAnimations");
definition.setCallingPidUid(Binder.getCallingPid(), Binder.getCallingUid());
synchronized (mGlobalLock) {
final DisplayContent display = mRootWindowContainer.getDisplayContent(displayId);
if (display == null) {
Slog.e(TAG, "Couldn't find display with id: " + displayId);
return;
}
final long origId = Binder.clearCallingIdentity();
try {
display.registerRemoteAnimations(definition);
} finally {
Binder.restoreCallingIdentity(origId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerRemoteAnimationsForDisplay
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
|
registerRemoteAnimationsForDisplay
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
MethodHandle cloneWithNewType(MethodType newType) {
return new InterfaceHandle(this, newType);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cloneWithNewType
File: jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
Repository: eclipse-openj9/openj9
The code follows secure coding practices.
|
[
"CWE-440",
"CWE-250"
] |
CVE-2021-41035
|
HIGH
| 7.5
|
eclipse-openj9/openj9
|
cloneWithNewType
|
jcl/src/java.base/share/classes/java/lang/invoke/InterfaceHandle.java
|
c6e0d9296ff9a3084965d83e207403de373c0bad
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String register(String loginName, String password) {
if (mallUserMapper.selectByLoginName(loginName) != null) {
return ServiceResultEnum.SAME_LOGIN_NAME_EXIST.getResult();
}
MallUser registerUser = new MallUser();
registerUser.setLoginName(loginName);
registerUser.setNickName(loginName);
String passwordMD5 = MD5Util.MD5Encode(password, "UTF-8");
registerUser.setPasswordMd5(passwordMD5);
if (mallUserMapper.insertSelective(registerUser) > 0) {
return ServiceResultEnum.SUCCESS.getResult();
}
return ServiceResultEnum.DB_ERROR.getResult();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: register
File: src/main/java/ltd/newbee/mall/service/impl/NewBeeMallUserServiceImpl.java
Repository: newbee-ltd/newbee-mall
The code follows secure coding practices.
|
[
"CWE-639"
] |
CVE-2023-30216
|
MEDIUM
| 5.4
|
newbee-ltd/newbee-mall
|
register
|
src/main/java/ltd/newbee/mall/service/impl/NewBeeMallUserServiceImpl.java
|
4f8948579ddd6843a2e313fdd55aafc809246f63
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onCancelClicked() {
mSecurityCallback.onCancelClicked();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCancelClicked
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
|
onCancelClicked
|
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
|
a33159e8cb297b9eee6fa5c63c0e343d05fad622
| 0
|
Analyze the following code function for security vulnerabilities
|
static void resetPriorityAfterLockedSection() {
sThreadPriorityBooster.reset();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetPriorityAfterLockedSection
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
|
resetPriorityAfterLockedSection
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setAutocompleteText(CharSequence userText, CharSequence inlineAutocompleteText) {
boolean emptyAutocomplete = TextUtils.isEmpty(inlineAutocompleteText);
if (!emptyAutocomplete) mDisableTextScrollingFromAutocomplete = true;
int autocompleteIndex = userText.length();
String previousText = getQueryText();
CharSequence newText = TextUtils.concat(userText, inlineAutocompleteText);
setIgnoreTextChangesForAutocomplete(true);
mDisableTextAccessibilityEvents = true;
if (!TextUtils.equals(previousText, newText)) {
// The previous text may also have included autocomplete text, so we only
// append the new autocomplete text that has changed.
if (TextUtils.indexOf(newText, previousText) == 0) {
append(newText.subSequence(previousText.length(), newText.length()));
} else {
setUrl(newText.toString(), null);
}
}
if (getSelectionStart() != autocompleteIndex
|| getSelectionEnd() != getText().length()) {
setSelection(autocompleteIndex, getText().length());
if (inlineAutocompleteText.length() != 0) {
// Sending a TYPE_VIEW_TEXT_SELECTION_CHANGED accessibility event causes the
// previous TYPE_VIEW_TEXT_CHANGED event to be swallowed. As a result the user
// hears the autocomplete text but *not* the text they typed. Instead we send a
// TYPE_ANNOUNCEMENT event, which doesn't swallow the text-changed event.
announceForAccessibility(inlineAutocompleteText);
}
}
if (emptyAutocomplete) {
mAutocompleteSpan.clearSpan();
} else {
mAutocompleteSpan.setSpan(userText, inlineAutocompleteText);
}
setIgnoreTextChangesForAutocomplete(false);
mDisableTextAccessibilityEvents = false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAutocompleteText
File: chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5163
|
MEDIUM
| 4.3
|
chromium
|
setAutocompleteText
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Bitmap getTaskDescriptionIcon(String filePath, int userId) {
userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
userId, false, ALLOW_FULL_ONLY, "getTaskDescriptionIcon", null);
final File passedIconFile = new File(filePath);
final File legitIconFile = new File(TaskPersister.getUserImagesDir(userId),
passedIconFile.getName());
if (!legitIconFile.getPath().equals(filePath)
|| !filePath.contains(ActivityRecord.ACTIVITY_ICON_SUFFIX)) {
throw new IllegalArgumentException("Bad file path: " + filePath
+ " passed for userId " + userId);
}
return mRecentTasks.getTaskDescriptionIcon(filePath);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTaskDescriptionIcon
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
|
getTaskDescriptionIcon
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setReuseParser(final boolean reuseParser) {
this.reuseParser = reuseParser;
if (!reuseParser) {
engine = null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setReuseParser
File: core/src/java/org/jdom2/input/SAXBuilder.java
Repository: hunterhacker/jdom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-33813
|
MEDIUM
| 5
|
hunterhacker/jdom
|
setReuseParser
|
core/src/java/org/jdom2/input/SAXBuilder.java
|
bd3ab78370098491911d7fe9d7a43b97144a234e
| 0
|
Analyze the following code function for security vulnerabilities
|
private String exportPropertiesPart(Map < String, Property<?>> mapOfProperties) {
// Create <features>
StringBuilder sb = new StringBuilder(BEGIN_PROPERTIES);
if (mapOfProperties != null && !mapOfProperties.isEmpty()) {
sb.append(buildPropertiesPart(mapOfProperties));
}
sb.append(END_PROPERTIES);
return sb.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exportPropertiesPart
File: ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
Repository: ff4j
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2022-44262
|
CRITICAL
| 9.8
|
ff4j
|
exportPropertiesPart
|
ff4j-core/src/main/java/org/ff4j/conf/XmlParser.java
|
991df72725f78adbc413d9b0fbb676201f1882e0
| 0
|
Analyze the following code function for security vulnerabilities
|
User getUser() {
return user;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUser
File: core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2014-2064
|
MEDIUM
| 5
|
jenkinsci/jenkins
|
getUser
|
core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java
|
fbf96734470caba9364f04e0b77b0bae7293a1ec
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
boolean showToCurrentUser() {
return mShowForAllUsers || mWmService.isCurrentProfile(mUserId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showToCurrentUser
File: services/core/java/com/android/server/wm/ActivityRecord.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21145
|
HIGH
| 7.8
|
android
|
showToCurrentUser
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean injectCustomMapping(BaseClass doc1class) throws XWikiException
{
if (!doc1class.hasExternalCustomMapping()) {
return false;
}
if (!isCustomMappingValid(doc1class, doc1class.getCustomMapping())) {
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
XWikiException.ERROR_XWIKI_STORE_HIBERNATE_INVALID_MAPPING, "Invalid Custom Mapping");
}
return injectCustomMapping(doc1class.getName(), doc1class.getCustomMapping(), null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: injectCustomMapping
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
injectCustomMapping
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onFragmentViewCreated(String tag, Fragment fragment) {
mQs = (QS) fragment;
mQs.setPanelView(NotificationPanelView.this);
mQs.setExpandClickListener(NotificationPanelView.this);
mQs.setHeaderClickable(mQsExpansionEnabled);
mQs.setKeyguardShowing(mKeyguardShowing);
mQs.setOverscrolling(mStackScrollerOverscrolling);
// recompute internal state when qspanel height changes
mQs.getView().addOnLayoutChangeListener(
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
final int height = bottom - top;
final int oldHeight = oldBottom - oldTop;
if (height != oldHeight) {
onQsHeightChanged();
}
});
mNotificationStackScroller.setQsContainer((ViewGroup) mQs.getView());
updateQsExpansion();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onFragmentViewCreated
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
onFragmentViewCreated
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("checkstyle:MethodLength")
public String generate(Config config) {
isNotNull(config, "Config");
StringBuilder xml = new StringBuilder();
XmlGenerator gen = new XmlGenerator(xml);
PersistenceAndHotRestartPersistenceMerger.merge(config.getHotRestartPersistenceConfig(),
config.getPersistenceConfig());
xml.append("<hazelcast ")
.append("xmlns=\"http://www.hazelcast.com/schema/config\"\n")
.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n")
.append("xsi:schemaLocation=\"http://www.hazelcast.com/schema/config ")
.append("http://www.hazelcast.com/schema/config/hazelcast-config-")
.append(Versions.CURRENT_CLUSTER_VERSION.toString())
.append(".xsd\">");
gen.node("license-key", getOrMaskValue(config.getLicenseKey()))
.node("instance-name", config.getInstanceName())
.node("cluster-name", config.getClusterName())
;
managementCenterXmlGenerator(gen, config);
gen.appendProperties(config.getProperties());
securityXmlGenerator(gen, config);
wanReplicationXmlGenerator(gen, config);
networkConfigXmlGenerator(gen, config);
advancedNetworkConfigXmlGenerator(gen, config);
replicatedMapXmlGenerator(gen, config);
mapXmlGenerator(gen, config);
cacheXmlGenerator(gen, config);
queueXmlGenerator(gen, config);
multiMapXmlGenerator(gen, config);
listXmlGenerator(gen, config);
setXmlGenerator(gen, config);
topicXmlGenerator(gen, config);
ringbufferXmlGenerator(gen, config);
executorXmlGenerator(gen, config);
durableExecutorXmlGenerator(gen, config);
scheduledExecutorXmlGenerator(gen, config);
partitionGroupXmlGenerator(gen, config);
cardinalityEstimatorXmlGenerator(gen, config);
listenerXmlGenerator(gen, config);
serializationXmlGenerator(gen, config);
reliableTopicXmlGenerator(gen, config);
liteMemberXmlGenerator(gen, config);
nativeMemoryXmlGenerator(gen, config);
persistenceXmlGenerator(gen, config);
dynamicConfigurationXmlGenerator(gen, config);
localDeviceConfigXmlGenerator(gen, config);
flakeIdGeneratorXmlGenerator(gen, config);
crdtReplicationXmlGenerator(gen, config);
pnCounterXmlGenerator(gen, config);
splitBrainProtectionXmlGenerator(gen, config);
cpSubsystemConfig(gen, config);
metricsConfig(gen, config);
instanceTrackingConfig(gen, config);
sqlConfig(gen, config);
jetConfig(gen, config);
factoryWithPropertiesXmlGenerator(gen, "auditlog", config.getAuditlogConfig());
userCodeDeploymentConfig(gen, config);
integrityCheckerXmlGenerator(gen, config);
dataConnectionConfiguration(gen, config);
tpcConfiguration(gen, config);
xml.append("</hazelcast>");
String xmlString = xml.toString();
return formatted ? formatXml(xmlString, INDENT) : xmlString;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: generate
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-33264
|
MEDIUM
| 4.3
|
hazelcast
|
generate
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
80a502d53cc48bf895711ab55f95e3a51e344ac1
| 0
|
Analyze the following code function for security vulnerabilities
|
@SystemApi
@RequiresPermission(anyOf = {
Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,
Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS
})
public @IntRange(from = 0) int getRuntimePermissionsVersion() {
try {
return mPackageManager.getRuntimePermissionsVersion(mContext.getUserId());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRuntimePermissionsVersion
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
getRuntimePermissionsVersion
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@GET
@Path("/extensions")
@Produces(MediaType.APPLICATION_JSON)
public List<String> getSupportedExtensions(@Context SecurityContext securityContext) {
if (!securityContext.isUserInRole(Authentication.ROLE_FILESYSTEM_EDITOR)) {
throw new ForbiddenException("FILESYSTEM EDITOR role is required for retrieving supported extensions.");
}
return SUPPORTED_FILE_EXTENSIONS.stream()
.sorted()
.collect(Collectors.toList());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSupportedExtensions
File: opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40315
|
HIGH
| 8
|
OpenNMS/opennms
|
getSupportedExtensions
|
opennms-webapp-rest/src/main/java/org/opennms/web/rest/v1/FilesystemRestService.java
|
201301e067329ababa3c0671ded5c4c43347d4a8
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract void resetFailedAttempts();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetFailedAttempts
File: services/core/java/com/android/server/fingerprint/AuthenticationClient.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3917
|
HIGH
| 7.2
|
android
|
resetFailedAttempts
|
services/core/java/com/android/server/fingerprint/AuthenticationClient.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
public BaseClass getRightsClass(XWikiContext context) throws XWikiException
{
return getRightsClass("XWikiRights", context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRightsClass
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
|
getRightsClass
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onActivityResult(int requestCode, int resultcode, Intent data) {
super.onActivityResult(requestCode, resultcode, data);
if (requestCode != 1) return;
if (resultcode == RESULT_OK) {
handleAuthenticated();
} else {
Log.w(TAG, "Authentication failed");
failure = true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onActivityResult
File: app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
Repository: oxen-io/session-android
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-1955
|
LOW
| 2.1
|
oxen-io/session-android
|
onActivityResult
|
app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
|
c69b49e676dd8f619418cf296d6fdad9ce5a9510
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setDozing(boolean dozing, boolean animate) {
mDozing = dozing;
updateCameraVisibility();
updateLeftAffordanceIcon();
if (dozing) {
mLockIcon.setVisibility(INVISIBLE);
} else {
mLockIcon.setVisibility(VISIBLE);
if (animate) {
startFinishDozeAnimation();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDozing
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
|
setDozing
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected int toVisibility(boolean visibleOrGone) {
return visibleOrGone ? View.VISIBLE : View.GONE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toVisibility
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
|
toVisibility
|
src/com/android/settings/password/ChooseLockPassword.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setHierarchyMode(String mode)
{
setPropertyInXWikiPreferences("core.hierarchyMode", "String", mode);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setHierarchyMode
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
|
setHierarchyMode
|
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 setNearbyAppStreamingPolicy(int policy) {
if (!mHasFeature) {
return;
}
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(
isDefaultDeviceOwner(caller) || isProfileOwner(caller));
synchronized (getLockObject()) {
final ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller.getUserId());
if (admin.mNearbyAppStreamingPolicy != policy) {
admin.mNearbyAppStreamingPolicy = policy;
saveSettingsLocked(caller.getUserId());
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setNearbyAppStreamingPolicy
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
setNearbyAppStreamingPolicy
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getMaxSessionCookieSize() {
return maxSessionCookieSize;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaxSessionCookieSize
File: ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java
Repository: ratpack
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2021-29481
|
MEDIUM
| 5
|
ratpack
|
getMaxSessionCookieSize
|
ratpack-session/src/main/java/ratpack/session/clientside/ClientSideSessionConfig.java
|
60302fae7ef26897b9a0ec0def6281a9425344cf
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressLint("ClickableViewAccessibility")
@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
NextcloudTalkApplication.Companion.getSharedApplication().getComponentApplication().inject(this);
binding = CallActivityBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
hideNavigationIfNoPipAvailable();
Bundle extras = getIntent().getExtras();
roomId = extras.getString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), "");
roomToken = extras.getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), "");
conversationUser = extras.getParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY());
conversationPassword = extras.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_PASSWORD(), "");
conversationName = extras.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_NAME(), "");
isVoiceOnlyCall = extras.getBoolean(BundleKeys.INSTANCE.getKEY_CALL_VOICE_ONLY(), false);
isCallWithoutNotification = extras.getBoolean(BundleKeys.INSTANCE.getKEY_CALL_WITHOUT_NOTIFICATION(), false);
if (extras.containsKey(BundleKeys.INSTANCE.getKEY_FROM_NOTIFICATION_START_CALL())) {
isIncomingCallFromNotification = extras.getBoolean(BundleKeys.INSTANCE.getKEY_FROM_NOTIFICATION_START_CALL());
}
credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken());
baseUrl = extras.getString(BundleKeys.INSTANCE.getKEY_MODIFIED_BASE_URL(), "");
if (TextUtils.isEmpty(baseUrl)) {
baseUrl = conversationUser.getBaseUrl();
}
powerManagerUtils = new PowerManagerUtils();
if (extras.getString("state", "").equalsIgnoreCase("resume")) {
setCallState(CallStatus.IN_CONVERSATION);
} else {
setCallState(CallStatus.CONNECTING);
}
initClickListeners();
binding.microphoneButton.setOnTouchListener(new MicrophoneButtonTouchListener());
pulseAnimation = PulseAnimation.create().with(binding.microphoneButton)
.setDuration(310)
.setRepeatCount(PulseAnimation.INFINITE)
.setRepeatMode(PulseAnimation.REVERSE);
basicInitialization();
participantDisplayItems = new HashMap<>();
initViews();
if (!isConnectionEstablished()) {
initiateCall();
}
updateSelfVideoViewPosition();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onCreate
File: app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
Repository: nextcloud/talk-android
The code follows secure coding practices.
|
[
"CWE-732",
"CWE-200"
] |
CVE-2022-41926
|
MEDIUM
| 5.5
|
nextcloud/talk-android
|
onCreate
|
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
|
bb7e82fbcbd8c10d0d0128d736c41cec0f79e7d0
| 0
|
Analyze the following code function for security vulnerabilities
|
void onUnlockUser(int userId) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "onUserUnlocked " + userId);
}
synchronized (mUsers) {
mLocalUnlockedUsers.put(userId, true);
}
if (userId < 1) return;
mHandler.post(() -> syncSharedAccounts(userId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUnlockUser
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
|
onUnlockUser
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void renderHead(final IHeaderResponse response)
{
super.renderHead(response);
if (lazyBinding == false) {
final String script = getJavaScriptAction();
response.render(OnDomReadyHeaderItem.forScript(script));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: renderHead
File: src/main/java/org/projectforge/web/dialog/ModalDialog.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
renderHead
|
src/main/java/org/projectforge/web/dialog/ModalDialog.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
private void resumeScreenLock() {
KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
assert keyguardManager != null;
if (!keyguardManager.isKeyguardSecure()) {
Log.w(TAG ,"Keyguard not secure...");
TextSecurePreferences.setScreenLockEnabled(getApplicationContext(), false);
TextSecurePreferences.setScreenLockTimeout(getApplicationContext(), 0);
handleAuthenticated();
return;
}
if (fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints()) {
Log.i(TAG, "Listening for fingerprints...");
fingerprintCancellationSignal = new CancellationSignal();
fingerprintManager.authenticate(null, 0, fingerprintCancellationSignal, fingerprintListener, null);
} else {
Log.i(TAG, "firing intent...");
Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Unlock Session", "");
startActivityForResult(intent, 1);
}
}
|
Vulnerability Classification:
- CWE: CWE-287
- CVE: CVE-2022-1955
- Severity: LOW
- CVSS Score: 2.1
Description: feat: handle KeyStore backed fingerprint verification
Function: resumeScreenLock
File: app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
Repository: oxen-io/session-android
Fixed Code:
private void resumeScreenLock() {
KeyguardManager keyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
assert keyguardManager != null;
if (!keyguardManager.isKeyguardSecure()) {
Log.w(TAG ,"Keyguard not secure...");
TextSecurePreferences.setScreenLockEnabled(getApplicationContext(), false);
TextSecurePreferences.setScreenLockTimeout(getApplicationContext(), 0);
handleAuthenticated();
return;
}
if (fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints()) {
Log.i(TAG, "Listening for fingerprints...");
fingerprintCancellationSignal = new CancellationSignal();
fingerprintManager.authenticate(new FingerprintManagerCompat.CryptoObject(biometricSecretProvider.getOrCreateBiometricSignature(this)), 0, fingerprintCancellationSignal, fingerprintListener, null);
} else {
Log.i(TAG, "firing intent...");
Intent intent = keyguardManager.createConfirmDeviceCredentialIntent("Unlock Session", "");
startActivityForResult(intent, 1);
}
}
|
[
"CWE-287"
] |
CVE-2022-1955
|
LOW
| 2.1
|
oxen-io/session-android
|
resumeScreenLock
|
app/src/main/java/org/thoughtcrime/securesms/PassphrasePromptActivity.java
|
c69b49e676dd8f619418cf296d6fdad9ce5a9510
| 1
|
Analyze the following code function for security vulnerabilities
|
public static Locale getCurrentLocale() {
Locale locale=null;
StaplerRequest req = Stapler.getCurrentRequest();
if(req!=null)
locale = req.getLocale();
if(locale==null)
locale = Locale.getDefault();
return locale;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentLocale
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
|
getCurrentLocale
|
core/src/main/java/hudson/Functions.java
|
bf539198564a1108b7b71a973bf7de963a6213ef
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<String> getVirtualWikiList()
{
return new ArrayList<>(this.initializedWikis.keySet());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getVirtualWikiList
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
|
getVirtualWikiList
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getCookieValue(String name) {
HttpCookie cookie = request.getCookies().getFirst(name);
if(cookie == null) {
return null;
}
return cookie.getValue();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCookieValue
File: sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
Repository: dromara/Sa-Token
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-44794
|
CRITICAL
| 9.8
|
dromara/Sa-Token
|
getCookieValue
|
sa-token-starter/sa-token-reactor-spring-boot-starter/src/main/java/cn/dev33/satoken/reactor/model/SaRequestForReactor.java
|
954efeb73277f924f836da2a25322ea35ee1bfa3
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean hasDirectBufferNoCleanerConstructor() {
return PlatformDependent0.hasDirectBufferNoCleanerConstructor();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasDirectBufferNoCleanerConstructor
File: common/src/main/java/io/netty/util/internal/PlatformDependent.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-668",
"CWE-378",
"CWE-379"
] |
CVE-2022-24823
|
LOW
| 1.9
|
netty
|
hasDirectBufferNoCleanerConstructor
|
common/src/main/java/io/netty/util/internal/PlatformDependent.java
|
185f8b2756a36aaa4f973f1a2a025e7d981823f1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setSort(Integer sort) {
this.sort = sort;
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-7171
- Severity: LOW
- CVSS Score: 3.3
Description: fix(novel-admin): 友情链接URL格式校验
Function: setSort
File: novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
Repository: 201206030/novel-plus
Fixed Code:
public void setSort(Integer sort) {
this.sort = sort;
}
|
[
"CWE-79"
] |
CVE-2023-7171
|
LOW
| 3.3
|
201206030/novel-plus
|
setSort
|
novel-admin/src/main/java/com/java2nb/novel/domain/FriendLinkDO.java
|
d6093d8182362422370d7eaf6c53afde9ee45215
| 1
|
Analyze the following code function for security vulnerabilities
|
private Map<String, List<File>> getAllDirectories(List<String> states) {
Map<String, List<File>> allDirectories = new HashMap<>();
if ( shouldIncludeState(states, Recording.STATE_PUBLISHED) ) {
List<File> listedDirectories = getAllDirectories(Recording.STATE_PUBLISHED);
allDirectories.put(Recording.STATE_PUBLISHED, listedDirectories);
}
if ( shouldIncludeState(states, Recording.STATE_UNPUBLISHED) ) {
List<File> listedDirectories = getAllDirectories(Recording.STATE_UNPUBLISHED);
allDirectories.put(Recording.STATE_UNPUBLISHED, listedDirectories);
}
if ( shouldIncludeState(states, Recording.STATE_DELETED) ) {
List<File> listedDirectories = getAllDirectories(Recording.STATE_DELETED);
allDirectories.put(Recording.STATE_DELETED, listedDirectories);
}
if ( shouldIncludeState(states, Recording.STATE_PROCESSING) ) {
List<File> listedDirectories = getAllDirectories(Recording.STATE_PROCESSING);
allDirectories.put(Recording.STATE_PROCESSING, listedDirectories);
}
if ( shouldIncludeState(states, Recording.STATE_PROCESSED) ) {
List<File> listedDirectories = getAllDirectories(Recording.STATE_PROCESSED);
allDirectories.put(Recording.STATE_PROCESSED, listedDirectories);
}
return allDirectories;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllDirectories
File: bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
Repository: bigbluebutton
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-12443
|
HIGH
| 7.5
|
bigbluebutton
|
getAllDirectories
|
bbb-common-web/src/main/java/org/bigbluebutton/api/RecordingService.java
|
b21ca8355a57286a1e6df96984b3a4c57679a463
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public WearableExtender setContentIconGravity(int contentIconGravity) {
mContentIconGravity = contentIconGravity;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setContentIconGravity
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setContentIconGravity
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
private void enforceCanQueryLockTaskLocked(ComponentName who, String callerPackageName) {
CallerIdentity caller = getCallerIdentity(who, callerPackageName);
final int userId = caller.getUserId();
enforceCanQuery(MANAGE_DEVICE_POLICY_LOCK_TASK, caller.getPackageName(), userId);
if ((isDeviceOwner(caller) || isProfileOwner(caller))
&& !canDPCManagedUserUseLockTaskLocked(userId)) {
throw new SecurityException("User " + userId + " is not allowed to use lock task");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceCanQueryLockTaskLocked
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
enforceCanQueryLockTaskLocked
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public ResumeMediaBrowser create(ResumeMediaBrowser.Callback callback,
ComponentName componentName) {
return new ResumeMediaBrowser(mContext, callback, componentName, mBrowserFactory, mLogger);
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-35675
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Improve user handling when querying for resumable media
- Before trying to query recent media from a saved component, check
whether the current user actually has that component installed
- Track user when creating the MediaBrowser, in case the user changes
before the MBS returns a result
Test: atest MediaResumeListenerTest
Bug: 284297711
(cherry picked from commit e566a250ad61e269119b475c7ebdae6ca962c4a7)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d61741288b4d7614e4677428aac6418f6f1d79f0)
Merged-In: I838ff0e125acadabc8436a00dbff707cc4be6249
Change-Id: I838ff0e125acadabc8436a00dbff707cc4be6249
Function: create
File: packages/SystemUI/src/com/android/systemui/media/ResumeMediaBrowserFactory.java
Repository: android
Fixed Code:
public ResumeMediaBrowser create(ResumeMediaBrowser.Callback callback,
ComponentName componentName, @UserIdInt int userId) {
return new ResumeMediaBrowser(mContext, callback, componentName, mBrowserFactory, mLogger,
userId);
}
|
[
"CWE-Other"
] |
CVE-2023-35675
|
MEDIUM
| 5.5
|
android
|
create
|
packages/SystemUI/src/com/android/systemui/media/ResumeMediaBrowserFactory.java
|
c1cf4b9746c9641190730172522324ccd5b8c914
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<PhoneAccountHandle> getCallCapablePhoneAccounts(
boolean includeDisabledAccounts, String callingPackage) {
if (!canReadPhoneState(callingPackage, "getDefaultOutgoingPhoneAccount")) {
return Collections.emptyList();
}
synchronized (mLock) {
long token = Binder.clearCallingIdentity();
try {
// TODO: Does this isVisible check actually work considering we are clearing
// the calling identity?
return filterForAccountsVisibleToCaller(
mPhoneAccountRegistrar.getCallCapablePhoneAccounts(
null, includeDisabledAccounts));
} catch (Exception e) {
Log.e(this, e, "getCallCapablePhoneAccounts");
throw e;
} finally {
Binder.restoreCallingIdentity(token);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCallCapablePhoneAccounts
File: src/com/android/server/telecom/TelecomServiceImpl.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0847
|
HIGH
| 7.2
|
android
|
getCallCapablePhoneAccounts
|
src/com/android/server/telecom/TelecomServiceImpl.java
|
2750faaa1ec819eed9acffea7bd3daf867fda444
| 0
|
Analyze the following code function for security vulnerabilities
|
int getCurrentTtyMode() {
return mTtyManager.getCurrentTtyMode();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCurrentTtyMode
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-2423
|
MEDIUM
| 6.6
|
android
|
getCurrentTtyMode
|
src/com/android/server/telecom/CallsManager.java
|
a06c9a4aef69ae27b951523cf72bf72412bf48fa
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String saveFormFile (String formInode, String formType,
String fileName, File fileToSave, Host currentHost, String filesFolder) throws Exception {
FileAPI fileAPI=APILocator.getFileAPI();
String path;
if(filesFolder != null)
path = filesFolder;
else
path = getFormFileFolderPath(formType, formInode);
Folder folder = APILocator.getFolderAPI().createFolders(path, currentHost, APILocator.getUserAPI().getSystemUser(), false);
String baseFilename = fileName;
int c = 1;
while(fileAPI.fileNameExists(folder, fileName)) {
fileName = UtilMethods.getFileName(baseFilename) + "-" + c + "." + UtilMethods.getFileExtension(baseFilename);
c++;
}
Host host = APILocator.getHostAPI().find(folder.getHostId(), APILocator.getUserAPI().getSystemUser(), false);
while(APILocator.getFileAssetAPI().fileNameExists(host,folder, fileName, "")) {
fileName = UtilMethods.getFileName(baseFilename) + "-" + c + "." + UtilMethods.getFileExtension(baseFilename);
c++;
}
Contentlet cont = new Contentlet();
cont.setStructureInode(folder.getDefaultFileType());
cont.setStringProperty(FileAssetAPI.TITLE_FIELD, UtilMethods.getFileName(fileName));
cont.setFolder(folder.getInode());
cont.setHost(host.getIdentifier());
cont.setBinary(FileAssetAPI.BINARY_FIELD, fileToSave);
APILocator.getContentletAPI().checkin(cont, APILocator.getUserAPI().getSystemUser(),false);
return path + "/" + fileName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveFormFile
File: src/com/dotmarketing/factories/EmailFactory.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
saveFormFile
|
src/com/dotmarketing/factories/EmailFactory.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
public void buildSyncCreate(IssuesWithBLOBs issue, String platformId, Integer nextNum) {
issue.setProjectId(projectId);
issue.setId(UUID.randomUUID().toString());
issue.setPlatformId(platformId);
issue.setCreator(SessionUtils.getUserId());
issue.setNum(nextNum);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildSyncCreate
File: test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
buildSyncCreate
|
test-track/backend/src/main/java/io/metersphere/service/issue/platform/AbstractIssuePlatform.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
public Object getSelectedRow() throws IllegalStateException {
if (selectionModel instanceof SelectionModel.Single) {
return ((SelectionModel.Single) selectionModel).getSelectedRow();
} else if (selectionModel instanceof SelectionModel.Multi) {
throw new IllegalStateException("Cannot get unique selected row: "
+ "Grid is in multiselect mode "
+ "(the current selection model is "
+ selectionModel.getClass().getName() + ").");
} else if (selectionModel instanceof SelectionModel.None) {
throw new IllegalStateException(
"Cannot get selected row: " + "Grid selection is disabled "
+ "(the current selection model is "
+ selectionModel.getClass().getName() + ").");
} else {
throw new IllegalStateException("Cannot get selected row: "
+ "Grid selection model does not implement "
+ SelectionModel.Single.class.getName() + " or "
+ SelectionModel.Multi.class.getName()
+ "(the current model is "
+ selectionModel.getClass().getName() + ").");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSelectedRow
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getSelectedRow
|
server/src/main/java/com/vaadin/ui/Grid.java
|
b9ba10adaa06a0977c531f878c3f0046b67f9cc0
| 0
|
Analyze the following code function for security vulnerabilities
|
public FormValidation doCheckDisplayName(@QueryParameter String displayName,
@QueryParameter String jobName) {
displayName = displayName.trim();
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Current job name is " + jobName);
}
if(!isNameUnique(displayName, jobName)) {
return FormValidation.warning(Messages.Jenkins_CheckDisplayName_NameNotUniqueWarning(displayName));
}
else if(!isDisplayNameUnique(displayName, jobName)){
return FormValidation.warning(Messages.Jenkins_CheckDisplayName_DisplayNameNotUniqueWarning(displayName));
}
else {
return FormValidation.ok();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: doCheckDisplayName
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
doCheckDisplayName
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void dispatchScreenTurnedOn() {
synchronized (this) {
mScreenOn = true;
}
mHandler.sendEmptyMessage(MSG_SCREEN_TURNED_ON);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dispatchScreenTurnedOn
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
|
dispatchScreenTurnedOn
|
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
|
f5334952131afa835dd3f08601fb3bced7b781cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
final boolean newTwoPaneState = mSplitController.isActivityEmbedded(this);
if (mIsTwoPane != newTwoPaneState) {
mIsTwoPane = newTwoPaneState;
updateHomepageAppBar();
updateHomepageBackground();
updateHomepagePaddings();
}
updateSplitLayout();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onConfigurationChanged
File: src/com/android/settings/homepage/SettingsHomepageActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21256
|
HIGH
| 7.8
|
android
|
onConfigurationChanged
|
src/com/android/settings/homepage/SettingsHomepageActivity.java
|
62fc1d269f5e754fc8f00b6167d79c3933b4c1f4
| 0
|
Analyze the following code function for security vulnerabilities
|
private void startUninstallIntent(final String packageName, final int userId) {
final UserPackage packageUserPair = UserPackage.of(userId, packageName);
synchronized (getLockObject()) {
if (!mPackagesToRemove.contains(packageUserPair)) {
// Do nothing if uninstall was not requested or was already started.
return;
}
mPackagesToRemove.remove(packageUserPair);
}
if (!isPackageInstalledForUser(packageName, userId)) {
// Package does not exist. Nothing to do.
return;
}
try { // force stop the package before uninstalling
mInjector.getIActivityManager().forceStopPackage(packageName, userId);
} catch (RemoteException re) {
Slogf.e(LOG_TAG, "Failure talking to ActivityManager while force stopping package");
}
final Uri packageURI = Uri.parse("package:" + packageName);
final Intent uninstallIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageURI);
uninstallIntent.setFlags(FLAG_ACTIVITY_NEW_TASK);
mContext.startActivityAsUser(uninstallIntent, UserHandle.of(userId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startUninstallIntent
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
startUninstallIntent
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
static boolean canBeImeTarget(WindowState w) {
final int fl = w.mAttrs.flags
& (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM);
if (fl == 0 || fl == (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)
|| w.mAttrs.type == TYPE_APPLICATION_STARTING) {
if (DEBUG_INPUT_METHOD) {
Slog.i(TAG, "isVisibleOrAdding " + w + ": " + w.isVisibleOrAdding());
if (!w.isVisibleOrAdding()) {
Slog.i(TAG, " mSurface=" + w.mWinAnimator.mSurfaceControl
+ " relayoutCalled=" + w.mRelayoutCalled + " viewVis=" + w.mViewVisibility
+ " policyVis=" + w.mPolicyVisibility
+ " policyVisAfterAnim=" + w.mPolicyVisibilityAfterAnim
+ " attachHid=" + w.mAttachedHidden
+ " exiting=" + w.mExiting + " destroying=" + w.mDestroying);
if (w.mAppToken != null) {
Slog.i(TAG, " mAppToken.hiddenRequested=" + w.mAppToken.hiddenRequested);
}
}
}
return w.isVisibleOrAdding();
}
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canBeImeTarget
File: services/core/java/com/android/server/wm/WindowManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3875
|
HIGH
| 7.2
|
android
|
canBeImeTarget
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
void handleLocaleChanged() {
if (DEBUG) {
Slog.d(TAG, "handleLocaleChanged");
}
scheduleSaveBaseState();
synchronized (mLock) {
final long token = injectClearCallingIdentity();
try {
forEachLoadedUserLocked(user -> user.detectLocaleChange());
} finally {
injectRestoreCallingIdentity(token);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleLocaleChanged
File: services/core/java/com/android/server/pm/ShortcutService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40079
|
HIGH
| 7.8
|
android
|
handleLocaleChanged
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<PotentialDuplicate> getAllByQuery( PotentialDuplicateQuery query )
{
String queryString = "from PotentialDuplicate pr where pr.status in (:status)";
return Optional.ofNullable( query.getTeis() ).filter( teis -> !teis.isEmpty() ).map( teis -> {
Query<PotentialDuplicate> hibernateQuery = getTypedQuery(
queryString + " and ( pr.original in (:uids) or pr.duplicate in (:uids) )" );
hibernateQuery.setParameterList( "uids", teis );
setStatusParameter( query.getStatus(), hibernateQuery );
return hibernateQuery.getResultList();
} ).orElseGet( () -> {
Query<PotentialDuplicate> hibernateQuery = getTypedQuery( queryString );
setStatusParameter( query.getStatus(), hibernateQuery );
return hibernateQuery.getResultList();
} );
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllByQuery
File: dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
Repository: dhis2/dhis2-core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24848
|
MEDIUM
| 6.5
|
dhis2/dhis2-core
|
getAllByQuery
|
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/deduplication/hibernate/HibernatePotentialDuplicateStore.java
|
ef04483a9b177d62e48dcf4e498b302a11f95e7d
| 0
|
Analyze the following code function for security vulnerabilities
|
final void scheduleAppGcsLocked() {
mHandler.removeMessages(GC_BACKGROUND_PROCESSES_MSG);
if (mProcessesToGc.size() > 0) {
// Schedule a GC for the time to the next process.
ProcessRecord proc = mProcessesToGc.get(0);
Message msg = mHandler.obtainMessage(GC_BACKGROUND_PROCESSES_MSG);
long when = proc.lastRequestedGc + mConstants.GC_MIN_INTERVAL;
long now = SystemClock.uptimeMillis();
if (when < (now+mConstants.GC_TIMEOUT)) {
when = now + mConstants.GC_TIMEOUT;
}
mHandler.sendMessageAtTime(msg, when);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: scheduleAppGcsLocked
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
|
scheduleAppGcsLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public String nextTo(char d) {
StringBuilder sb = new StringBuilder();
for (;;) {
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') {
if (c != 0) {
back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nextTo
File: src/main/java/org/codehaus/jettison/json/JSONTokener.java
Repository: jettison-json/jettison
The code follows secure coding practices.
|
[
"CWE-674",
"CWE-787"
] |
CVE-2022-45693
|
HIGH
| 7.5
|
jettison-json/jettison
|
nextTo
|
src/main/java/org/codehaus/jettison/json/JSONTokener.java
|
cf6a4a1f85416b49b16a5b0c5c0bb81a4833dbc8
| 0
|
Analyze the following code function for security vulnerabilities
|
@TestApi
public void setDeviceOwnerType(@NonNull ComponentName admin,
@DeviceOwnerType int deviceOwnerType) {
throwIfParentInstance("setDeviceOwnerType");
if (mService != null) {
try {
mService.setDeviceOwnerType(admin, deviceOwnerType);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDeviceOwnerType
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
|
setDeviceOwnerType
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean hasRunningForegroundService(int uid, int foregroundServicetype) {
synchronized (ActivityManagerService.this) {
return mProcessList.searchEachLruProcessesLOSP(true, app -> {
if (app.uid != uid) {
return null;
}
if ((app.mServices.getForegroundServiceTypes() & foregroundServicetype) != 0) {
return Boolean.TRUE;
}
return null;
}) != null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasRunningForegroundService
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
|
hasRunningForegroundService
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean areMutableImagesFast() {
if (myView == null) return false;
return !myView.alwaysRepaintAll();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: areMutableImagesFast
File: Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
Repository: codenameone/CodenameOne
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-4903
|
MEDIUM
| 5.1
|
codenameone/CodenameOne
|
areMutableImagesFast
|
Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java
|
dad49c9ef26a598619fc48d2697151a02987d478
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract void process(CiphertextHeader header, boolean mode, InputStream input, OutputStream output);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: process
File: src/main/java/org/cryptacular/bean/AbstractCipherBean.java
Repository: vt-middleware/cryptacular
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2020-7226
|
MEDIUM
| 5
|
vt-middleware/cryptacular
|
process
|
src/main/java/org/cryptacular/bean/AbstractCipherBean.java
|
8c6c7528f1e24c6b71f3e36db0cb8a697256ce25
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean dumpHeap(String process, int userId, boolean managed, boolean mallocInfo,
boolean runGc, String path, ParcelFileDescriptor fd, RemoteCallback finishCallback) {
try {
// note: 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);
}
if (fd == null) {
throw new IllegalArgumentException("null fd");
}
synchronized (this) {
ProcessRecord proc = findProcessLOSP(process, userId, "dumpHeap");
IApplicationThread thread;
if (proc == null || (thread = proc.getThread()) == null) {
throw new IllegalArgumentException("Unknown process: " + process);
}
enforceDebuggable(proc);
mOomAdjuster.mCachedAppOptimizer.enableFreezer(false);
final RemoteCallback intermediateCallback = new RemoteCallback(
new RemoteCallback.OnResultListener() {
@Override
public void onResult(Bundle result) {
finishCallback.sendResult(result);
mOomAdjuster.mCachedAppOptimizer.enableFreezer(true);
}
}, null);
thread.dumpHeap(managed, mallocInfo, runGc, path, fd, intermediateCallback);
fd = null;
return true;
}
} catch (RemoteException e) {
throw new IllegalStateException("Process disappeared");
} finally {
if (fd != null) {
try {
fd.close();
} catch (IOException e) {
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpHeap
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
|
dumpHeap
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
void addCrossProfileIntentFilter(DefaultCrossProfileIntentFilter filter, int parentUserId,
int profileUserId)
throws RemoteException {
if (filter.direction == DefaultCrossProfileIntentFilter.Direction.TO_PROFILE) {
mIPackageManager.addCrossProfileIntentFilter(
filter.filter.getIntentFilter(),
mContext.getOpPackageName(),
parentUserId,
profileUserId,
filter.flags);
} else {
mIPackageManager.addCrossProfileIntentFilter(
filter.filter.getIntentFilter(),
mContext.getOpPackageName(),
profileUserId,
parentUserId,
filter.flags);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCrossProfileIntentFilter
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
addCrossProfileIntentFilter
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setSyncAdapterPackagesprovider(SyncAdapterPackagesProvider provider) {
synchronized (mPackages) {
mDefaultPermissionPolicy.setSyncAdapterPackagesProviderLPw(provider);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSyncAdapterPackagesprovider
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
|
setSyncAdapterPackagesprovider
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public URLStreamHandler createURLStreamHandler() {
return Optional.ofNullable(urlStreamHandlerClassName)
.map(Util::createInstanceOrNull)
.map(urlStreamHandlerFactory -> ((URLStreamHandlerFactory) urlStreamHandlerFactory).createURLStreamHandler(this.name()))
.orElse(null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createURLStreamHandler
File: core/src/main/java/apoc/util/FileUtils.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-23532
|
MEDIUM
| 6.5
|
neo4j-contrib/neo4j-apoc-procedures
|
createURLStreamHandler
|
core/src/main/java/apoc/util/FileUtils.java
|
01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522
| 0
|
Analyze the following code function for security vulnerabilities
|
public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(task);
data.writeInt(flags);
if (options != null) {
data.writeInt(1);
options.writeToParcel(data, 0);
} else {
data.writeInt(0);
}
mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: moveTaskToFront
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
moveTaskToFront
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@NonNull
public Builder setPublicVersion(Notification n) {
if (n != null) {
mN.publicVersion = new Notification();
n.cloneInto(mN.publicVersion, /*heavy=*/ true);
} else {
mN.publicVersion = null;
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setPublicVersion
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
setPublicVersion
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // since 2.12
public LogicalType logicalType() {
return LogicalType.Untyped;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logicalType
File: src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2020-36518
|
MEDIUM
| 5
|
FasterXML/jackson-databind
|
logicalType
|
src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
|
8238ab41d0350fb915797c89d46777b4496b74fd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void processFile(GFile file, File destFSFile, TaskMonitor monitor)
throws IOException, CancelledException {
if (!shouldSkip(file)) {
super.processFile(file, destFSFile, monitor);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processFile
File: Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java
Repository: NationalSecurityAgency/ghidra
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2019-13623
|
MEDIUM
| 6.8
|
NationalSecurityAgency/ghidra
|
processFile
|
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/archive/RestoreTask.java
|
c15364e0a4bd2bcd3bdf13a35afd6ac9607a5164
| 0
|
Analyze the following code function for security vulnerabilities
|
public ViewPage createPageWithAttachment(String space, String page, String content, String title,
String attachmentName, InputStream attachmentData) throws Exception
{
return createPageWithAttachment(space, page, content, title, null, null, attachmentName, attachmentData);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPageWithAttachment
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
|
createPageWithAttachment
|
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
|
boolean isFrontStack(ActivityStack stack) {
if (stack == null) {
return false;
}
final ActivityRecord parent = stack.mActivityContainer.mParentActivity;
if (parent != null) {
stack = parent.task.stack;
}
return stack == mFocusedStack;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isFrontStack
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
isFrontStack
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected List<Contentlet> findAllCurrent() throws DotDataException {
throw new DotDataException("findAllCurrent() will blow your stack off, use findAllCurrent(offset, limit)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: findAllCurrent
File: src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-2355
|
HIGH
| 7.5
|
dotCMS/core
|
findAllCurrent
|
src/com/dotcms/content/elasticsearch/business/ESContentFactoryImpl.java
|
897f3632d7e471b7a73aabed5b19f6f53d4e5562
| 0
|
Analyze the following code function for security vulnerabilities
|
private static final void handleIOException(String msg, Exception e) {
try {
String className = e.getClass().getSimpleName();
if("ClientAbortException".equals(className)) {
log.debug("client browser probably abort during operaation", e);
} else {
log.error(msg, e);
}
} catch (Exception e1) {
log.error("", e1);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleIOException
File: src/main/java/org/olat/core/util/ZipUtil.java
Repository: OpenOLAT
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2021-39180
|
HIGH
| 9
|
OpenOLAT
|
handleIOException
|
src/main/java/org/olat/core/util/ZipUtil.java
|
5668a41ab3f1753102a89757be013487544279d5
| 0
|
Analyze the following code function for security vulnerabilities
|
public int parseWidth(String widthDecimal) {
String w = "";
widthDecimal = widthDecimal.trim();
if (widthDecimal.startsWith("(")) {
} else if (widthDecimal.contains("(")) {
w = widthDecimal.split("\\(")[0];
} else {
w = widthDecimal;
}
if (w.length() > 0) {
return "w".equalsIgnoreCase(w) ? 0 : Integer.parseInt(w);
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseWidth
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
parseWidth
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public String getRealLanguage() throws XWikiException
{
return this.doc.getRealLanguage(getXWikiContext());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRealLanguage
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2022-23615
|
MEDIUM
| 5.5
|
xwiki/xwiki-platform
|
getRealLanguage
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void abort(String callId, Session.Info info) throws RemoteException { }
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: abort
File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21283
|
MEDIUM
| 5.5
|
android
|
abort
|
tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
|
9b41a963f352fdb3da1da8c633d45280badfcb24
| 0
|
Analyze the following code function for security vulnerabilities
|
private static String getFormFileFolderPath (String formType, String formInode) {
String path = Config.getStringProperty("SAVED_UPLOAD_FILES_PATH")
+ "/" + formType.replace(" ", "_") + "/"
+ String.valueOf(formInode).substring(0, 1) + "/" + formInode;
return path;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getFormFileFolderPath
File: src/com/dotmarketing/factories/EmailFactory.java
Repository: dotCMS/core
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-4040
|
MEDIUM
| 6.5
|
dotCMS/core
|
getFormFileFolderPath
|
src/com/dotmarketing/factories/EmailFactory.java
|
bc4db5d71dc67015572f8e4c6fdf87e29b854d02
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateNString(@Positive int columnIndex, @Nullable String nString) throws SQLException {
throw org.postgresql.Driver.notImplemented(this.getClass(), "updateNString(int, String)");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateNString
File: pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Repository: pgjdbc
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-31197
|
HIGH
| 8
|
pgjdbc
|
updateNString
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
@SuppressWarnings("unchecked")
public Jooby map(final Mapper<?> mapper) {
requireNonNull(mapper, "Mapper is required.");
if (mappers.add(mapper.name())) {
this.mapper = Optional.ofNullable(this.mapper)
.map(next -> Route.Mapper.chain(mapper, next))
.orElse((Mapper<Object>) mapper);
}
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: map
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
map
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public void loadXWikiCollection(BaseCollection object, XWikiContext context, boolean bTransaction)
throws XWikiException
{
loadXWikiCollectionInternal(object, context, bTransaction, false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadXWikiCollection
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-459"
] |
CVE-2023-36468
|
HIGH
| 8.8
|
xwiki/xwiki-platform
|
loadXWikiCollection
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java
|
15a6f845d8206b0ae97f37aa092ca43d4f9d6e59
| 0
|
Analyze the following code function for security vulnerabilities
|
public static ActivityOptions makeClipRevealAnimation(View source,
int startX, int startY, int width, int height) {
ActivityOptions opts = new ActivityOptions();
opts.mAnimationType = ANIM_CLIP_REVEAL;
int[] pts = new int[2];
source.getLocationOnScreen(pts);
opts.mStartX = pts[0] + startX;
opts.mStartY = pts[1] + startY;
opts.mWidth = width;
opts.mHeight = height;
return opts;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeClipRevealAnimation
File: core/java/android/app/ActivityOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-20918
|
CRITICAL
| 9.8
|
android
|
makeClipRevealAnimation
|
core/java/android/app/ActivityOptions.java
|
51051de4eb40bb502db448084a83fd6cbfb7d3cf
| 0
|
Analyze the following code function for security vulnerabilities
|
public void characters(char[] ch, int start, int length) throws SAXException {
if (appendChar) {
content.append(ch, start, length).append(" ");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: characters
File: src/main/java/com/openkm/extractor/OpenOfficeTextExtractor.java
Repository: openkm/document-management-system
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-33950
|
HIGH
| 7.5
|
openkm/document-management-system
|
characters
|
src/main/java/com/openkm/extractor/OpenOfficeTextExtractor.java
|
ce1d82329615aea6aa9f2cc6508c1fe7891e34b5
| 0
|
Analyze the following code function for security vulnerabilities
|
protected B frameLogger(Http2FrameLogger frameLogger) {
enforceNonCodecConstraints("frameLogger");
this.frameLogger = checkNotNull(frameLogger, "frameLogger");
return self();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: frameLogger
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-44487
|
HIGH
| 7.5
|
netty
|
frameLogger
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTransferProgress(
long progressRate,
long totalTransferredSoFar,
long totalToTransfer,
String fileName
) {
String key = buildRemoteName(mCurrentUpload.getUser().getAccountName(), mCurrentUpload.getFile().getRemotePath());
OnDatatransferProgressListener boundListener = mBoundListeners.get(key);
if (boundListener != null) {
boundListener.onTransferProgress(progressRate, totalTransferredSoFar, totalToTransfer, fileName);
}
Context context = MainApp.getAppContext();
if (context != null) {
ResultCode cancelReason = null;
Connectivity connectivity = connectivityService.getConnectivity();
if (mCurrentUpload.isWifiRequired() && !connectivity.isWifi()) {
cancelReason = ResultCode.DELAYED_FOR_WIFI;
} else if (mCurrentUpload.isChargingRequired() && !powerManagementService.getBattery().isCharging()) {
cancelReason = ResultCode.DELAYED_FOR_CHARGING;
} else if (!mCurrentUpload.isIgnoringPowerSaveMode() && powerManagementService.isPowerSavingEnabled()) {
cancelReason = ResultCode.DELAYED_IN_POWER_SAVE_MODE;
}
if (cancelReason != null) {
cancel(
mCurrentUpload.getUser().getAccountName(),
mCurrentUpload.getFile().getRemotePath(),
cancelReason
);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTransferProgress
File: app/src/main/java/com/owncloud/android/files/services/FileUploader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-39210
|
MEDIUM
| 5.5
|
nextcloud/android
|
onTransferProgress
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
public static SvnClientManager createClientManager(AbstractProject context) {
return new SvnClientManager(createSvnClientManager(Hudson.getInstance().getDescriptorByType(DescriptorImpl.class).createAuthenticationProvider(context)));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createClientManager
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
|
createClientManager
|
src/main/java/hudson/scm/SubversionSCM.java
|
7d4562d6f7e40de04bbe29577b51c79f07d05ba6
| 0
|
Analyze the following code function for security vulnerabilities
|
private Object extractPayload(Object payload, String eventClass) {
try {
final Class<?> clazz = chainingClassLoader.loadClass(eventClass);
return objectMapper.convertValue(payload, clazz);
} catch (ClassNotFoundException e) {
LOG.debug("Couldn't load class <" + eventClass + "> for event", e);
return null;
} catch (IllegalArgumentException e) {
LOG.debug("Error while deserializing payload", e);
return null;
}
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2024-24824
- Severity: HIGH
- CVSS Score: 8.8
Description: Restrict classes allowed for cluster config and event types (#18165) (#18179)
* Restrict classes allowed for cluster config and event types (#18165)
Add a new safe_classes configuration option to restrict the classes allowed to be used
as cluster config and event types.
The configuration option allows to specify a comma-separated set of prefixes matched
against the fully qualified class name.
For now, the default value for the configuration is org.graylog.,org.graylog2., which will
allow all classes that Graylog maintains.
This should work out of the box for almost all setups. Changing the default value might
only be necessary if external plugins require cluster config or event types outside the
"org.graylog." or "org.graylog2." namespaces. If that is the case, the configuration setting
can be adjusted to cover this use case, e.b. by setting it to
safe_classes = org.graylog.,org.graylog2.,custom.plugin.namespace.
if said classes are located within the custom.plugin.namespace package.
Refs: https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-p6gg-5hf4-4rgj
(cherry picked from commit 813203263b06dda18e2aed68ae92b34277f904b4)
* Use javax.inject.Inject instead of jakarta.inject.Inject
* Use javax.ws.rs instead of jakarta.ws.rs
---------
Co-authored-by: Othello Maurer <othello@graylog.com>
Function: extractPayload
File: graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
Repository: Graylog2/graylog2-server
Fixed Code:
private Object extractPayload(Object payload, String eventClass) {
try {
final Class<?> clazz = chainingClassLoader.loadClassSafely(eventClass);
return objectMapper.convertValue(payload, clazz);
} catch (ClassNotFoundException e) {
LOG.debug("Couldn't load class <" + eventClass + "> for event", e);
} catch (IllegalArgumentException e) {
LOG.debug("Error while deserializing payload", e);
} catch (UnsafeClassLoadingAttemptException e) {
LOG.warn("Couldn't load class <{}>.", eventClass, e);
}
return null;
}
|
[
"CWE-863"
] |
CVE-2024-24824
|
HIGH
| 8.8
|
Graylog2/graylog2-server
|
extractPayload
|
graylog2-server/src/main/java/org/graylog2/events/ClusterEventPeriodical.java
|
75ef2b8d60e7d67f859b79fe712c8ae7b2e861d8
| 1
|
Analyze the following code function for security vulnerabilities
|
public static String prettyPrintXML(final String xml) {
final Reader reader = new StringReader(xml);
final Writer writer = new StringWriter(1000);
prettyPrintXML(reader, writer);
return writer.toString();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: prettyPrintXML
File: stroom-core-server/src/main/java/stroom/entity/server/util/XMLUtil.java
Repository: gchq/stroom
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
prettyPrintXML
|
stroom-core-server/src/main/java/stroom/entity/server/util/XMLUtil.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationAsFloatEdgeCase10() throws Exception
{
String input = "1e-10000000";
Instant value = MAPPER.readValue(input, Instant.class);
assertEquals(0, value.getEpochSecond());
}
|
Vulnerability Classification:
- CWE: CWE-20
- CVE: CVE-2018-1000873
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Avoid latency problems converting decimal to time.
Fixes https://github.com/FasterXML/jackson-databind/issues/2141
Function: testDeserializationAsFloatEdgeCase10
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
Repository: FasterXML/jackson-modules-java8
Fixed Code:
@Test(timeout = 100)
public void testDeserializationAsFloatEdgeCase10() throws Exception
{
String input = "1e-10000000";
Instant value = MAPPER.readValue(input, Instant.class);
assertEquals(0, value.getEpochSecond());
}
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationAsFloatEdgeCase10
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestInstantSerialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 1
|
Analyze the following code function for security vulnerabilities
|
private void cleanUpOldUsers() {
// This is needed in case the broadcast {@link Intent.ACTION_USER_REMOVED} was not handled
// before reboot
Set<Integer> usersWithProfileOwners;
Set<Integer> usersWithData;
synchronized (getLockObject()) {
usersWithProfileOwners = mOwners.getProfileOwnerKeys();
usersWithData = new ArraySet<>();
for (int i = 0; i < mUserData.size(); i++) {
usersWithData.add(mUserData.keyAt(i));
}
}
List<UserInfo> allUsers = mUserManager.getUsers();
Set<Integer> deletedUsers = new ArraySet<>();
deletedUsers.addAll(usersWithProfileOwners);
deletedUsers.addAll(usersWithData);
for (UserInfo userInfo : allUsers) {
deletedUsers.remove(userInfo.id);
}
for (Integer userId : deletedUsers) {
removeUserData(userId);
if (isPolicyEngineForFinanceFlagEnabled() || isPermissionCheckFlagEnabled()) {
mDevicePolicyEngine.handleUserRemoved(userId);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cleanUpOldUsers
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-40089
|
HIGH
| 7.8
|
android
|
cleanUpOldUsers
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<CmsContent> recycle(short siteId, Serializable[] ids) {
List<CmsContent> entityList = new ArrayList<>();
for (CmsContent entity : getEntitys(ids)) {
if (siteId == entity.getSiteId() && entity.isDisabled()) {
entity.setDisabled(false);
entityList.add(entity);
if (null != entity.getParentId()) {
updateChilds(entity.getParentId(), 1);
}
}
}
return entityList;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: recycle
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
recycle
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/logic/service/cms/CmsContentService.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
public void updateSystemUiContext() {
final PackageManagerInternal packageManagerInternal = getPackageManagerInternal();
ApplicationInfo ai = packageManagerInternal.getApplicationInfo("android",
GET_SHARED_LIBRARY_FILES, Binder.getCallingUid(), UserHandle.USER_SYSTEM);
ActivityThread.currentActivityThread().handleSystemApplicationInfoChanged(ai);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateSystemUiContext
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
|
updateSystemUiContext
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static RecentsTaskLoadPlan consumeInstanceLoadPlan() {
RecentsTaskLoadPlan plan = sInstanceLoadPlan;
sInstanceLoadPlan = null;
return plan;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: consumeInstanceLoadPlan
File: packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0813
|
MEDIUM
| 6.6
|
android
|
consumeInstanceLoadPlan
|
packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
|
16a76dadcc23a13223e9c2216dad1fe5cad7d6e1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public MergeTarget newMergeTargetForField(
Descriptors.FieldDescriptor field, Message defaultInstance) {
Message.Builder subBuilder;
if (defaultInstance != null) {
subBuilder = defaultInstance.newBuilderForType();
} else {
subBuilder = builder.newBuilderForField(field);
}
if (!field.isRepeated()) {
Message originalMessage = (Message) getField(field);
if (originalMessage != null) {
subBuilder.mergeFrom(originalMessage);
}
}
return new BuilderAdapter(subBuilder);
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2022-3509
- Severity: HIGH
- CVSS Score: 7.5
Description: Clean up TextFormat parser (#10673)
* Fix TextFormat parser
Function: newMergeTargetForField
File: java/core/src/main/java/com/google/protobuf/MessageReflection.java
Repository: protocolbuffers/protobuf
Fixed Code:
@Override
public MergeTarget newMergeTargetForField(
Descriptors.FieldDescriptor field, Message defaultInstance) {
Message.Builder subBuilder;
if (!field.isRepeated() && hasField(field)) {
subBuilder = getFieldBuilder(field);
if (subBuilder != null) {
return new BuilderAdapter(subBuilder);
}
}
subBuilder = newMessageFieldInstance(field, defaultInstance);
if (!field.isRepeated()) {
Message originalMessage = (Message) getField(field);
if (originalMessage != null) {
subBuilder.mergeFrom(originalMessage);
}
}
return new BuilderAdapter(subBuilder);
}
|
[
"CWE-Other"
] |
CVE-2022-3509
|
HIGH
| 7.5
|
protocolbuffers/protobuf
|
newMergeTargetForField
|
java/core/src/main/java/com/google/protobuf/MessageReflection.java
|
a3888f53317a8018e7a439bac4abeb8f3425d5e9
| 1
|
Analyze the following code function for security vulnerabilities
|
private static MetadataMappingResolver getMetadaMappingResolver(){
return Context.getRegisteredComponent("metadataMappingResolver", MetadataMappingResolver.class);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMetadaMappingResolver
File: api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
Repository: openmrs/openmrs-module-htmlformentry
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-16521
|
HIGH
| 7.5
|
openmrs/openmrs-module-htmlformentry
|
getMetadaMappingResolver
|
api/src/main/java/org/openmrs/module/htmlformentry/HtmlFormEntryUtil.java
|
9dcd304688e65c31cac5532fe501b9816ed975ae
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean entityForbidden(AnnotatedElement entity,
HttpServletRequest request) {
return entity.isAnnotationPresent(DenyAll.class) || (!entity
.isAnnotationPresent(AnonymousAllowed.class)
&& !roleAllowed(entity.getAnnotation(RolesAllowed.class),
request));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: entityForbidden
File: fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31406
|
LOW
| 1.9
|
vaadin/flow
|
entityForbidden
|
fusion-endpoint/src/main/java/com/vaadin/flow/server/connect/auth/VaadinConnectAccessChecker.java
|
3fe644cab2cffa5b86316dbe71b11df1083861a9
| 0
|
Analyze the following code function for security vulnerabilities
|
private AuthenticationInfo authenticate( IdProviderKey idProvider )
{
AuthenticationInfo authInfo = null;
if ( isValidEmail( this.user ) )
{
if ( this.skipAuth )
{
final VerifiedEmailAuthToken verifiedEmailAuthToken = new VerifiedEmailAuthToken();
verifiedEmailAuthToken.setEmail( this.user );
verifiedEmailAuthToken.setIdProvider( idProvider );
authInfo = runAsAuthenticated( () -> this.securityService.get().authenticate( verifiedEmailAuthToken ) );
}
else
{
final EmailPasswordAuthToken emailAuthToken = new EmailPasswordAuthToken();
emailAuthToken.setEmail( this.user );
emailAuthToken.setPassword( this.password );
emailAuthToken.setIdProvider( idProvider );
authInfo = runAsAuthenticated( () -> this.securityService.get().authenticate( emailAuthToken ) );
}
}
if ( authInfo == null || !authInfo.isAuthenticated() )
{
if ( this.skipAuth )
{
final VerifiedUsernameAuthToken usernameAuthToken = new VerifiedUsernameAuthToken();
usernameAuthToken.setUsername( this.user );
usernameAuthToken.setIdProvider( idProvider );
authInfo = runAsAuthenticated( () -> this.securityService.get().authenticate( usernameAuthToken ) );
}
else
{
final UsernamePasswordAuthToken usernameAuthToken = new UsernamePasswordAuthToken();
usernameAuthToken.setUsername( this.user );
usernameAuthToken.setPassword( this.password );
usernameAuthToken.setIdProvider( idProvider );
authInfo = runAsAuthenticated( () -> this.securityService.get().authenticate( usernameAuthToken ) );
}
}
return authInfo;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: authenticate
File: modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
Repository: enonic/xp
The code follows secure coding practices.
|
[
"CWE-384"
] |
CVE-2024-23679
|
CRITICAL
| 9.8
|
enonic/xp
|
authenticate
|
modules/lib/lib-auth/src/main/java/com/enonic/xp/lib/auth/LoginHandler.java
|
0189975691e9e6407a9fee87006f730e84f734ff
| 0
|
Analyze the following code function for security vulnerabilities
|
private void preventPositionRollover() {
//if the position counter is about to roll over we iterate all the table entries
//and set their position to their actual position
for (Map.Entry<HttpString, List<TableEntry>> entry : dynamicTable.entrySet()) {
for (TableEntry t : entry.getValue()) {
t.position = t.getPosition();
}
}
entryPositionCounter = 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: preventPositionRollover
File: core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
Repository: undertow-io/undertow
The code follows secure coding practices.
|
[
"CWE-214"
] |
CVE-2021-3859
|
HIGH
| 7.5
|
undertow-io/undertow
|
preventPositionRollover
|
core/src/main/java/io/undertow/protocols/http2/HpackEncoder.java
|
e43f0ada3f4da6e8579e0020cec3cb1a81e487c2
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void openBrowser(String url) {
lastUrl = url;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openBrowser
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
openBrowser
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setUseWorkflowSendEmail(boolean useWorkflowSendEmail) {
this.useWorkflowSendEmail = useWorkflowSendEmail;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUseWorkflowSendEmail
File: dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
Repository: DSpace
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-31195
|
HIGH
| 7.2
|
DSpace
|
setUseWorkflowSendEmail
|
dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
|
7af52a0883a9dbc475cf3001f04ed11b24c8a4c0
| 0
|
Analyze the following code function for security vulnerabilities
|
private void cancelAccountAccessRequestNotificationIfNeeded(Account account, int uid,
boolean checkAccess) {
String[] packageNames = mPackageManager.getPackagesForUid(uid);
if (packageNames != null) {
for (String packageName : packageNames) {
cancelAccountAccessRequestNotificationIfNeeded(account, uid,
packageName, checkAccess);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelAccountAccessRequestNotificationIfNeeded
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
|
cancelAccountAccessRequestNotificationIfNeeded
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void checkAndFillCacheLoaderConfigXml(XmlGenerator gen, String cacheLoader) {
if (isNullOrEmpty(cacheLoader)) {
return;
}
gen.node("cache-loader", null, "class-name", cacheLoader);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAndFillCacheLoaderConfigXml
File: hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
checkAndFillCacheLoaderConfigXml
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
public Column<T, ?> getColumn(String columnId) {
return columnIds.get(columnId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getColumn
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2019-25028
|
MEDIUM
| 4.3
|
vaadin/framework
|
getColumn
|
server/src/main/java/com/vaadin/ui/Grid.java
|
c40bed109c3723b38694ed160ea647fef5b28593
| 0
|
Analyze the following code function for security vulnerabilities
|
public String executeWiki(String wikiContent, Syntax wikiSyntax) throws Exception
{
LocalDocumentReference reference =
new LocalDocumentReference(List.of("Test", "Execute"), UUID.randomUUID().toString());
rest().savePage(reference, wikiContent, wikiSyntax.toIdString(), null, null);
return executeAndGetBodyAsString(reference, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeWiki
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-79"
] |
CVE-2023-35157
|
MEDIUM
| 4.8
|
xwiki/xwiki-platform
|
executeWiki
|
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/TestUtils.java
|
35e9073ffec567861e0abeea072bd97921a3decf
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return getName() + ": static final long serialVersionUID =" + getSerialVersionUID() + "L;";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
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
|
toString
|
luni/src/main/java/java/io/ObjectStreamClass.java
|
738c833d38d41f8f76eb7e77ab39add82b1ae1e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onCreate(Bundle savedInstanceState) {
if (DeviceUtils.isAuto(this)) {
// Automotive relies on a different theme. Apply before calling super so that
// fragments are restored properly on configuration changes.
setTheme(R.style.CarSettings);
}
super.onCreate(savedInstanceState);
// If this is not a phone (which uses the Navigation component), and there is a previous
// instance, re-use its Fragment instead of making a new one.
if ((DeviceUtils.isTelevision(this) || DeviceUtils.isAuto(this)
|| DeviceUtils.isWear(this)) && savedInstanceState != null) {
return;
}
android.app.Fragment fragment = null;
Fragment androidXFragment = null;
String action = getIntent().getAction();
getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
long sessionId = getIntent().getLongExtra(Constants.EXTRA_SESSION_ID, INVALID_SESSION_ID);
while (sessionId == INVALID_SESSION_ID) {
sessionId = new Random().nextLong();
}
int autoRevokeAction =
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION__ACTION__OPENED_FOR_AUTO_REVOKE;
int openFromIntentAction =
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION__ACTION__OPENED_FROM_INTENT;
String permissionName;
switch (action) {
case Intent.ACTION_MANAGE_PERMISSIONS:
Bundle arguments = new Bundle();
arguments.putLong(EXTRA_SESSION_ID, sessionId);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoManageStandardPermissionsFragment.newInstance();
androidXFragment.setArguments(arguments);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment =
com.android.permissioncontroller.permission.ui.television
.ManagePermissionsFragment.newInstance();
} else {
setContentView(R.layout.nav_host_fragment);
Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(
R.navigation.nav_graph, arguments);
return;
}
break;
case Intent.ACTION_REVIEW_PERMISSION_USAGE: {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
finishAfterTransition();
return;
}
PermissionControllerStatsLog.write(PERMISSION_USAGE_FRAGMENT_INTERACTION, sessionId,
PERMISSION_USAGE_FRAGMENT_INTERACTION__ACTION__OPEN);
if (DeviceUtils.isAuto(this)) {
androidXFragment = new AutoPermissionUsageFragment();
} else {
androidXFragment = PermissionUsageV2WrapperFragment.newInstance(
Long.MAX_VALUE, sessionId);
}
} break;
case Intent.ACTION_REVIEW_PERMISSION_HISTORY: {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
finishAfterTransition();
return;
}
String groupName = getIntent()
.getStringExtra(Intent.EXTRA_PERMISSION_GROUP_NAME);
boolean showSystem = getIntent()
.getBooleanExtra(EXTRA_SHOW_SYSTEM, false);
boolean show7Days = getIntent()
.getBooleanExtra(EXTRA_SHOW_7_DAYS, false);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoPermissionUsageDetailsFragment.Companion.newInstance(
groupName, showSystem, sessionId);
} else {
androidXFragment = PermissionDetailsWrapperFragment
.newInstance(groupName, Long.MAX_VALUE, showSystem, sessionId,
show7Days);
}
break;
}
case Intent.ACTION_MANAGE_APP_PERMISSION: {
if (DeviceUtils.isAuto(this) || DeviceUtils.isTelevision(this)
|| DeviceUtils.isWear(this)) {
Intent compatIntent = new Intent(this, AppPermissionActivity.class);
compatIntent.putExtras(getIntent().getExtras());
startActivityForResult(compatIntent, PROXY_ACTIVITY_REQUEST_CODE);
return;
}
String packageName = getIntent().getStringExtra(Intent.EXTRA_PACKAGE_NAME);
if (packageName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PACKAGE_NAME");
finishAfterTransition();
return;
}
permissionName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_NAME);
String groupName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_GROUP_NAME);
if (permissionName == null && groupName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PERMISSION_NAME or"
+ "EXTRA_PERMISSION_GROUP_NAME");
finishAfterTransition();
return;
}
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
String caller = getIntent().getStringExtra(EXTRA_CALLER_NAME);
if (groupName == null) {
groupName = getGroupFromPermission(permissionName);
}
if (groupName != null
&& groupName.equals(Manifest.permission_group.NOTIFICATIONS)) {
// Redirect notification group to notification settings
Utils.navigateToAppNotificationSettings(this, packageName, userHandle);
finishAfterTransition();
return;
}
Bundle args = AppPermissionFragment.createArgs(packageName, permissionName,
groupName, userHandle, caller, sessionId, null);
setNavGraph(args, R.id.app_permission);
return;
}
case Intent.ACTION_MANAGE_APP_PERMISSIONS: {
String packageName = getIntent().getStringExtra(Intent.EXTRA_PACKAGE_NAME);
if (packageName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PACKAGE_NAME");
finishAfterTransition();
return;
}
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
if (userHandle == null) {
userHandle = Process.myUserHandle();
}
try {
int uid = getPackageManager().getApplicationInfoAsUser(packageName, 0,
userHandle).uid;
long settingsSessionId = getIntent().getLongExtra(
Intent.ACTION_AUTO_REVOKE_PERMISSIONS, INVALID_SESSION_ID);
if (settingsSessionId != INVALID_SESSION_ID) {
sessionId = settingsSessionId;
Log.i(LOG_TAG, "sessionId: " + sessionId
+ " Reaching AppPermissionGroupsFragment for auto revoke. "
+ "packageName: " + packageName + " uid " + uid);
PermissionControllerStatsLog.write(
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION, sessionId, uid,
packageName, autoRevokeAction);
} else {
if (KotlinUtils.INSTANCE.isROrAutoRevokeEnabled(getApplication(),
packageName, userHandle)) {
Log.i(LOG_TAG, "sessionId: " + sessionId
+ " Reaching AppPermissionGroupsFragment from intent. "
+ "packageName " + packageName + " uid " + uid);
PermissionControllerStatsLog.write(
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION, sessionId,
uid, packageName, openFromIntentAction);
}
}
} catch (PackageManager.NameNotFoundException e) {
// Do no logging
}
final boolean allPermissions = getIntent().getBooleanExtra(
EXTRA_ALL_PERMISSIONS, false);
if (DeviceUtils.isAuto(this)) {
if (allPermissions) {
androidXFragment = AutoAllAppPermissionsFragment.newInstance(packageName,
userHandle, sessionId);
} else {
androidXFragment = AutoAppPermissionsFragment.newInstance(packageName,
userHandle, sessionId, /* isSystemPermsScreen= */ true);
}
} else if (DeviceUtils.isWear(this)) {
androidXFragment = AppPermissionsFragmentWear.newInstance(packageName);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = com.android.permissioncontroller.permission.ui.television
.AppPermissionsFragment.newInstance(packageName, userHandle);
} else {
Bundle args = AppPermissionGroupsFragment.createArgs(packageName, userHandle,
sessionId, /* isSystemPermsScreen= */ true);
setNavGraph(args, R.id.app_permission_groups);
return;
}
} break;
case Intent.ACTION_MANAGE_PERMISSION_APPS: {
permissionName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_NAME);
String permissionGroupName = getIntent().getStringExtra(
Intent.EXTRA_PERMISSION_GROUP_NAME);
if (permissionGroupName == null) {
try {
PermissionInfo permInfo = getPackageManager().getPermissionInfo(
permissionName, 0);
permissionGroupName = Utils.getGroupOfPermission(permInfo);
} catch (PackageManager.NameNotFoundException e) {
Log.i(LOG_TAG, "Permission " + permissionName + " does not exist");
}
}
if (permissionGroupName == null) {
permissionGroupName = permissionName;
}
if (permissionName == null && permissionGroupName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PERMISSION_NAME or"
+ "EXTRA_PERMISSION_GROUP_NAME");
finishAfterTransition();
return;
}
// Redirect notification group to notification settings
if (permissionGroupName.equals(Manifest.permission_group.NOTIFICATIONS)) {
Utils.navigateToNotificationSettings(this);
finishAfterTransition();
return;
}
if (DeviceUtils.isAuto(this)) {
androidXFragment =
AutoPermissionAppsFragment.newInstance(permissionGroupName, sessionId);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = com.android.permissioncontroller.permission.ui.television
.PermissionAppsFragment.newInstance(permissionGroupName);
} else {
Bundle args = PermissionAppsFragment.createArgs(permissionGroupName, sessionId);
setNavGraph(args, R.id.permission_apps);
return;
}
} break;
case Intent.ACTION_MANAGE_UNUSED_APPS :
// fall through
case ACTION_MANAGE_AUTO_REVOKE: {
Log.i(LOG_TAG, "sessionId " + sessionId + " starting auto revoke fragment"
+ " from notification");
PermissionControllerStatsLog.write(AUTO_REVOKE_NOTIFICATION_CLICKED, sessionId);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoUnusedAppsFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = TvUnusedAppsFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else if (DeviceUtils.isWear(this)) {
androidXFragment = HandheldUnusedAppsWrapperFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else {
setNavGraph(UnusedAppsFragment.createArgs(sessionId), R.id.auto_revoke);
return;
}
} break;
case PermissionManager.ACTION_REVIEW_PERMISSION_DECISIONS: {
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
if (userHandle == null) {
userHandle = Process.myUserHandle();
}
if (DeviceUtils.isAuto(this)) {
String source = getIntent().getStringExtra(
AutoReviewPermissionDecisionsFragment.EXTRA_SOURCE);
androidXFragment = AutoReviewPermissionDecisionsFragment.Companion
.newInstance(sessionId, userHandle, source);
} else {
Log.e(LOG_TAG, "ACTION_REVIEW_PERMISSION_DECISIONS is not "
+ "supported on this device type");
finishAfterTransition();
return;
}
} break;
default: {
Log.w(LOG_TAG, "Unrecognized action " + action);
finishAfterTransition();
return;
}
}
if (fragment != null) {
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment)
.commit();
} else if (androidXFragment != null) {
getSupportFragmentManager().beginTransaction().replace(android.R.id.content,
androidXFragment).commit();
}
}
|
Vulnerability Classification:
- CWE: CWE-862
- CVE: CVE-2023-21132
- Severity: MEDIUM
- CVSS Score: 6.8
Description: RESTRICT AUTOMERGE Finish ManagePermissionsActivity if device is not provisioned
If the device isn't set up yet, do not allow access to the permissions
settings
Bug: 253043490
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8a6f1f59d6cb5367f0c88980a75ddc227dba956a)
Merged-In: I6e8fb8f2d934cff965069493740cfc1c59c3623f
Change-Id: I6e8fb8f2d934cff965069493740cfc1c59c3623f
Function: onCreate
File: PermissionController/src/com/android/permissioncontroller/permission/ui/ManagePermissionsActivity.java
Repository: android
Fixed Code:
@Override
public void onCreate(Bundle savedInstanceState) {
if (DeviceUtils.isAuto(this)) {
// Automotive relies on a different theme. Apply before calling super so that
// fragments are restored properly on configuration changes.
setTheme(R.style.CarSettings);
}
super.onCreate(savedInstanceState);
// If this is not a phone (which uses the Navigation component), and there is a previous
// instance, re-use its Fragment instead of making a new one.
if ((DeviceUtils.isTelevision(this) || DeviceUtils.isAuto(this)
|| DeviceUtils.isWear(this)) && savedInstanceState != null) {
return;
}
boolean provisioned = Settings.Global.getInt(
getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0) != 0;
boolean completed = Settings.Secure.getInt(
getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0) != 0;
if (!provisioned || !completed) {
finishAfterTransition();
return;
}
android.app.Fragment fragment = null;
Fragment androidXFragment = null;
String action = getIntent().getAction();
getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
long sessionId = getIntent().getLongExtra(Constants.EXTRA_SESSION_ID, INVALID_SESSION_ID);
while (sessionId == INVALID_SESSION_ID) {
sessionId = new Random().nextLong();
}
int autoRevokeAction =
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION__ACTION__OPENED_FOR_AUTO_REVOKE;
int openFromIntentAction =
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION__ACTION__OPENED_FROM_INTENT;
String permissionName;
switch (action) {
case Intent.ACTION_MANAGE_PERMISSIONS:
Bundle arguments = new Bundle();
arguments.putLong(EXTRA_SESSION_ID, sessionId);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoManageStandardPermissionsFragment.newInstance();
androidXFragment.setArguments(arguments);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment =
com.android.permissioncontroller.permission.ui.television
.ManagePermissionsFragment.newInstance();
} else {
setContentView(R.layout.nav_host_fragment);
Navigation.findNavController(this, R.id.nav_host_fragment).setGraph(
R.navigation.nav_graph, arguments);
return;
}
break;
case Intent.ACTION_REVIEW_PERMISSION_USAGE: {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
finishAfterTransition();
return;
}
PermissionControllerStatsLog.write(PERMISSION_USAGE_FRAGMENT_INTERACTION, sessionId,
PERMISSION_USAGE_FRAGMENT_INTERACTION__ACTION__OPEN);
if (DeviceUtils.isAuto(this)) {
androidXFragment = new AutoPermissionUsageFragment();
} else {
androidXFragment = PermissionUsageV2WrapperFragment.newInstance(
Long.MAX_VALUE, sessionId);
}
} break;
case Intent.ACTION_REVIEW_PERMISSION_HISTORY: {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
finishAfterTransition();
return;
}
String groupName = getIntent()
.getStringExtra(Intent.EXTRA_PERMISSION_GROUP_NAME);
boolean showSystem = getIntent()
.getBooleanExtra(EXTRA_SHOW_SYSTEM, false);
boolean show7Days = getIntent()
.getBooleanExtra(EXTRA_SHOW_7_DAYS, false);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoPermissionUsageDetailsFragment.Companion.newInstance(
groupName, showSystem, sessionId);
} else {
androidXFragment = PermissionDetailsWrapperFragment
.newInstance(groupName, Long.MAX_VALUE, showSystem, sessionId,
show7Days);
}
break;
}
case Intent.ACTION_MANAGE_APP_PERMISSION: {
if (DeviceUtils.isAuto(this) || DeviceUtils.isTelevision(this)
|| DeviceUtils.isWear(this)) {
Intent compatIntent = new Intent(this, AppPermissionActivity.class);
compatIntent.putExtras(getIntent().getExtras());
startActivityForResult(compatIntent, PROXY_ACTIVITY_REQUEST_CODE);
return;
}
String packageName = getIntent().getStringExtra(Intent.EXTRA_PACKAGE_NAME);
if (packageName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PACKAGE_NAME");
finishAfterTransition();
return;
}
permissionName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_NAME);
String groupName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_GROUP_NAME);
if (permissionName == null && groupName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PERMISSION_NAME or"
+ "EXTRA_PERMISSION_GROUP_NAME");
finishAfterTransition();
return;
}
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
String caller = getIntent().getStringExtra(EXTRA_CALLER_NAME);
if (groupName == null) {
groupName = getGroupFromPermission(permissionName);
}
if (groupName != null
&& groupName.equals(Manifest.permission_group.NOTIFICATIONS)) {
// Redirect notification group to notification settings
Utils.navigateToAppNotificationSettings(this, packageName, userHandle);
finishAfterTransition();
return;
}
Bundle args = AppPermissionFragment.createArgs(packageName, permissionName,
groupName, userHandle, caller, sessionId, null);
setNavGraph(args, R.id.app_permission);
return;
}
case Intent.ACTION_MANAGE_APP_PERMISSIONS: {
String packageName = getIntent().getStringExtra(Intent.EXTRA_PACKAGE_NAME);
if (packageName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PACKAGE_NAME");
finishAfterTransition();
return;
}
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
if (userHandle == null) {
userHandle = Process.myUserHandle();
}
try {
int uid = getPackageManager().getApplicationInfoAsUser(packageName, 0,
userHandle).uid;
long settingsSessionId = getIntent().getLongExtra(
Intent.ACTION_AUTO_REVOKE_PERMISSIONS, INVALID_SESSION_ID);
if (settingsSessionId != INVALID_SESSION_ID) {
sessionId = settingsSessionId;
Log.i(LOG_TAG, "sessionId: " + sessionId
+ " Reaching AppPermissionGroupsFragment for auto revoke. "
+ "packageName: " + packageName + " uid " + uid);
PermissionControllerStatsLog.write(
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION, sessionId, uid,
packageName, autoRevokeAction);
} else {
if (KotlinUtils.INSTANCE.isROrAutoRevokeEnabled(getApplication(),
packageName, userHandle)) {
Log.i(LOG_TAG, "sessionId: " + sessionId
+ " Reaching AppPermissionGroupsFragment from intent. "
+ "packageName " + packageName + " uid " + uid);
PermissionControllerStatsLog.write(
APP_PERMISSION_GROUPS_FRAGMENT_AUTO_REVOKE_ACTION, sessionId,
uid, packageName, openFromIntentAction);
}
}
} catch (PackageManager.NameNotFoundException e) {
// Do no logging
}
final boolean allPermissions = getIntent().getBooleanExtra(
EXTRA_ALL_PERMISSIONS, false);
if (DeviceUtils.isAuto(this)) {
if (allPermissions) {
androidXFragment = AutoAllAppPermissionsFragment.newInstance(packageName,
userHandle, sessionId);
} else {
androidXFragment = AutoAppPermissionsFragment.newInstance(packageName,
userHandle, sessionId, /* isSystemPermsScreen= */ true);
}
} else if (DeviceUtils.isWear(this)) {
androidXFragment = AppPermissionsFragmentWear.newInstance(packageName);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = com.android.permissioncontroller.permission.ui.television
.AppPermissionsFragment.newInstance(packageName, userHandle);
} else {
Bundle args = AppPermissionGroupsFragment.createArgs(packageName, userHandle,
sessionId, /* isSystemPermsScreen= */ true);
setNavGraph(args, R.id.app_permission_groups);
return;
}
} break;
case Intent.ACTION_MANAGE_PERMISSION_APPS: {
permissionName = getIntent().getStringExtra(Intent.EXTRA_PERMISSION_NAME);
String permissionGroupName = getIntent().getStringExtra(
Intent.EXTRA_PERMISSION_GROUP_NAME);
if (permissionGroupName == null) {
try {
PermissionInfo permInfo = getPackageManager().getPermissionInfo(
permissionName, 0);
permissionGroupName = Utils.getGroupOfPermission(permInfo);
} catch (PackageManager.NameNotFoundException e) {
Log.i(LOG_TAG, "Permission " + permissionName + " does not exist");
}
}
if (permissionGroupName == null) {
permissionGroupName = permissionName;
}
if (permissionName == null && permissionGroupName == null) {
Log.i(LOG_TAG, "Missing mandatory argument EXTRA_PERMISSION_NAME or"
+ "EXTRA_PERMISSION_GROUP_NAME");
finishAfterTransition();
return;
}
// Redirect notification group to notification settings
if (permissionGroupName.equals(Manifest.permission_group.NOTIFICATIONS)) {
Utils.navigateToNotificationSettings(this);
finishAfterTransition();
return;
}
if (DeviceUtils.isAuto(this)) {
androidXFragment =
AutoPermissionAppsFragment.newInstance(permissionGroupName, sessionId);
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = com.android.permissioncontroller.permission.ui.television
.PermissionAppsFragment.newInstance(permissionGroupName);
} else {
Bundle args = PermissionAppsFragment.createArgs(permissionGroupName, sessionId);
setNavGraph(args, R.id.permission_apps);
return;
}
} break;
case Intent.ACTION_MANAGE_UNUSED_APPS :
// fall through
case ACTION_MANAGE_AUTO_REVOKE: {
Log.i(LOG_TAG, "sessionId " + sessionId + " starting auto revoke fragment"
+ " from notification");
PermissionControllerStatsLog.write(AUTO_REVOKE_NOTIFICATION_CLICKED, sessionId);
if (DeviceUtils.isAuto(this)) {
androidXFragment = AutoUnusedAppsFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else if (DeviceUtils.isTelevision(this)) {
androidXFragment = TvUnusedAppsFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else if (DeviceUtils.isWear(this)) {
androidXFragment = HandheldUnusedAppsWrapperFragment.newInstance();
androidXFragment.setArguments(UnusedAppsFragment.createArgs(sessionId));
} else {
setNavGraph(UnusedAppsFragment.createArgs(sessionId), R.id.auto_revoke);
return;
}
} break;
case PermissionManager.ACTION_REVIEW_PERMISSION_DECISIONS: {
UserHandle userHandle = getIntent().getParcelableExtra(Intent.EXTRA_USER);
if (userHandle == null) {
userHandle = Process.myUserHandle();
}
if (DeviceUtils.isAuto(this)) {
String source = getIntent().getStringExtra(
AutoReviewPermissionDecisionsFragment.EXTRA_SOURCE);
androidXFragment = AutoReviewPermissionDecisionsFragment.Companion
.newInstance(sessionId, userHandle, source);
} else {
Log.e(LOG_TAG, "ACTION_REVIEW_PERMISSION_DECISIONS is not "
+ "supported on this device type");
finishAfterTransition();
return;
}
} break;
default: {
Log.w(LOG_TAG, "Unrecognized action " + action);
finishAfterTransition();
return;
}
}
if (fragment != null) {
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment)
.commit();
} else if (androidXFragment != null) {
getSupportFragmentManager().beginTransaction().replace(android.R.id.content,
androidXFragment).commit();
}
}
|
[
"CWE-862"
] |
CVE-2023-21132
|
MEDIUM
| 6.8
|
android
|
onCreate
|
PermissionController/src/com/android/permissioncontroller/permission/ui/ManagePermissionsActivity.java
|
0679e4f35055729be7276536fe45fe8ec18a0453
| 1
|
Analyze the following code function for security vulnerabilities
|
public Descriptor<Builder> getBuilder(String shortClassName) {
return findDescriptor(shortClassName, Builder.all());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBuilder
File: core/src/main/java/jenkins/model/Jenkins.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2065
|
MEDIUM
| 4.3
|
jenkinsci/jenkins
|
getBuilder
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.