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 List<DocumentReference> getChildrenReferences() throws XWikiException
{
return this.doc.getChildrenReferences(getXWikiContext());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getChildrenReferences
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-648"
] | CVE-2023-29507 | HIGH | 7.2 | xwiki/xwiki-platform | getChildrenReferences | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java | 905cdd7c421dbf8c565557cdc773ab1aa9028f83 | 0 |
Analyze the following code function for security vulnerabilities | private void verifyJars(List<JARDesc> jars, ResourceTracker tracker)
throws Exception {
for (JARDesc jar : jars) {
try {
File jarFile = tracker.getCacheFile(jar.getLocation());
// some sort of resource download/cache error. Nothing to add
// in that case ... but don't fail here
if (jarFile == null) {
continue;
}
String localFile = jarFile.getAbsolutePath();
if (verifiedJars.contains(localFile)
|| unverifiedJars.contains(localFile)) {
continue;
}
VerifyResult result = verifyJar(localFile);
if (result == VerifyResult.UNSIGNED) {
unverifiedJars.add(localFile);
} else if (result == VerifyResult.SIGNED_NOT_OK) {
verifiedJars.add(localFile);
} else if (result == VerifyResult.SIGNED_OK) {
verifiedJars.add(localFile);
}
} catch (Exception e) {
// We may catch exceptions from using verifyJar()
// or from checkTrustedCerts
throw e;
}
}
for (CertPath certPath : certs.keySet())
checkTrustedCerts(certPath);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: verifyJars
File: core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.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 | verifyJars | core/src/main/java/net/sourceforge/jnlp/tools/JarCertVerifier.java | 2fd1e4b769911f2c6f7f3902f7ea21568ddc2f99 | 0 |
Analyze the following code function for security vulnerabilities | public ScenarioEnv getApiScenarioProjectId(String id) {
ApiScenarioWithBLOBs scenario = apiScenarioMapper.selectByPrimaryKey(id);
ScenarioEnv scenarioEnv = new ScenarioEnv();
if (scenario == null) {
return scenarioEnv;
}
String definition = scenario.getScenarioDefinition();
if (StringUtils.isBlank(definition)) {
return scenarioEnv;
}
scenarioEnv = apiScenarioEnvService.getApiScenarioEnv(definition);
scenarioEnv.getProjectIds().remove(null);
scenarioEnv.getProjectIds().add(scenario.getProjectId());
return scenarioEnv;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getApiScenarioProjectId
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 | getApiScenarioProjectId | backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java | d74e02cdff47cdf7524d305d098db6ffb7f61b47 | 0 |
Analyze the following code function for security vulnerabilities | final void trimApplicationsLocked() {
// First remove any unused application processes whose package
// has been removed.
for (int i=mRemovedProcesses.size()-1; i>=0; i--) {
final ProcessRecord app = mRemovedProcesses.get(i);
if (app.activities.size() == 0 && app.recentTasks.size() == 0
&& app.curReceivers.isEmpty() && app.services.size() == 0) {
Slog.i(
TAG, "Exiting empty application process "
+ app.toShortString() + " ("
+ (app.thread != null ? app.thread.asBinder() : null)
+ ")\n");
if (app.pid > 0 && app.pid != MY_PID) {
app.kill("empty", false);
} else if (app.thread != null) {
try {
app.thread.scheduleExit();
} catch (Exception e) {
// Ignore exceptions.
}
}
cleanUpApplicationRecordLocked(app, false, true, -1, false /*replacingPid*/);
mRemovedProcesses.remove(i);
if (app.persistent) {
addAppLocked(app.info, null, false, null /* ABI override */);
}
}
}
// Now update the oom adj for all processes. Don't skip this, since other callers
// might be depending on it.
updateOomAdjLocked();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: trimApplicationsLocked
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 | trimApplicationsLocked | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | public String formatDate(Date date) {
return dateFormat.format(date);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: formatDate
File: samples/client/petstore/java/jersey2-java8-localdatetime/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 | formatDate | samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/ApiClient.java | 2c576483f26f85b3979c6948a131f585c237109a | 0 |
Analyze the following code function for security vulnerabilities | protected Double _checkDoubleSpecialValue(String text)
{
if (!text.isEmpty()) {
switch (text.charAt(0)) {
case 'I':
if (_isPosInf(text)) {
return Double.POSITIVE_INFINITY;
}
break;
case 'N':
if (_isNaN(text)) {
return Double.NaN;
}
break;
case '-':
if (_isNegInf(text)) {
return Double.NEGATIVE_INFINITY;
}
break;
default:
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _checkDoubleSpecialValue
File: src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
Repository: FasterXML/jackson-databind
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2022-42003 | HIGH | 7.5 | FasterXML/jackson-databind | _checkDoubleSpecialValue | src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java | d78d00ee7b5245b93103fef3187f70543d67ca33 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setCrossProfilePackages(ComponentName who, List<String> packageNames) {
if (!mHasFeature) {
return;
}
Objects.requireNonNull(who, "ComponentName is null");
Objects.requireNonNull(packageNames, "Package names is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(isProfileOwner(caller));
final List<String> previousCrossProfilePackages;
synchronized (getLockObject()) {
final ActiveAdmin admin = getProfileOwnerLocked(caller.getUserId());
previousCrossProfilePackages = admin.mCrossProfilePackages;
if (packageNames.equals(previousCrossProfilePackages)) {
return;
}
admin.mCrossProfilePackages = packageNames;
saveSettingsLocked(caller.getUserId());
}
logSetCrossProfilePackages(who, packageNames);
final CrossProfileApps crossProfileApps =
mContext.createContextAsUser(
caller.getUserHandle(), /* flags= */ 0)
.getSystemService(CrossProfileApps.class);
mInjector.binderWithCleanCallingIdentity(
() -> crossProfileApps.resetInteractAcrossProfilesAppOps(
previousCrossProfilePackages, new HashSet<>(packageNames)));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setCrossProfilePackages
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 | setCrossProfilePackages | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | public Context getContext() {
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getContext
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 | getContext | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | private static void handleException(String msg, Throwable t) throws APIManagementException {
log.error(msg, t);
throw new APIManagementException(msg, t);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleException
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2018-20736 | LOW | 3.5 | wso2/carbon-apimgt | handleException | components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java | 490f2860822f89d745b7c04fa9570bd86bef4236 | 0 |
Analyze the following code function for security vulnerabilities | @Beta
public static MappedByteBuffer map(File file, MapMode mode, long size) throws IOException {
checkArgument(size >= 0, "size (%s) may not be negative", size);
return mapInternal(file, mode, size);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: map
File: guava/src/com/google/common/io/Files.java
Repository: google/guava
The code follows secure coding practices. | [
"CWE-732"
] | CVE-2020-8908 | LOW | 2.1 | google/guava | map | guava/src/com/google/common/io/Files.java | fec0dbc4634006a6162cfd4d0d09c962073ddf40 | 0 |
Analyze the following code function for security vulnerabilities | private void validateDurationField(Errors errors, AppointmentType appointmentType) {
ValidationUtils.rejectIfEmpty(errors, "duration", "appointmentscheduling.AppointmentType.durationEmpty");
if (appointmentType.getDuration() == null || appointmentType.getDuration() <= 0) {
errors.rejectValue("duration", "appointmentscheduling.AppointmentType.duration.errorMessage");
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateDurationField
File: api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java
Repository: openmrs/openmrs-module-appointmentscheduling
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2020-36635 | MEDIUM | 5.4 | openmrs/openmrs-module-appointmentscheduling | validateDurationField | api/src/main/java/org/openmrs/module/appointmentscheduling/validator/AppointmentTypeValidator.java | 34213c3f6ea22df427573076fb62744694f601d8 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void setSecureSetting(ComponentName who, String setting, String value) {
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(
isProfileOwner(caller) || isDefaultDeviceOwner(caller));
int callingUserId = caller.getUserId();
synchronized (getLockObject()) {
if (isDeviceOwner(who, callingUserId)) {
if (!SECURE_SETTINGS_DEVICEOWNER_ALLOWLIST.contains(setting)
&& !isCurrentUserDemo()) {
throw new SecurityException(String.format(
"Permission denial: Device owners cannot update %1$s", setting));
}
} else if (!SECURE_SETTINGS_ALLOWLIST.contains(setting) && !isCurrentUserDemo()) {
throw new SecurityException(String.format(
"Permission denial: Profile owners cannot update %1$s", setting));
}
if (setting.equals(Settings.Secure.LOCATION_MODE)
&& isSetSecureSettingLocationModeCheckEnabled(who.getPackageName(),
callingUserId)) {
throw new UnsupportedOperationException(Settings.Secure.LOCATION_MODE + " is "
+ "deprecated. Please use setLocationEnabled() instead.");
}
if (setting.equals(Settings.Secure.INSTALL_NON_MARKET_APPS)) {
if (getTargetSdk(who.getPackageName(), callingUserId) >= Build.VERSION_CODES.O) {
throw new UnsupportedOperationException(Settings.Secure.INSTALL_NON_MARKET_APPS
+ " is deprecated. Please use one of the user restrictions "
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES + " or "
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY + " instead.");
}
if (!mUserManager.isManagedProfile(callingUserId)) {
Slogf.e(LOG_TAG, "Ignoring setSecureSetting request for "
+ setting + ". User restriction "
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES + " or "
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY
+ " should be used instead.");
} else {
try {
setUserRestriction(who, UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
(Integer.parseInt(value) == 0) ? true : false, /* parent */ false);
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_SECURE_SETTING)
.setAdmin(who)
.setStrings(setting, value)
.write();
} catch (NumberFormatException exc) {
Slogf.e(LOG_TAG, "Invalid value: " + value + " for setting " + setting);
}
}
return;
}
mInjector.binderWithCleanCallingIdentity(() -> {
if (Settings.Secure.DEFAULT_INPUT_METHOD.equals(setting)) {
final String currentValue = mInjector.settingsSecureGetStringForUser(
Settings.Secure.DEFAULT_INPUT_METHOD, callingUserId);
if (!TextUtils.equals(currentValue, value)) {
// Tell the content observer that the next change will be due to the owner
// changing the value. There is a small race condition here that we cannot
// avoid: Change notifications are sent asynchronously, so it is possible
// that there are prior notifications queued up before the one we are about
// to trigger. This is a corner case that will have no impact in practice.
mSetupContentObserver.addPendingChangeByOwnerLocked(callingUserId);
}
getUserData(callingUserId).mCurrentInputMethodSet = true;
saveSettingsLocked(callingUserId);
}
mInjector.settingsSecurePutStringForUser(setting, value, callingUserId);
// Notify the user if it's the location mode setting that's been set, to any value
// other than 'off'.
if (setting.equals(Settings.Secure.LOCATION_MODE)
&& (Integer.parseInt(value) != 0)) {
showLocationSettingsEnabledNotification(UserHandle.of(callingUserId));
}
});
}
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_SECURE_SETTING)
.setAdmin(who)
.setStrings(setting, value)
.write();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setSecureSetting
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 | setSecureSetting | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | private boolean canConvert(Object obj) {
return engine != null
&& obj != null
&& !(obj instanceof Class)
&& !(obj instanceof Map)
&& !simpleObject(obj)
&& !collectionObject(obj);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canConvert
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 | canConvert | console/src/main/java/org/jline/console/impl/DefaultPrinter.java | f3c60a3e6255e8e0c20d5043a4fe248446f292bb | 0 |
Analyze the following code function for security vulnerabilities | @NonNull
public BubbleMetadata.Builder setDesiredHeight(@Dimension(unit = DP) int height) {
mDesiredHeight = Math.max(height, 0);
mDesiredHeightResId = 0;
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setDesiredHeight
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | setDesiredHeight | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void onSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException {
super.onSuccessfulAuthentication(request,response,authResult);
// make sure we have a session to store this successful authentication, given that we no longer
// let HttpSessionContextIntegrationFilter2 to create sessions.
// HttpSessionContextIntegrationFilter stores the updated SecurityContext object into this session later
// (either when a redirect is issued, via its HttpResponseWrapper, or when the execution returns to its
// doFilter method.
request.getSession();
} | Vulnerability Classification:
- CWE: CWE-287
- CVE: CVE-2014-2066
- Severity: MEDIUM
- CVSS Score: 6.8
Description: [FIXED SECURITY-75] Invalidate session after login to avoid session fixation
Function: onSuccessfulAuthentication
File: core/src/main/java/hudson/security/AuthenticationProcessingFilter2.java
Repository: jenkinsci/jenkins
Fixed Code:
@Override
protected void onSuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, Authentication authResult) throws IOException {
super.onSuccessfulAuthentication(request,response,authResult);
// make sure we have a session to store this successful authentication, given that we no longer
// let HttpSessionContextIntegrationFilter2 to create sessions.
// HttpSessionContextIntegrationFilter stores the updated SecurityContext object into this session later
// (either when a redirect is issued, via its HttpResponseWrapper, or when the execution returns to its
// doFilter method.
request.getSession().invalidate();
request.getSession();
} | [
"CWE-287"
] | CVE-2014-2066 | MEDIUM | 6.8 | jenkinsci/jenkins | onSuccessfulAuthentication | core/src/main/java/hudson/security/AuthenticationProcessingFilter2.java | 8ac74c350779921598f9d5edfed39dd35de8842a | 1 |
Analyze the following code function for security vulnerabilities | @Override
public void setAuthenticated() {
this.authed = true;
encoder.setAuthenticated();
decoder.setAuthenticated();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setAuthenticated
File: src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Repository: hierynomus/sshj
The code follows secure coding practices. | [
"CWE-354"
] | CVE-2023-48795 | MEDIUM | 5.9 | hierynomus/sshj | setAuthenticated | src/main/java/net/schmizz/sshj/transport/TransportImpl.java | 94fcc960e0fb198ddec0f7efc53f95ac627fe083 | 0 |
Analyze the following code function for security vulnerabilities | public boolean isQuotedExecutableEnabled()
{
return quotedExecutableEnabled;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isQuotedExecutableEnabled
File: src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java
Repository: codehaus-plexus/plexus-utils
The code follows secure coding practices. | [
"CWE-78"
] | CVE-2017-1000487 | HIGH | 7.5 | codehaus-plexus/plexus-utils | isQuotedExecutableEnabled | src/main/java/org/codehaus/plexus/util/cli/shell/Shell.java | b38a1b3a4352303e4312b2bb601a0d7ec6e28f41 | 0 |
Analyze the following code function for security vulnerabilities | @Test
public void upsert5binary(TestContext context) {
String id = randomUuid();
byte [] witloof = "witloof".getBytes();
byte [] weld = "weld".getBytes();
PostgresClient postgresClient = createFooBinary(context);
postgresClient.upsert(FOO, id, new JsonArray().add(witloof), /* convertEntity */ false, context.asyncAssertSuccess(save -> {
context.assertEquals(id, save);
String fullTable = PostgresClient.convertToPsqlStandard(TENANT) + "." + FOO;
postgresClient.select("SELECT jsonb FROM " + fullTable, context.asyncAssertSuccess(select -> {
context.assertEquals(base64(witloof), select.getRows().get(0).getString("jsonb"), "select");
postgresClient.upsert(FOO, id, new JsonArray().add(weld), /* convertEntity */ false, context.asyncAssertSuccess(update -> {
context.assertEquals(id, update);
postgresClient.select("SELECT jsonb FROM " + fullTable, context.asyncAssertSuccess(select2 -> {
context.assertEquals(base64(weld), select2.getRows().get(0).getString("jsonb"), "select2");
}));
}));
}));
}));
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: upsert5binary
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.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 | upsert5binary | domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | public WearableExtender addAction(Action action) {
mActions.add(action);
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAction
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21288 | MEDIUM | 5.5 | android | addAction | core/java/android/app/Notification.java | 726247f4f53e8cc0746175265652fa415a123c0c | 0 |
Analyze the following code function for security vulnerabilities | boolean setName(String name) {
enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
"Need BLUETOOTH ADMIN permission");
return mAdapterProperties.setName(name);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setName
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 | setName | src/com/android/bluetooth/btservice/AdapterService.java | 122feb9a0b04290f55183ff2f0384c6c53756bd8 | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("resource")
protected byte[] _finishBytes(int len) throws IOException
{
// First, simple: non-chunked
if (len >= 0) {
if (len == 0) {
return NO_BYTES;
}
byte[] b = new byte[len];
if (_inputPtr >= _inputEnd) {
loadMoreGuaranteed();
}
int ptr = 0;
while (true) {
int toAdd = Math.min(len, _inputEnd - _inputPtr);
System.arraycopy(_inputBuffer, _inputPtr, b, ptr, toAdd);
_inputPtr += toAdd;
ptr += toAdd;
len -= toAdd;
if (len <= 0) {
return b;
}
loadMoreGuaranteed();
}
}
// or, if not, chunked...
ByteArrayBuilder bb = _getByteArrayBuilder();
while (true) {
if (_inputPtr >= _inputEnd) {
loadMoreGuaranteed();
}
int ch = _inputBuffer[_inputPtr++] & 0xFF;
if (ch == 0xFF) { // end marker
break;
}
// verify that type matches
int type = (ch >> 5);
if (type != CBORConstants.MAJOR_TYPE_BYTES) {
throw _constructError("Mismatched chunk in chunked content: expected "+CBORConstants.MAJOR_TYPE_BYTES
+" but encountered "+type);
}
len = _decodeExplicitLength(ch & 0x1F);
if (len < 0) {
throw _constructError("Illegal chunked-length indicator within chunked-length value (type "+CBORConstants.MAJOR_TYPE_BYTES+")");
}
while (len > 0) {
int avail = _inputEnd - _inputPtr;
if (_inputPtr >= _inputEnd) {
loadMoreGuaranteed();
avail = _inputEnd - _inputPtr;
}
int count = Math.min(avail, len);
bb.write(_inputBuffer, _inputPtr, count);
_inputPtr += count;
len -= count;
}
}
return bb.toByteArray();
} | Vulnerability Classification:
- CWE: CWE-770
- CVE: CVE-2020-28491
- Severity: MEDIUM
- CVSS Score: 5.0
Description: Fix eager allocation aspect of #186
Function: _finishBytes
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
Fixed Code:
@SuppressWarnings("resource")
protected byte[] _finishBytes(int len) throws IOException
{
// Chunked?
// First, simple: non-chunked
if (len <= 0) {
if (len == 0) {
return NO_BYTES;
}
return _finishChunkedBytes();
}
// Non-chunked, contiguous
if (len > LONGEST_NON_CHUNKED_BINARY) {
// [dataformats-binary#186]: avoid immediate allocation for longest
return _finishLongContiguousBytes(len);
}
final byte[] b = new byte[len];
final int expLen = len;
if (_inputPtr >= _inputEnd) {
if (!loadMore()) {
_reportIncompleteBinaryRead(expLen, 0);
}
}
int ptr = 0;
while (true) {
int toAdd = Math.min(len, _inputEnd - _inputPtr);
System.arraycopy(_inputBuffer, _inputPtr, b, ptr, toAdd);
_inputPtr += toAdd;
ptr += toAdd;
len -= toAdd;
if (len <= 0) {
return b;
}
if (!loadMore()) {
_reportIncompleteBinaryRead(expLen, ptr);
}
}
} | [
"CWE-770"
] | CVE-2020-28491 | MEDIUM | 5 | FasterXML/jackson-dataformats-binary | _finishBytes | cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java | de072d314af8f5f269c8abec6930652af67bc8e6 | 1 |
Analyze the following code function for security vulnerabilities | public static EventProxy createEventProxy() {
/*
* Rather than defaulting to localhost all the time, give an option in properties
*/
final String vaultHost = Vault.getProperty("opennms.rtc.event.proxy.host");
final String vaultPort = Vault.getProperty("opennms.rtc.event.proxy.port");
final String vaultTimeout = Vault.getProperty("opennms.rtc.event.proxy.timeout");
final String proxyHostName = vaultHost == null ? "127.0.0.1" : vaultHost;
final String proxyHostPort = vaultPort == null ? Integer.toString(TcpEventProxy.DEFAULT_PORT) : vaultPort;
final String proxyHostTimeout = vaultTimeout == null ? Integer.toString(TcpEventProxy.DEFAULT_TIMEOUT) : vaultTimeout;
InetAddress proxyAddr = null;
EventProxy proxy = null;
proxyAddr = InetAddressUtils.addr(proxyHostName);
if (proxyAddr == null) {
try {
proxy = new TcpEventProxy();
} catch (final UnknownHostException e) {
// XXX Ewwww! We should just let the first UnknownException bubble up.
throw new UndeclaredThrowableException(e);
}
} else {
proxy = new TcpEventProxy(new InetSocketAddress(proxyAddr, Integer.parseInt(proxyHostPort)), Integer.parseInt(proxyHostTimeout));
}
return proxy;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createEventProxy
File: opennms-web-api/src/main/java/org/opennms/web/api/Util.java
Repository: OpenNMS/opennms
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2023-0869 | MEDIUM | 6.1 | OpenNMS/opennms | createEventProxy | opennms-web-api/src/main/java/org/opennms/web/api/Util.java | 66b4ba96a18b9952f25a350bbccc2a7e206238d1 | 0 |
Analyze the following code function for security vulnerabilities | private String buildPrintMessage(final SAXParseException x) {
return this.message.format( new Object[]{x.getSystemId(), new Integer( x.getLineNumber() ), new Integer( x.getColumnNumber() ), x.getMessage()} );
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildPrintMessage
File: drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java
Repository: apache/incubator-kie-drools
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2014-8125 | HIGH | 7.5 | apache/incubator-kie-drools | buildPrintMessage | drools-core/src/main/java/org/drools/core/xml/ExtensibleXmlParser.java | c48464c3b246e6ef0d4cd0dbf67e83ccd532c6d3 | 0 |
Analyze the following code function for security vulnerabilities | @Deprecated(since = "9.10RC1")
public XWikiAttachment addAttachment(String fileName, InputStream content, XWikiContext context)
throws XWikiException, IOException
{
return setAttachment(fileName, content, context);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addAttachment
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-74"
] | CVE-2023-29523 | HIGH | 8.8 | xwiki/xwiki-platform | addAttachment | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | 0d547181389f7941e53291af940966413823f61c | 0 |
Analyze the following code function for security vulnerabilities | @Override
public CharSequence getOrganizationName(@NonNull ComponentName who) {
if (!mHasFeature) {
return null;
}
Objects.requireNonNull(who, "ComponentName is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallingUser(isManagedProfile(caller.getUserId()));
synchronized (getLockObject()) {
ActiveAdmin admin = getProfileOwnerOrDeviceOwnerLocked(caller);
return admin.organizationName;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrganizationName
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 | getOrganizationName | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | abstract public void savedMore(); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: savedMore
File: main/src/com/google/refine/importing/ImportingUtilities.java
Repository: OpenRefine
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2018-19859 | MEDIUM | 4 | OpenRefine | savedMore | main/src/com/google/refine/importing/ImportingUtilities.java | e243e73e4064de87a913946bd320fbbe246da656 | 0 |
Analyze the following code function for security vulnerabilities | public ISession getSessionBinder() {
return mSession;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionBinder
File: services/core/java/com/android/server/media/MediaSessionRecord.java
Repository: android
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-21280 | MEDIUM | 5.5 | android | getSessionBinder | services/core/java/com/android/server/media/MediaSessionRecord.java | 06e772e05514af4aa427641784c5eec39a892ed3 | 0 |
Analyze the following code function for security vulnerabilities | public boolean dumpHeap(String process, int userId, boolean managed,
String path, ParcelFileDescriptor fd) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeString(process);
data.writeInt(userId);
data.writeInt(managed ? 1 : 0);
data.writeString(path);
if (fd != null) {
data.writeInt(1);
fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
data.writeInt(0);
}
mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
reply.readException();
boolean res = reply.readInt() != 0;
reply.recycle();
data.recycle();
return res;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: dumpHeap
File: core/java/android/app/ActivityManagerNative.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | dumpHeap | core/java/android/app/ActivityManagerNative.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Analyze the following code function for security vulnerabilities | boolean containsShowWhenLockedWindow() {
// When we are relaunching, it is possible for us to be unfrozen before our previous
// windows have been added back. Using the cached value ensures that our previous
// showWhenLocked preference is honored until relaunching is complete.
if (isRelaunching()) {
return mLastContainsShowWhenLockedWindow;
}
for (int i = mChildren.size() - 1; i >= 0; i--) {
if ((mChildren.get(i).mAttrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
return true;
}
}
return false;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: containsShowWhenLockedWindow
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 | containsShowWhenLockedWindow | services/core/java/com/android/server/wm/ActivityRecord.java | 44aeef1b82ecf21187d4903c9e3666a118bdeaf3 | 0 |
Analyze the following code function for security vulnerabilities | public String getRealm() {
return realm;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRealm
File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | getRealm | base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | public static NativeObject jsFunction_getAllPaginatedAPIs(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
throws ScriptException, APIManagementException {
APIConsumer apiConsumer = getAPIConsumer(thisObj);
String tenantDomain;
boolean retuenAPItags = false;
String state = null;
Boolean displayAPIsWithMultipleStatus = APIUtil.isAllowDisplayAPIsWithMultipleStatus();
if (args[0] != null) {
tenantDomain = (String) args[0];
} else {
tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
}
int start = Integer.parseInt((String) args[1]);
int end = Integer.parseInt((String) args[2]);
if (args.length > 3 && args[3] != null) {
retuenAPItags = Boolean.parseBoolean((String) args[3]);
}
if (args.length > 4 && args[4] != null) {
state = (String) args[4];
}
String [] statusList = {APIConstants.PUBLISHED, APIConstants.PROTOTYPED};
if (displayAPIsWithMultipleStatus) {
statusList = new String[]{APIConstants.PUBLISHED, APIConstants.PROTOTYPED, APIConstants.DEPRECATED};
}
// The following condition is used to support API category in store
if(null != state){
if(state == APIConstants.PUBLISHED && displayAPIsWithMultipleStatus) {
statusList = new String[]{APIConstants.PUBLISHED, APIConstants.DEPRECATED};
}else if(state == APIConstants.PUBLISHED ){
statusList = new String[]{APIConstants.PUBLISHED};
}else if(state == APIConstants.PROTOTYPED){
statusList = new String[]{APIConstants.PROTOTYPED};
}
}
return getPaginatedAPIsByStatus(apiConsumer, tenantDomain, start, end, statusList, retuenAPItags);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jsFunction_getAllPaginatedAPIs
File: components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java
Repository: wso2/carbon-apimgt
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2018-20736 | LOW | 3.5 | wso2/carbon-apimgt | jsFunction_getAllPaginatedAPIs | components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java | 490f2860822f89d745b7c04fa9570bd86bef4236 | 0 |
Analyze the following code function for security vulnerabilities | public static Collection<Descriptor> getSortedDescriptorsForGlobalConfigUnclassified() {
return getSortedDescriptorsForGlobalConfig(new Predicate<GlobalConfigurationCategory>() {
public boolean apply(GlobalConfigurationCategory cat) {
return cat instanceof GlobalConfigurationCategory.Unclassified;
}
});
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSortedDescriptorsForGlobalConfigUnclassified
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-310"
] | CVE-2014-2061 | MEDIUM | 5 | jenkinsci/jenkins | getSortedDescriptorsForGlobalConfigUnclassified | core/src/main/java/hudson/Functions.java | bf539198564a1108b7b71a973bf7de963a6213ef | 0 |
Analyze the following code function for security vulnerabilities | void setLastParentBeforePip(@Nullable ActivityRecord launchIntoPipHostActivity) {
mLastParentBeforePip = (launchIntoPipHostActivity == null)
? getTask()
: launchIntoPipHostActivity.getTask();
mLastParentBeforePip.mChildPipActivity = this;
mLaunchIntoPipHostActivity = launchIntoPipHostActivity;
final TaskFragment organizedTf = launchIntoPipHostActivity == null
? getOrganizedTaskFragment()
: launchIntoPipHostActivity.getOrganizedTaskFragment();
mLastTaskFragmentOrganizerBeforePip = organizedTf != null
? organizedTf.getTaskFragmentOrganizer()
: null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setLastParentBeforePip
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 | setLastParentBeforePip | services/core/java/com/android/server/wm/ActivityRecord.java | 44aeef1b82ecf21187d4903c9e3666a118bdeaf3 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((issuedBy == null) ? 0 : issuedBy.hashCode());
result = prime * result + ((issuedOn == null) ? 0 : issuedOn.hashCode());
result = prime * result + ((keyAlgorithmOID == null) ? 0 : keyAlgorithmOID.hashCode());
result = prime * result + ((keyLength == null) ? 0 : keyLength.hashCode());
result = prime * result + ((notValidAfter == null) ? 0 : notValidAfter.hashCode());
result = prime * result + ((notValidBefore == null) ? 0 : notValidBefore.hashCode());
result = prime * result + ((status == null) ? 0 : status.hashCode());
result = prime * result + ((subjectDN == null) ? 0 : subjectDN.hashCode());
result = prime * result + ((issuerDN == null) ? 0 : issuerDN.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
result = prime * result + ((version == null) ? 0 : version.hashCode());
result = prime * result + ((revokedOn == null) ? 0 : revokedOn.hashCode());
result = prime * result + ((revokedBy == null) ? 0 : revokedBy.hashCode());
return result;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hashCode
File: base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | hashCode | base/common/src/main/java/com/netscape/certsrv/cert/CertDataInfo.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | @WorkbenchPartTitle
public String getTitle() {
return constants.Details();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTitle
File: jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java
Repository: kiegroup/jbpm-wb
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2013-6465 | LOW | 3.5 | kiegroup/jbpm-wb | getTitle | jbpm-console-ng-human-tasks/jbpm-console-ng-human-tasks-client/src/main/java/org/jbpm/console/ng/ht/client/editors/taskdetailsmulti/TaskDetailsMultiPresenter.java | 4818204506e8e94645b52adb9426bedfa9ffdd04 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Intent getResolvedIntent() {
if (mSourceInfo != null) {
return mSourceInfo.getResolvedIntent();
}
return getTargetIntent();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getResolvedIntent
File: core/java/com/android/internal/app/ChooserActivity.java
Repository: android
The code follows secure coding practices. | [
"CWE-254",
"CWE-19"
] | CVE-2016-3752 | HIGH | 7.5 | android | getResolvedIntent | core/java/com/android/internal/app/ChooserActivity.java | ddbf2db5b946be8fdc45c7b0327bf560b2a06988 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Revision oldestRevision(Modifications modifications) {
return Modification.oldestRevision(modifications);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: oldestRevision
File: domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java
Repository: gocd
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2022-39309 | MEDIUM | 6.5 | gocd | oldestRevision | domain/src/main/java/com/thoughtworks/go/config/materials/ScmMaterial.java | 691b479f1310034992da141760e9c5d1f5b60e8a | 0 |
Analyze the following code function for security vulnerabilities | public Optional<String> name() {
return Optional.ofNullable(name);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: name
File: web/play-java-forms/src/main/java/play/data/Form.java
Repository: playframework
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2022-31018 | MEDIUM | 5 | playframework | name | web/play-java-forms/src/main/java/play/data/Form.java | 15393b736df939e35e275af2347155f296c684f2 | 0 |
Analyze the following code function for security vulnerabilities | public static <T> Query applyAndBind(String queryString, Iterable<T> entities, EntityManager entityManager) {
Assert.notNull(queryString);
Assert.notNull(entities);
Assert.notNull(entityManager);
Iterator<T> iterator = entities.iterator();
if (!iterator.hasNext()) {
return entityManager.createQuery(queryString);
}
String alias = detectAlias(queryString);
StringBuilder builder = new StringBuilder(queryString);
builder.append(" where");
int i = 0;
while (iterator.hasNext()) {
iterator.next();
builder.append(String.format(" %s = ?%d", alias, ++i));
if (iterator.hasNext()) {
builder.append(" or");
}
}
Query query = entityManager.createQuery(builder.toString());
iterator = entities.iterator();
i = 0;
while (iterator.hasNext()) {
query.setParameter(++i, iterator.next());
}
return query;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: applyAndBind
File: src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java
Repository: spring-projects/spring-data-jpa
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2016-6652 | MEDIUM | 6.8 | spring-projects/spring-data-jpa | applyAndBind | src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java | b8e7fe | 0 |
Analyze the following code function for security vulnerabilities | public static EditorType getEditorType(String contentType, EditorType def)
{
return getEditorType(ContentType.getByValue(contentType), def);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getEditorType
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-41046 | MEDIUM | 6.3 | xwiki/xwiki-platform | getEditorType | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/objects/classes/TextAreaClass.java | edc52579eeaab1b4514785c134044671a1ecd839 | 0 |
Analyze the following code function for security vulnerabilities | public GetMethod executeGet(Object resourceUri, Object... elements) throws Exception
{
return executeGet(resourceUri, Collections.<String, Object[]>emptyMap(), elements);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeGet
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 | executeGet | 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 int getMinY() {
return minY;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMinY
File: worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java
Repository: IntellectualSites/FastAsyncWorldEdit
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-35925 | MEDIUM | 5.5 | IntellectualSites/FastAsyncWorldEdit | getMinY | worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/implementation/SingleThreadQueueExtent.java | 3a8dfb4f7b858a439c35f7af1d56d21f796f61f5 | 0 |
Analyze the following code function for security vulnerabilities | private Set<DocumentReference> getUniqueLinkedPages10(XWikiContext context)
{
Set<DocumentReference> pageNames;
try {
List<String> list = context.getUtil().getUniqueMatches(getContent(), "\\[(.*?)\\]", 1);
pageNames = new HashSet<DocumentReference>(list.size());
DocumentReference currentDocumentReference = getDocumentReference();
for (String name : list) {
int i1 = name.indexOf('>');
if (i1 != -1) {
name = name.substring(i1 + 1);
}
i1 = name.indexOf(">");
if (i1 != -1) {
name = name.substring(i1 + 4);
}
i1 = name.indexOf('#');
if (i1 != -1) {
name = name.substring(0, i1);
}
i1 = name.indexOf('?');
if (i1 != -1) {
name = name.substring(0, i1);
}
// Let's get rid of anything that's not a real link
if (name.trim().equals("") || (name.indexOf('$') != -1) || (name.indexOf("://") != -1)
|| (name.indexOf('"') != -1) || (name.indexOf('\'') != -1) || (name.indexOf("..") != -1)
|| (name.indexOf(':') != -1) || (name.indexOf('=') != -1)) {
continue;
}
// generate the link
String newname = StringUtils.replace(Util.noaccents(name), " ", "");
// If it is a local link let's add the space
if (newname.indexOf('.') == -1) {
newname = getSpace() + "." + name;
}
if (context.getWiki().exists(newname, context)) {
name = newname;
} else {
// If it is a local link let's add the space
if (name.indexOf('.') == -1) {
name = getSpace() + "." + name;
}
}
// If the reference is empty, the link is an autolink
if (!StringUtils.isEmpty(name)) {
// The reference may not have the space or even document specified (in case of an empty
// string)
// Thus we need to find the fully qualified document name
DocumentReference documentReference = getCurrentDocumentReferenceResolver().resolve(name);
// Verify that the link is not an autolink (i.e. a link to the current document)
if (!documentReference.equals(currentDocumentReference)) {
pageNames.add(documentReference);
}
}
}
return pageNames;
} catch (Exception e) {
// This should never happen
LOGGER.error("Failed to get linked documents", e);
return null;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUniqueLinkedPages10
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-26470 | HIGH | 7.5 | xwiki/xwiki-platform | getUniqueLinkedPages10 | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | db3d1c62fc5fb59fefcda3b86065d2d362f55164 | 0 |
Analyze the following code function for security vulnerabilities | public Column setConverter(Converter<?, ?> converter)
throws IllegalArgumentException {
Class<?> modelType = getModelType();
if (converter != null) {
if (!converter.getModelType().isAssignableFrom(modelType)) {
throw new IllegalArgumentException(
"The converter model type "
+ converter.getModelType()
+ " is not compatible with the property type "
+ modelType + " (in " + toString() + ")");
} else if (!getRenderer().getPresentationType()
.isAssignableFrom(converter.getPresentationType())) {
throw new IllegalArgumentException(
"The converter presentation type "
+ converter.getPresentationType()
+ " is not compatible with the renderer presentation type "
+ getRenderer().getPresentationType()
+ " (in " + toString() + ")");
}
}
else {
/*
* Since the converter is null (i.e. will be removed), we need
* to know that the renderer and model are compatible. If not,
* we can't allow for this to happen.
*
* The constructor is allowed to call this method with null
* without any compatibility checks, therefore we have a special
* case for it.
*/
Class<?> rendererPresentationType = getRenderer()
.getPresentationType();
if (!isFirstConverterAssignment && !rendererPresentationType
.isAssignableFrom(modelType)) {
throw new IllegalArgumentException(
"Cannot remove converter, "
+ "as renderer's presentation type "
+ rendererPresentationType.getName()
+ " and column's " + "model "
+ modelType.getName() + " type aren't "
+ "directly compatible with each other (in "
+ toString() + ")");
}
}
isFirstConverterAssignment = false;
@SuppressWarnings("unchecked")
Converter<?, Object> castConverter = (Converter<?, Object>) converter;
this.converter = castConverter;
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setConverter
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2019-25028 | MEDIUM | 4.3 | vaadin/framework | setConverter | server/src/main/java/com/vaadin/ui/Grid.java | b9ba10adaa06a0977c531f878c3f0046b67f9cc0 | 0 |
Analyze the following code function for security vulnerabilities | @JsonProperty("ClassName")
public String getClassName() {
return className;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getClassName
File: base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | getClassName | base/common/src/main/java/com/netscape/certsrv/base/RESTMessage.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | @MediumTest
@Test
public void testAutoSpeakerphoneOutgoingBidirectional() throws Exception {
// Start an incoming video call.
IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA,
VideoProfile.STATE_BIDIRECTIONAL);
verifyAudioRoute(CallAudioState.ROUTE_SPEAKER);
} | Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21283
- Severity: MEDIUM
- CVSS Score: 5.5
Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634
Fixes: 285211549
Fixes: 280797684
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15)
Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Function: testAutoSpeakerphoneOutgoingBidirectional
File: tests/src/com/android/server/telecom/tests/VideoCallTests.java
Repository: android
Fixed Code:
@MediumTest
@Test
public void testAutoSpeakerphoneOutgoingBidirectional() throws Exception {
// Start an incoming video call.
IdPair ids = startAndMakeActiveOutgoingCall("650-555-1212",
mPhoneAccountA0.getAccountHandle(), mConnectionServiceFixtureA,
VideoProfile.STATE_BIDIRECTIONAL, null);
verifyAudioRoute(CallAudioState.ROUTE_SPEAKER);
} | [
"CWE-Other"
] | CVE-2023-21283 | MEDIUM | 5.5 | android | testAutoSpeakerphoneOutgoingBidirectional | tests/src/com/android/server/telecom/tests/VideoCallTests.java | 9b41a963f352fdb3da1da8c633d45280badfcb24 | 1 |
Analyze the following code function for security vulnerabilities | ProcessRecord handleApplicationWtfInner(int callingUid, int callingPid, IBinder app, String tag,
final ApplicationErrorReport.CrashInfo crashInfo) {
final ProcessRecord r = findAppProcess(app, "WTF");
final String processName = app == null ? "system_server"
: (r == null ? "unknown" : r.processName);
EventLog.writeEvent(EventLogTags.AM_WTF, UserHandle.getUserId(callingUid), callingPid,
processName, r == null ? -1 : r.info.flags, tag, crashInfo.exceptionMessage);
addErrorToDropBox("wtf", r, processName, null, null, tag, null, null, crashInfo);
return r;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: handleApplicationWtfInner
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 | handleApplicationWtfInner | services/core/java/com/android/server/am/ActivityManagerService.java | aaa0fee0d7a8da347a0c47cef5249c70efee209e | 0 |
Analyze the following code function for security vulnerabilities | @SystemApi
@RequiresPermission(anyOf = {
android.Manifest.permission.MANAGE_USERS,
android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS
})
public @Nullable String getProfileOwnerNameAsUser(int userId) throws IllegalArgumentException {
throwIfParentInstance("getProfileOwnerNameAsUser");
if (mService != null) {
try {
return mService.getProfileOwnerName(userId);
} catch (RemoteException re) {
throw re.rethrowFromSystemServer();
}
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getProfileOwnerNameAsUser
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 | getProfileOwnerNameAsUser | core/java/android/app/admin/DevicePolicyManager.java | e2e05f488da6abc765a62e7faf10cb74e729732e | 0 |
Analyze the following code function for security vulnerabilities | public Integer getMonthlyVotes() {
if (monthlyVotes < 0) {
monthlyVotes = 0;
}
return monthlyVotes;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMonthlyVotes
File: src/main/java/com/erudika/scoold/core/Profile.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getMonthlyVotes | src/main/java/com/erudika/scoold/core/Profile.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | public static String getDefaultAvatar() {
return CONF.imagesLink() + "/anon.svg";
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultAvatar
File: src/main/java/com/erudika/scoold/utils/ScooldUtils.java
Repository: Erudika/scoold
The code follows secure coding practices. | [
"CWE-130"
] | CVE-2022-1543 | MEDIUM | 6.5 | Erudika/scoold | getDefaultAvatar | src/main/java/com/erudika/scoold/utils/ScooldUtils.java | 62a0e92e1486ddc17676a7ead2c07ff653d167ce | 0 |
Analyze the following code function for security vulnerabilities | protected Intent getLockPasswordIntent(int quality, int minLength, int maxLength) {
ChooseLockPassword.IntentBuilder builder =
new ChooseLockPassword.IntentBuilder(getContext())
.setPasswordQuality(quality)
.setPasswordLengthRange(minLength, maxLength)
.setForFingerprint(mForFingerprint)
.setUserId(mUserId);
if (mHasChallenge) {
builder.setChallenge(mChallenge);
}
if (mUserPassword != null) {
builder.setPassword(mUserPassword);
}
return builder.build();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockPasswordIntent
File: src/com/android/settings/password/ChooseLockGeneric.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2018-9501 | HIGH | 7.2 | android | getLockPasswordIntent | src/com/android/settings/password/ChooseLockGeneric.java | 5e43341b8c7eddce88f79c9a5068362927c05b54 | 0 |
Analyze the following code function for security vulnerabilities | @Nullable
public BlobRenderContext getBlobRenderContext() {
return blobRenderContext;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getBlobRenderContext
File: server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java
Repository: theonedev/onedev
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2021-21242 | HIGH | 7.5 | theonedev/onedev | getBlobRenderContext | server-core/src/main/java/io/onedev/server/web/component/markdown/MarkdownEditor.java | f864053176c08f59ef2d97fea192ceca46a4d9be | 0 |
Analyze the following code function for security vulnerabilities | private String getGroupFromPermission(String permissionName) {
try {
PermissionInfo permInfo = getPackageManager().getPermissionInfo(
permissionName, 0);
return Utils.getGroupOfPermission(permInfo);
} catch (PackageManager.NameNotFoundException e) {
Log.i(LOG_TAG, "Permission " + permissionName + " does not exist");
}
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getGroupFromPermission
File: PermissionController/src/com/android/permissioncontroller/permission/ui/ManagePermissionsActivity.java
Repository: android
The code follows secure coding practices. | [
"CWE-862"
] | CVE-2023-21132 | MEDIUM | 6.8 | android | getGroupFromPermission | PermissionController/src/com/android/permissioncontroller/permission/ui/ManagePermissionsActivity.java | 0679e4f35055729be7276536fe45fe8ec18a0453 | 0 |
Analyze the following code function for security vulnerabilities | private static Path resolvePath(String url) throws IOException {
Path urlPath = getPath(url);
final Path resolvedPath;
if (apocConfig().isImportFolderConfigured() && isImportUsingNeo4jConfig()) {
Path basePath = Paths.get(apocConfig().getImportDir());
urlPath = relativizeIfSamePrefix(urlPath, basePath);
resolvedPath = basePath.resolve(urlPath).toAbsolutePath().normalize();
if (!pathStartsWithOther(resolvedPath, basePath)) {
throw new IOException(ACCESS_OUTSIDE_DIR_ERROR);
}
} else {
resolvedPath = urlPath;
}
return resolvedPath;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolvePath
File: core/src/main/java/apoc/util/FileUtils.java
Repository: neo4j-contrib/neo4j-apoc-procedures
The code follows secure coding practices. | [
"CWE-22"
] | CVE-2022-23532 | MEDIUM | 6.5 | neo4j-contrib/neo4j-apoc-procedures | resolvePath | core/src/main/java/apoc/util/FileUtils.java | 01e63ed2d187cd2a8aa1d78bf831ef0fdd69b522 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public ComponentName startServiceInPackage(int uid, Intent service, String resolvedType,
boolean fgRequired, String callingPackage, @Nullable String callingFeatureId,
int userId, boolean allowBackgroundActivityStarts,
@Nullable IBinder backgroundActivityStartsToken)
throws TransactionTooLargeException {
synchronized(ActivityManagerService.this) {
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE,
"startServiceInPackage: " + service + " type=" + resolvedType);
final long origId = Binder.clearCallingIdentity();
ComponentName res;
try {
res = mServices.startServiceLocked(null, service,
resolvedType, -1, uid, fgRequired, callingPackage,
callingFeatureId, userId, allowBackgroundActivityStarts,
backgroundActivityStartsToken);
} finally {
Binder.restoreCallingIdentity(origId);
}
return res;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startServiceInPackage
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 | startServiceInPackage | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | @RequestMapping(value = { "/about" })
public String actionAbout(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) {
addCommonParams(theServletRequest, theRequest, theModel);
theModel.put("notHome", true);
theModel.put("extraBreadcrumb", "About");
ourLog.info(logPrefix(theModel) + "Displayed about page");
return "about";
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: actionAbout
File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
Repository: hapifhir/hapi-fhir
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2020-24301 | MEDIUM | 4.3 | hapifhir/hapi-fhir | actionAbout | hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java | adb3734fcbbf9a9165445e9ee5eef168dbcaedaf | 0 |
Analyze the following code function for security vulnerabilities | public void startContainer(String containerId) {
KieServerState currentState = context.getStateRepository().load(KieServerEnvironment.getServerId());
Set<String> controllers = currentState.getControllers();
KieServerConfig config = currentState.getConfiguration();
if (controllers != null && !controllers.isEmpty()) {
for (String controllerUrl : controllers) {
if (controllerUrl != null && !controllerUrl.isEmpty()) {
String connectAndSyncUrl = controllerUrl + "/management/servers/" + KieServerEnvironment.getServerId() + "/containers/" + containerId + "/status/started";
String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver");
String password = loadPassword(config);
String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN);
try {
makeHttpPostRequestAndCreateCustomResponse(connectAndSyncUrl, "", null, userName, password, token);
break;
} catch (Exception e) {
// let's check all other controllers in case of running in cluster of controllers
logger.warn("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getCause() == null ? e.getMessage() : e.getCause().getMessage());
logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e);
}
}
}
}
} | Vulnerability Classification:
- CWE: CWE-260
- CVE: CVE-2016-7043
- Severity: MEDIUM
- CVSS Score: 5.0
Description: [RHBMS-4312] Loading pasword from a keystore
Function: startContainer
File: kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java
Repository: kiegroup/droolsjbpm-integration
Fixed Code:
public void startContainer(String containerId) {
KieServerState currentState = context.getStateRepository().load(KieServerEnvironment.getServerId());
Set<String> controllers = currentState.getControllers();
KieServerConfig config = currentState.getConfiguration();
if (controllers != null && !controllers.isEmpty()) {
for (String controllerUrl : controllers) {
if (controllerUrl != null && !controllerUrl.isEmpty()) {
String connectAndSyncUrl = controllerUrl + "/management/servers/" + KieServerEnvironment.getServerId() + "/containers/" + containerId + "/status/started";
String userName = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_USER, "kieserver");
String password = loadControllerPassword(config);
String token = config.getConfigItemValue(KieServerConstants.CFG_KIE_CONTROLLER_TOKEN);
try {
makeHttpPostRequestAndCreateCustomResponse(connectAndSyncUrl, "", null, userName, password, token);
break;
} catch (Exception e) {
// let's check all other controllers in case of running in cluster of controllers
logger.warn("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getCause() == null ? e.getMessage() : e.getCause().getMessage());
logger.debug("Exception encountered while syncing with controller at {} error {}", connectAndSyncUrl, e.getMessage(), e);
}
}
}
}
} | [
"CWE-260"
] | CVE-2016-7043 | MEDIUM | 5 | kiegroup/droolsjbpm-integration | startContainer | kie-server-parent/kie-server-services/kie-server-services-common/src/main/java/org/kie/server/services/impl/controller/DefaultRestControllerImpl.java | e916032edd47aa46d15f3a11909b4804ee20a7e8 | 1 |
Analyze the following code function for security vulnerabilities | public IntentBuilder setUserId(int userId) {
mIntent.putExtra(Intent.EXTRA_USER_ID, userId);
return this;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setUserId
File: src/com/android/settings/password/ChooseLockPattern.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-40117 | HIGH | 7.8 | android | setUserId | src/com/android/settings/password/ChooseLockPattern.java | 11815817de2f2d70fe842b108356a1bc75d44ffb | 0 |
Analyze the following code function for security vulnerabilities | public float getAttributeFloatValue(String namespace, String attribute,
float defaultValue) {
int idx = nativeGetAttributeIndex(mParseState, namespace, attribute);
if (idx >= 0) {
return getAttributeFloatValue(idx, defaultValue);
}
return defaultValue;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttributeFloatValue
File: core/java/android/content/res/XmlBlock.java
Repository: android
The code follows secure coding practices. | [
"CWE-415"
] | CVE-2023-40103 | HIGH | 7.8 | android | getAttributeFloatValue | core/java/android/content/res/XmlBlock.java | c3bc12c484ef3bbca4cec19234437c45af5e584d | 0 |
Analyze the following code function for security vulnerabilities | @SneakyThrows
private void addRoleSpecification(String tenantName) {
String rolesYml = mapper.writeValueAsString(new HashMap<>());
tenantConfigRepository.updateConfigFullPath(tenantName,
API + permissionProperties.getRolesSpecPath(), rolesYml);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addRoleSpecification
File: src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java
Repository: xm-online/xm-uaa
The code follows secure coding practices. | [
"CWE-89"
] | CVE-2019-15557 | HIGH | 7.5 | xm-online/xm-uaa | addRoleSpecification | src/main/java/com/icthh/xm/uaa/service/tenant/TenantService.java | bd235434f119c67090952e08fc28abe41aea2e2c | 0 |
Analyze the following code function for security vulnerabilities | protected void internalGetManagedLedgerInfo(AsyncResponse asyncResponse, boolean authoritative) {
if (topicName.isGlobal()) {
try {
validateGlobalNamespaceOwnership(namespaceName);
} catch (Exception e) {
log.error("[{}] Failed to get managed info for {}", clientAppId(), topicName, e);
resumeAsyncResponseExceptionally(asyncResponse, e);
return;
}
}
// If the topic name is a partition name, no need to get partition topic metadata again
if (topicName.isPartitioned()) {
internalGetManagedLedgerInfoForNonPartitionedTopic(asyncResponse);
} else {
getPartitionedTopicMetadataAsync(topicName,
authoritative, false).thenAccept(partitionMetadata -> {
if (partitionMetadata.partitions > 0) {
final List<CompletableFuture<String>> futures = Lists.newArrayList();
PartitionedManagedLedgerInfo partitionedManagedLedgerInfo = new PartitionedManagedLedgerInfo();
for (int i = 0; i < partitionMetadata.partitions; i++) {
TopicName topicNamePartition = topicName.getPartition(i);
try {
futures.add(pulsar().getAdminClient().topics()
.getInternalInfoAsync(
topicNamePartition.toString()).whenComplete((response, throwable) -> {
if (throwable != null) {
log.error("[{}] Failed to get managed info for {}",
clientAppId(), topicNamePartition, throwable);
asyncResponse.resume(new RestException(throwable));
}
try {
partitionedManagedLedgerInfo.partitions.put(topicNamePartition.toString(),
jsonMapper().readValue(response,
ManagedLedgerInfo.class));
} catch (JsonProcessingException ex) {
log.error("[{}] Failed to parse ManagedLedgerInfo for {} from [{}]",
clientAppId(),
topicNamePartition, response, ex);
}
}));
} catch (Exception e) {
log.error("[{}] Failed to get managed info for {}", clientAppId(), topicNamePartition, e);
throw new RestException(e);
}
}
FutureUtil.waitForAll(futures).handle((result, exception) -> {
if (exception != null) {
Throwable t = exception.getCause();
if (t instanceof NotFoundException) {
asyncResponse.resume(new RestException(Status.NOT_FOUND, "Topic not found"));
} else {
log.error("[{}] Failed to get managed info for {}", clientAppId(), topicName, t);
asyncResponse.resume(new RestException(t));
}
}
asyncResponse.resume((StreamingOutput) output -> {
jsonMapper().writer().writeValue(output, partitionedManagedLedgerInfo);
});
return null;
});
} else {
internalGetManagedLedgerInfoForNonPartitionedTopic(asyncResponse);
}
}).exceptionally(ex -> {
log.error("[{}] Failed to get managed info for {}", clientAppId(), topicName, ex);
resumeAsyncResponseExceptionally(asyncResponse, ex);
return null;
});
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: internalGetManagedLedgerInfo
File: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
Repository: apache/pulsar
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-41571 | MEDIUM | 4 | apache/pulsar | internalGetManagedLedgerInfo | pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java | 5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52 | 0 |
Analyze the following code function for security vulnerabilities | public List<SyncInfo> getCurrentSyncsCopy(int userId) {
synchronized (mAuthorities) {
final List<SyncInfo> syncs = getCurrentSyncsLocked(userId);
final List<SyncInfo> syncsCopy = new ArrayList<SyncInfo>();
for (SyncInfo sync : syncs) {
syncsCopy.add(new SyncInfo(sync));
}
return syncsCopy;
}
} | Vulnerability Classification:
- CWE: CWE-200
- CVE: CVE-2016-2426
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Redact Account info from getCurrentSyncs
BUG:26094635
If the caller to ContentResolver#getCurrentSyncs does not hold the
GET_ACCOUNTS permission, return a SyncInfo object that does not
contain any Account information.
Change-Id: I5628ebe1f56c8e3f784aaf1b3281e6b829d19314
(cherry picked from commit b63057e698a01dafcefc7ba09b397b0336bba43d)
Function: getCurrentSyncsCopy
File: services/core/java/com/android/server/content/SyncStorageEngine.java
Repository: android
Fixed Code:
public List<SyncInfo> getCurrentSyncsCopy(int userId, boolean canAccessAccounts) {
synchronized (mAuthorities) {
final List<SyncInfo> syncs = getCurrentSyncsLocked(userId);
final List<SyncInfo> syncsCopy = new ArrayList<SyncInfo>();
for (SyncInfo sync : syncs) {
SyncInfo copy;
if (!canAccessAccounts) {
copy = SyncInfo.createAccountRedacted(
sync.authorityId, sync.authority, sync.startTime);
} else {
copy = new SyncInfo(sync);
}
syncsCopy.add(copy);
}
return syncsCopy;
}
} | [
"CWE-200"
] | CVE-2016-2426 | MEDIUM | 4.3 | android | getCurrentSyncsCopy | services/core/java/com/android/server/content/SyncStorageEngine.java | 63363af721650e426db5b0bdfb8b2d4fe36abdb0 | 1 |
Analyze the following code function for security vulnerabilities | public void deleteOnExit() {
internal.deleteOnExit();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: deleteOnExit
File: src/net/sourceforge/plantuml/security/SFile.java
Repository: plantuml
The code follows secure coding practices. | [
"CWE-284"
] | CVE-2023-3431 | MEDIUM | 5.3 | plantuml | deleteOnExit | src/net/sourceforge/plantuml/security/SFile.java | fbe7fa3b25b4c887d83927cffb1009ec6cb8ab1e | 0 |
Analyze the following code function for security vulnerabilities | @SuppressWarnings("PMD.CompareObjectsWithEquals")
private static void ensureReceivedMatchesExpected(Message got, Message expected)
throws TransportException {
if (got != expected)
throw new TransportException(DisconnectReason.PROTOCOL_ERROR, "Was expecting " + expected);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: ensureReceivedMatchesExpected
File: src/main/java/net/schmizz/sshj/transport/KeyExchanger.java
Repository: hierynomus/sshj
The code follows secure coding practices. | [
"CWE-354"
] | CVE-2023-48795 | MEDIUM | 5.9 | hierynomus/sshj | ensureReceivedMatchesExpected | src/main/java/net/schmizz/sshj/transport/KeyExchanger.java | 94fcc960e0fb198ddec0f7efc53f95ac627fe083 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void activate(final ComponentContext cc) throws IllegalStateException {
super.activate(cc);
final String solrServerUrlConfig = StringUtils.trimToNull(cc.getBundleContext().getProperty(CONFIG_SOLR_URL));
logger.info("Setting up solr server");
solrServer = new Object() {
SolrServer create() {
if (solrServerUrlConfig != null) {
/* Use external SOLR server */
try {
logger.info("Setting up solr server at {}", solrServerUrlConfig);
URL solrServerUrl = new URL(solrServerUrlConfig);
return setupSolr(solrServerUrl);
} catch (MalformedURLException e) {
throw connectError(solrServerUrlConfig, e);
}
} else {
/* Set-up embedded SOLR */
String solrRoot = SolrServerFactory.getEmbeddedDir(cc, CONFIG_SOLR_ROOT, "search");
try {
logger.debug("Setting up solr server at {}", solrRoot);
return setupSolr(new File(solrRoot));
} catch (IOException e) {
throw connectError(solrServerUrlConfig, e);
} catch (SolrServerException e) {
throw connectError(solrServerUrlConfig, e);
}
}
}
IllegalStateException connectError(String target, Exception e) {
logger.error("Unable to connect to solr at {}: {}", target, e.getMessage());
return new IllegalStateException("Unable to connect to solr at " + target, e);
}
// CHECKSTYLE:OFF
}.create();
// CHECKSTYLE:ON
solrRequester = new SolrRequester(solrServer, securityService, serializer);
indexManager = new SolrIndexManager(solrServer, workspace, mdServices, seriesService, mpeg7CatalogService,
securityService);
String systemUserName = cc.getBundleContext().getProperty(SecurityUtil.PROPERTY_KEY_SYS_USER);
populateIndex(systemUserName);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: activate
File: modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java
Repository: opencast
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2021-21318 | MEDIUM | 5.5 | opencast | activate | modules/search-service-impl/src/main/java/org/opencastproject/search/impl/SearchServiceImpl.java | b18c6a7f81f08ed14884592a6c14c9ab611ad450 | 0 |
Analyze the following code function for security vulnerabilities | RecentTasks getRecentTasks() {
return mRecentTasks;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRecentTasks
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 | getRecentTasks | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 1120bc7e511710b1b774adf29ba47106292365e7 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public @ProcessCapability int getUidProcessCapabilities(int uid, String callingPackage) {
if (!hasUsageStatsPermission(callingPackage)) {
enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
"getUidProcessState");
}
// In case the caller is requesting processCapabilities of an app in a different user,
// then verify the caller has INTERACT_ACROSS_USERS_FULL permission
mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
UserHandle.getUserId(uid), false /* allowAll */, ALLOW_FULL_ONLY,
"getUidProcessCapabilities", callingPackage); // Ignore return value
synchronized (mProcLock) {
return mProcessList.getUidProcessCapabilityLOSP(uid);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUidProcessCapabilities
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 | getUidProcessCapabilities | services/core/java/com/android/server/am/ActivityManagerService.java | d10b27e539f7bc91c2360d429b9d05f05274670d | 0 |
Analyze the following code function for security vulnerabilities | public com.xpn.xwiki.api.PropertyClass getPropertyClassFromName(String propPath)
{
return new PropertyClass(this.xwiki.getPropertyClassFromName(propPath, getXWikiContext()), getXWikiContext());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPropertyClassFromName
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2023-37911 | MEDIUM | 6.5 | xwiki/xwiki-platform | getPropertyClassFromName | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java | f471f2a392aeeb9e51d59fdfe1d76fccf532523f | 0 |
Analyze the following code function for security vulnerabilities | public List<Attachment> getAttachmentList()
{
List<Attachment> apis = new ArrayList<Attachment>();
for (XWikiAttachment attachment : this.getDoc().getAttachmentList()) {
apis.add(new Attachment(this, attachment, getXWikiContext()));
}
return apis;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getAttachmentList
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-23615 | MEDIUM | 5.5 | xwiki/xwiki-platform | getAttachmentList | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java | 7ab0fe7b96809c7a3881454147598d46a1c9bbbe | 0 |
Analyze the following code function for security vulnerabilities | public void load(List<Dependency> dependencies) throws LoadFailureException {
for (Dependency dependency : dependencies) {
load(dependency);
}
} | Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2022-41967
- Severity: HIGH
- CVSS Score: 7.5
Description: fix: CVE-2022-41967
Dragonfly v0.3.0-SNAPSHOT fails to properly configure the
DocumentBuilderFactory to prevent XML enternal entity (XXE) attacks when
parsing maven-metadata.xml files provided by external Maven repositories
during "SNAPSHOT" version resolution.
This patches CVE-2022-41967 by disabling features which may lead to XXE.
If you are currently using v0.3.0-SNAPSHOT it is STRONGLY advised to
update Dragonfly to v0.3.1-SNAPSHOT just to be safe.
Function: load
File: src/main/java/dev/hypera/dragonfly/loading/DependencyLoader.java
Repository: HyperaDev/Dragonfly
Fixed Code:
public void load(@NotNull List<Dependency> dependencies) throws LoadFailureException {
for (Dependency dependency : dependencies) {
load(dependency);
}
} | [
"CWE-611"
] | CVE-2022-41967 | HIGH | 7.5 | HyperaDev/Dragonfly | load | src/main/java/dev/hypera/dragonfly/loading/DependencyLoader.java | 9661375e1135127ca6cdb5712e978bec33cc06b3 | 1 |
Analyze the following code function for security vulnerabilities | private native WebContents nativeGetWebContents(long nativeTabAndroid); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeGetWebContents
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | nativeGetWebContents | chrome/android/java/src/org/chromium/chrome/browser/Tab.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | public void takeEmergencyCallAction() {
MetricsLogger.action(mContext, MetricsLogger.ACTION_EMERGENCY_CALL);
// TODO: implement a shorter timeout once new PowerManager API is ready.
// should be the equivalent to the old userActivity(EMERGENCY_CALL_TIMEOUT)
mPowerManager.userActivity(SystemClock.uptimeMillis(), true);
if (isInCall()) {
resumeCall();
if (mEmergencyButtonCallback != null) {
mEmergencyButtonCallback.onEmergencyButtonClickedWhenInCall();
}
} else {
KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(
true /* bypassHandler */);
getContext().startActivityAsUser(INTENT_EMERGENCY_DIAL,
ActivityOptions.makeCustomAnimation(getContext(), 0, 0).toBundle(),
new UserHandle(KeyguardUpdateMonitor.getCurrentUser()));
}
} | Vulnerability Classification:
- CWE: CWE-284
- CVE: CVE-2016-3838
- Severity: MEDIUM
- CVSS Score: 4.3
Description: DO NOT MERGE Disable app pinning when emergency call button pressed
Also disables app pinning when the "return to call" button is pressed
and brings up the in-call screen when app pinning is stopped if there is
an existing call.
Combination of ag/1091397 and ag/1085584 adapted for MNC.
Bug: 28558307
Bug: 28761672
Change-Id: I82ec4042bff387c845ce571b197a4a86e1dd5ec8
Function: takeEmergencyCallAction
File: packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
Repository: android
Fixed Code:
public void takeEmergencyCallAction() {
MetricsLogger.action(mContext, MetricsLogger.ACTION_EMERGENCY_CALL);
// TODO: implement a shorter timeout once new PowerManager API is ready.
// should be the equivalent to the old userActivity(EMERGENCY_CALL_TIMEOUT)
mPowerManager.userActivity(SystemClock.uptimeMillis(), true);
try {
ActivityManagerNative.getDefault().stopLockTaskMode();
} catch (RemoteException e) {
Slog.w(LOG_TAG, "Failed to stop app pinning");
}
if (isInCall()) {
resumeCall();
if (mEmergencyButtonCallback != null) {
mEmergencyButtonCallback.onEmergencyButtonClickedWhenInCall();
}
} else {
KeyguardUpdateMonitor.getInstance(mContext).reportEmergencyCallAction(
true /* bypassHandler */);
getContext().startActivityAsUser(INTENT_EMERGENCY_DIAL,
ActivityOptions.makeCustomAnimation(getContext(), 0, 0).toBundle(),
new UserHandle(KeyguardUpdateMonitor.getCurrentUser()));
}
} | [
"CWE-284"
] | CVE-2016-3838 | MEDIUM | 4.3 | android | takeEmergencyCallAction | packages/Keyguard/src/com/android/keyguard/EmergencyButton.java | 468651c86a8adb7aa56c708d2348e99022088af3 | 1 |
Analyze the following code function for security vulnerabilities | private String[] getDefaultRoleHolderPackageNameAndSignature() {
String packageNameAndSignature = mContext.getString(
com.android.internal.R.string.config_devicePolicyManagement);
if (TextUtils.isEmpty(packageNameAndSignature)) {
return null;
}
if (packageNameAndSignature.contains(":")) {
return packageNameAndSignature.split(":");
}
return new String[]{packageNameAndSignature};
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDefaultRoleHolderPackageNameAndSignature
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 | getDefaultRoleHolderPackageNameAndSignature | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public StackInfo getStackInfo(int stackId) {
enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
"getStackInfo()");
long ident = Binder.clearCallingIdentity();
try {
synchronized (this) {
return mStackSupervisor.getStackInfoLocked(stackId);
}
} finally {
Binder.restoreCallingIdentity(ident);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStackInfo
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 | getStackInfo | services/core/java/com/android/server/am/ActivityManagerService.java | aaa0fee0d7a8da347a0c47cef5249c70efee209e | 0 |
Analyze the following code function for security vulnerabilities | void updateSourceFrame(Rect winFrame) {
if (mGivenInsetsPending) {
// The given insets are pending, and they are not reliable for now. The source frame
// should be updated after the new given insets are sent to window manager.
return;
}
final SparseArray<InsetsSource> providedSources = getProvidedInsetsSources();
final InsetsStateController controller = getDisplayContent().getInsetsStateController();
for (int i = providedSources.size() - 1; i >= 0; i--) {
controller.getSourceProvider(providedSources.keyAt(i)).updateSourceFrame(winFrame);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateSourceFrame
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 | updateSourceFrame | services/core/java/com/android/server/wm/WindowState.java | 7428962d3b064ce1122809d87af65099d1129c9e | 0 |
Analyze the following code function for security vulnerabilities | public static boolean isArtifactsPermissionEnabled() {
return Boolean.getBoolean("hudson.security.ArtifactsPermission");
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isArtifactsPermissionEnabled
File: core/src/main/java/hudson/Functions.java
Repository: jenkinsci/jenkins
The code follows secure coding practices. | [
"CWE-310"
] | CVE-2014-2061 | MEDIUM | 5 | jenkinsci/jenkins | isArtifactsPermissionEnabled | core/src/main/java/hudson/Functions.java | bf539198564a1108b7b71a973bf7de963a6213ef | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected void bindFields() {
List<Field<?>> fields = new ArrayList<Field<?>>(getFields());
Item itemDataSource = getItemDataSource();
if (itemDataSource == null) {
unbindFields(fields);
} else {
bindFields(fields, itemDataSource);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: bindFields
File: server/src/main/java/com/vaadin/ui/Grid.java
Repository: vaadin/framework
The code follows secure coding practices. | [
"CWE-79"
] | CVE-2019-25028 | MEDIUM | 4.3 | vaadin/framework | bindFields | server/src/main/java/com/vaadin/ui/Grid.java | b9ba10adaa06a0977c531f878c3f0046b67f9cc0 | 0 |
Analyze the following code function for security vulnerabilities | private native void nativeShowImeIfNeeded(long nativeContentViewCoreImpl); | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: nativeShowImeIfNeeded
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 | nativeShowImeIfNeeded | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
@SuppressWarnings("serial")
protected void init()
{
super.init();
add(createFeedbackPanel());
gridBuilder = newGridBuilder(this, "flowform");
{
gridBuilder.newSplitPanel(GridSize.COL50);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("searchFilter"));
final TextField<String> searchField = new TextField<String>(InputPanel.WICKET_ID, new PropertyModel<String>(getSearchFilter(),
"searchString"));
searchField.add(WicketUtils.setFocus());
fs.add(new InputPanel(fs.newChildId(), searchField));
fs.add(new IconPanel(fs.newIconChildId(), IconType.HELP, getString("tooltip.lucene.link")).setOnClickLocation(getRequestCycle(),
WebConstants.DOC_LINK_HANDBUCH_LUCENE, true), FieldSetIconPosition.TOP_RIGHT);
}
{
gridBuilder.newSplitPanel(GridSize.COL50);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.options")).suppressLabelForWarning();
final DivPanel checkBoxPanel = fs.addNewCheckBoxDiv();
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "notOpened"),
getString("task.status.notOpened")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "opened"),
getString("task.status.opened")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "closed"),
getString("task.status.closed")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "deleted"),
getString("deleted")));
}
actionButtons = new MyComponentsRepeater<Component>("actionButtons");
add(actionButtons.getRepeatingView());
{
final Button cancelButton = new Button("button", new Model<String>("cancel")) {
@Override
public final void onSubmit()
{
getParentPage().onCancelSubmit();
}
};
cancelButton.setDefaultFormProcessing(false);
cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL);
actionButtons.add(cancelButtonPanel);
}
{
final Button resetButton = new Button("button", new Model<String>("reset")) {
@Override
public final void onSubmit()
{
getParentPage().onResetSubmit();
}
};
resetButton.setDefaultFormProcessing(false);
resetButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), resetButton, getString("reset"), SingleButtonPanel.RESET);
actionButtons.add(resetButtonPanel);
}
{
final Button listViewButton = new Button("button", new Model<String>("listView")) {
@Override
public final void onSubmit()
{
getParentPage().onListViewSubmit();
}
};
listViewButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), listViewButton, getString("listView"), SingleButtonPanel.NORMAL);
actionButtons.add(listViewButtonPanel);
}
{
final Button searchButton = new Button("button", new Model<String>("search")) {
@Override
public final void onSubmit()
{
getParentPage().onSearchSubmit();
}
};
searchButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), searchButton, getString("search"),
SingleButtonPanel.DEFAULT_SUBMIT);
actionButtons.add(searchButtonPanel);
setDefaultButton(searchButton);
}
setComponentsVisibility();
} | Vulnerability Classification:
- CWE: CWE-352
- CVE: CVE-2013-7251
- Severity: MEDIUM
- CVSS Score: 6.8
Description: CSRF protection.
Function: init
File: src/main/java/org/projectforge/web/task/TaskTreeForm.java
Repository: micromata/projectforge-webapp
Fixed Code:
@Override
@SuppressWarnings("serial")
protected void init()
{
super.init();
add(createFeedbackPanel());
gridBuilder = newGridBuilder(this, "flowform");
{
gridBuilder.newSplitPanel(GridSize.COL50);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("searchFilter"));
final TextField<String> searchField = new TextField<String>(InputPanel.WICKET_ID, new PropertyModel<String>(getSearchFilter(),
"searchString"));
searchField.add(WicketUtils.setFocus());
fs.add(new InputPanel(fs.newChildId(), searchField));
fs.add(new IconPanel(fs.newIconChildId(), IconType.HELP, getString("tooltip.lucene.link")).setOnClickLocation(getRequestCycle(),
WebConstants.DOC_LINK_HANDBUCH_LUCENE, true), FieldSetIconPosition.TOP_RIGHT);
}
{
gridBuilder.newSplitPanel(GridSize.COL50);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.options")).suppressLabelForWarning();
final DivPanel checkBoxPanel = fs.addNewCheckBoxDiv();
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "notOpened"),
getString("task.status.notOpened")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "opened"),
getString("task.status.opened")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "closed"),
getString("task.status.closed")));
checkBoxPanel.add(new MyCheckBoxPanel(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(getSearchFilter(), "deleted"),
getString("deleted")));
}
actionButtons = new MyComponentsRepeater<Component>("actionButtons");
add(actionButtons.getRepeatingView());
{
final Button cancelButton = new Button("button", new Model<String>("cancel")) {
@Override
public final void onSubmit()
{
getParentPage().onCancelSubmit();
}
};
cancelButton.setDefaultFormProcessing(false);
cancelButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), cancelButton, getString("cancel"), SingleButtonPanel.CANCEL);
actionButtons.add(cancelButtonPanel);
}
{
final Button resetButton = new Button("button", new Model<String>("reset")) {
@Override
public final void onSubmit()
{
getParentPage().onResetSubmit();
}
};
resetButton.setDefaultFormProcessing(false);
resetButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), resetButton, getString("reset"), SingleButtonPanel.RESET);
actionButtons.add(resetButtonPanel);
}
{
final Button listViewButton = new Button("button", new Model<String>("listView")) {
@Override
public final void onSubmit()
{
getParentPage().onListViewSubmit();
}
};
listViewButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), listViewButton, getString("listView"),
SingleButtonPanel.NORMAL);
actionButtons.add(listViewButtonPanel);
}
{
final Button searchButton = new Button("button", new Model<String>("search")) {
@Override
public final void onSubmit()
{
getParentPage().onSearchSubmit();
}
};
searchButtonPanel = new SingleButtonPanel(actionButtons.newChildId(), searchButton, getString("search"),
SingleButtonPanel.DEFAULT_SUBMIT);
actionButtons.add(searchButtonPanel);
setDefaultButton(searchButton);
}
setComponentsVisibility();
} | [
"CWE-352"
] | CVE-2013-7251 | MEDIUM | 6.8 | micromata/projectforge-webapp | init | src/main/java/org/projectforge/web/task/TaskTreeForm.java | 422de35e3c3141e418a73bfb39b430d5fd74077e | 1 |
Analyze the following code function for security vulnerabilities | void placeOutgoingCall(Call call, Uri handle, GatewayInfo gatewayInfo, boolean speakerphoneOn,
int videoState) {
if (call == null) {
// don't do anything if the call no longer exists
Log.i(this, "Canceling unknown call.");
return;
}
final Uri uriHandle = (gatewayInfo == null) ? handle : gatewayInfo.getGatewayAddress();
if (gatewayInfo == null) {
Log.i(this, "Creating a new outgoing call with handle: %s", Log.piiHandle(uriHandle));
} else {
Log.i(this, "Creating a new outgoing call with gateway handle: %s, original handle: %s",
Log.pii(uriHandle), Log.pii(handle));
}
call.setHandle(uriHandle);
call.setGatewayInfo(gatewayInfo);
call.setStartWithSpeakerphoneOn(speakerphoneOn);
call.setVideoState(videoState);
boolean isEmergencyCall = TelephonyUtil.shouldProcessAsEmergency(mContext,
call.getHandle());
if (isEmergencyCall) {
// Emergency -- CreateConnectionProcessor will choose accounts automatically
call.setTargetPhoneAccount(null);
}
if (call.getTargetPhoneAccount() != null || isEmergencyCall) {
// If the account has been set, proceed to place the outgoing call.
// Otherwise the connection will be initiated when the account is set by the user.
call.startCreateConnection(mPhoneAccountRegistrar);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: placeOutgoingCall
File: src/com/android/server/telecom/CallsManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-2423 | MEDIUM | 6.6 | android | placeOutgoingCall | src/com/android/server/telecom/CallsManager.java | a06c9a4aef69ae27b951523cf72bf72412bf48fa | 0 |
Analyze the following code function for security vulnerabilities | public List<String> getTagsList(XWikiContext context)
{
List<String> tagList = null;
BaseProperty prop = getTagProperty(context);
if (prop != null) {
tagList = (List<String>) prop.getValue();
}
return tagList;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTagsList
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices. | [
"CWE-787"
] | CVE-2023-26470 | HIGH | 7.5 | xwiki/xwiki-platform | getTagsList | xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java | db3d1c62fc5fb59fefcda3b86065d2d362f55164 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public Mono<ActionExecutionResult> executeParameterized(APIConnection connection,
ExecuteActionDTO executeActionDTO,
DatasourceConfiguration datasourceConfiguration,
ActionConfiguration actionConfiguration) {
final List<Property> properties = actionConfiguration.getPluginSpecifiedTemplates();
List<Map.Entry<String, String>> parameters = new ArrayList<>();
// Smartly substitute in actionConfiguration.body and replace all the bindings with values.
Boolean smartJsonSubstitution = this.smartSubstitutionUtils.isSmartSubstitutionEnabled(properties);
if (TRUE.equals(smartJsonSubstitution)) {
// Do smart replacements in JSON body
if (actionConfiguration.getBody() != null) {
// First extract all the bindings in order
List<String> mustacheKeysInOrder = MustacheHelper.extractMustacheKeysInOrder(actionConfiguration.getBody());
// Replace all the bindings with a ? as expected in a prepared statement.
String updatedBody = MustacheHelper.replaceMustacheWithPlaceholder(actionConfiguration.getBody(), mustacheKeysInOrder);
try {
updatedBody = (String) smartSubstitutionOfBindings(updatedBody,
mustacheKeysInOrder,
executeActionDTO.getParams(),
parameters);
} catch (AppsmithPluginException e) {
ActionExecutionResult errorResult = new ActionExecutionResult();
errorResult.setIsExecutionSuccess(false);
errorResult.setErrorInfo(e);
errorResult.setStatusCode(AppsmithPluginError.PLUGIN_ERROR.getAppErrorCode().toString());
return Mono.just(errorResult);
}
actionConfiguration.setBody(updatedBody);
}
}
prepareConfigurationsForExecution(executeActionDTO, actionConfiguration, datasourceConfiguration);
// If the action is paginated, update the configurations to update the correct URL.
if (actionConfiguration.getPaginationType() != null &&
PaginationType.URL.equals(actionConfiguration.getPaginationType()) &&
executeActionDTO.getPaginationField() != null) {
updateDatasourceConfigurationForPagination(actionConfiguration, datasourceConfiguration, executeActionDTO.getPaginationField());
updateActionConfigurationForPagination(actionConfiguration, executeActionDTO.getPaginationField());
}
// Filter out any empty headers
headerUtils.removeEmptyHeaders(actionConfiguration);
return this.executeCommon(connection, datasourceConfiguration, actionConfiguration, parameters);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeParameterized
File: app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java
Repository: appsmithorg/appsmith
The code follows secure coding practices. | [
"CWE-918"
] | CVE-2022-4096 | MEDIUM | 6.5 | appsmithorg/appsmith | executeParameterized | app/server/appsmith-plugins/restApiPlugin/src/main/java/com/external/plugins/RestApiPlugin.java | 769719ccfe667f059fe0b107a19ec9feb90f2e40 | 0 |
Analyze the following code function for security vulnerabilities | public <T> void appendClause(String newClause, final T... parameters) {
if (newClause == null || newClause.isEmpty()) {
return;
}
if (mWhereClause.length() != 0) {
mWhereClause.append(" AND ");
}
mWhereClause.append("(");
mWhereClause.append(newClause);
mWhereClause.append(")");
if (parameters != null) {
for (Object parameter : parameters) {
mParameters.add(parameter.toString());
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: appendClause
File: src/com/android/providers/downloads/DownloadProvider.java
Repository: android
The code follows secure coding practices. | [
"CWE-362"
] | CVE-2016-0848 | HIGH | 7.2 | android | appendClause | src/com/android/providers/downloads/DownloadProvider.java | bdc831357e7a116bc561d51bf2ddc85ff11c01a9 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean next() throws SQLException {
checkClosed();
castNonNull(rows, "rows");
if (onInsertRow) {
throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."),
PSQLState.INVALID_CURSOR_STATE);
}
if (currentRow + 1 >= rows.size()) {
ResultCursor cursor = this.cursor;
if (cursor == null || (maxRows > 0 && rowOffset + rows.size() >= maxRows)) {
currentRow = rows.size();
thisRow = null;
rowBuffer = null;
return false; // End of the resultset.
}
// Ask for some more data.
rowOffset += rows.size(); // We are discarding some data.
int fetchRows = fetchSize;
int adaptiveFetchRows = connection.getQueryExecutor()
.getAdaptiveFetchSize(adaptiveFetch, cursor);
if (adaptiveFetchRows != -1) {
fetchRows = adaptiveFetchRows;
}
if (maxRows != 0) {
if (fetchRows == 0 || rowOffset + fetchRows > maxRows) {
// Fetch would exceed maxRows, limit it.
fetchRows = maxRows - rowOffset;
}
}
// Execute the fetch and update this resultset.
connection.getQueryExecutor()
.fetch(cursor, new CursorResultHandler(), fetchRows, adaptiveFetch);
// .fetch(...) could update this.cursor, and cursor==null means
// there are no more rows to fetch
closeRefCursor();
// After fetch, update last used fetch size (could be useful for adaptive fetch).
lastUsedFetchSize = fetchRows;
currentRow = 0;
// Test the new rows array.
if (rows == null || rows.isEmpty()) {
thisRow = null;
rowBuffer = null;
return false;
}
} else {
currentRow++;
}
initRowBuffer();
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: next
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 | next | pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java | 739e599d52ad80f8dcd6efedc6157859b1a9d637 | 0 |
Analyze the following code function for security vulnerabilities | public String getCdmaMin() {
return mMin;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCdmaMin
File: src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java
Repository: android
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2016-3831 | MEDIUM | 5 | android | getCdmaMin | src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | f47bc301ccbc5e6d8110afab5a1e9bac1d4ef058 | 0 |
Analyze the following code function for security vulnerabilities | private void enforceNonCodecConstraints(String rejected) {
enforceConstraint(rejected, "server/connection", decoder);
enforceConstraint(rejected, "server/connection", encoder);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: enforceNonCodecConstraints
File: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
Repository: netty
The code follows secure coding practices. | [
"CWE-400"
] | CVE-2023-44487 | HIGH | 7.5 | netty | enforceNonCodecConstraints | codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java | 58f75f665aa81a8cbcf6ffa74820042a285c5e61 | 0 |
Analyze the following code function for security vulnerabilities | @Override
protected URL getStaticResource(String path) {
return null;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getStaticResource
File: flow-osgi/src/main/java/com/vaadin/flow/osgi/support/OSGiStaticFileHandlerFactory.java
Repository: vaadin/osgi
The code follows secure coding practices. | [
"CWE-668"
] | CVE-2021-31407 | MEDIUM | 5 | vaadin/osgi | getStaticResource | flow-osgi/src/main/java/com/vaadin/flow/osgi/support/OSGiStaticFileHandlerFactory.java | 0b82a606eeafdf56a129630f00b9c55a5177b64b | 0 |
Analyze the following code function for security vulnerabilities | CounterManager getCounterManager() {
return counterManager;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getCounterManager
File: client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java
Repository: infinispan
The code follows secure coding practices. | [
"CWE-502"
] | CVE-2017-15089 | MEDIUM | 6.5 | infinispan | getCounterManager | client/hotrod-client/src/main/java/org/infinispan/client/hotrod/RemoteCacheManager.java | efc44b7b0a5dd4f44773808840dd9785cabcf21c | 0 |
Analyze the following code function for security vulnerabilities | private void sendNetworkChangeBroadcast(NetworkInfo.DetailedState state) {
boolean hidden = false;
if (mIsAutoRoaming) {
// There is generally a confusion in the system about colluding
// WiFi Layer 2 state (as reported by supplicant) and the Network state
// which leads to multiple confusion.
//
// If link is roaming, we already have an IP address
// as well we were connected and are doing L2 cycles of
// reconnecting or renewing IP address to check that we still have it
// This L2 link flapping should not be reflected into the Network state
// which is the state of the WiFi Network visible to Layer 3 and applications
// Note that once roaming is completed, we will
// set the Network state to where it should be, or leave it as unchanged
//
hidden = true;
}
if (mVerboseLoggingEnabled) {
log("sendNetworkChangeBroadcast"
+ " oldState=" + mNetworkAgentState
+ " newState=" + state
+ " hidden=" + hidden);
}
if (hidden || state == mNetworkAgentState) return;
mNetworkAgentState = state;
sendNetworkChangeBroadcastWithCurrentState();
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sendNetworkChangeBroadcast
File: service/java/com/android/server/wifi/ClientModeImpl.java
Repository: android
The code follows secure coding practices. | [
"CWE-Other"
] | CVE-2023-21242 | CRITICAL | 9.8 | android | sendNetworkChangeBroadcast | service/java/com/android/server/wifi/ClientModeImpl.java | 72e903f258b5040b8f492cf18edd124b5a1ac770 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CMSRequestInfo other = (CMSRequestInfo) obj;
if (realm == null) {
if (other.realm != null)
return false;
} else if (!realm.equals(other.realm))
return false;
if (requestID == null) {
if (other.requestID != null)
return false;
} else if (!requestID.equals(other.requestID))
return false;
if (requestStatus == null) {
if (other.requestStatus != null)
return false;
} else if (!requestStatus.equals(other.requestStatus))
return false;
if (requestType == null) {
if (other.requestType != null)
return false;
} else if (!requestType.equals(other.requestType))
return false;
if (requestURL == null) {
if (other.requestURL != null)
return false;
} else if (!requestURL.equals(other.requestURL))
return false;
return true;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: equals
File: base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java
Repository: dogtagpki/pki
The code follows secure coding practices. | [
"CWE-611"
] | CVE-2022-2414 | HIGH | 7.5 | dogtagpki/pki | equals | base/common/src/main/java/com/netscape/certsrv/request/CMSRequestInfo.java | 16deffdf7548e305507982e246eb9fd1eac414fd | 0 |
Analyze the following code function for security vulnerabilities | private ObjectStreamClass readClassDesc() throws ClassNotFoundException, IOException {
byte tc = nextTC();
switch (tc) {
case TC_CLASSDESC:
return readNewClassDesc(false);
case TC_PROXYCLASSDESC:
Class<?> proxyClass = readNewProxyClassDesc();
ObjectStreamClass streamClass = ObjectStreamClass.lookup(proxyClass);
streamClass.setLoadFields(ObjectStreamClass.NO_FIELDS);
registerObjectRead(streamClass, nextHandle(), false);
checkedSetSuperClassDesc(streamClass, readClassDesc());
return streamClass;
case TC_REFERENCE:
return (ObjectStreamClass) readCyclicReference();
case TC_NULL:
return null;
default:
throw corruptStream(tc);
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readClassDesc
File: luni/src/main/java/java/io/ObjectInputStream.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2014-7911 | HIGH | 7.2 | android | readClassDesc | luni/src/main/java/java/io/ObjectInputStream.java | 738c833d38d41f8f76eb7e77ab39add82b1ae1e2 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public int getMaximumFailedPasswordsForWipe(ComponentName who, int userHandle, boolean parent) {
if (!mHasFeature || !mLockPatternUtils.hasSecureLockScreen()) {
return 0;
}
Preconditions.checkArgumentNonnegative(userHandle, "Invalid userId");
final CallerIdentity caller = getCallerIdentity();
Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
// System caller can query policy for a particular admin.
Preconditions.checkCallAuthorization(
who == null || isCallingFromPackage(who.getPackageName(), caller.getUid())
|| canQueryAdminPolicy(caller));
synchronized (getLockObject()) {
ActiveAdmin admin = (who != null)
? getActiveAdminUncheckedLocked(who, userHandle, parent)
: getAdminWithMinimumFailedPasswordsForWipeLocked(userHandle, parent);
return admin != null ? admin.maximumFailedPasswordsForWipe : 0;
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getMaximumFailedPasswordsForWipe
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 | getMaximumFailedPasswordsForWipe | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | ed3f25b7222d4cff471f2b7d22d1150348146957 | 0 |
Analyze the following code function for security vulnerabilities | protected void _finishToken() throws IOException
{
_tokenIncomplete = false;
int ch = _typeByte;
final int type = ((ch >> 5) & 0x7);
ch &= 0x1F;
// Either String or byte[]
if (type != CBORConstants.MAJOR_TYPE_TEXT) {
if (type == CBORConstants.MAJOR_TYPE_BYTES) {
_binaryValue = _finishBytes(_decodeExplicitLength(ch));
return;
}
// should never happen so
_throwInternal();
}
// String value, decode
final int len = _decodeExplicitLength(ch);
if (len <= 0) {
if (len < 0) {
_finishChunkedText();
} else {
_textBuffer.resetWithEmpty();
}
return;
}
if (len > (_inputEnd - _inputPtr)) {
// or if not, could we read?
if (len >= _inputBuffer.length) {
// If not enough space, need handling similar to chunked
_finishLongText(len);
return;
}
_loadToHaveAtLeast(len);
}
// offline for better optimization
_finishShortText(len);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _finishToken
File: cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
Repository: FasterXML/jackson-dataformats-binary
The code follows secure coding practices. | [
"CWE-770"
] | CVE-2020-28491 | MEDIUM | 5 | FasterXML/jackson-dataformats-binary | _finishToken | cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java | de072d314af8f5f269c8abec6930652af67bc8e6 | 0 |
Analyze the following code function for security vulnerabilities | @Override
public void onConference(Connection cxn1, Connection cxn2) {
if (((FakeConnection) cxn1).getIsConferenceCreated()) {
// Usually, this is implemented by something in Telephony, which does a bunch of
// radio work to conference the two connections together. Here we just short-cut
// that and declare them conferenced.
Conference fakeConference = new FakeConference();
fakeConference.addConnection(cxn1);
fakeConference.addConnection(cxn2);
mLatestConference = fakeConference;
addConference(fakeConference);
} else {
try {
sendSetConferenceMergeFailed(cxn1.getTelecomCallId());
} catch (Exception e) {
Log.w(this, "Exception on sendSetConferenceMergeFailed: " + e.getMessage());
}
}
} | Vulnerability Classification:
- CWE: CWE-Other
- CVE: CVE-2023-21283
- Severity: MEDIUM
- CVSS Score: 5.5
Description: [conflict] Resolve StatusHints image exploit across user. am: a853f6ba61
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/23463634
Fixes: 285211549
Fixes: 280797684
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:41042bd0c8e1e47c19dfdb2a378c70d2090b1e15)
Merged-In: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Change-Id: I69b0c64413ce3b5e8f56c4fbc5e195a5f5adb6d7
Function: onConference
File: tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java
Repository: android
Fixed Code:
@Override
public void onConference(Connection cxn1, Connection cxn2) {
if (((FakeConnection) cxn1).getIsConferenceCreated()) {
// Usually, this is implemented by something in Telephony, which does a bunch of
// radio work to conference the two connections together. Here we just short-cut
// that and declare them conferenced.
Conference fakeConference = new FakeConference();
fakeConference.addConnection(cxn1);
fakeConference.addConnection(cxn2);
if (cxn1.getStatusHints() != null || cxn2.getStatusHints() != null) {
// For testing purposes, pick one of the status hints that isn't null.
StatusHints statusHints = cxn1.getStatusHints() != null
? cxn1.getStatusHints() : cxn2.getStatusHints();
fakeConference.setStatusHints(statusHints);
}
mLatestConference = fakeConference;
addConference(fakeConference);
} else {
try {
sendSetConferenceMergeFailed(cxn1.getTelecomCallId());
} catch (Exception e) {
Log.w(this, "Exception on sendSetConferenceMergeFailed: " + e.getMessage());
}
}
} | [
"CWE-Other"
] | CVE-2023-21283 | MEDIUM | 5.5 | android | onConference | tests/src/com/android/server/telecom/tests/ConnectionServiceFixture.java | 9b41a963f352fdb3da1da8c633d45280badfcb24 | 1 |
Analyze the following code function for security vulnerabilities | void pushTempWhitelist() {
final int N;
final PendingTempWhitelist[] list;
// First copy out the pending changes... we need to leave them in the map for now,
// in case someone needs to check what is coming up while we don't have the lock held.
synchronized(this) {
N = mPendingTempWhitelist.size();
list = new PendingTempWhitelist[N];
for (int i = 0; i < N; i++) {
list[i] = mPendingTempWhitelist.valueAt(i);
}
}
// Now safely dispatch changes to device idle controller.
for (int i = 0; i < N; i++) {
PendingTempWhitelist ptw = list[i];
mLocalDeviceIdleController.addPowerSaveTempWhitelistAppDirect(ptw.targetUid,
ptw.duration, true, ptw.tag);
}
// And now we can safely remove them from the map.
synchronized(this) {
for (int i = 0; i < N; i++) {
PendingTempWhitelist ptw = list[i];
int index = mPendingTempWhitelist.indexOfKey(ptw.targetUid);
if (index >= 0 && mPendingTempWhitelist.valueAt(index) == ptw) {
mPendingTempWhitelist.removeAt(index);
}
}
}
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: pushTempWhitelist
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 | pushTempWhitelist | services/core/java/com/android/server/am/ActivityManagerService.java | 962fb40991f15be4f688d960aa00073683ebdd20 | 0 |
Analyze the following code function for security vulnerabilities | @Test
public void executeParamNullConnection(TestContext context) throws Exception {
postgresClientNullConnection().execute("SELECT 1", new JsonArray(), context.asyncAssertFailure());
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: executeParamNullConnection
File: domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.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 | executeParamNullConnection | domain-models-runtime/src/test/java/org/folio/rest/persist/PostgresClientIT.java | b7ef741133e57add40aa4cb19430a0065f378a94 | 0 |
Analyze the following code function for security vulnerabilities | protected void destroyContentViewCoreInternal(ContentViewCore cvc) {
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: destroyContentViewCoreInternal
File: chrome/android/java/src/org/chromium/chrome/browser/Tab.java
Repository: chromium
The code follows secure coding practices. | [
"CWE-20"
] | CVE-2014-3159 | MEDIUM | 6.4 | chromium | destroyContentViewCoreInternal | chrome/android/java/src/org/chromium/chrome/browser/Tab.java | 98a50b76141f0b14f292f49ce376e6554142d5e2 | 0 |
Analyze the following code function for security vulnerabilities | public SecurityCheck getSecuritySettings() {
checkTrusted();
return SecurityCheck.INSTANCE;
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSecuritySettings
File: api/src/main/java/io/github/karlatemp/unsafeaccessor/UnsafeAccess.java
Repository: Karlatemp/UnsafeAccessor
The code follows secure coding practices. | [
"CWE-863"
] | CVE-2022-31139 | MEDIUM | 4.3 | Karlatemp/UnsafeAccessor | getSecuritySettings | api/src/main/java/io/github/karlatemp/unsafeaccessor/UnsafeAccess.java | 4ef83000184e8f13239a1ea2847ee401d81585fd | 0 |
Analyze the following code function for security vulnerabilities | protected void openConversationForContact(int position) {
Contact contact = (Contact) contacts.get(position);
openConversationForContact(contact);
} | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: openConversationForContact
File: src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
Repository: iNPUTmice/Conversations
The code follows secure coding practices. | [
"CWE-200"
] | CVE-2018-18467 | MEDIUM | 5 | iNPUTmice/Conversations | openConversationForContact | src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java | 7177c523a1b31988666b9337249a4f1d0c36f479 | 0 |
Analyze the following code function for security vulnerabilities | public boolean startUserInBackground(int userid) throws RemoteException; | No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startUserInBackground
File: core/java/android/app/IActivityManager.java
Repository: android
The code follows secure coding practices. | [
"CWE-264"
] | CVE-2016-3832 | HIGH | 8.3 | android | startUserInBackground | core/java/android/app/IActivityManager.java | e7cf91a198de995c7440b3b64352effd2e309906 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.