instruction
string | input
string | output
string | cwe_ids
list | cve_id
string | severity
string | cvss_score
float64 | repo_name
string | func_name
string | file_path
string | commit_hash
string | is_vulnerable
int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Analyze the following code function for security vulnerabilities
|
public String getEncryptedValue() {
try {
Cipher cipher = KEY.encrypt();
// add the magic suffix which works like a check sum.
return new String(Base64.encode(cipher.doFinal((value+MAGIC).getBytes("UTF-8"))));
} catch (GeneralSecurityException e) {
throw new Error(e); // impossible
} catch (UnsupportedEncodingException e) {
throw new Error(e); // impossible
}
}
|
Vulnerability Classification:
- CWE: CWE-326
- CVE: CVE-2017-2598
- Severity: MEDIUM
- CVSS Score: 4.0
Description: Merge pull request #105 from jenkinsci-cert/SECURITY-304-t3
[SECURITY-304] Encrypt new secrets with CBC and random IV instead of ECB
Function: getEncryptedValue
File: core/src/main/java/hudson/util/Secret.java
Repository: jenkinsci/jenkins
Fixed Code:
public String getEncryptedValue() {
try {
synchronized (this) {
if (iv == null) { //if we were created from plain text or other reason without iv
iv = KEY.newIv();
}
}
Cipher cipher = KEY.encrypt(iv);
byte[] encrypted = cipher.doFinal(this.value.getBytes(UTF_8));
byte[] payload = new byte[1 + 8 + iv.length + encrypted.length];
int pos = 0;
// For PAYLOAD_V1 we use this byte shifting model, V2 probably will need DataOutput
payload[pos++] = PAYLOAD_V1;
payload[pos++] = (byte)(iv.length >> 24);
payload[pos++] = (byte)(iv.length >> 16);
payload[pos++] = (byte)(iv.length >> 8);
payload[pos++] = (byte)(iv.length);
payload[pos++] = (byte)(encrypted.length >> 24);
payload[pos++] = (byte)(encrypted.length >> 16);
payload[pos++] = (byte)(encrypted.length >> 8);
payload[pos++] = (byte)(encrypted.length);
System.arraycopy(iv, 0, payload, pos, iv.length);
pos+=iv.length;
System.arraycopy(encrypted, 0, payload, pos, encrypted.length);
return "{"+new String(Base64.encode(payload))+"}";
} catch (GeneralSecurityException e) {
throw new Error(e); // impossible
}
}
|
[
"CWE-326"
] |
CVE-2017-2598
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
getEncryptedValue
|
core/src/main/java/hudson/util/Secret.java
|
e6aa166246d1734f4798a9e31f78842f4c85c28b
| 1
|
Analyze the following code function for security vulnerabilities
|
public <T> void get(String table, Class<T> clazz, String fieldName, String where,
boolean returnCount, boolean returnIdField, boolean setId,
Handler<AsyncResult<Results<T>>> replyHandler) {
get(table, clazz, fieldName, where, returnCount, returnIdField, setId, null, replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: get
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
get
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setId(Long id) {
this.id = id;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setId
File: publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java
Repository: sanluan/PublicCMS
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-21333
|
LOW
| 3.5
|
sanluan/PublicCMS
|
setId
|
publiccms-parent/publiccms-core/src/main/java/com/publiccms/entities/log/LogUpload.java
|
b4d5956e65b14347b162424abb197a180229b3db
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract void sendData(String destAddr, String scAddr, int destPort,
byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendData
File: src/java/com/android/internal/telephony/SMSDispatcher.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2015-3858
|
HIGH
| 9.3
|
android
|
sendData
|
src/java/com/android/internal/telephony/SMSDispatcher.java
|
df31d37d285dde9911b699837c351aed2320b586
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean getRequestedVisibility(@InternalInsetsType int type) {
return mRequestedVisibilities.getVisibility(type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRequestedVisibility
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getRequestedVisibility
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void launch(Context context, Account account, Message message, int action,
String toAddress, String body, String quotedText, String subject,
final ContentValues extraValues) {
Intent intent = new Intent(ACTION_LAUNCH_COMPOSE);
intent.setPackage(context.getPackageName());
intent.putExtra(EXTRA_FROM_EMAIL_TASK, true);
intent.putExtra(EXTRA_ACTION, action);
intent.putExtra(Utils.EXTRA_ACCOUNT, account);
if (action == EDIT_DRAFT) {
intent.putExtra(ORIGINAL_DRAFT_MESSAGE, message);
} else {
intent.putExtra(EXTRA_IN_REFERENCE_TO_MESSAGE, message);
}
if (toAddress != null) {
intent.putExtra(EXTRA_TO, toAddress);
}
if (body != null) {
intent.putExtra(EXTRA_BODY, body);
}
if (quotedText != null) {
intent.putExtra(EXTRA_QUOTED_TEXT, quotedText);
}
if (subject != null) {
intent.putExtra(EXTRA_SUBJECT, subject);
}
if (extraValues != null) {
LogUtils.d(LOG_TAG, "Launching with extraValues: %s", extraValues.toString());
intent.putExtra(EXTRA_VALUES, extraValues);
}
if (action == COMPOSE) {
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
} else if (message != null) {
intent.setData(Utils.normalizeUri(message.uri));
}
context.startActivity(intent);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: launch
File: src/com/android/mail/compose/ComposeActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-2425
|
MEDIUM
| 4.3
|
android
|
launch
|
src/com/android/mail/compose/ComposeActivity.java
|
0d9dfd649bae9c181e3afc5d571903f1eb5dc46f
| 0
|
Analyze the following code function for security vulnerabilities
|
private void trimLabels() {
for (Iterator<Label> itr = labels.values().iterator(); itr.hasNext();) {
Label l = itr.next();
resetLabel(l);
if(l.isEmpty())
itr.remove();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: trimLabels
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
|
trimLabels
|
core/src/main/java/jenkins/model/Jenkins.java
|
a0b00508eeb74d7033dc4100eb382df4e8fa72e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private @NonNull WifiConfiguration updateExistingInternalWifiConfigurationFromExternal(
@NonNull WifiConfiguration internalConfig, @NonNull WifiConfiguration externalConfig,
int uid, @Nullable String packageName, boolean overrideCreator) {
WifiConfiguration newInternalConfig = new WifiConfiguration(internalConfig);
// Copy over all the public elements from the provided configuration.
mergeWithInternalWifiConfiguration(newInternalConfig, externalConfig);
// Add debug information for network update.
newInternalConfig.lastUpdateUid = uid;
newInternalConfig.lastUpdateName =
packageName != null ? packageName : mContext.getPackageManager().getNameForUid(uid);
newInternalConfig.lastUpdated = mClock.getWallClockMillis();
newInternalConfig.numRebootsSinceLastUse = 0;
if (overrideCreator) {
newInternalConfig.creatorName = newInternalConfig.lastUpdateName;
newInternalConfig.creatorUid = uid;
}
return newInternalConfig;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateExistingInternalWifiConfigurationFromExternal
File: service/java/com/android/server/wifi/WifiConfigManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21242
|
CRITICAL
| 9.8
|
android
|
updateExistingInternalWifiConfigurationFromExternal
|
service/java/com/android/server/wifi/WifiConfigManager.java
|
72e903f258b5040b8f492cf18edd124b5a1ac770
| 0
|
Analyze the following code function for security vulnerabilities
|
public @Nullable String getWifiMacAddress(@Nullable ComponentName admin) {
throwIfParentInstance("getWifiMacAddress");
try {
return mService.getWifiMacAddress(admin, mContext.getPackageName());
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWifiMacAddress
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
|
getWifiMacAddress
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
String reportPackage) {
if (processName != null) {
enforceCallingPermission(android.Manifest.permission.SET_DEBUG_APP,
"setDumpHeapDebugLimit()");
} else {
synchronized (mPidsSelfLocked) {
ProcessRecord proc = mPidsSelfLocked.get(Binder.getCallingPid());
if (proc == null) {
throw new SecurityException("No process found for calling pid "
+ Binder.getCallingPid());
}
if (!Build.IS_DEBUGGABLE
&& (proc.info.flags&ApplicationInfo.FLAG_DEBUGGABLE) == 0) {
throw new SecurityException("Not running a debuggable build");
}
processName = proc.processName;
uid = proc.uid;
if (reportPackage != null && !proc.pkgList.containsKey(reportPackage)) {
throw new SecurityException("Package " + reportPackage + " is not running in "
+ proc);
}
}
}
synchronized (this) {
if (maxMemSize > 0) {
mMemWatchProcesses.put(processName, uid, new Pair(maxMemSize, reportPackage));
} else {
if (uid != 0) {
mMemWatchProcesses.remove(processName, uid);
} else {
mMemWatchProcesses.getMap().remove(processName);
}
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDumpHeapDebugLimit
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
|
setDumpHeapDebugLimit
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String toString() {
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: toString
File: chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2015-1261
|
MEDIUM
| 5
|
chromium
|
toString
|
chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java
|
5bf8a2dccf4777c5f065d918d1d9a2bbaa013f9f
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isContextActivatedInRequest(HttpServletRequest request) {
Object result = request.getAttribute(CONTEXT_ACTIVATED_IN_REQUEST);
if (result == null) {
return false;
}
return (Boolean) result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isContextActivatedInRequest
File: impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
Repository: weld/core
The code follows secure coding practices.
|
[
"CWE-362"
] |
CVE-2014-8122
|
MEDIUM
| 4.3
|
weld/core
|
isContextActivatedInRequest
|
impl/src/main/java/org/jboss/weld/servlet/ConversationContextActivator.java
|
8e413202fa1af08c09c580f444e4fd16874f9c65
| 0
|
Analyze the following code function for security vulnerabilities
|
@CurrentTimeMillisLong
public long getSubscriptionExpirationTimeMillis() {
return mSubscriptionExpirationTimeMillis;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSubscriptionExpirationTimeMillis
File: framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-120"
] |
CVE-2023-21243
|
MEDIUM
| 5.5
|
android
|
getSubscriptionExpirationTimeMillis
|
framework/java/android/net/wifi/hotspot2/PasspointConfiguration.java
|
5b49b8711efaadadf5052ba85288860c2d7ca7a6
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int getActivityDisplayId(IBinder activityToken) throws RemoteException {
synchronized (this) {
ActivityStack stack = ActivityRecord.getStackLocked(activityToken);
if (stack != null && stack.mActivityContainer.isAttachedLocked()) {
return stack.mActivityContainer.getDisplayId();
}
return Display.DEFAULT_DISPLAY;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActivityDisplayId
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
getActivityDisplayId
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void copyExternalResource(String path, File dest) {
try {
InputStream is = new FileInputStream(path);
copy(is, dest);
} catch (Exception e) {
logger.error("Exception while copying " + path + e.getMessage());
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: copyExternalResource
File: src/main/java/widoco/WidocoUtils.java
Repository: dgarijo/Widoco
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4772
|
HIGH
| 7.8
|
dgarijo/Widoco
|
copyExternalResource
|
src/main/java/widoco/WidocoUtils.java
|
f2279b76827f32190adfa9bd5229b7d5a147fa92
| 0
|
Analyze the following code function for security vulnerabilities
|
private long contentLength() {
if (contentLength == Long.MIN_VALUE) {
contentLength = HttpUtil.getContentLength(message, -1L);
}
return contentLength;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: contentLength
File: codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-444"
] |
CVE-2019-16869
|
MEDIUM
| 5
|
netty
|
contentLength
|
codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java
|
39cafcb05c99f2aa9fce7e6597664c9ed6a63a95
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onDetach() {
if (m_tooltipHandler != null) {
m_tooltipHandler.clearShowing();
}
super.onDetach();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onDetach
File: src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
Repository: alkacon/opencms-core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-31544
|
MEDIUM
| 5.4
|
alkacon/opencms-core
|
onDetach
|
src-gwt/org/opencms/ade/galleries/client/ui/CmsResultItemWidget.java
|
21bfbeaf6b038e2c03bb421ce7f0933dd7a7633e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onEmptyLines(int count)
{
// We need to use a special tag for empty lines since in XHTML the BR tag cannot be used outside of content
// tags.
// Note: We're using <div><div/> and not <div/> since some browsers do not support the <div/> syntax (FF3)
// when the content type is set to HTML instead of XHTML.
for (int i = 0; i < count; ++i) {
getXHTMLWikiPrinter().printXMLStartElement("div", new String[][] { { "class", "wikimodel-emptyline" } });
getXHTMLWikiPrinter().printXMLEndElement("div");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onEmptyLines
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
onEmptyLines
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-xhtml/src/main/java/org/xwiki/rendering/internal/renderer/xhtml/XHTMLChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTuiPin(final String name) throws IOException {
update();
m_readLock.lock();
try {
return m_users.get(name).getTuiPin().orElse(null);
} finally {
m_readLock.unlock();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTuiPin
File: opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
Repository: OpenNMS/opennms
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25931
|
MEDIUM
| 6.8
|
OpenNMS/opennms
|
getTuiPin
|
opennms-config/src/main/java/org/opennms/netmgt/config/UserManager.java
|
607151ea8f90212a3fb37c977fa57c7d58d26a84
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getMethod() {
return request.getMethod().name();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMethod
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
|
getMethod
|
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
|
@Override
public int getAboveUniverseLayer() {
return windowTypeToLayerLw(TYPE_SYSTEM_ERROR);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAboveUniverseLayer
File: policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-0812
|
MEDIUM
| 6.6
|
android
|
getAboveUniverseLayer
|
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
|
84669ca8de55d38073a0dcb01074233b0a417541
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Resource createRelative(String relativePath) {
String pathToUse = StringUtils.applyRelativePath(this.path, relativePath);
return new ClassPathResource(pathToUse, this.classLoader, this.clazz);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createRelative
File: src/main/java/spark/resource/ClassPathResource.java
Repository: perwendel/spark
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-9159
|
MEDIUM
| 5
|
perwendel/spark
|
createRelative
|
src/main/java/spark/resource/ClassPathResource.java
|
a221a864db28eb736d36041df2fa6eb8839fc5cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Ignore("fails - SQL injection!")
@Test
public void deleteByCriterionSingleQuote(TestContext context) throws FieldException {
deleteByCriterion(context, "'"); // SQL injection?
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2019-15534
- Severity: HIGH
- CVSS Score: 7.5
Description: RMB-200: Single quote SQL Injection in PostgresClient.update(table, updateSection, ...)
Function: deleteByCriterionSingleQuote
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
Repository: folio-org/raml-module-builder
Fixed Code:
@Test
public void deleteByCriterionSingleQuote(TestContext context) throws FieldException {
deleteByCriterion(context, "'"); // SQL injection?
}
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
deleteByCriterionSingleQuote
|
domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 1
|
Analyze the following code function for security vulnerabilities
|
public IReadOnlyAccess getRof() {
return rof;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRof
File: src/main/java/com/github/junrar/Archive.java
Repository: junrar
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2018-12418
|
MEDIUM
| 4.3
|
junrar
|
getRof
|
src/main/java/com/github/junrar/Archive.java
|
ad8d0ba8e155630da8a1215cee3f253e0af45817
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<ApiScenario> selectByIds(List<String> ids) {
ApiScenarioExample example = new ApiScenarioExample();
example.createCriteria().andIdIn(ids);
return apiScenarioMapper.selectByExample(example);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: selectByIds
File: backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2021-45789
|
MEDIUM
| 6.5
|
metersphere
|
selectByIds
|
backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java
|
d74e02cdff47cdf7524d305d098db6ffb7f61b47
| 0
|
Analyze the following code function for security vulnerabilities
|
void completeResumeLocked() {
final boolean wasVisible = mVisibleRequested;
setVisibility(true);
if (!wasVisible) {
// Visibility has changed, so take a note of it so we call the TaskStackChangedListener
mTaskSupervisor.mAppVisibilitiesChangedSinceLastPause = true;
}
idle = false;
results = null;
if (newIntents != null && newIntents.size() > 0) {
mLastNewIntent = newIntents.get(newIntents.size() - 1);
}
newIntents = null;
stopped = false;
if (isActivityTypeHome()) {
mTaskSupervisor.updateHomeProcess(task.getBottomMostActivity().app);
}
if (nowVisible) {
mTaskSupervisor.stopWaitingForActivityVisible(this);
}
// Schedule an idle timeout in case the app doesn't do it for us.
mTaskSupervisor.scheduleIdleTimeout(this);
mTaskSupervisor.reportResumedActivityLocked(this);
resumeKeyDispatchingLocked();
final Task rootTask = getRootTask();
mTaskSupervisor.mNoAnimActivities.clear();
returningOptions = null;
if (canTurnScreenOn()) {
mTaskSupervisor.wakeUp("turnScreenOnFlag");
} else {
// If the screen is going to turn on because the caller explicitly requested it and
// the keyguard is not showing don't attempt to sleep. Otherwise the Activity will
// pause and then resume again later, which will result in a double life-cycle event.
rootTask.checkReadyForSleep();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: completeResumeLocked
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
|
completeResumeLocked
|
services/core/java/com/android/server/wm/ActivityRecord.java
|
44aeef1b82ecf21187d4903c9e3666a118bdeaf3
| 0
|
Analyze the following code function for security vulnerabilities
|
public InternetResource createResource(Object base, String path)
throws FacesException {
// TODO - detect type of resource ( for example, resources location path
// in Skin
try {
return getResource(path);
} catch (ResourceNotFoundException e) {
try {
return getResource(buildKey(base, path));
} catch (ResourceNotFoundException e1) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.BUILD_RESOURCE_INFO,
path));
}
}
}
// path - is class name ?
InternetResource res;
try {
Class<?> resourceClass = Class.forName(path);
res = createDynamicResource(path, resourceClass);
} catch (Exception e) {
try {
res = createJarResource(base, path);
} catch (ResourceNotFoundException ex) {
res = createStaticResource(path);
}
// TODO - if resource not found, create static ?
}
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createResource
File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Repository: nuxeo/richfaces-3.3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2013-4521
|
HIGH
| 7.5
|
nuxeo/richfaces-3.3
|
createResource
|
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
|
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public List<ResolveInfo> queryIntentActivities(Intent intent,
String resolvedType, int flags, int userId) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false, "query intent activities");
ComponentName comp = intent.getComponent();
if (comp == null) {
if (intent.getSelector() != null) {
intent = intent.getSelector();
comp = intent.getComponent();
}
}
if (comp != null) {
final List<ResolveInfo> list = new ArrayList<ResolveInfo>(1);
final ActivityInfo ai = getActivityInfo(comp, flags, userId);
if (ai != null) {
final ResolveInfo ri = new ResolveInfo();
ri.activityInfo = ai;
list.add(ri);
}
return list;
}
// reader
synchronized (mPackages) {
final String pkgName = intent.getPackage();
if (pkgName == null) {
List<CrossProfileIntentFilter> matchingFilters =
getMatchingCrossProfileIntentFilters(intent, resolvedType, userId);
// Check for results that need to skip the current profile.
ResolveInfo xpResolveInfo = querySkipCurrentProfileIntents(matchingFilters, intent,
resolvedType, flags, userId);
if (xpResolveInfo != null && isUserEnabled(xpResolveInfo.targetUserId)) {
List<ResolveInfo> result = new ArrayList<ResolveInfo>(1);
result.add(xpResolveInfo);
return filterIfNotPrimaryUser(result, userId);
}
// Check for results in the current profile.
List<ResolveInfo> result = mActivities.queryIntent(
intent, resolvedType, flags, userId);
// Check for cross profile results.
xpResolveInfo = queryCrossProfileIntents(
matchingFilters, intent, resolvedType, flags, userId);
if (xpResolveInfo != null && isUserEnabled(xpResolveInfo.targetUserId)) {
result.add(xpResolveInfo);
Collections.sort(result, mResolvePrioritySorter);
}
result = filterIfNotPrimaryUser(result, userId);
if (hasWebURI(intent)) {
CrossProfileDomainInfo xpDomainInfo = null;
final UserInfo parent = getProfileParent(userId);
if (parent != null) {
xpDomainInfo = getCrossProfileDomainPreferredLpr(intent, resolvedType,
flags, userId, parent.id);
}
if (xpDomainInfo != null) {
if (xpResolveInfo != null) {
// If we didn't remove it, the cross-profile ResolveInfo would be twice
// in the result.
result.remove(xpResolveInfo);
}
if (result.size() == 0) {
result.add(xpDomainInfo.resolveInfo);
return result;
}
} else if (result.size() <= 1) {
return result;
}
result = filterCandidatesWithDomainPreferredActivitiesLPr(intent, flags, result,
xpDomainInfo, userId);
Collections.sort(result, mResolvePrioritySorter);
}
return result;
}
final PackageParser.Package pkg = mPackages.get(pkgName);
if (pkg != null) {
return filterIfNotPrimaryUser(
mActivities.queryIntentForPackage(
intent, resolvedType, flags, pkg.activities, userId),
userId);
}
return new ArrayList<ResolveInfo>();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: queryIntentActivities
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
|
queryIntentActivities
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Map<String, Map<String, Map<String, Map<String, ?>>>> getCoreValidationConstraints() {
if (CORE_CONSTRAINTS.isEmpty()) {
for (Map.Entry<String, Class<? extends ParaObject>> e : ParaObjectUtils.getCoreClassesMap().entrySet()) {
String type = e.getKey();
List<Field> fieldlist = Utils.getAllDeclaredFields(e.getValue());
for (Field field : fieldlist) {
Annotation[] annos = field.getAnnotations();
if (annos.length > 1) {
Map<String, Map<String, ?>> constrMap = new HashMap<>();
for (Annotation anno : annos) {
if (isValidConstraintType(anno.annotationType())) {
Constraint c = fromAnnotation(anno);
if (c != null) {
constrMap.put(c.getName(), c.getPayload());
}
}
}
if (!constrMap.isEmpty()) {
if (!CORE_CONSTRAINTS.containsKey(type)) {
CORE_CONSTRAINTS.put(type, new HashMap<>());
}
CORE_CONSTRAINTS.get(type).put(field.getName(), constrMap);
}
}
}
}
CORE_CONSTRAINTS.get(Utils.type(User.class)).put("password",
Collections.singletonMap("max", Constraint.max(User.MAX_PASSWORD_LENGTH).getPayload()));
}
return Collections.unmodifiableMap(CORE_CONSTRAINTS);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCoreValidationConstraints
File: para-core/src/main/java/com/erudika/para/core/validation/ValidationUtils.java
Repository: Erudika/para
The code follows secure coding practices.
|
[
"CWE-840"
] |
CVE-2022-1848
|
MEDIUM
| 4.3
|
Erudika/para
|
getCoreValidationConstraints
|
para-core/src/main/java/com/erudika/para/core/validation/ValidationUtils.java
|
fa677c629842df60099daa9c23bd802bc41b48d1
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean updateConfigurationLocked(Configuration values, ActivityRecord starting,
boolean initLocale) {
return updateConfigurationLocked(values, starting, initLocale, false /* deferResume */);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateConfigurationLocked
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
|
updateConfigurationLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void doesNotPrefixSortsIfFunction() {
Sort sort = new Sort("sum(foo)");
assertThat(applySorting("select p from Person p", sort, "p"), endsWith("order by sum(foo) asc"));
}
|
Vulnerability Classification:
- CWE: CWE-89
- CVE: CVE-2016-6652
- Severity: MEDIUM
- CVSS Score: 6.8
Description: DATAJPA-965 - Fix potential blind SQL injection in Sort when used in combination with @Query.
We now decline sort expressions that contain functions such as ORDER BY LENGTH(name) when used with repository having a String query defined via the @Query annotation.
Think of a query method as follows:
@Query("select p from Person p where LOWER(p.lastname) = LOWER(:lastname)")
List<Person> findByLastname(@Param("lastname") String lastname, Sort sort);
Calls to findByLastname("lannister", new Sort("LENGTH(firstname)")) from now on throw an Exception indicating function calls are not allowed within the _ORDER BY_ clause. However you still can use JpaSort.unsafe("LENGTH(firstname)") to restore the behavior.
Kudos to Niklas Särökaari, Joona Immonen, Arto Santala, Antti Virtanen, Michael Holopainen and Antti Ahola who brought this to our attention.
Function: doesNotPrefixSortsIfFunction
File: src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
Repository: spring-projects/spring-data-jpa
Fixed Code:
@Test(expected = InvalidDataAccessApiUsageException.class)
public void doesNotPrefixSortsIfFunction() {
Sort sort = new Sort("sum(foo)");
assertThat(applySorting("select p from Person p", sort, "p"), endsWith("order by sum(foo) asc"));
}
|
[
"CWE-89"
] |
CVE-2016-6652
|
MEDIUM
| 6.8
|
spring-projects/spring-data-jpa
|
doesNotPrefixSortsIfFunction
|
src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java
|
b8e7fe
| 1
|
Analyze the following code function for security vulnerabilities
|
public boolean isInWikiEditMode()
{
return getDriver().findElements(By.xpath("//div[@id='editcolumn' and contains(@class, 'editor-wiki')]"))
.size() > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isInWikiEditMode
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
|
isInWikiEditMode
|
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 saveVoterInfo(Voter voter) {
String sql = "insert into voter_table(voter_name, password, gender, state_no, district, email, dob, imageurl) values(?,?,?,?,?,?,?,?)";
try {
ps = DbUtil.getConnection().prepareStatement(sql);
ps.setString(1, voter.getVoterName());
ps.setString(2, voter.getPassword());
ps.setString(3, voter.getGender());
ps.setInt(4, voter.getStateNo());
ps.setString(5, voter.getDistrictName());
ps.setString(6, voter.getEmail());
ps.setDate(7, new Date(voter.getDob().getTime()));
ps.setString(8, voter.getImgUrl());
ps.executeUpdate();
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: saveVoterInfo
File: src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
Repository: bijaythapaa/OnlineVotingSystem
The code follows secure coding practices.
|
[
"CWE-916"
] |
CVE-2021-21253
|
MEDIUM
| 5
|
bijaythapaa/OnlineVotingSystem
|
saveVoterInfo
|
src/com/bijay/onlinevotingsystem/dao/VoterDaoImpl.java
|
0181cb0272857696c8eb3e44fcf6cb014ff90f09
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract String getMainDivId(VaadinSession session,
VaadinRequest request);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMainDivId
File: flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-203"
] |
CVE-2021-31404
|
LOW
| 1.9
|
vaadin/flow
|
getMainDivId
|
flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java
|
621ef1b322737d963bee624b2d2e38cd739903d9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isAppFreezerSupported() {
final long token = Binder.clearCallingIdentity();
try {
return mOomAdjuster.mCachedAppOptimizer.isFreezerSupported();
} finally {
Binder.restoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isAppFreezerSupported
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
|
isAppFreezerSupported
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public void closeQs() {
cancelQsAnimation();
setQsExpansion(mQsMinExpansionHeight);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeQs
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
|
closeQs
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private DocumentReference getDefaultDocumentReference()
{
return getDefaultDocumentReferenceProvider().get();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultDocumentReference
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
|
getDefaultDocumentReference
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
private void showSnackbar(int newItemsCount) {
Snackbar snackbar = Snackbar.make(findViewById(R.id.coordinator_layout),
getResources().getQuantityString(R.plurals.message_bar_new_articles_available, newItemsCount, newItemsCount),
Snackbar.LENGTH_LONG);
snackbar.setAction(getString(R.string.message_bar_reload), mSnackbarListener);
//snackbar.setActionTextColor(ContextCompat.getColor(this, R.color.accent_material_dark));
// Setting android:TextColor to #000 in the light theme results in black on black
// text on the Snackbar, set the text back to white,
//TextView textView = snackbar.getView().findViewById(com.google.android.material.R.id.snackbar_text);
//textView.setTextColor(Color.WHITE);
snackbar.show();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: showSnackbar
File: News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
Repository: nextcloud/news-android
The code follows secure coding practices.
|
[
"CWE-829"
] |
CVE-2021-41256
|
MEDIUM
| 5.8
|
nextcloud/news-android
|
showSnackbar
|
News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java
|
05449cb666059af7de2302df9d5c02997a23df85
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setBackwardCompatibleUserRestriction(
CallerIdentity caller, EnforcingAdmin admin, String key, boolean enabled,
boolean parent) {
synchronized (getLockObject()) {
if (isDeviceOwner(caller)) {
if (UserRestrictionsUtils.isGlobal(OWNER_TYPE_DEVICE_OWNER, key)) {
setGlobalUserRestrictionInternal(admin, key, enabled);
} else {
setLocalUserRestrictionInternal(admin, key, enabled, caller.getUserId());
}
} else if (isProfileOwner(caller)) {
if (UserRestrictionsUtils.isGlobal(OWNER_TYPE_PROFILE_OWNER, key)
|| (parent && isProfileOwnerOfOrganizationOwnedDevice(caller)
&& UserRestrictionsUtils.isGlobal(
OWNER_TYPE_PROFILE_OWNER_OF_ORGANIZATION_OWNED_DEVICE, key))) {
setGlobalUserRestrictionInternal(admin, key, enabled);
} else {
int affectedUserId = parent
? getProfileParentId(caller.getUserId()) : caller.getUserId();
setLocalUserRestrictionInternal(admin, key, enabled, affectedUserId);
}
} else {
throw new IllegalStateException("Non-DO/Non-PO cannot set restriction " + key
+ " while targetSdkVersion is less than UPSIDE_DOWN_CAKE");
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBackwardCompatibleUserRestriction
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
|
setBackwardCompatibleUserRestriction
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
static RuntimeException logAndRethrowRuntimeExceptionOnTransact(String name,
RuntimeException e) {
if (!(e instanceof SecurityException)) {
Slog.w(TAG, name + " onTransact aborts"
+ " UID:" + Binder.getCallingUid()
+ " PID:" + Binder.getCallingPid(), e);
}
throw e;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: logAndRethrowRuntimeExceptionOnTransact
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
|
logAndRethrowRuntimeExceptionOnTransact
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public void loadDataSync(final AwContents awContents,
CallbackHelper onPageFinishedHelper,
final String data, final String mimeType,
final boolean isBase64Encoded) throws Exception {
int currentCallCount = onPageFinishedHelper.getCallCount();
loadDataAsync(awContents, data, mimeType, isBase64Encoded);
onPageFinishedHelper.waitForCallback(currentCallCount, 1, WAIT_TIMEOUT_MS,
TimeUnit.MILLISECONDS);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: loadDataSync
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
loadDataSync
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean hasViolationOccurred() {
return violationOccurred;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasViolationOccurred
File: dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java
Repository: dropwizard
The code follows secure coding practices.
|
[
"CWE-74"
] |
CVE-2020-11002
|
HIGH
| 9
|
dropwizard
|
hasViolationOccurred
|
dropwizard-validation/src/main/java/io/dropwizard/validation/selfvalidating/ViolationCollector.java
|
d5a512f7abf965275f2a6b913ac4fe778e424242
| 0
|
Analyze the following code function for security vulnerabilities
|
public void addCharSet(String charset) {
style.addCharSet(charset);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addCharSet
File: org/w3c/css/css/StyleSheetParser.java
Repository: w3c/css-validator
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-4070
|
LOW
| 3.5
|
w3c/css-validator
|
addCharSet
|
org/w3c/css/css/StyleSheetParser.java
|
e5c09a9119167d3064db786d5f00d730b584a53b
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isSameApp(int callingUid, @Nullable String packageName) {
if (callingUid != 0 && callingUid != SYSTEM_UID) {
return mPmInternal.isSameApp(packageName, callingUid, UserHandle.getUserId(callingUid));
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSameApp
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
|
isSameApp
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
private native int createSocketChannelNative(int type, String serviceName,
byte[] uuid, int port, int flag);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createSocketChannelNative
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
createSocketChannelNative
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
public void onUidRemovedLocked(int uid) {
final SettingsState ssaidSettings = getSettingsLocked(SETTINGS_TYPE_SSAID,
UserHandle.getUserId(uid));
if (ssaidSettings != null) {
ssaidSettings.deleteSettingLocked(Integer.toString(uid));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onUidRemovedLocked
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
onUidRemovedLocked
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onTransferProgress(long progressRate, long totalTransferredSoFar,
long totalToTransfer, String filePath) {
int percent = (int) (100.0 * ((double) totalTransferredSoFar) / ((double) totalToTransfer));
if (percent != mLastPercent) {
mNotificationBuilder.setProgress(100, percent, totalToTransfer < 0);
String fileName = filePath.substring(filePath.lastIndexOf(FileUtils.PATH_SEPARATOR) + 1);
String text = String.format(getString(R.string.downloader_download_in_progress_content), percent, fileName);
mNotificationBuilder.setContentText(text);
if (mNotificationManager == null) {
mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
}
if (mNotificationManager != null) {
mNotificationManager.notify(R.string.downloader_download_in_progress_ticker,
mNotificationBuilder.build());
}
}
mLastPercent = percent;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onTransferProgress
File: src/main/java/com/owncloud/android/files/services/FileDownloader.java
Repository: nextcloud/android
The code follows secure coding practices.
|
[
"CWE-732"
] |
CVE-2022-24886
|
LOW
| 2.1
|
nextcloud/android
|
onTransferProgress
|
src/main/java/com/owncloud/android/files/services/FileDownloader.java
|
27559efb79d45782e000b762860658d49e9c35e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public MediaPackage createMediaPackage(String mediaPackageId)
throws MediaPackageException, ConfigurationException {
MediaPackage mediaPackage;
try {
mediaPackage = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder()
.createNew(new IdImpl(mediaPackageId));
} catch (MediaPackageException e) {
logger.error("INGEST:Failed to create media package " + e.getLocalizedMessage());
throw e;
}
mediaPackage.setDate(new Date());
logger.info("Created mediapackage {}", mediaPackage);
return mediaPackage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createMediaPackage
File: modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
Repository: opencast
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2022-29237
|
MEDIUM
| 5.5
|
opencast
|
createMediaPackage
|
modules/ingest-service-impl/src/main/java/org/opencastproject/ingest/impl/IngestServiceImpl.java
|
8d5ec1614eed109b812bc27b0c6d3214e456d4e7
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
void setSelectedAction(int selectedAction) {
if (mSelectedAction == selectedAction) {
return;
}
mSelectedAction = selectedAction;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSelectedAction
File: packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40098
|
MEDIUM
| 5.5
|
android
|
setSelectedAction
|
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfo.java
|
d21ffbe8a2eeb2a5e6da7efbb1a0430ba6b022e0
| 0
|
Analyze the following code function for security vulnerabilities
|
@Pure
public @Nullable Time getTime(String columnName) throws SQLException {
return getTime(findColumn(columnName), null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTime
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
|
getTime
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private Externalizable read(InputStream in, String className, ClassLoader classLoader) throws Exception {
Externalizable ds = ClassLoaderUtil.newInstance(classLoader, className);
ObjectInputStream objectInputStream = newObjectInputStream(classLoader, in);
ds.readExternal(objectInputStream);
return ds;
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2016-10750
- Severity: MEDIUM
- CVSS Score: 6.8
Description: Add basic protection against untrusted deserialization.
Function: read
File: hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
Repository: hazelcast
Fixed Code:
private Externalizable read(InputStream in, String className, ClassLoader classLoader) throws Exception {
Externalizable ds = ClassLoaderUtil.newInstance(classLoader, className);
ObjectInputStream objectInputStream = newObjectInputStream(classLoader, classFilter, in);
ds.readExternal(objectInputStream);
return ds;
}
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
read
|
hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/JavaDefaultSerializers.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 1
|
Analyze the following code function for security vulnerabilities
|
protected void registerResources() throws FacesException {
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Enumeration<URL> e = loader
.getResources("META-INF/resources-config.xml");
while (e.hasMoreElements()) {
URL resource = e.nextElement();
registerConfig(resource);
}
} catch (IOException e) {
throw new FacesException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: registerResources
File: framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Repository: nuxeo/richfaces-3.3
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2013-4521
|
HIGH
| 7.5
|
nuxeo/richfaces-3.3
|
registerResources
|
framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
|
6cbad2a6dcb70d3e33a6ce5879b1a3ad79eb1aec
| 0
|
Analyze the following code function for security vulnerabilities
|
public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws LaunchException {
JNLPClassLoader loader;
String uniqueKey = file.getUniqueKey();
synchronized (getUniqueKeyLock(uniqueKey)) {
JNLPClassLoader baseLoader = uniqueKeyToLoader.get(uniqueKey);
// A null baseloader implies that no loader has been created
// for this codebase/jnlp yet. Create one.
if (baseLoader == null
|| (file.isApplication()
&& !baseLoader.getJNLPFile().getFileLocation().equals(file.getFileLocation()))) {
loader = createInstance(file, policy, mainName, enableCodeBase);
} else {
// if key is same and locations match, this is the loader we want
if (!file.isApplication()) {
// If this is an applet, we do need to consider its loader
loader = new JNLPClassLoader(file, policy, mainName, enableCodeBase);
if (baseLoader != null) {
baseLoader.merge(loader);
}
}
loader = baseLoader;
}
// loaders are mapped to a unique key. Only extensions and parent
// share a key, so it is safe to always share based on it
loader.incrementLoaderUseCount();
uniqueKeyToLoader.put(uniqueKey, loader);
}
return loader;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getInstance
File: core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
Repository: AdoptOpenJDK/IcedTea-Web
The code follows secure coding practices.
|
[
"CWE-345",
"CWE-94",
"CWE-22"
] |
CVE-2019-10182
|
MEDIUM
| 5.8
|
AdoptOpenJDK/IcedTea-Web
|
getInstance
|
core/src/main/java/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
|
e0818f521a0711aeec4b913b49b5fc6a52815662
| 0
|
Analyze the following code function for security vulnerabilities
|
private void exitGuest() {
// Just to be safe
if (!mUserCaps.mIsGuest) {
return;
}
removeThisUser();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: exitGuest
File: src/com/android/settings/users/UserSettings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
exitGuest
|
src/com/android/settings/users/UserSettings.java
|
bd5d5176c74021e8cf4970f93f273ba3023c3d72
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (event.getAction() == KeyEvent.ACTION_DOWN
&& event.getRepeatCount() == 0) {
// Tell the framework to start tracking this event.
getKeyDispatcherState().startTracking(event, this);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
getKeyDispatcherState().handleUpEvent(event);
if (event.isTracking() && !event.isCanceled()) {
mUrlBarDelegate.backKeyPressed();
return true;
}
}
}
return super.onKeyPreIme(keyCode, event);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onKeyPreIme
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
|
onKeyPreIme
|
chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
|
3bd33fee094e863e5496ac24714c558bd58d28ef
| 0
|
Analyze the following code function for security vulnerabilities
|
private void setServiceIcon(Context context, View view, Drawable serviceIcon) {
final ImageView iconView = view.findViewById(R.id.autofill_save_icon);
final Resources res = context.getResources();
final int maxWidth = res.getDimensionPixelSize(R.dimen.autofill_save_icon_max_size);
final int maxHeight = maxWidth;
final int actualWidth = serviceIcon.getMinimumWidth();
final int actualHeight = serviceIcon.getMinimumHeight();
if (actualWidth <= maxWidth && actualHeight <= maxHeight) {
if (sDebug) {
Slog.d(TAG, "Adding service icon "
+ "(" + actualWidth + "x" + actualHeight + ") as it's less than maximum "
+ "(" + maxWidth + "x" + maxHeight + ").");
}
iconView.setImageDrawable(serviceIcon);
} else {
Slog.w(TAG, "Not adding service icon of size "
+ "(" + actualWidth + "x" + actualHeight + ") because maximum is "
+ "(" + maxWidth + "x" + maxHeight + ").");
((ViewGroup)iconView.getParent()).removeView(iconView);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setServiceIcon
File: services/autofill/java/com/android/server/autofill/ui/SaveUi.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-610"
] |
CVE-2023-40133
|
MEDIUM
| 5.5
|
android
|
setServiceIcon
|
services/autofill/java/com/android/server/autofill/ui/SaveUi.java
|
08becc8c600f14c5529115cc1a1e0c97cd503f33
| 0
|
Analyze the following code function for security vulnerabilities
|
private Bitmap getProfileBadge() {
Drawable badge = getProfileBadgeDrawable();
if (badge == null) {
return null;
}
final int size = mContext.getResources().getDimensionPixelSize(
R.dimen.notification_badge_size);
Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
badge.setBounds(0, 0, size, size);
badge.draw(canvas);
return bitmap;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProfileBadge
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
getProfileBadge
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public Map<String, Object> compileOptions(Options opt) {
Map<String, Object> options = new HashMap<>();
if (opt.isSet(Printer.SKIP_DEFAULT_OPTIONS)) {
options.put(Printer.SKIP_DEFAULT_OPTIONS, true);
} else if (opt.isSet(Printer.STYLE)) {
options.put(Printer.STYLE, opt.get(Printer.STYLE));
}
if (opt.isSet(Printer.TO_STRING)) {
options.put(Printer.TO_STRING, true);
}
if (opt.isSet(Printer.WIDTH)) {
options.put(Printer.WIDTH, opt.getNumber(Printer.WIDTH));
}
if (opt.isSet(Printer.ROWNUM)) {
options.put(Printer.ROWNUM, true);
}
if (opt.isSet(Printer.ONE_ROW_TABLE)) {
options.put(Printer.ONE_ROW_TABLE, true);
}
if (opt.isSet(Printer.SHORT_NAMES)) {
options.put(Printer.SHORT_NAMES, true);
}
if (opt.isSet(Printer.STRUCT_ON_TABLE)) {
options.put(Printer.STRUCT_ON_TABLE, true);
}
if (opt.isSet(Printer.COLUMNS)) {
options.put(Printer.COLUMNS, Arrays.asList(opt.get(Printer.COLUMNS).split(",")));
}
if (opt.isSet(Printer.EXCLUDE)) {
options.put(Printer.EXCLUDE, Arrays.asList(opt.get(Printer.EXCLUDE).split(",")));
}
if (opt.isSet(Printer.INCLUDE)) {
options.put(Printer.INCLUDE, Arrays.asList(opt.get(Printer.INCLUDE).split(",")));
}
if (opt.isSet(Printer.ALL)) {
options.put(Printer.ALL, true);
}
if (opt.isSet(Printer.MAXROWS)) {
options.put(Printer.MAXROWS, opt.getNumber(Printer.MAXROWS));
}
if (opt.isSet(Printer.MAX_COLUMN_WIDTH)) {
options.put(Printer.MAX_COLUMN_WIDTH, opt.getNumber(Printer.MAX_COLUMN_WIDTH));
}
if (opt.isSet(Printer.MAX_DEPTH)) {
options.put(Printer.MAX_DEPTH, opt.getNumber(Printer.MAX_DEPTH));
}
if (opt.isSet(Printer.INDENTION)) {
options.put(Printer.INDENTION, opt.getNumber(Printer.INDENTION));
}
if (opt.isSet(Printer.VALUE_STYLE)) {
options.put(Printer.VALUE_STYLE, opt.get(Printer.VALUE_STYLE));
}
if (opt.isSet(Printer.BORDER)) {
options.put(Printer.BORDER, opt.get(Printer.BORDER));
}
if (opt.isSet(Printer.ROW_HIGHLIGHT)) {
try {
options.put(Printer.ROW_HIGHLIGHT, optionRowHighlight(opt.get(Printer.ROW_HIGHLIGHT)));
} catch (Exception e) {
RuntimeException exception = new BadOptionValueException(
Printer.ROW_HIGHLIGHT + " has a bad value: " + opt.get(Printer.ROW_HIGHLIGHT));
exception.addSuppressed(e);
throw exception;
}
}
if (opt.isSet(Printer.MULTI_COLUMNS)) {
options.put(Printer.MULTI_COLUMNS, true);
}
options.put("exception", "stack");
return options;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: compileOptions
File: console/src/main/java/org/jline/console/impl/DefaultPrinter.java
Repository: jline/jline3
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-50572
|
MEDIUM
| 5.5
|
jline/jline3
|
compileOptions
|
console/src/main/java/org/jline/console/impl/DefaultPrinter.java
|
f3c60a3e6255e8e0c20d5043a4fe248446f292bb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public StackInfo getStackInfo(int stackId) throws RemoteException
{
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeInt(stackId);
mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
reply.readException();
int res = reply.readInt();
StackInfo info = null;
if (res != 0) {
info = StackInfo.CREATOR.createFromParcel(reply);
}
data.recycle();
reply.recycle();
return info;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStackInfo
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getStackInfo
|
core/java/android/app/ActivityManagerNative.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private UserPropertiesResolver getAllUserPropertiesResolver()
{
if (this.userPropertiesResolver == null) {
this.userPropertiesResolver = Utils.getComponent(UserPropertiesResolver.class, "all");
}
return this.userPropertiesResolver;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAllUserPropertiesResolver
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
|
getAllUserPropertiesResolver
|
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 Route.Definition head(final String path, final Route.Filter filter) {
return appendDefinition(HEAD, path, filter);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: head
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
|
head
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean getPowerButtonInstantlyLocks(int userId) {
return getBoolean(LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS, true, userId);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPowerButtonInstantlyLocks
File: core/java/com/android/internal/widget/LockPatternUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3908
|
MEDIUM
| 4.3
|
android
|
getPowerButtonInstantlyLocks
|
core/java/com/android/internal/widget/LockPatternUtils.java
|
96daf7d4893f614714761af2d53dfb93214a32e4
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean pushDynamicShortcut(@NonNull ShortcutInfo newShortcut,
@NonNull List<ShortcutInfo> changedShortcuts) {
Preconditions.checkArgument(newShortcut.isEnabled(),
"pushDynamicShortcuts() cannot publish disabled shortcuts");
ensureShortcutCountBeforePush();
newShortcut.addFlags(ShortcutInfo.FLAG_DYNAMIC);
changedShortcuts.clear();
final ShortcutInfo oldShortcut = findShortcutById(newShortcut.getId());
boolean deleted = false;
if (oldShortcut == null || !oldShortcut.isDynamic()) {
final ShortcutService service = mShortcutUser.mService;
final int maxShortcuts = service.getMaxActivityShortcuts();
final ArrayMap<ComponentName, ArrayList<ShortcutInfo>> all =
sortShortcutsToActivities();
final ArrayList<ShortcutInfo> activityShortcuts = all.get(newShortcut.getActivity());
if (activityShortcuts != null && activityShortcuts.size() > maxShortcuts) {
// Root cause was discovered in b/233155034, so this should not be happening.
service.wtf("Error pushing shortcut. There are already "
+ activityShortcuts.size() + " shortcuts.");
}
if (activityShortcuts != null && activityShortcuts.size() == maxShortcuts) {
// Max has reached. Delete the shortcut with lowest rank.
// Sort by isManifestShortcut() and getRank().
Collections.sort(activityShortcuts, mShortcutTypeAndRankComparator);
final ShortcutInfo shortcut = activityShortcuts.get(maxShortcuts - 1);
if (shortcut.isManifestShortcut()) {
// All shortcuts are manifest shortcuts and cannot be removed.
Slog.e(TAG, "Failed to remove manifest shortcut while pushing dynamic shortcut "
+ newShortcut.getId());
return true; // poppedShortcuts is empty which indicates a failure.
}
changedShortcuts.add(shortcut);
deleted = deleteDynamicWithId(shortcut.getId(), /* ignoreInvisible =*/ true,
/*ignorePersistedShortcuts=*/ true) != null;
}
}
if (oldShortcut != null) {
// It's an update case.
// Make sure the target is updatable. (i.e. should be mutable.)
oldShortcut.ensureUpdatableWith(newShortcut, /*isUpdating=*/ false);
// If it was originally pinned or cached, the new one should be pinned or cached too.
newShortcut.addFlags(oldShortcut.getFlags()
& (ShortcutInfo.FLAG_PINNED | ShortcutInfo.FLAG_CACHED_ALL));
}
if (newShortcut.isExcludedFromSurfaces(ShortcutInfo.SURFACE_LAUNCHER)) {
if (isAppSearchEnabled()) {
synchronized (mLock) {
mTransientShortcuts.put(newShortcut.getId(), newShortcut);
}
}
} else {
forceReplaceShortcutInner(newShortcut);
}
if (isAppSearchEnabled()) {
runAsSystem(() -> fromAppSearch().thenAccept(session ->
session.reportUsage(new ReportUsageRequest.Builder(
getPackageName(), newShortcut.getId()).build(), mExecutor, result -> {
if (!result.isSuccess()) {
Slog.e(TAG, "Failed to report usage via AppSearch. "
+ result.getErrorMessage());
}
})));
}
return deleted;
}
|
Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-40075
- Severity: MEDIUM
- CVSS Score: 5.5
Description: Restrict number of shortcuts can be added through addDynamicShortcuts
This CL fixes the issue where, when an app have multiple main
activities, the total number of shortcuts can grow indefinitely if they
were published through addDynamicShortcuts.
Bug: 281061287
Test: manual
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3215e73e36aa0463429226b5743ce24badf31227)
Merged-In: Ib3eecefee34517b670c59dd5b8526fe9eb24f463
Change-Id: Ib3eecefee34517b670c59dd5b8526fe9eb24f463
Function: pushDynamicShortcut
File: services/core/java/com/android/server/pm/ShortcutPackage.java
Repository: android
Fixed Code:
public boolean pushDynamicShortcut(@NonNull ShortcutInfo newShortcut,
@NonNull List<ShortcutInfo> changedShortcuts) {
Preconditions.checkArgument(newShortcut.isEnabled(),
"pushDynamicShortcuts() cannot publish disabled shortcuts");
newShortcut.addFlags(ShortcutInfo.FLAG_DYNAMIC);
changedShortcuts.clear();
final ShortcutInfo oldShortcut = findShortcutById(newShortcut.getId());
boolean deleted = false;
if (oldShortcut == null || !oldShortcut.isDynamic()) {
final ShortcutService service = mShortcutUser.mService;
final int maxShortcuts = service.getMaxActivityShortcuts();
final ArrayMap<ComponentName, ArrayList<ShortcutInfo>> all =
sortShortcutsToActivities();
final ArrayList<ShortcutInfo> activityShortcuts = all.get(newShortcut.getActivity());
if (activityShortcuts != null && activityShortcuts.size() > maxShortcuts) {
// Root cause was discovered in b/233155034, so this should not be happening.
service.wtf("Error pushing shortcut. There are already "
+ activityShortcuts.size() + " shortcuts.");
}
if (activityShortcuts != null && activityShortcuts.size() == maxShortcuts) {
// Max has reached. Delete the shortcut with lowest rank.
// Sort by isManifestShortcut() and getRank().
Collections.sort(activityShortcuts, mShortcutTypeAndRankComparator);
final ShortcutInfo shortcut = activityShortcuts.get(maxShortcuts - 1);
if (shortcut.isManifestShortcut()) {
// All shortcuts are manifest shortcuts and cannot be removed.
Slog.e(TAG, "Failed to remove manifest shortcut while pushing dynamic shortcut "
+ newShortcut.getId());
return true; // poppedShortcuts is empty which indicates a failure.
}
changedShortcuts.add(shortcut);
deleted = deleteDynamicWithId(shortcut.getId(), /* ignoreInvisible =*/ true,
/*ignorePersistedShortcuts=*/ true) != null;
}
}
if (oldShortcut != null) {
// It's an update case.
// Make sure the target is updatable. (i.e. should be mutable.)
oldShortcut.ensureUpdatableWith(newShortcut, /*isUpdating=*/ false);
// If it was originally pinned or cached, the new one should be pinned or cached too.
newShortcut.addFlags(oldShortcut.getFlags()
& (ShortcutInfo.FLAG_PINNED | ShortcutInfo.FLAG_CACHED_ALL));
}
if (newShortcut.isExcludedFromSurfaces(ShortcutInfo.SURFACE_LAUNCHER)) {
if (isAppSearchEnabled()) {
synchronized (mLock) {
mTransientShortcuts.put(newShortcut.getId(), newShortcut);
}
}
} else {
forceReplaceShortcutInner(newShortcut);
}
if (isAppSearchEnabled()) {
runAsSystem(() -> fromAppSearch().thenAccept(session ->
session.reportUsage(new ReportUsageRequest.Builder(
getPackageName(), newShortcut.getId()).build(), mExecutor, result -> {
if (!result.isSuccess()) {
Slog.e(TAG, "Failed to report usage via AppSearch. "
+ result.getErrorMessage());
}
})));
}
return deleted;
}
|
[
"CWE-Other"
] |
CVE-2023-40075
|
MEDIUM
| 5.5
|
android
|
pushDynamicShortcut
|
services/core/java/com/android/server/pm/ShortcutPackage.java
|
ae768fbb9975fdab267f525831cb52f485ab0ecc
| 1
|
Analyze the following code function for security vulnerabilities
|
public ApiClient setConnectTimeout(int connectionTimeout) {
this.connectionTimeout = connectionTimeout;
httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setConnectTimeout
File: samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
setConnectTimeout
|
samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Route.AssetDefinition assets(final String path, final AssetHandler handler) {
Route.AssetDefinition route = appendDefinition(GET, path, handler, Route.AssetDefinition::new);
return configureAssetHandler(route);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: assets
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
|
assets
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected DeviceStateCache getDeviceStateCache() {
return mStateCache;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDeviceStateCache
File: services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2023-21284
|
MEDIUM
| 5.5
|
android
|
getDeviceStateCache
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public DefaultJpaInstanceConfiguration volatilePersistence(final boolean volatilePersistence) {
this.volatilePersistence = volatilePersistence;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: volatilePersistence
File: src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
Repository: KrailOrg/krail-jpa
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2016-15018
|
MEDIUM
| 5.2
|
KrailOrg/krail-jpa
|
volatilePersistence
|
src/main/java/uk/q3c/krail/jpa/persist/DefaultJpaInstanceConfiguration.java
|
c1e848665492e21ef6cc9be443205e36b9a1f6be
| 0
|
Analyze the following code function for security vulnerabilities
|
@VisibleForTesting
SparseArray<ShortcutUser> getShortcutsForTest() {
return mUsers;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getShortcutsForTest
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
|
getShortcutsForTest
|
services/core/java/com/android/server/pm/ShortcutService.java
|
96e0524c48c6e58af7d15a2caf35082186fc8de2
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isEnded(String ename) {
String content = new String(fCurrentEntity.buffer, fCurrentEntity.offset,
fCurrentEntity.length - fCurrentEntity.offset);
return content.toLowerCase().indexOf("</" + ename.toLowerCase() + ">") != -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isEnded
File: src/org/cyberneko/html/HTMLScanner.java
Repository: sparklemotion/nekohtml
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2022-24839
|
MEDIUM
| 5
|
sparklemotion/nekohtml
|
isEnded
|
src/org/cyberneko/html/HTMLScanner.java
|
a800fce3b079def130ed42a408ff1d09f89e773d
| 0
|
Analyze the following code function for security vulnerabilities
|
private native void nativeRequestRestoreLoad(long nativeContentViewCoreImpl);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeRequestRestoreLoad
File: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2014-3159
|
MEDIUM
| 6.4
|
chromium
|
nativeRequestRestoreLoad
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
@PermissionCheckerManager.PermissionResult
private static int checkPermission(@NonNull Context context,
@NonNull PermissionManagerServiceInternal permissionManagerServiceInt,
@NonNull String permission, @NonNull AttributionSource attributionSource,
@Nullable String message, boolean forDataDelivery, boolean startDataDelivery,
boolean fromDatasource, int attributedOp) {
PermissionInfo permissionInfo = sPlatformPermissions.get(permission);
if (permissionInfo == null) {
try {
permissionInfo = context.getPackageManager().getPermissionInfo(permission, 0);
if (PLATFORM_PACKAGE_NAME.equals(permissionInfo.packageName)) {
// Double addition due to concurrency is fine - the backing
// store is concurrent.
sPlatformPermissions.put(permission, permissionInfo);
}
} catch (PackageManager.NameNotFoundException ignored) {
return PermissionChecker.PERMISSION_HARD_DENIED;
}
}
if (permissionInfo.isAppOp()) {
return checkAppOpPermission(context, permissionManagerServiceInt, permission,
attributionSource, message, forDataDelivery, fromDatasource);
}
if (permissionInfo.isRuntime()) {
return checkRuntimePermission(context, permissionManagerServiceInt, permission,
attributionSource, message, forDataDelivery, startDataDelivery,
fromDatasource, attributedOp);
}
if (!fromDatasource && !checkPermission(context, permissionManagerServiceInt,
permission, attributionSource.getUid(),
attributionSource.getRenouncedPermissions())) {
return PermissionChecker.PERMISSION_HARD_DENIED;
}
if (attributionSource.getNext() != null) {
return checkPermission(context, permissionManagerServiceInt, permission,
attributionSource.getNext(), message, forDataDelivery, startDataDelivery,
/*fromDatasource*/ false, attributedOp);
}
return PermissionChecker.PERMISSION_GRANTED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkPermission
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
checkPermission
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Object createCollection(Class type) {
return super.createCollection(this.type != null ? this.type : type);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createCollection
File: xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
Repository: x-stream/xstream
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2021-43859
|
MEDIUM
| 5
|
x-stream/xstream
|
createCollection
|
xstream/src/java/com/thoughtworks/xstream/converters/collections/MapConverter.java
|
e8e88621ba1c85ac3b8620337dd672e0c0c3a846
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds,
Rect tempDockedTaskInsetBounds,
Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds) {
enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "resizeDockedStack()");
long ident = Binder.clearCallingIdentity();
try {
synchronized (this) {
mStackSupervisor.resizeDockedStackLocked(dockedBounds, tempDockedTaskBounds,
tempDockedTaskInsetBounds, tempOtherTaskBounds, tempOtherTaskInsetBounds,
PRESERVE_WINDOWS);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resizeDockedStack
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
|
resizeDockedStack
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public int getPasswordMinimumSymbols(@Nullable ComponentName admin) {
return getPasswordMinimumSymbols(admin, myUserId());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordMinimumSymbols
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
|
getPasswordMinimumSymbols
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static final boolean shouldShowDialogs(Configuration config, boolean inVrMode) {
final boolean inputMethodExists = !(config.keyboard == Configuration.KEYBOARD_NOKEYS
&& config.touchscreen == Configuration.TOUCHSCREEN_NOTOUCH
&& config.navigation == Configuration.NAVIGATION_NONAV);
final boolean uiIsNotCarType = !((config.uiMode & Configuration.UI_MODE_TYPE_MASK)
== Configuration.UI_MODE_TYPE_CAR);
return inputMethodExists && uiIsNotCarType && !inVrMode;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldShowDialogs
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3912
|
HIGH
| 9.3
|
android
|
shouldShowDialogs
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
6c049120c2d749f0c0289d822ec7d0aa692f55c5
| 0
|
Analyze the following code function for security vulnerabilities
|
public static @Nullable Object[] deepCopyOf(@Nullable Object[] args) {
if (args == null) return null;
final Object[] res = new Object[args.length];
for (int i = 0; i < args.length; i++) {
final Object arg = args[i];
if ((arg == null) || (arg instanceof Number) || (arg instanceof String)) {
// When the argument is immutable, we can copy by reference
res[i] = arg;
} else if (arg instanceof byte[]) {
// Need to deep copy blobs
final byte[] castArg = (byte[]) arg;
res[i] = Arrays.copyOf(castArg, castArg.length);
} else {
// Convert everything else to string, making it immutable
res[i] = String.valueOf(arg);
}
}
return res;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deepCopyOf
File: core/java/android/database/DatabaseUtils.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2023-40121
|
MEDIUM
| 5.5
|
android
|
deepCopyOf
|
core/java/android/database/DatabaseUtils.java
|
3287ac2d2565dc96bf6177967f8e3aed33954253
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void lockXmlGenerator(XmlGenerator gen, Config config) {
for (LockConfig c : config.getLockConfigs().values()) {
gen.open("lock", "name", c.getName())
.node("quorum-ref", c.getQuorumName())
.close();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: lockXmlGenerator
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
|
lockXmlGenerator
|
hazelcast/src/main/java/com/hazelcast/config/ConfigXmlGenerator.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Map<String, ProtocolMapperModel> getBuiltinMappers() {
return builtins;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBuiltinMappers
File: services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2021-3827
|
MEDIUM
| 6.8
|
keycloak
|
getBuiltinMappers
|
services/src/main/java/org/keycloak/protocol/saml/SamlProtocolFactory.java
|
44000caaf5051d7f218d1ad79573bd3d175cad0d
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isImmersive(IBinder token) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isImmersive
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
isImmersive
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean isSameNode(Node other) {
return doc.isSameNode(other);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSameNode
File: HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
Repository: LoboEvolution
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2018-1000540
|
MEDIUM
| 6.8
|
LoboEvolution
|
isSameNode
|
HTML_Renderer/src/main/java/org/loboevolution/html/js/xml/XMLDocument.java
|
9b75694cedfa4825d4a2330abf2719d470c654cd
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override // NotificationData.Environment
public boolean shouldHideNotifications(int userId) {
return isLockscreenPublicMode(userId) && !userAllowsNotificationsInPublic(userId)
|| (userId != mCurrentUserId && shouldHideNotifications(mCurrentUserId));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: shouldHideNotifications
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
shouldHideNotifications
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getDockerExecutable() {
return super.getDockerExecutable();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDockerExecutable
File: server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java
Repository: theonedev/onedev
The code follows secure coding practices.
|
[
"CWE-610"
] |
CVE-2022-39206
|
CRITICAL
| 9.9
|
theonedev/onedev
|
getDockerExecutable
|
server-plugin/server-plugin-executor-remotedocker/src/main/java/io/onedev/server/plugin/executor/remotedocker/RemoteDockerExecutor.java
|
0052047a5b5095ac6a6b4a73a522d0272fec3a22
| 0
|
Analyze the following code function for security vulnerabilities
|
private Configuration computeNewConfigurationLocked() {
if (!mDisplayReady) {
return null;
}
Configuration config = new Configuration();
config.fontScale = 0;
computeScreenConfigurationLocked(config);
return config;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: computeNewConfigurationLocked
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
|
computeNewConfigurationLocked
|
services/core/java/com/android/server/wm/WindowManagerService.java
|
69729fa8b13cadbf3173fe1f389fe4f3b7bd0f9c
| 0
|
Analyze the following code function for security vulnerabilities
|
public void removeProfile(ProfileService profile) {
synchronized (mProfiles) {
mProfiles.remove(profile);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeProfile
File: src/com/android/bluetooth/btservice/AdapterService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-362",
"CWE-20"
] |
CVE-2016-3760
|
MEDIUM
| 5.4
|
android
|
removeProfile
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (thingTypeUID.equals(THING_COMMAND)) {
return new ExecHandler(thing);
}
return null;
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2020-5242
- Severity: HIGH
- CVSS Score: 9.3
Description: Merge pull request from GHSA-w698-693g-23hv
* fix arbitrary code execution vulnerability
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* Update bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java
Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
* address review comments
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Co-authored-by: Christoph Weitkamp <github@christophweitkamp.de>
Function: createHandler
File: bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java
Repository: openhab/openhab-addons
Fixed Code:
@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
ThingTypeUID thingTypeUID = thing.getThingTypeUID();
if (thingTypeUID.equals(THING_COMMAND)) {
return new ExecHandler(thing, execWhitelistWatchService);
}
return null;
}
|
[
"CWE-863"
] |
CVE-2020-5242
|
HIGH
| 9.3
|
openhab/openhab-addons
|
createHandler
|
bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/ExecHandlerFactory.java
|
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public void removeRootTasksInWindowingModes(int[] windowingModes) {
enforceTaskPermission("removeRootTasksInWindowingModes()");
synchronized (mGlobalLock) {
final long ident = Binder.clearCallingIdentity();
try {
mRootWindowContainer.removeRootTasksInWindowingModes(windowingModes);
} finally {
Binder.restoreCallingIdentity(ident);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: removeRootTasksInWindowingModes
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
|
removeRootTasksInWindowingModes
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
public int getUidForIntentSender(IIntentSender sender) throws RemoteException;
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUidForIntentSender
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3832
|
HIGH
| 8.3
|
android
|
getUidForIntentSender
|
core/java/android/app/IActivityManager.java
|
e7cf91a198de995c7440b3b64352effd2e309906
| 0
|
Analyze the following code function for security vulnerabilities
|
private static int FFmulX2(int x)
{
int t0 = (x & m5) << 2;
int t1 = (x & m4);
t1 ^= (t1 >>> 1);
return t0 ^ (t1 >>> 2) ^ (t1 >>> 5);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: FFmulX2
File: core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
Repository: bcgit/bc-java
The code follows secure coding practices.
|
[
"CWE-310"
] |
CVE-2016-1000339
|
MEDIUM
| 5
|
bcgit/bc-java
|
FFmulX2
|
core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java
|
413b42f4d770456508585c830cfcde95f9b0e93b
| 0
|
Analyze the following code function for security vulnerabilities
|
void setSSL(boolean b) {
ssl = b;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSSL
File: h2/src/main/org/h2/server/web/WebServer.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
setSSL
|
h2/src/main/org/h2/server/web/WebServer.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
public float getScaleOnUiThread(final AwContents awContents) throws Exception {
return runTestOnUiThreadAndGetResult(new Callable<Float>() {
@Override
public Float call() throws Exception {
return awContents.getPageScaleFactor();
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getScaleOnUiThread
File: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
Repository: chromium
The code follows secure coding practices.
|
[
"CWE-254"
] |
CVE-2016-5155
|
MEDIUM
| 4.3
|
chromium
|
getScaleOnUiThread
|
android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
|
b8dcfeb065bbfd777cdc5f5433da9a87f25e6ec6
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void redirectToChangeRequest(ChangeRequest changeRequest, String action) throws IOException
{
XWikiContext context = this.contextProvider.get();
DocumentReference changeRequestDocumentReference =
this.changeRequestDocumentReferenceResolver.resolve(changeRequest);
String url = context.getWiki().getURL(changeRequestDocumentReference, action, context);
context.getResponse().sendRedirect(url);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: redirectToChangeRequest
File: application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java
Repository: xwiki-contrib/application-changerequest
The code follows secure coding practices.
|
[
"CWE-522"
] |
CVE-2023-49280
|
MEDIUM
| 6.5
|
xwiki-contrib/application-changerequest
|
redirectToChangeRequest
|
application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/handlers/AbstractChangeRequestActionHandler.java
|
ff0f5368ea04f0e4aa7b33821c707dc68a8c5ca8
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Server createPgServer(String... args) throws SQLException {
return new Server(new PgServer(), args);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createPgServer
File: h2/src/main/org/h2/tools/Server.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
createPgServer
|
h2/src/main/org/h2/tools/Server.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private void updateEmptyShadeView() {
// Hide "No notifications" in QS.
mNotificationStackScroller.updateEmptyShadeView(mShowEmptyShadeView && !mQsExpanded);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateEmptyShadeView
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
|
updateEmptyShadeView
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void detachNavigationBarFromApp(@NonNull IBinder transition) {
mAmInternal.enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS,
"detachNavigationBarFromApp");
final long token = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
getTransitionController().legacyDetachNavigationBarFromApp(transition);
}
} finally {
Binder.restoreCallingIdentity(token);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: detachNavigationBarFromApp
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
|
detachNavigationBarFromApp
|
services/core/java/com/android/server/wm/ActivityTaskManagerService.java
|
1120bc7e511710b1b774adf29ba47106292365e7
| 0
|
Analyze the following code function for security vulnerabilities
|
protected abstract String getExtensionClassName();
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getExtensionClassName
File: xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-29206
|
MEDIUM
| 5.4
|
xwiki/xwiki-platform
|
getExtensionClassName
|
xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/src/main/java/com/xpn/xwiki/plugin/skinx/AbstractDocumentSkinExtensionPlugin.java
|
fe65bc35d5672dd2505b7ac4ec42aec57d500fbb
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unchecked")
public <T> T toBean(Class<T> beanClass) {
setTag(new Tag(beanClass));
if (getVersion() != null) {
try {
MigrationHelper.migrate(getVersion(), beanClass.newInstance(), this);
removeVersion();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
return (T) new OneYaml().construct(this);
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2021-21249
- Severity: MEDIUM
- CVSS Score: 6.5
Description: Fix security vulnerability issue caused by SnakeYaml deserialization
Function: toBean
File: server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
Repository: theonedev/onedev
Fixed Code:
@SuppressWarnings("unchecked")
public <T> T toBean(Class<T> beanClass) {
setTag(new Tag(beanClass));
if (getVersion() != null) {
try {
MigrationHelper.migrate(getVersion(), beanClass.newInstance(), this);
removeVersion();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
return (T) new OneYaml().construct(this);
}
|
[
"CWE-502"
] |
CVE-2021-21249
|
MEDIUM
| 6.5
|
theonedev/onedev
|
toBean
|
server-core/src/main/java/io/onedev/server/migration/VersionedYamlDoc.java
|
d6fc4212b1ac1e9bbe3ce444e95f9af1e3ab8b66
| 1
|
Analyze the following code function for security vulnerabilities
|
public String getNaiForSubscriber(int subId) {
PhoneSubInfoProxy phoneSubInfoProxy = getPhoneSubInfoProxy(subId);
if (phoneSubInfoProxy != null) {
return phoneSubInfoProxy.getNai();
} else {
Rlog.e(TAG,"getNai phoneSubInfoProxy is null" +
" for Subscription:" + subId);
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNaiForSubscriber
File: src/java/com/android/internal/telephony/PhoneSubInfoController.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-0831
|
MEDIUM
| 4.3
|
android
|
getNaiForSubscriber
|
src/java/com/android/internal/telephony/PhoneSubInfoController.java
|
79eecef63f3ea99688333c19e22813f54d4a31b1
| 0
|
Analyze the following code function for security vulnerabilities
|
public void uploadFile(String uploadKey) {
mCurrentUpload = mPendingUploads.get(uploadKey);
if (mCurrentUpload != null) {
/// Check account existence
if (!accountManager.exists(mCurrentUpload.getUser().toPlatformAccount())) {
Log_OC.w(TAG, "Account " + mCurrentUpload.getUser().getAccountName() +
" does not exist anymore -> cancelling all its uploads");
cancelPendingUploads(mCurrentUpload.getUser().getAccountName());
return;
}
/// OK, let's upload
mUploadsStorageManager.updateDatabaseUploadStart(mCurrentUpload);
notifyUploadStart(mCurrentUpload);
sendBroadcastUploadStarted(mCurrentUpload);
RemoteOperationResult uploadResult = null;
try {
/// prepare client object to send the request to the ownCloud server
if (mCurrentAccount == null || !mCurrentAccount.equals(mCurrentUpload.getUser().toPlatformAccount())) {
mCurrentAccount = mCurrentUpload.getUser().toPlatformAccount();
mStorageManager = new FileDataStorageManager(getCurrentUser().get(), getContentResolver());
} // else, reuse storage manager from previous operation
// always get client from client manager, to get fresh credentials in case of update
OwnCloudAccount ocAccount = new OwnCloudAccount(mCurrentAccount, this);
mUploadClient = OwnCloudClientManagerFactory.getDefaultSingleton().getClientFor(ocAccount, this);
uploadResult = mCurrentUpload.execute(mUploadClient);
} catch (Exception e) {
Log_OC.e(TAG, "Error uploading", e);
uploadResult = new RemoteOperationResult(e);
} finally {
Pair<UploadFileOperation, String> removeResult;
if (mCurrentUpload.wasRenamed()) {
removeResult = mPendingUploads.removePayload(
mCurrentAccount.name,
mCurrentUpload.getOldFile().getRemotePath()
);
// TODO: grant that name is also updated for mCurrentUpload.getOCUploadId
} else {
removeResult = mPendingUploads.removePayload(mCurrentAccount.name,
mCurrentUpload.getDecryptedRemotePath());
}
mUploadsStorageManager.updateDatabaseUploadResult(uploadResult, mCurrentUpload);
/// notify result
notifyUploadResult(mCurrentUpload, uploadResult);
sendBroadcastUploadFinished(mCurrentUpload, uploadResult, removeResult.second);
}
// generate new Thumbnail
Optional<User> user = getCurrentUser();
if (user.isPresent()) {
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, user.get());
File file = new File(mCurrentUpload.getOriginalStoragePath());
String remoteId = mCurrentUpload.getFile().getRemoteId();
task.execute(new ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId));
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: uploadFile
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
|
uploadFile
|
app/src/main/java/com/owncloud/android/files/services/FileUploader.java
|
cd3bd0845a97e1d43daa0607a122b66b0068c751
| 0
|
Analyze the following code function for security vulnerabilities
|
int getTouchOcclusionMode() {
if (WindowManager.LayoutParams.isSystemAlertWindowType(mAttrs.type)) {
return TouchOcclusionMode.USE_OPACITY;
}
if (isAnimating(PARENTS | TRANSITION, ANIMATION_TYPE_ALL) || inTransition()) {
return TouchOcclusionMode.USE_OPACITY;
}
return TouchOcclusionMode.BLOCK_UNTRUSTED;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTouchOcclusionMode
File: services/core/java/com/android/server/wm/WindowState.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-35674
|
HIGH
| 7.8
|
android
|
getTouchOcclusionMode
|
services/core/java/com/android/server/wm/WindowState.java
|
7428962d3b064ce1122809d87af65099d1129c9e
| 0
|
Analyze the following code function for security vulnerabilities
|
public static int getMinSdkVersionFromWhichSupportedInManifestOrSignatureFile(
String jcaAlgorithmName) {
Integer result =
MIN_SDK_VESION_FROM_WHICH_DIGEST_SUPPORTED_IN_MANIFEST.get(
jcaAlgorithmName.toUpperCase(Locale.US));
return (result != null) ? result : Integer.MAX_VALUE;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinSdkVersionFromWhichSupportedInManifestOrSignatureFile
File: src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
getMinSdkVersionFromWhichSupportedInManifestOrSignatureFile
|
src/main/java/com/android/apksig/internal/apk/v1/V1SchemeVerifier.java
|
41d882324288085fd32ae0bb70dc85f5fd0e2be7
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.