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
|
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
{
switch(hiByte)
{
case 0:
return ((jjbitVec2[i2] & l2) != 0L);
default :
if ((jjbitVec0[i1] & l1) != 0L)
return true;
return false;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: jjCanMove_0
File: impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
Repository: jakartaee/expression-language
The code follows secure coding practices.
|
[
"CWE-917"
] |
CVE-2021-28170
|
MEDIUM
| 5
|
jakartaee/expression-language
|
jjCanMove_0
|
impl/src/main/java/com/sun/el/parser/ELParserTokenManager.java
|
b6a3943ac5fba71cbc6719f092e319caa747855b
| 0
|
Analyze the following code function for security vulnerabilities
|
public String displayErrorMessages()
{
String errorMessage = "";
for(String s : errorCodes)
{
errorMessage += "The reCAPTCHA " + codesMap.get(s) + " ";
}
return errorMessage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: displayErrorMessages
File: src/main/java/com/unboundid/webapp/ssam/SSAMController.java
Repository: pingidentity/ssam
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2018-25084
|
MEDIUM
| 4
|
pingidentity/ssam
|
displayErrorMessages
|
src/main/java/com/unboundid/webapp/ssam/SSAMController.java
|
f64b10d63bb19ca2228b0c2d561a1a6e5a3bf251
| 0
|
Analyze the following code function for security vulnerabilities
|
@Pure
protected String getPGType(@Positive int column) throws SQLException {
Field field = fields[column - 1];
initSqlType(field);
return field.getPGType();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPGType
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
|
getPGType
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
private long getWearSystemCapabilities(boolean isLe) {
// Capability constants are imported from
// com.google.android.clockwork.common.system.WearableConstants.
final int capabilityCompanionLegacyCalling = 5;
final int capabilitySpeaker = 6;
final int capabilitySetupProtocommChannel = 7;
long capabilities =
Long.parseLong(
getContext().getResources()
.getString(
isLe ? R.string.def_wearable_leSystemCapabilities
: R.string.def_wearable_systemCapabilities));
PackageManager pm = getContext().getPackageManager();
if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
capabilities |= getBitMask(capabilityCompanionLegacyCalling);
}
if (pm.hasSystemFeature(PackageManager.FEATURE_AUDIO_OUTPUT)) {
capabilities |= getBitMask(capabilitySpeaker);
}
capabilities |= getBitMask(capabilitySetupProtocommChannel);
return capabilities;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getWearSystemCapabilities
File: packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-40117
|
HIGH
| 7.8
|
android
|
getWearSystemCapabilities
|
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
|
ff86ff28cf82124f8e65833a2dd8c319aea08945
| 0
|
Analyze the following code function for security vulnerabilities
|
private void validateResponseStatus(HttpResponse response) throws IOException {
int statusCode = response.getStatusLine().getStatusCode();
if (!(VALID_RESPONSE_STATUS.contains(statusCode))) {
throw new IOException("Failed: " + response);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateResponseStatus
File: notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
Repository: opendistro-for-elasticsearch/alerting
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2021-31828
|
MEDIUM
| 5.5
|
opendistro-for-elasticsearch/alerting
|
validateResponseStatus
|
notification/src/main/java/com/amazon/opendistroforelasticsearch/alerting/destination/client/DestinationHttpClient.java
|
49cc584dd6bd38ca26129eeaca5cd04e40a27f25
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
for (CallForwardEditPreference pref : mPreferences) {
Bundle bundle = new Bundle();
bundle.putBoolean(KEY_TOGGLE, pref.isToggled());
bundle.putBoolean(KEY_ENABLE, pref.isEnabled());
if (pref.callForwardInfo != null) {
bundle.putString(KEY_NUMBER, pref.callForwardInfo.number);
bundle.putInt(KEY_STATUS, pref.callForwardInfo.status);
}
outState.putParcelable(pref.getKey(), bundle);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSaveInstanceState
File: src/com/android/phone/GsmUmtsCallForwardOptions.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
onSaveInstanceState
|
src/com/android/phone/GsmUmtsCallForwardOptions.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 0
|
Analyze the following code function for security vulnerabilities
|
@Test
public void testDeserializationAsFloatEdgeCase05() throws Exception
{
// Just beyond the lower-bound of Duration.
String input = new BigInteger(Long.toString(Long.MIN_VALUE)).subtract(BigInteger.ONE) + ".0";
Duration value = READER.without(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)
.readValue(input);
assertEquals(Long.MAX_VALUE, value.getSeconds()); // We've turned a negative number into positive duration!
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: testDeserializationAsFloatEdgeCase05
File: datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
Repository: FasterXML/jackson-modules-java8
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2018-1000873
|
MEDIUM
| 4.3
|
FasterXML/jackson-modules-java8
|
testDeserializationAsFloatEdgeCase05
|
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/TestDurationDeserialization.java
|
ba27ce5909dfb49bcaf753ad3e04ecb980010b0b
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public KBTemplate create(long kbTemplateId) {
KBTemplate kbTemplate = new KBTemplateImpl();
kbTemplate.setNew(true);
kbTemplate.setPrimaryKey(kbTemplateId);
String uuid = PortalUUIDUtil.generate();
kbTemplate.setUuid(uuid);
kbTemplate.setCompanyId(companyProvider.getCompanyId());
return kbTemplate;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
Repository: brianchandotcom/liferay-portal
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2017-12647
|
MEDIUM
| 4.3
|
brianchandotcom/liferay-portal
|
create
|
modules/apps/knowledge-base/knowledge-base-service/src/main/java/com/liferay/knowledge/base/service/persistence/impl/KBTemplatePersistenceImpl.java
|
ef93d984be9d4d478a5c4b1ca9a86f4e80174774
| 0
|
Analyze the following code function for security vulnerabilities
|
private Set<String> getSessionIDsForUser(User user) {
final String userId = requireNonNull(user.getId(), "user ID cannot be null");
return sessionService.loadAll().stream()
.filter(session -> userId.equals(session.getUserIdAttribute().orElse(null)))
.map(MongoDbSession::getSessionId)
.collect(Collectors.toSet());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getSessionIDsForUser
File: graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
Repository: Graylog2/graylog2-server
The code follows secure coding practices.
|
[
"CWE-613"
] |
CVE-2023-41041
|
LOW
| 3.1
|
Graylog2/graylog2-server
|
getSessionIDsForUser
|
graylog2-server/src/main/java/org/graylog2/security/UserSessionTerminationService.java
|
bb88f3d0b2b0351669ab32c60b595ab7242a3fe3
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getName() {
return name;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getName
File: base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java
Repository: dogtagpki/pki
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2022-2414
|
HIGH
| 7.5
|
dogtagpki/pki
|
getName
|
base/common/src/main/java/com/netscape/certsrv/profile/ProfileParameter.java
|
16deffdf7548e305507982e246eb9fd1eac414fd
| 0
|
Analyze the following code function for security vulnerabilities
|
private void close() {
synchronized (mSessions) {
if (mSessions.remove(toString()) == null) {
// the session was already closed, so bail out now
return;
}
}
if (mResponse != null) {
// stop listening for response deaths
mResponse.asBinder().unlinkToDeath(this, 0 /* flags */);
// clear this so that we don't accidentally send any further results
mResponse = null;
}
cancelTimeout();
unbind();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: close
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
close
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
@ApiOperation(value = "修改", notes = "修改")
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("novel:friendLink:edit")
public R update(FriendLinkDO friendLink) {
friendLinkService.update(friendLink);
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
return R.ok();
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2023-7171
- Severity: LOW
- CVSS Score: 3.3
Description: fix(novel-admin): 友情链接URL格式校验
Function: update
File: novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java
Repository: 201206030/novel-plus
Fixed Code:
@ApiOperation(value = "修改", notes = "修改")
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("novel:friendLink:edit")
public R update(@Validated FriendLinkDO friendLink) {
friendLinkService.update(friendLink);
redisTemplate.delete(CacheKey.INDEX_LINK_KEY);
return R.ok();
}
|
[
"CWE-79"
] |
CVE-2023-7171
|
LOW
| 3.3
|
201206030/novel-plus
|
update
|
novel-admin/src/main/java/com/java2nb/novel/controller/FriendLinkController.java
|
d6093d8182362422370d7eaf6c53afde9ee45215
| 1
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean hasOverlappingRendering() {
return false;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hasOverlappingRendering
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
hasOverlappingRendering
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
private Type transformState(Type state) {
String result = state.toFullString();
try {
result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString());
} catch (TransformationException e) {
logger.warn("Could not transform state '{}' with function '{}' and format '{}'", state, function,
sourceFormat);
}
StringType resultType = new StringType(result);
logger.debug("Transformed '{}' into '{}'", state, resultType);
return resultType;
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2020-5242
- Severity: HIGH
- CVSS Score: 9.3
Description: Merge pull request from GHSA-w698-693g-23hv
* fix arbitrary code execution vulnerability
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* Update bundles/org.openhab.binding.exec/src/main/java/org/openhab/binding/exec/internal/handler/ExecHandler.java
Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
* address review comments
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Co-authored-by: Christoph Weitkamp <github@christophweitkamp.de>
Function: transformState
File: bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
Repository: openhab/openhab-addons
Fixed Code:
private Type transformState(Type state) {
String result = state.toFullString();
String function = this.function;
String sourceFormat = this.sourceFormat;
if (function == null || sourceFormat == null) {
logger.warn("Could not transform state '{}' with function '{}' and format '{}'", state, function,
sourceFormat);
} else {
try {
result = TransformationHelper.transform(service, function, sourceFormat, state.toFullString());
} catch (TransformationException e) {
logger.warn("Could not transform state '{}' with function '{}' and format '{}'", state, function,
sourceFormat);
}
}
StringType resultType = new StringType(result);
logger.debug("Transformed '{}' into '{}'", state, resultType);
return resultType;
}
|
[
"CWE-863"
] |
CVE-2020-5242
|
HIGH
| 9.3
|
openhab/openhab-addons
|
transformState
|
bundles/org.openhab.transform.exec/src/main/java/org/openhab/transform/exec/internal/profiles/ExecTransformationProfile.java
|
4c4cb664f2e2c3866aadf117d22fb54aa8dd0031
| 1
|
Analyze the following code function for security vulnerabilities
|
private boolean isMultiConnectionAvailable() {
//noinspection SimplifiableIfStatement
if (isResumeAvailableOnDB && model.getConnectionCount() <= 1) {
return false;
}
return acceptPartial && supportSeek && !isChunked;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isMultiConnectionAvailable
File: library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
Repository: lingochamp/FileDownloader
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2018-11248
|
HIGH
| 7.5
|
lingochamp/FileDownloader
|
isMultiConnectionAvailable
|
library/src/main/java/com/liulishuo/filedownloader/download/DownloadLaunchRunnable.java
|
b023cc081bbecdd2a9f3549a3ae5c12a9647ed7f
| 0
|
Analyze the following code function for security vulnerabilities
|
@Nullable
public PermissionInfo getPermissionInfo(@NonNull String permissionName,
@PackageManager.PermissionInfoFlags int flags) {
try {
final String packageName = mContext.getOpPackageName();
return mPermissionManager.getPermissionInfo(permissionName, packageName, flags);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPermissionInfo
File: core/java/android/permission/PermissionManager.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
getPermissionInfo
|
core/java/android/permission/PermissionManager.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public void setBlockBuildWhenDownstreamBuilding(boolean b) throws IOException {
blockBuildWhenDownstreamBuilding = b;
save();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBlockBuildWhenDownstreamBuilding
File: core/src/main/java/hudson/model/AbstractProject.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2013-7330
|
MEDIUM
| 4
|
jenkinsci/jenkins
|
setBlockBuildWhenDownstreamBuilding
|
core/src/main/java/hudson/model/AbstractProject.java
|
36342d71e29e0620f803a7470ce96c61761648d8
| 0
|
Analyze the following code function for security vulnerabilities
|
private void addProjectPages() {
add(new DynamicPathPageMapper("projects", ProjectListPage.class));
add(new DynamicPathPageMapper("projects/new", NewProjectPage.class));
add(new DynamicPathPageMapper("projects/${project}", ProjectDashboardPage.class));
add(new DynamicPathPageMapper("projects/${project}/blob/#{revision}/#{path}", ProjectBlobPage.class));
add(new DynamicPathPageMapper("projects/${project}/commits", ProjectCommitsPage.class));
add(new DynamicPathPageMapper("projects/${project}/commits/${revision}", CommitDetailPage.class));
add(new DynamicPathPageMapper("projects/${project}/compare", RevisionComparePage.class));
add(new DynamicPathPageMapper("projects/${project}/stats/contribs", ProjectContribsPage.class));
add(new DynamicPathPageMapper("projects/${project}/stats/lines", SourceLinesPage.class));
add(new DynamicPathPageMapper("projects/${project}/branches", ProjectBranchesPage.class));
add(new DynamicPathPageMapper("projects/${project}/tags", ProjectTagsPage.class));
add(new DynamicPathPageMapper("projects/${project}/code-comments", ProjectCodeCommentsPage.class));
add(new DynamicPathPageMapper("projects/${project}/code-comments/${code-comment}/invalid", InvalidCodeCommentPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls", ProjectPullRequestsPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/new", NewPullRequestPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}", PullRequestActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/activities", PullRequestActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/code-comments", PullRequestCodeCommentsPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/changes", PullRequestChangesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/merge-preview", MergePreviewPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/invalid", InvalidPullRequestPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/boards", IssueBoardsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/boards/${board}", IssueBoardsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/list", ProjectIssueListPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}", IssueActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/activities", IssueActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/commits", IssueCommitsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/pull-requests", IssuePullRequestsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/builds", IssueBuildsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/new", NewIssuePage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones", MilestoneListPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/${milestone}", MilestoneDetailPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/${milestone}/edit", MilestoneEditPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/new", NewMilestonePage.class));
add(new DynamicPathPageMapper("projects/${project}/builds", ProjectBuildsPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}", BuildDashboardPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/log", BuildLogPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/changes", BuildChangesPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/fixed-issues", FixedIssuesPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/artifacts", BuildArtifactsPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/invalid", InvalidBuildPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/general", GeneralSecuritySettingPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/authorizations", ProjectAuthorizationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/avatar-edit", AvatarEditPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/branch-protection", BranchProtectionsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/tag-protection", TagProtectionsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/job-secrets", JobSecretsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/action-authorizations", ActionAuthorizationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/build-preserve-rules", BuildPreservationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/web-hooks", WebHooksPage.class));
}
|
Vulnerability Classification:
- CWE: CWE-502
- CVE: CVE-2021-21242
- Severity: HIGH
- CVSS Score: 7.5
Description: Do not use deserialized AttachmentSupport from client side to avoid security vulnerabilities
Function: addProjectPages
File: server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java
Repository: theonedev/onedev
Fixed Code:
private void addProjectPages() {
add(new DynamicPathPageMapper("projects", ProjectListPage.class));
add(new DynamicPathPageMapper("projects/new", NewProjectPage.class));
add(new DynamicPathPageMapper("projects/${project}", ProjectDashboardPage.class));
add(new DynamicPathPageMapper("projects/${project}/blob/#{revision}/#{path}", ProjectBlobPage.class));
add(new DynamicPathPageMapper("projects/${project}/commits", ProjectCommitsPage.class));
add(new DynamicPathPageMapper("projects/${project}/commits/${revision}", CommitDetailPage.class));
add(new DynamicPathPageMapper("projects/${project}/compare", RevisionComparePage.class));
add(new DynamicPathPageMapper("projects/${project}/stats/contribs", ProjectContribsPage.class));
add(new DynamicPathPageMapper("projects/${project}/stats/lines", SourceLinesPage.class));
add(new DynamicPathPageMapper("projects/${project}/branches", ProjectBranchesPage.class));
add(new DynamicPathPageMapper("projects/${project}/tags", ProjectTagsPage.class));
add(new DynamicPathPageMapper("projects/${project}/code-comments", ProjectCodeCommentsPage.class));
add(new DynamicPathPageMapper("projects/${project}/code-comments/${code-comment}/invalid", InvalidCodeCommentPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls", ProjectPullRequestsPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/new", NewPullRequestPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}", PullRequestActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/activities", PullRequestActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/code-comments", PullRequestCodeCommentsPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/changes", PullRequestChangesPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/merge-preview", MergePreviewPage.class));
add(new DynamicPathPageMapper("projects/${project}/pulls/${request}/invalid", InvalidPullRequestPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/boards", IssueBoardsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/boards/${board}", IssueBoardsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/list", ProjectIssueListPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}", IssueActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/activities", IssueActivitiesPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/commits", IssueCommitsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/pull-requests", IssuePullRequestsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/${issue}/builds", IssueBuildsPage.class));
add(new DynamicPathPageMapper("projects/${project}/issues/new", NewIssuePage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones", MilestoneListPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/${milestone}", MilestoneDetailPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/${milestone}/edit", MilestoneEditPage.class));
add(new DynamicPathPageMapper("projects/${project}/milestones/new", NewMilestonePage.class));
add(new DynamicPathPageMapper("projects/${project}/builds", ProjectBuildsPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}", BuildDashboardPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/log", BuildLogPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/changes", BuildChangesPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/fixed-issues", FixedIssuesPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/artifacts", BuildArtifactsPage.class));
add(new DynamicPathPageMapper("projects/${project}/builds/${build}/invalid", InvalidBuildPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/general", GeneralProjectSettingPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/authorizations", ProjectAuthorizationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/avatar-edit", AvatarEditPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/branch-protection", BranchProtectionsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/tag-protection", TagProtectionsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/job-secrets", JobSecretsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/action-authorizations", ActionAuthorizationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/build/build-preserve-rules", BuildPreservationsPage.class));
add(new DynamicPathPageMapper("projects/${project}/settings/web-hooks", WebHooksPage.class));
}
|
[
"CWE-502"
] |
CVE-2021-21242
|
HIGH
| 7.5
|
theonedev/onedev
|
addProjectPages
|
server-core/src/main/java/io/onedev/server/web/BaseUrlMapper.java
|
f864053176c08f59ef2d97fea192ceca46a4d9be
| 1
|
Analyze the following code function for security vulnerabilities
|
private String getLocationChangedTitle() {
return getUpdatableString(
LOCATION_CHANGED_TITLE, R.string.location_changed_notification_title);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLocationChangedTitle
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
|
getLocationChangedTitle
|
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
|
ed3f25b7222d4cff471f2b7d22d1150348146957
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public String getParameter(String name) {
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getParameter
File: h2/src/test/org/h2/test/server/TestWeb.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-312"
] |
CVE-2022-45868
|
HIGH
| 7.8
|
h2database
|
getParameter
|
h2/src/test/org/h2/test/server/TestWeb.java
|
23ee3d0b973923c135fa01356c8eaed40b895393
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void writeFile(final HttpQuery query,
final String path,
final byte[] contents) {
try {
final FileOutputStream out = new FileOutputStream(path);
try {
out.write(contents);
} finally {
out.close();
}
} catch (FileNotFoundException e) {
logError(query, "Failed to create file " + path, e);
} catch (IOException e) {
logError(query, "Failed to write file " + path, e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeFile
File: src/tsd/GraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
writeFile
|
src/tsd/GraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 0
|
Analyze the following code function for security vulnerabilities
|
public void update(String table, Object entity, Criterion filter, boolean returnUpdatedIds, Handler<AsyncResult<UpdateResult>> replyHandler)
{
String where = null;
if(filter != null){
where = filter.toString();
}
update(table, entity, DEFAULT_JSONB_FIELD_NAME, where, returnUpdatedIds, replyHandler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: update
File: domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
Repository: folio-org/raml-module-builder
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2019-15534
|
HIGH
| 7.5
|
folio-org/raml-module-builder
|
update
|
domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java
|
b7ef741133e57add40aa4cb19430a0065f378a94
| 0
|
Analyze the following code function for security vulnerabilities
|
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public int getPasswordMinimumLetters(@Nullable ComponentName admin, int userHandle) {
if (mService != null) {
try {
return mService.getPasswordMinimumLetters(admin, userHandle, mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getPasswordMinimumLetters
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
|
getPasswordMinimumLetters
|
core/java/android/app/admin/DevicePolicyManager.java
|
e2e05f488da6abc765a62e7faf10cb74e729732e
| 0
|
Analyze the following code function for security vulnerabilities
|
public AsyncHttpClientConfigBean setIdleConnectionInPoolTimeoutInMs(int idleConnectionInPoolTimeoutInMs) {
this.idleConnectionInPoolTimeoutInMs = idleConnectionInPoolTimeoutInMs;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setIdleConnectionInPoolTimeoutInMs
File: api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7397
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
setIdleConnectionInPoolTimeoutInMs
|
api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java
|
df6ed70e86c8fc340ed75563e016c8baa94d7e72
| 0
|
Analyze the following code function for security vulnerabilities
|
public static boolean defaultDisableUrlEncodingForBoundedRequests() {
return Boolean.getBoolean(ASYNC_CLIENT + "disableUrlEncodingForBoundedRequests");
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: defaultDisableUrlEncodingForBoundedRequests
File: src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
Repository: AsyncHttpClient/async-http-client
The code follows secure coding practices.
|
[
"CWE-345"
] |
CVE-2013-7398
|
MEDIUM
| 4.3
|
AsyncHttpClient/async-http-client
|
defaultDisableUrlEncodingForBoundedRequests
|
src/main/java/com/ning/http/client/AsyncHttpClientConfigDefaults.java
|
a894583921c11c3b01f160ada36a8bb9d5158e96
| 0
|
Analyze the following code function for security vulnerabilities
|
private int writePlaintextData(final ByteBuffer src) {
final int pos = src.position();
final int limit = src.limit();
final int len = Math.min(limit - pos, MAX_PLAINTEXT_LENGTH);
final int sslWrote;
if (src.isDirect()) {
final long addr = Buffer.address(src) + pos;
sslWrote = SSL.writeToSSL(ssl, addr, len);
if (sslWrote > 0) {
src.position(pos + sslWrote);
}
} else {
ByteBuf buf = alloc.directBuffer(len);
try {
final long addr = memoryAddress(buf);
src.limit(pos + len);
buf.setBytes(0, src);
src.limit(limit);
sslWrote = SSL.writeToSSL(ssl, addr, len);
if (sslWrote > 0) {
src.position(pos + sslWrote);
} else {
src.position(pos);
}
} finally {
buf.release();
}
}
return sslWrote;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writePlaintextData
File: handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
Repository: netty
The code follows secure coding practices.
|
[
"CWE-835"
] |
CVE-2016-4970
|
HIGH
| 7.8
|
netty
|
writePlaintextData
|
handler/src/main/java/io/netty/handler/ssl/OpenSslEngine.java
|
bc8291c80912a39fbd2303e18476d15751af0bf1
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public long getLong() {
if (currentEvent != Event.VALUE_NUMBER) {
throw new IllegalStateException(
JsonMessages.PARSER_GETLONG_ERR(currentEvent));
}
return tokenizer.getLong();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLong
File: impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
Repository: eclipse-ee4j/parsson
The code follows secure coding practices.
|
[
"CWE-834"
] |
CVE-2023-4043
|
HIGH
| 7.5
|
eclipse-ee4j/parsson
|
getLong
|
impl/src/main/java/org/eclipse/parsson/JsonParserImpl.java
|
ab239fee273cb262910890f1a6fe666ae92cd623
| 0
|
Analyze the following code function for security vulnerabilities
|
private void execGnuplot(RunGnuplot rungnuplot, HttpQuery query) {
try {
gnuplot.execute(rungnuplot);
} catch (RejectedExecutionException e) {
query.internalError(new Exception("Too many requests pending,"
+ " please try again later", e));
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: execGnuplot
File: src/tsd/GraphHandler.java
Repository: OpenTSDB/opentsdb
The code follows secure coding practices.
|
[
"CWE-78"
] |
CVE-2023-25826
|
CRITICAL
| 9.8
|
OpenTSDB/opentsdb
|
execGnuplot
|
src/tsd/GraphHandler.java
|
26be40a5e5b6ce8b0b1e4686c4b0d7911e5d8a25
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType, boolean isBodyNullable) throws ApiException {
return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: invokeAPI
File: samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
Repository: OpenAPITools/openapi-generator
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2021-21430
|
LOW
| 2.1
|
OpenAPITools/openapi-generator
|
invokeAPI
|
samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java
|
2c576483f26f85b3979c6948a131f585c237109a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void resetUserChangesToRuntimePermissionsAndFlagsLPw(
final PackageSetting ps, final int userId) {
if (ps.pkg == null) {
return;
}
final int userSettableFlags = FLAG_PERMISSION_USER_SET
| FLAG_PERMISSION_USER_FIXED
| FLAG_PERMISSION_REVOKE_ON_UPGRADE;
final int policyOrSystemFlags = FLAG_PERMISSION_SYSTEM_FIXED
| FLAG_PERMISSION_POLICY_FIXED;
boolean writeInstallPermissions = false;
boolean writeRuntimePermissions = false;
final int permissionCount = ps.pkg.requestedPermissions.size();
for (int i = 0; i < permissionCount; i++) {
String permission = ps.pkg.requestedPermissions.get(i);
BasePermission bp = mSettings.mPermissions.get(permission);
if (bp == null) {
continue;
}
// If shared user we just reset the state to which only this app contributed.
if (ps.sharedUser != null) {
boolean used = false;
final int packageCount = ps.sharedUser.packages.size();
for (int j = 0; j < packageCount; j++) {
PackageSetting pkg = ps.sharedUser.packages.valueAt(j);
if (pkg.pkg != null && !pkg.pkg.packageName.equals(ps.pkg.packageName)
&& pkg.pkg.requestedPermissions.contains(permission)) {
used = true;
break;
}
}
if (used) {
continue;
}
}
PermissionsState permissionsState = ps.getPermissionsState();
final int oldFlags = permissionsState.getPermissionFlags(bp.name, userId);
// Always clear the user settable flags.
final boolean hasInstallState = permissionsState.getInstallPermissionState(
bp.name) != null;
if (permissionsState.updatePermissionFlags(bp, userId, userSettableFlags, 0)) {
if (hasInstallState) {
writeInstallPermissions = true;
} else {
writeRuntimePermissions = true;
}
}
// Below is only runtime permission handling.
if (!bp.isRuntime()) {
continue;
}
// Never clobber system or policy.
if ((oldFlags & policyOrSystemFlags) != 0) {
continue;
}
// If this permission was granted by default, make sure it is.
if ((oldFlags & FLAG_PERMISSION_GRANTED_BY_DEFAULT) != 0) {
if (permissionsState.grantRuntimePermission(bp, userId)
!= PERMISSION_OPERATION_FAILURE) {
writeRuntimePermissions = true;
}
} else {
// Otherwise, reset the permission.
final int revokeResult = permissionsState.revokeRuntimePermission(bp, userId);
switch (revokeResult) {
case PERMISSION_OPERATION_SUCCESS: {
writeRuntimePermissions = true;
} break;
case PERMISSION_OPERATION_SUCCESS_GIDS_CHANGED: {
writeRuntimePermissions = true;
final int appId = ps.appId;
mHandler.post(new Runnable() {
@Override
public void run() {
killUid(appId, userId, KILL_APP_REASON_GIDS_CHANGED);
}
});
} break;
}
}
}
// Synchronously write as we are taking permissions away.
if (writeRuntimePermissions) {
mSettings.writeRuntimePermissionsForUserLPr(userId, true);
}
// Synchronously write as we are taking permissions away.
if (writeInstallPermissions) {
mSettings.writeLPr();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resetUserChangesToRuntimePermissionsAndFlagsLPw
File: services/core/java/com/android/server/pm/PackageManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-119"
] |
CVE-2016-2497
|
HIGH
| 7.5
|
android
|
resetUserChangesToRuntimePermissionsAndFlagsLPw
|
services/core/java/com/android/server/pm/PackageManagerService.java
|
a75537b496e9df71c74c1d045ba5569631a16298
| 0
|
Analyze the following code function for security vulnerabilities
|
void setBindInstantServiceAllowed(int userId, boolean allowed) {
mAuthenticatorCache.setBindInstantServiceAllowed(userId, allowed);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setBindInstantServiceAllowed
File: services/core/java/com/android/server/accounts/AccountManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-502"
] |
CVE-2023-45777
|
HIGH
| 7.8
|
android
|
setBindInstantServiceAllowed
|
services/core/java/com/android/server/accounts/AccountManagerService.java
|
f810d81839af38ee121c446105ca67cb12992fc6
| 0
|
Analyze the following code function for security vulnerabilities
|
public ModalDialog setResizable(final boolean resizable)
{
this.resizable = resizable;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setResizable
File: src/main/java/org/projectforge/web/dialog/ModalDialog.java
Repository: micromata/projectforge-webapp
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2013-7251
|
MEDIUM
| 6.8
|
micromata/projectforge-webapp
|
setResizable
|
src/main/java/org/projectforge/web/dialog/ModalDialog.java
|
422de35e3c3141e418a73bfb39b430d5fd74077e
| 0
|
Analyze the following code function for security vulnerabilities
|
private static void checkV4Certificate(List<X509Certificate> v4Certs,
List<X509Certificate> v2v3Certs, Result result) {
try {
byte[] v4Cert = v4Certs.get(0).getEncoded();
byte[] cert = v2v3Certs.get(0).getEncoded();
if (!Arrays.equals(cert, v4Cert)) {
result.addError(Issue.V4_SIG_V2_V3_SIGNERS_MISMATCH);
}
} catch (CertificateEncodingException e) {
throw new RuntimeException("Failed to encode APK signer cert", e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkV4Certificate
File: src/main/java/com/android/apksig/ApkVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
checkV4Certificate
|
src/main/java/com/android/apksig/ApkVerifier.java
|
039f815895f62c9f8af23df66622b66246f3f61e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void cancelNotificationFromListener(INotificationListener token, String pkg,
String tag, int id) {
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
long identity = Binder.clearCallingIdentity();
try {
synchronized (mNotificationList) {
final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token);
if (info.supportsProfiles()) {
Log.e(TAG, "Ignoring deprecated cancelNotification(pkg, tag, id) "
+ "from " + info.component
+ " use cancelNotification(key) instead.");
} else {
cancelNotificationFromListenerLocked(info, callingUid, callingPid,
pkg, tag, id, info.userid);
}
}
} finally {
Binder.restoreCallingIdentity(identity);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: cancelNotificationFromListener
File: services/core/java/com/android/server/notification/NotificationManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3884
|
MEDIUM
| 4.3
|
android
|
cancelNotificationFromListener
|
services/core/java/com/android/server/notification/NotificationManagerService.java
|
61e9103b5725965568e46657f4781dd8f2e5b623
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getURL(String fullname, String action, String querystring, XWikiContext context)
{
return getURL(fullname, action, querystring, null, context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getURL
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getURL
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onPerform(CommandEvent commandEvent) {
if (!commandEvent.isSlashCommand()) {
commandEvent.reply("This command is only available as slash command!");
return;
}
OptionMapping title = commandEvent.getSlashCommandInteractionEvent().getOption("title");
OptionMapping description = commandEvent.getSlashCommandInteractionEvent().getOption("description");
OptionMapping color = commandEvent.getSlashCommandInteractionEvent().getOption("color");
OptionMapping footer = commandEvent.getSlashCommandInteractionEvent().getOption("footer");
OptionMapping footerIcon = commandEvent.getSlashCommandInteractionEvent().getOption("footer_icon");
OptionMapping image = commandEvent.getSlashCommandInteractionEvent().getOption("image");
OptionMapping thumbnail = commandEvent.getSlashCommandInteractionEvent().getOption("thumbnail");
OptionMapping author = commandEvent.getSlashCommandInteractionEvent().getOption("author");
OptionMapping authorUrl = commandEvent.getSlashCommandInteractionEvent().getOption("author_url");
OptionMapping authorIcon = commandEvent.getSlashCommandInteractionEvent().getOption("author_icon");
OptionMapping url = commandEvent.getSlashCommandInteractionEvent().getOption("url");
OptionMapping timestamp = commandEvent.getSlashCommandInteractionEvent().getOption("timestamp");
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle(title != null ? title.getAsString() : "Invalid Title", url != null ? url.getAsString() : null);
embedBuilder.setDescription(description != null ? description.getAsString() : "Invalid description");
if (color != null) {
embedBuilder.setColor(new Color(color.getAsInt()));
}
if (footer != null) {
embedBuilder.setFooter(footer.getAsString(), footerIcon != null ? footerIcon.getAsString() : null);
}
if (image != null) {
embedBuilder.setImage(image.getAsString());
}
if (thumbnail != null) {
embedBuilder.setThumbnail(thumbnail.getAsString());
}
if (author != null) {
embedBuilder.setAuthor(author.getAsString(), authorUrl != null ? authorUrl.getAsString() : null, authorIcon != null ? authorIcon.getAsString() : null);
}
if (timestamp != null) {
embedBuilder.setTimestamp(Instant.ofEpochMilli(timestamp.getAsLong()));
}
Main.getInstance().getCommandManager().sendMessage(embedBuilder, commandEvent.getChannel());
}
|
Vulnerability Classification:
- CWE: CWE-863
- CVE: CVE-2022-39302
- Severity: MEDIUM
- CVSS Score: 5.4
Description: Removed News-Channel.
Fixed Cross-Server Channel Exploit.
Fixed Temporal-Voice setup.
Function: onPerform
File: src/main/java/de/presti/ree6/commands/impl/mod/EmbedSender.java
Repository: Ree6-Applications/Ree6
Fixed Code:
@Override
public void onPerform(CommandEvent commandEvent) {
if (!commandEvent.isSlashCommand()) {
commandEvent.reply("This command is only available as slash command!");
return;
}
if (!commandEvent.getMember().hasPermission(Permission.MESSAGE_MANAGE)) {
commandEvent.reply("You do not have the permission to do that!");
return;
}
OptionMapping title = commandEvent.getSlashCommandInteractionEvent().getOption("title");
OptionMapping description = commandEvent.getSlashCommandInteractionEvent().getOption("description");
OptionMapping color = commandEvent.getSlashCommandInteractionEvent().getOption("color");
OptionMapping footer = commandEvent.getSlashCommandInteractionEvent().getOption("footer");
OptionMapping footerIcon = commandEvent.getSlashCommandInteractionEvent().getOption("footer_icon");
OptionMapping image = commandEvent.getSlashCommandInteractionEvent().getOption("image");
OptionMapping thumbnail = commandEvent.getSlashCommandInteractionEvent().getOption("thumbnail");
OptionMapping author = commandEvent.getSlashCommandInteractionEvent().getOption("author");
OptionMapping authorUrl = commandEvent.getSlashCommandInteractionEvent().getOption("author_url");
OptionMapping authorIcon = commandEvent.getSlashCommandInteractionEvent().getOption("author_icon");
OptionMapping url = commandEvent.getSlashCommandInteractionEvent().getOption("url");
OptionMapping timestamp = commandEvent.getSlashCommandInteractionEvent().getOption("timestamp");
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setTitle(title != null ? title.getAsString() : "Invalid Title", url != null ? url.getAsString() : null);
embedBuilder.setDescription(description != null ? description.getAsString() : "Invalid description");
if (color != null) {
embedBuilder.setColor(new Color(color.getAsInt()));
}
if (footer != null) {
embedBuilder.setFooter(footer.getAsString(), footerIcon != null ? footerIcon.getAsString() : null);
}
if (image != null) {
embedBuilder.setImage(image.getAsString());
}
if (thumbnail != null) {
embedBuilder.setThumbnail(thumbnail.getAsString());
}
if (author != null) {
embedBuilder.setAuthor(author.getAsString(), authorUrl != null ? authorUrl.getAsString() : null, authorIcon != null ? authorIcon.getAsString() : null);
}
if (timestamp != null) {
embedBuilder.setTimestamp(Instant.ofEpochMilli(timestamp.getAsLong()));
}
Main.getInstance().getCommandManager().sendMessage(embedBuilder, commandEvent.getChannel());
}
|
[
"CWE-863"
] |
CVE-2022-39302
|
MEDIUM
| 5.4
|
Ree6-Applications/Ree6
|
onPerform
|
src/main/java/de/presti/ree6/commands/impl/mod/EmbedSender.java
|
459b5bc24f0ea27e50031f563373926e94b9aa0a
| 1
|
Analyze the following code function for security vulnerabilities
|
final StandardTemplateParams hideLeftIcon(boolean hideLeftIcon) {
this.mHideLeftIcon = hideLeftIcon;
return this;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hideLeftIcon
File: core/java/android/app/Notification.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-862"
] |
CVE-2023-21288
|
MEDIUM
| 5.5
|
android
|
hideLeftIcon
|
core/java/android/app/Notification.java
|
726247f4f53e8cc0746175265652fa415a123c0c
| 0
|
Analyze the following code function for security vulnerabilities
|
public @CheckForNull Run<?,?> getUpstreamRun() {
Job<?,?> job = Jenkins.getInstance().getItemByFullName(upstreamProject, Job.class);
return job != null ? job.getBuildByNumber(upstreamBuild) : null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUpstreamRun
File: core/src/main/java/hudson/model/Cause.java
Repository: jenkinsci/jenkins
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-2067
|
LOW
| 3.5
|
jenkinsci/jenkins
|
getUpstreamRun
|
core/src/main/java/hudson/model/Cause.java
|
5d57c855f3147bfc5e7fda9252317b428a700014
| 0
|
Analyze the following code function for security vulnerabilities
|
public static InputStream newInputStream(final ByteBuffer src) {
return new InputStream() {
public int read() {
if (!src.hasRemaining()) {
return -1;
}
return src.get() & 0xff;
}
public int read(byte[] bytes, int off, int len) {
if (!src.hasRemaining()) {
return -1;
}
len = Math.min(len, src.remaining());
src.get(bytes, off, len);
return len;
}
};
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: newInputStream
File: hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
Repository: hazelcast
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2016-10750
|
MEDIUM
| 6.8
|
hazelcast
|
newInputStream
|
hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java
|
c1c31359a1df953e79a9ca9b6c54b3cdbfef11e9
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void endFigureCaption(Map<String, String> parameters)
{
getXHTMLWikiPrinter().printXMLEndElement(FIGURE_CAPTION_TAG);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: endFigureCaption
File: xwiki-rendering-syntaxes/xwiki-rendering-syntax-html5/src/main/java/org/xwiki/rendering/internal/renderer/html5/HTML5ChainingRenderer.java
Repository: xwiki/xwiki-rendering
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-32070
|
MEDIUM
| 6.1
|
xwiki/xwiki-rendering
|
endFigureCaption
|
xwiki-rendering-syntaxes/xwiki-rendering-syntax-html5/src/main/java/org/xwiki/rendering/internal/renderer/html5/HTML5ChainingRenderer.java
|
c40e2f5f9482ec6c3e71dbf1fff5ba8a5e44cdc1
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean wasNull() throws SQLException {
checkClosed();
return wasNullFlag;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: wasNull
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
|
wasNull
|
pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
|
739e599d52ad80f8dcd6efedc6157859b1a9d637
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public BackupConfig buildEntityFromRequestBody(Request req) {
JsonReader jsonReader = GsonTransformer.getInstance().jsonReaderFrom(req.body());
return BackupConfigRepresenter.fromJSON(jsonReader);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: buildEntityFromRequestBody
File: api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-352"
] |
CVE-2021-25924
|
HIGH
| 9.3
|
gocd
|
buildEntityFromRequestBody
|
api/api-backup-config-v1/src/main/java/com/thoughtworks/go/apiv1/backupconfig/BackupConfigControllerV1.java
|
7d0baab0d361c377af84994f95ba76c280048548
| 0
|
Analyze the following code function for security vulnerabilities
|
private void finalizeRestore() {
if (MORE_DEBUG) Slog.d(TAG, "finishing restore mObserver=" + mObserver);
try {
mTransport.finishRestore();
} catch (Exception e) {
Slog.e(TAG, "Error finishing restore", e);
}
// Tell the observer we're done
if (mObserver != null) {
try {
mObserver.restoreFinished(mStatus);
} catch (RemoteException e) {
Slog.d(TAG, "Restore observer died at restoreFinished");
}
}
// Clear any ongoing session timeout.
mBackupHandler.removeMessages(MSG_RESTORE_TIMEOUT);
// If we have a PM token, we must under all circumstances be sure to
// handshake when we've finished.
if (mPmToken > 0) {
if (MORE_DEBUG) Slog.v(TAG, "finishing PM token " + mPmToken);
try {
mPackageManagerBinder.finishPackageInstall(mPmToken);
} catch (RemoteException e) { /* can't happen */ }
} else {
// We were invoked via an active restore session, not by the Package
// Manager, so start up the session timeout again.
mBackupHandler.sendEmptyMessageDelayed(MSG_RESTORE_TIMEOUT,
TIMEOUT_RESTORE_INTERVAL);
}
// Kick off any work that may be needed regarding app widget restores
AppWidgetBackupBridge.restoreFinished(UserHandle.USER_OWNER);
// If this was a full-system restore, record the ancestral
// dataset information
if (mIsSystemRestore && mPmAgent != null) {
mAncestralPackages = mPmAgent.getRestoredPackages();
mAncestralToken = mToken;
writeRestoreTokens();
}
// done; we can finally release the wakelock and be legitimately done.
Slog.i(TAG, "Restore complete.");
mWakelock.release();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finalizeRestore
File: services/backup/java/com/android/server/backup/BackupManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-200"
] |
CVE-2016-3759
|
MEDIUM
| 5
|
android
|
finalizeRestore
|
services/backup/java/com/android/server/backup/BackupManagerService.java
|
9b8c6d2df35455ce9e67907edded1e4a2ecb9e28
| 0
|
Analyze the following code function for security vulnerabilities
|
protected Intent getLockPatternIntent() {
ChooseLockPattern.IntentBuilder builder =
new ChooseLockPattern.IntentBuilder(getContext())
.setForFingerprint(mForFingerprint)
.setUserId(mUserId);
if (mHasChallenge) {
builder.setChallenge(mChallenge);
}
if (mUserPassword != null) {
builder.setPattern(mUserPassword);
}
return builder.build();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getLockPatternIntent
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
|
getLockPatternIntent
|
src/com/android/settings/password/ChooseLockGeneric.java
|
5e43341b8c7eddce88f79c9a5068362927c05b54
| 0
|
Analyze the following code function for security vulnerabilities
|
public int count(Class<? extends Material> materialClass) {
int count = 0;
for (Material material : this) {
if (materialClass.isInstance(material)) {
count++;
}
}
return count;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: count
File: domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
Repository: gocd
The code follows secure coding practices.
|
[
"CWE-668"
] |
CVE-2022-39309
|
MEDIUM
| 6.5
|
gocd
|
count
|
domain/src/main/java/com/thoughtworks/go/config/materials/Materials.java
|
691b479f1310034992da141760e9c5d1f5b60e8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public abstract String getDestination(String function, T componentSC, HttpRequest request);
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDestination
File: core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getDestination
|
core-web/src/main/java/org/silverpeas/core/web/mvc/route/ComponentRequestRouter.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public void onChosenLockSaveFinished(boolean wasSecureBefore, Intent resultData) {
getActivity().setResult(RESULT_FINISHED, resultData);
if (mChosenPattern != null) {
mChosenPattern.zeroize();
}
if (mCurrentCredential != null) {
mCurrentCredential.zeroize();
}
if (!wasSecureBefore) {
Intent intent = getRedactionInterstitialIntent(getActivity());
if (intent != null) {
startActivity(intent);
}
}
getActivity().finish();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onChosenLockSaveFinished
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
|
onChosenLockSaveFinished
|
src/com/android/settings/password/ChooseLockPattern.java
|
11815817de2f2d70fe842b108356a1bc75d44ffb
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public final void finishHeavyWeightApp() {
if (checkCallingPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
!= PackageManager.PERMISSION_GRANTED) {
String msg = "Permission Denial: finishHeavyWeightApp() from pid="
+ Binder.getCallingPid()
+ ", uid=" + Binder.getCallingUid()
+ " requires " + android.Manifest.permission.FORCE_STOP_PACKAGES;
Slog.w(TAG, msg);
throw new SecurityException(msg);
}
synchronized(this) {
final ProcessRecord proc = mHeavyWeightProcess;
if (proc == null) {
return;
}
ArrayList<ActivityRecord> activities = new ArrayList<>(proc.activities);
for (int i = 0; i < activities.size(); i++) {
ActivityRecord r = activities.get(i);
if (!r.finishing && r.isInStackLocked()) {
r.getStack().finishActivityLocked(r, Activity.RESULT_CANCELED,
null, "finish-heavy", true);
}
}
mHandler.sendMessage(mHandler.obtainMessage(CANCEL_HEAVY_NOTIFICATION_MSG,
proc.userId, 0));
mHeavyWeightProcess = null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishHeavyWeightApp
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
|
finishHeavyWeightApp
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private final int _decodeChunkedUTF8_3(int c1) throws IOException
{
c1 &= 0x0F;
int d = _nextChunkedByte();
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
int c = (c1 << 6) | (d & 0x3F);
d = _nextChunkedByte();
if ((d & 0xC0) != 0x080) {
_reportInvalidOther(d & 0xFF, _inputPtr);
}
c = (c << 6) | (d & 0x3F);
return c;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: _decodeChunkedUTF8_3
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
|
_decodeChunkedUTF8_3
|
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java
|
de072d314af8f5f269c8abec6930652af67bc8e6
| 0
|
Analyze the following code function for security vulnerabilities
|
public static String valueToString(Object value) throws JSONException {
// moves the implementation to JSONWriter as:
// 1. It makes more sense to be part of the writer class
// 2. For Android support this method is not available. By implementing it in the Writer
// Android users can use the writer with the built in Android JSONObject implementation.
return JSONWriter.valueToString(value);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: valueToString
File: src/main/java/org/json/JSONObject.java
Repository: stleary/JSON-java
The code follows secure coding practices.
|
[
"CWE-770"
] |
CVE-2023-5072
|
HIGH
| 7.5
|
stleary/JSON-java
|
valueToString
|
src/main/java/org/json/JSONObject.java
|
661114c50dcfd53bb041aab66f14bb91e0a87c8a
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean isSSLEnabled(ConnectorType connectorType) {
String address = prop.getProperty(TS_INFERENCE_ADDRESS, "http://127.0.0.1:8080");
switch (connectorType) {
case MANAGEMENT_CONNECTOR:
address = prop.getProperty(TS_MANAGEMENT_ADDRESS, "http://127.0.0.1:8081");
break;
case METRICS_CONNECTOR:
address = prop.getProperty(TS_METRICS_ADDRESS, "http://127.0.0.1:8082");
break;
default:
break;
}
// String inferenceAddress = prop.getProperty(TS_INFERENCE_ADDRESS,
// "http://127.0.0.1:8080");
Matcher matcher = ConfigManager.ADDRESS_PATTERN.matcher(address);
if (!matcher.matches()) {
throw new IllegalArgumentException("Invalid binding address: " + address);
}
String protocol = matcher.group(2);
return "https".equalsIgnoreCase(protocol);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSSLEnabled
File: frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
Repository: pytorch/serve
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2023-43654
|
CRITICAL
| 9.8
|
pytorch/serve
|
isSSLEnabled
|
frontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java
|
391bdec3348e30de173fbb7c7277970e0b53c8ad
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean resumeTopActivitiesLocked() {
return resumeTopActivitiesLocked(null, null, null);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resumeTopActivitiesLocked
File: services/core/java/com/android/server/am/ActivityStackSupervisor.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2016-3838
|
MEDIUM
| 4.3
|
android
|
resumeTopActivitiesLocked
|
services/core/java/com/android/server/am/ActivityStackSupervisor.java
|
468651c86a8adb7aa56c708d2348e99022088af3
| 0
|
Analyze the following code function for security vulnerabilities
|
private static boolean validateBitSets(WifiConfiguration config) {
// 1. Check |allowedKeyManagement|.
if (!validateBitSet(config.allowedKeyManagement,
WifiConfiguration.KeyMgmt.strings.length)) {
Log.e(TAG, "validateBitsets failed: invalid allowedKeyManagement bitset "
+ config.allowedKeyManagement);
return false;
}
// 2. Check |allowedProtocols|.
if (!validateBitSet(config.allowedProtocols,
WifiConfiguration.Protocol.strings.length)) {
Log.e(TAG, "validateBitsets failed: invalid allowedProtocols bitset "
+ config.allowedProtocols);
return false;
}
// 3. Check |allowedAuthAlgorithms|.
if (!validateBitSet(config.allowedAuthAlgorithms,
WifiConfiguration.AuthAlgorithm.strings.length)) {
Log.e(TAG, "validateBitsets failed: invalid allowedAuthAlgorithms bitset "
+ config.allowedAuthAlgorithms);
return false;
}
// 4. Check |allowedGroupCiphers|.
if (!validateBitSet(config.allowedGroupCiphers,
WifiConfiguration.GroupCipher.strings.length)) {
Log.e(TAG, "validateBitsets failed: invalid allowedGroupCiphers bitset "
+ config.allowedGroupCiphers);
return false;
}
// 5. Check |allowedPairwiseCiphers|.
if (!validateBitSet(config.allowedPairwiseCiphers,
WifiConfiguration.PairwiseCipher.strings.length)) {
Log.e(TAG, "validateBitsets failed: invalid allowedPairwiseCiphers bitset "
+ config.allowedPairwiseCiphers);
return false;
}
return true;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: validateBitSets
File: service/java/com/android/server/wifi/WifiConfigurationUtil.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2023-21252
|
MEDIUM
| 5.5
|
android
|
validateBitSets
|
service/java/com/android/server/wifi/WifiConfigurationUtil.java
|
50b08ee30e04d185e5ae97a5f717d436fd5a90f3
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean startNextMatchingActivity(IBinder callingActivity,
Intent intent, Bundle bOptions) {
// Refuse possible leaked file descriptors
if (intent != null && intent.hasFileDescriptors() == true) {
throw new IllegalArgumentException("File descriptors passed in Intent");
}
SafeActivityOptions options = SafeActivityOptions.fromBundle(bOptions);
synchronized (this) {
final ActivityRecord r = ActivityRecord.isInStackLocked(callingActivity);
if (r == null) {
SafeActivityOptions.abort(options);
return false;
}
if (r.app == null || r.app.thread == null) {
// The caller is not running... d'oh!
SafeActivityOptions.abort(options);
return false;
}
intent = new Intent(intent);
// The caller is not allowed to change the data.
intent.setDataAndType(r.intent.getData(), r.intent.getType());
// And we are resetting to find the next component...
intent.setComponent(null);
final boolean debug = ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0);
ActivityInfo aInfo = null;
try {
List<ResolveInfo> resolves =
AppGlobals.getPackageManager().queryIntentActivities(
intent, r.resolvedType,
PackageManager.MATCH_DEFAULT_ONLY | STOCK_PM_FLAGS,
UserHandle.getCallingUserId()).getList();
// Look for the original activity in the list...
final int N = resolves != null ? resolves.size() : 0;
for (int i=0; i<N; i++) {
ResolveInfo rInfo = resolves.get(i);
if (rInfo.activityInfo.packageName.equals(r.packageName)
&& rInfo.activityInfo.name.equals(r.info.name)) {
// We found the current one... the next matching is
// after it.
i++;
if (i<N) {
aInfo = resolves.get(i).activityInfo;
}
if (debug) {
Slog.v(TAG, "Next matching activity: found current " + r.packageName
+ "/" + r.info.name);
Slog.v(TAG, "Next matching activity: next is " + ((aInfo == null)
? "null" : aInfo.packageName + "/" + aInfo.name));
}
break;
}
}
} catch (RemoteException e) {
}
if (aInfo == null) {
// Nobody who is next!
SafeActivityOptions.abort(options);
if (debug) Slog.d(TAG, "Next matching activity: nothing found");
return false;
}
intent.setComponent(new ComponentName(
aInfo.applicationInfo.packageName, aInfo.name));
intent.setFlags(intent.getFlags()&~(
Intent.FLAG_ACTIVITY_FORWARD_RESULT|
Intent.FLAG_ACTIVITY_CLEAR_TOP|
Intent.FLAG_ACTIVITY_MULTIPLE_TASK|
FLAG_ACTIVITY_NEW_TASK));
// Okay now we need to start the new activity, replacing the
// currently running activity. This is a little tricky because
// we want to start the new one as if the current one is finished,
// but not finish the current one first so that there is no flicker.
// And thus...
final boolean wasFinishing = r.finishing;
r.finishing = true;
// Propagate reply information over to the new activity.
final ActivityRecord resultTo = r.resultTo;
final String resultWho = r.resultWho;
final int requestCode = r.requestCode;
r.resultTo = null;
if (resultTo != null) {
resultTo.removeResultsLocked(r, resultWho, requestCode);
}
final long origId = Binder.clearCallingIdentity();
// TODO(b/64750076): Check if calling pid should really be -1.
final int res = mActivityStartController
.obtainStarter(intent, "startNextMatchingActivity")
.setCaller(r.app.thread)
.setResolvedType(r.resolvedType)
.setActivityInfo(aInfo)
.setResultTo(resultTo != null ? resultTo.appToken : null)
.setResultWho(resultWho)
.setRequestCode(requestCode)
.setCallingPid(-1)
.setCallingUid(r.launchedFromUid)
.setCallingPackage(r.launchedFromPackage)
.setRealCallingPid(-1)
.setRealCallingUid(r.launchedFromUid)
.setActivityOptions(options)
.execute();
Binder.restoreCallingIdentity(origId);
r.finishing = wasFinishing;
if (res != ActivityManager.START_SUCCESS) {
return false;
}
return true;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: startNextMatchingActivity
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
|
startNextMatchingActivity
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<Delta> getRenderedContentDiff(Document origdoc, Document newdoc)
throws XWikiException, DifferentiationFailedException
{
try {
if ((origdoc == null) && (newdoc == null)) {
return Collections.emptyList();
}
if (origdoc == null) {
return this.doc.getRenderedContentDiff(new XWikiDocument(newdoc.getDocumentReference()), newdoc.doc,
getXWikiContext());
}
if (newdoc == null) {
return this.doc.getRenderedContentDiff(origdoc.doc, new XWikiDocument(origdoc.getDocumentReference()),
getXWikiContext());
}
return this.doc.getRenderedContentDiff(origdoc.doc, newdoc.doc, getXWikiContext());
} catch (Exception e) {
java.lang.Object[] args = { origdoc.getFullName(), origdoc.getVersion(), newdoc.getVersion() };
List list = new ArrayList();
XWikiException xe =
new XWikiException(XWikiException.MODULE_XWIKI_DIFF, XWikiException.ERROR_XWIKI_DIFF_RENDERED_ERROR,
"Error while making rendered diff of {0} between version {1} and version {2}", e, args);
String errormsg = Util.getHTMLExceptionMessage(xe, getXWikiContext());
list.add(errormsg);
return list;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getRenderedContentDiff
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
|
getRenderedContentDiff
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/Document.java
|
7ab0fe7b96809c7a3881454147598d46a1c9bbbe
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public int hashCode() {
return Objects.hash(stmts, options, sourceImages, destImages, globals);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: hashCode
File: jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/parser/node/Script.java
Repository: geosolutions-it/jai-ext
The code follows secure coding practices.
|
[
"CWE-94"
] |
CVE-2022-24816
|
HIGH
| 7.5
|
geosolutions-it/jai-ext
|
hashCode
|
jt-jiffle/jt-jiffle-language/src/main/java/it/geosolutions/jaiext/jiffle/parser/node/Script.java
|
cb1d6565d38954676b0a366da4f965fef38da1cb
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean isSignedJar() {
return certificates.size() > 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isSignedJar
File: core/java/android/util/jar/StrictJarVerifier.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21253
|
MEDIUM
| 5.5
|
android
|
isSignedJar
|
core/java/android/util/jar/StrictJarVerifier.java
|
84df68840b6f2407146e722ebd95a7d8bc6e3529
| 0
|
Analyze the following code function for security vulnerabilities
|
protected void customizeClientBuilder(ClientBuilder clientBuilder) {
// No-op extension point
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: customizeClientBuilder
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
|
customizeClientBuilder
|
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
|
void makeExpandedVisible(boolean force) {
if (SPEW) Log.d(TAG, "Make expanded visible: expanded visible=" + mExpandedVisible);
if (!force && (mExpandedVisible || !panelsEnabled())) {
return;
}
mExpandedVisible = true;
// Expand the window to encompass the full screen in anticipation of the drag.
// This is only possible to do atomically because the status bar is at the top of the screen!
mStatusBarWindowManager.setPanelVisible(true);
visibilityChanged(true);
mWaitingForKeyguardExit = false;
recomputeDisableFlags(!force /* animate */);
setInteracting(StatusBarManager.WINDOW_STATUS_BAR, true);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: makeExpandedVisible
File: packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other"
] |
CVE-2017-0822
|
HIGH
| 7.5
|
android
|
makeExpandedVisible
|
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
|
c574568aaede7f652432deb7707f20ae54bbdf9a
| 0
|
Analyze the following code function for security vulnerabilities
|
protected B encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams) {
enforceNonCodecConstraints("encoderEnforceMaxConcurrentStreams");
this.encoderEnforceMaxConcurrentStreams = encoderEnforceMaxConcurrentStreams;
return self();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: encoderEnforceMaxConcurrentStreams
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
|
encoderEnforceMaxConcurrentStreams
|
codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandlerBuilder.java
|
58f75f665aa81a8cbcf6ffa74820042a285c5e61
| 0
|
Analyze the following code function for security vulnerabilities
|
@SuppressWarnings("unused")
@CalledByNative
private void onSelectionBoundsChanged(Rect anchorRectDip, int anchorDir, Rect focusRectDip,
int focusDir, boolean isAnchorFirst) {
// All coordinates are in DIP.
int x1 = anchorRectDip.left;
int y1 = anchorRectDip.bottom;
int x2 = focusRectDip.left;
int y2 = focusRectDip.bottom;
if (x1 != x2 || y1 != y2 ||
(mSelectionHandleController != null && mSelectionHandleController.isDragging())) {
if (mInsertionHandleController != null) {
mInsertionHandleController.hide();
}
if (isAnchorFirst) {
mStartHandlePoint.setLocalDip(x1, y1);
mEndHandlePoint.setLocalDip(x2, y2);
} else {
mStartHandlePoint.setLocalDip(x2, y2);
mEndHandlePoint.setLocalDip(x1, y1);
}
boolean wereSelectionHandlesShowing = getSelectionHandleController().isShowing();
getSelectionHandleController().onSelectionChanged(anchorDir, focusDir);
updateHandleScreenPositions();
mHasSelection = true;
if (!wereSelectionHandlesShowing && getSelectionHandleController().isShowing()) {
// TODO(cjhopman): Remove this when there is a better signal that long press caused
// a selection. See http://crbug.com/150151.
mContainerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
}
} else {
mUnselectAllOnActionModeDismiss = false;
hideSelectActionBar();
if (x1 != 0 && y1 != 0 && mSelectionEditable) {
// Selection is a caret, and a text field is focused.
if (mSelectionHandleController != null) {
mSelectionHandleController.hide();
}
mInsertionHandlePoint.setLocalDip(x1, y1);
getInsertionHandleController().onCursorPositionChanged();
updateHandleScreenPositions();
if (mInputMethodManagerWrapper.isWatchingCursor(mContainerView)) {
final int xPix = (int) mInsertionHandlePoint.getXPix();
final int yPix = (int) mInsertionHandlePoint.getYPix();
mInputMethodManagerWrapper.updateCursor(
mContainerView, xPix, yPix, xPix, yPix);
}
} else {
// Deselection
if (mSelectionHandleController != null) {
mSelectionHandleController.hideAndDisallowAutomaticShowing();
}
if (mInsertionHandleController != null) {
mInsertionHandleController.hideAndDisallowAutomaticShowing();
}
}
mHasSelection = false;
}
if (isSelectionHandleShowing() || isInsertionHandleShowing()) {
mPositionObserver.addListener(mPositionListener);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: onSelectionBoundsChanged
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
|
onSelectionBoundsChanged
|
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
|
98a50b76141f0b14f292f49ce376e6554142d5e2
| 0
|
Analyze the following code function for security vulnerabilities
|
private String targetDriverFile(String databaseType, String fileName) {
return driverBaseDirectory
+ "/" + databaseType
+ "/" + fileName;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: targetDriverFile
File: core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
Repository: vran-dev/databasir
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-31196
|
HIGH
| 7.5
|
vran-dev/databasir
|
targetDriverFile
|
core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java
|
226c20e0c9124037671a91d6b3e5083bd2462058
| 0
|
Analyze the following code function for security vulnerabilities
|
private void writeStream(ServletOutputStream outputStream,
InputStream inputStream) throws IOException {
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
int bytes;
while ((bytes = inputStream.read(buffer)) >= 0) {
outputStream.write(buffer, 0, bytes);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: writeStream
File: vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
Repository: vaadin/flow
The code follows secure coding practices.
|
[
"CWE-172"
] |
CVE-2021-33604
|
LOW
| 1.2
|
vaadin/flow
|
writeStream
|
vaadin-dev-server/src/main/java/com/vaadin/base/devserver/DevModeHandlerImpl.java
|
2a801c42b406a00c44f4a85b4b4e4a4c5bf89adc
| 0
|
Analyze the following code function for security vulnerabilities
|
public XWikiUser checkAuth() throws XWikiException
{
return this.context.getWiki().checkAuth(this.context);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkAuth
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
|
checkAuth
|
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 void setRequiredProtoPortMap(Map<Integer, String> requiredProtoPortMap) {
mRequiredProtoPortMap = requiredProtoPortMap;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: setRequiredProtoPortMap
File: framework/java/android/net/wifi/hotspot2/pps/Policy.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-400"
] |
CVE-2023-21240
|
MEDIUM
| 5.5
|
android
|
setRequiredProtoPortMap
|
framework/java/android/net/wifi/hotspot2/pps/Policy.java
|
69119d1d3102e27b6473c785125696881bce9563
| 0
|
Analyze the following code function for security vulnerabilities
|
private String extractTypes(JsonNode typeNode) {
if (typeNode != null) {
if (typeNode.getClass() == TextNode.class) {
// Single type
return typeNode.asText();
} else if (typeNode.getClass() == ArrayNode.class) {
// Multiple types, build a string to represent them
StringBuilder typeDetails = new StringBuilder();
boolean optional = false;
for (JsonNode type : typeNode) {
if (type.getClass() == TextNode.class) {
// This is a simple type
if (type.asText().equals("null")) {
// null as a type means this field is optional
optional = true;
} else {
// Add a simple type to the string
typeDetails.append(type.asText());
typeDetails.append(", ");
}
} else if (typeNode.getClass() == ArrayNode.class) {
// This is a verbose type with sub-fields broken down into type: and other params
if (type.get(TYPE).asText().equals(ARRAY)) {
typeDetails.append(type.get(ARRAY_ITEMS).asText());
typeDetails.append("[], ");
} else {
typeDetails.append(type.get(TYPE).asText());
}
}
}
// Trim off excessive separators
if (typeDetails.length() > 1) {
typeDetails.setLength(typeDetails.length() - 2);
}
// Add optional if null was included in the multiple types
if (optional) typeDetails.append("?");
// Set the type to the constructed string
return typeDetails.toString();
} else if (typeNode.getClass() == ObjectNode.class) {
// Type: array and items:
if (typeNode.has(ARRAY_ITEMS)) {
return typeNode.get(ARRAY_ITEMS).asText() + "[]";
}
}
}
return null;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: extractTypes
File: src/main/java/org/commonwl/view/cwl/CWLService.java
Repository: common-workflow-language/cwlviewer
The code follows secure coding practices.
|
[
"CWE-502"
] |
CVE-2021-41110
|
HIGH
| 7.5
|
common-workflow-language/cwlviewer
|
extractTypes
|
src/main/java/org/commonwl/view/cwl/CWLService.java
|
f6066f09edb70033a2ce80200e9fa9e70a5c29de
| 0
|
Analyze the following code function for security vulnerabilities
|
private void grantPermissions(String topicUri, String role, Set<AuthAction> actions) {
try {
namespaceResources().set(path(POLICIES, namespaceName.toString()), (policies) -> {
if (!policies.auth_policies.getTopicAuthentication().containsKey(topicUri)) {
policies.auth_policies.getTopicAuthentication().put(topicUri, new HashMap<>());
}
policies.auth_policies.getTopicAuthentication().get(topicUri).put(role, actions);
return policies;
});
log.info("[{}] Successfully granted access for role {}: {} - topic {}", clientAppId(), role, actions,
topicUri);
} catch (org.apache.pulsar.metadata.api.MetadataStoreException.NotFoundException e) {
log.warn("[{}] Failed to grant permissions on topic {}: Namespace does not exist", clientAppId(), topicUri);
throw new RestException(Status.NOT_FOUND, "Namespace does not exist");
} catch (Exception e) {
log.error("[{}] Failed to grant permissions for topic {}", clientAppId(), topicUri, e);
throw new RestException(e);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: grantPermissions
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
|
grantPermissions
|
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
|
5b35bb81c31f1bc2ad98c9fde5b39ec68110ca52
| 0
|
Analyze the following code function for security vulnerabilities
|
private void addKeyDescriptors(SSODescriptorType descriptor, List<Certificate> certificates) {
certificates.forEach(cert -> {
KeyDescriptorType key = new KeyDescriptorType();
key.setUse(KeyTypes.SIGNING);
KeyInfoType info = new KeyInfoType();
key.setKeyInfo(info);
X509DataType data = new X509DataType();
info.getContent().add(DSIG_OBJECT_FACTORY.createX509Data(data));
try {
JAXBElement<byte[]> certElement = DSIG_OBJECT_FACTORY.createX509DataTypeX509Certificate(cert.getEncoded());
data.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(certElement);
descriptor.getKeyDescriptor().add(key);
} catch (Exception e) {
// Rethrow
throw new IllegalArgumentException(e);
}
});
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: addKeyDescriptors
File: src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
Repository: FusionAuth/fusionauth-samlv2
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-27736
|
MEDIUM
| 4
|
FusionAuth/fusionauth-samlv2
|
addKeyDescriptors
|
src/main/java/io/fusionauth/samlv2/service/DefaultSAMLv2Service.java
|
c66fb689d50010662f705d5b585c6388ce555dbd
| 0
|
Analyze the following code function for security vulnerabilities
|
private static @Nullable String resolvePackageName(@NonNull Context context,
@NonNull AttributionSource attributionSource) {
if (attributionSource.getPackageName() != null) {
return attributionSource.getPackageName();
}
final String[] packageNames = context.getPackageManager().getPackagesForUid(
attributionSource.getUid());
if (packageNames != null) {
// This is best effort if the caller doesn't pass a package. The security
// sandbox is UID, therefore we pick an arbitrary package.
return packageNames[0];
}
// Last resort to handle special UIDs like root, etc.
return AppOpsManager.resolvePackageName(attributionSource.getUid(),
attributionSource.getPackageName());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: resolvePackageName
File: services/core/java/com/android/server/pm/permission/PermissionManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-281"
] |
CVE-2023-21249
|
MEDIUM
| 5.5
|
android
|
resolvePackageName
|
services/core/java/com/android/server/pm/permission/PermissionManagerService.java
|
c00b7e7dbc1fa30339adef693d02a51254755d7f
| 0
|
Analyze the following code function for security vulnerabilities
|
public static final int getThreadGroupLeader(int tid) {
String[] procStatusLabels = { "Tgid:" };
long[] procStatusValues = new long[1];
procStatusValues[0] = -1;
Process.readProcLines("/proc/" + tid + "/status", procStatusLabels, procStatusValues);
return (int) procStatusValues[0];
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getThreadGroupLeader
File: core/java/android/os/Process.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3911
|
HIGH
| 9.3
|
android
|
getThreadGroupLeader
|
core/java/android/os/Process.java
|
2c7008421cb67f5d89f16911bdbe36f6c35311ad
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
void checkReadable() throws SQLException, IOException {
checkClosed();
if (state == State.SET_CALLED) {
if (domResult != null) {
Node node = domResult.getNode();
domResult = null;
TransformerFactory factory = TransformerFactory.newInstance();
try {
Transformer transformer = factory.newTransformer();
DOMSource domSource = new DOMSource(node);
StringWriter stringWriter = new StringWriter();
StreamResult streamResult = new StreamResult(stringWriter);
transformer.transform(domSource, streamResult);
completeWrite(conn.createClob(new StringReader(stringWriter.toString()), -1));
} catch (Exception e) {
throw logAndConvert(e);
}
return;
} else if (closable != null) {
closable.close();
closable = null;
return;
}
throw DbException.getUnsupportedException("Stream setter is not yet closed.");
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: checkReadable
File: h2/src/main/org/h2/jdbc/JdbcSQLXML.java
Repository: h2database
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-23463
|
MEDIUM
| 6.4
|
h2database
|
checkReadable
|
h2/src/main/org/h2/jdbc/JdbcSQLXML.java
|
d83285fd2e48fb075780ee95badee6f5a15ea7f8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
@Deprecated
@CanIgnoreReturnValue // some processors won't return a useful result
public
static <T> T readLines(File file, Charset charset, LineProcessor<T> callback) throws IOException {
return asCharSource(file, charset).readLines(callback);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: readLines
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
|
readLines
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
private String createAndSubmitPrintJob(
final String appId, final String format, final String requestDataRaw,
final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse)
throws NoSuchAppException {
PJsonObject specJson = parseJson(requestDataRaw, httpServletResponse);
if (specJson == null) {
return null;
}
String ref = maybeAddRequestId(
UUID.randomUUID().toString() + "@" + this.servletInfo.getServletId(),
httpServletRequest);
MDC.put(Processor.MDC_JOB_ID_KEY, ref);
LOGGER.debug("{}", specJson);
specJson.getInternalObj().remove(JSON_OUTPUT_FORMAT);
specJson.getInternalObj().put(JSON_OUTPUT_FORMAT, format);
specJson.getInternalObj().remove(JSON_APP);
specJson.getInternalObj().put(JSON_APP, appId);
final JSONObject requestHeaders = getHeaders(httpServletRequest);
if (requestHeaders.length() > 0) {
specJson.getInternalObj().getJSONObject(JSON_ATTRIBUTES)
.put(JSON_REQUEST_HEADERS, requestHeaders);
}
// check that we have authorization and configure the job so it can only be access by users with
// sufficient authorization
final String templateName = specJson.getString(Constants.JSON_LAYOUT_KEY);
final MapPrinter mapPrinter = this.mapPrinterFactory.create(appId);
checkReferer(httpServletRequest, mapPrinter);
final Template template = mapPrinter.getConfiguration().getTemplate(templateName);
if (template == null) {
return null;
}
PrintJobEntryImpl jobEntry = new PrintJobEntryImpl(ref, specJson, System.currentTimeMillis());
jobEntry.configureAccess(template, this.context);
try {
this.jobManager.submit(jobEntry);
} catch (RuntimeException exc) {
LOGGER.error("Error when creating job on {}: {}", appId, specJson, exc);
ref = null;
}
return ref;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createAndSubmitPrintJob
File: core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
Repository: mapfish/mapfish-print
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2020-15231
|
MEDIUM
| 4.3
|
mapfish/mapfish-print
|
createAndSubmitPrintJob
|
core/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
|
89155f2506b9cee822e15ce60ccae390a1419d5e
| 0
|
Analyze the following code function for security vulnerabilities
|
@XmlElement
public String getDate() {
return date;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getDate
File: core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
Repository: Silverpeas/Silverpeas-Core
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2023-47324
|
MEDIUM
| 5.4
|
Silverpeas/Silverpeas-Core
|
getDate
|
core-web/src/main/java/org/silverpeas/core/webapi/notification/user/InboxUserNotificationEntity.java
|
9a55728729a3b431847045c674b3e883507d1e1a
| 0
|
Analyze the following code function for security vulnerabilities
|
public List<XWikiAttachment> getAttachmentList()
{
return this.attachmentList;
}
|
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/doc/XWikiDocument.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-787"
] |
CVE-2023-26470
|
HIGH
| 7.5
|
xwiki/xwiki-platform
|
getAttachmentList
|
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
|
protected ActiveDataHandler getActiveDataHandler() {
return handler;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getActiveDataHandler
File: server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
Repository: vaadin/framework
The code follows secure coding practices.
|
[
"CWE-20"
] |
CVE-2021-33609
|
MEDIUM
| 4
|
vaadin/framework
|
getActiveDataHandler
|
server/src/main/java/com/vaadin/data/provider/DataCommunicator.java
|
9a93593d9f3802d2881fc8ad22dbc210d0d1d295
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getUserName(DocumentReference userReference, String format, boolean link, boolean escapeXML,
XWikiContext context)
{
if (userReference == null) {
return localizePlainOrKey("core.users.unknownUser");
}
XWikiDocument userdoc = null;
try {
userdoc = getDocument(userReference, context);
if (userdoc == null) {
return escapeXML ? XMLUtils.escape(userReference.getName()) : userReference.getName();
}
BaseObject userobj = userdoc.getObject("XWiki.XWikiUsers");
if (userobj == null) {
return escapeXML ? XMLUtils.escape(userdoc.getDocumentReference().getName())
: userdoc.getDocumentReference().getName();
}
String text;
if (format == null) {
text = userobj.getStringValue("first_name");
String lastName = userobj.getStringValue("last_name");
if (!text.isEmpty() && !lastName.isEmpty()) {
text += ' ';
}
text += userobj.getStringValue("last_name");
if (StringUtils.isBlank(text)) {
text = userdoc.getDocumentReference().getName();
}
} else {
VelocityContext vcontext;
try {
vcontext = getVelocityContextFactory().createContext();
} catch (XWikiVelocityException e) {
LOGGER.error("Failed to create standard VelocityContext", e);
vcontext = new XWikiVelocityContext();
}
for (String propname : userobj.getPropertyList()) {
vcontext.put(propname, userobj.getStringValue(propname));
}
text = evaluateVelocity(format,
"<username formatting code in " + context.getDoc().getDocumentReference() + ">", vcontext);
}
if (escapeXML || link) {
text = XMLUtils.escape(text.trim());
}
if (link) {
text = "<span class=\"wikilink\"><a href=\"" + userdoc.getURL("view", context) + "\">" + text
+ "</a></span>";
}
return text;
} catch (Exception e) {
LOGGER.warn("Failed to display the user name of [{}]. Root cause is [{}]. Falling back on the user id.",
userReference, ExceptionUtils.getRootCauseMessage(e));
return escapeXML ? XMLUtils.escape(userReference.getName()) : userReference.getName();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getUserName
File: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
Repository: xwiki/xwiki-platform
The code follows secure coding practices.
|
[
"CWE-863"
] |
CVE-2021-32620
|
MEDIUM
| 4
|
xwiki/xwiki-platform
|
getUserName
|
xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
|
f9a677408ffb06f309be46ef9d8df1915d9099a4
| 0
|
Analyze the following code function for security vulnerabilities
|
@RequestMapping(value = { "/page" })
public String actionPage(HttpServletRequest theReq, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) {
addCommonParams(theReq, theRequest, theModel);
CaptureInterceptor interceptor = new CaptureInterceptor();
FhirContext context = getContext(theRequest);
GenericClient client = theRequest.newClient(theReq, context, myConfig, interceptor);
String url = defaultString(theReq.getParameter("page-url"));
if (myConfig.isRefuseToFetchThirdPartyUrls()) {
if (!url.startsWith(theModel.get("base").toString())) {
ourLog.warn(logPrefix(theModel) + "Refusing to load page URL: {}", url);
theModel.put("errorMsg", toDisplayError("Invalid page URL: " + url, null));
return "result";
}
}
url = url.replace("&", "&");
ResultType returnsResource = ResultType.BUNDLE;
long start = System.currentTimeMillis();
try {
ourLog.info(logPrefix(theModel) + "Loading paging URL: {}", url);
@SuppressWarnings("unchecked")
Class<? extends IBaseBundle> bundleType = (Class<? extends IBaseBundle>) context.getResourceDefinition("Bundle").getImplementingClass();
client.loadPage().byUrl(url).andReturnBundle(bundleType).execute();
} catch (Exception e) {
returnsResource = handleClientException(client, e, theModel);
}
long delay = System.currentTimeMillis() - start;
String outcomeDescription = "Bundle Page";
processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest);
return "result";
}
|
Vulnerability Classification:
- CWE: CWE-79
- CVE: CVE-2020-24301
- Severity: MEDIUM
- CVSS Score: 4.3
Description: Resolve XSS vulnerability
Function: actionPage
File: hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
Repository: hapifhir/hapi-fhir
Fixed Code:
@RequestMapping(value = { "/page" })
public String actionPage(HttpServletRequest theReq, HomeRequest theRequest, BindingResult theBindingResult, ModelMap theModel) {
addCommonParams(theReq, theRequest, theModel);
CaptureInterceptor interceptor = new CaptureInterceptor();
FhirContext context = getContext(theRequest);
GenericClient client = theRequest.newClient(theReq, context, myConfig, interceptor);
String url = sanitizeUrlPart(defaultString(theReq.getParameter("page-url")));
if (myConfig.isRefuseToFetchThirdPartyUrls()) {
if (!url.startsWith(theModel.get("base").toString())) {
ourLog.warn(logPrefix(theModel) + "Refusing to load page URL: {}", url);
theModel.put("errorMsg", toDisplayError("Invalid page URL: " + url, null));
return "result";
}
}
url = url.replace("&", "&");
ResultType returnsResource = ResultType.BUNDLE;
long start = System.currentTimeMillis();
try {
ourLog.info(logPrefix(theModel) + "Loading paging URL: {}", url);
@SuppressWarnings("unchecked")
Class<? extends IBaseBundle> bundleType = (Class<? extends IBaseBundle>) context.getResourceDefinition("Bundle").getImplementingClass();
client.loadPage().byUrl(url).andReturnBundle(bundleType).execute();
} catch (Exception e) {
returnsResource = handleClientException(client, e, theModel);
}
long delay = System.currentTimeMillis() - start;
String outcomeDescription = "Bundle Page";
processAndAddLastClientInvocation(client, returnsResource, theModel, delay, outcomeDescription, interceptor, theRequest);
return "result";
}
|
[
"CWE-79"
] |
CVE-2020-24301
|
MEDIUM
| 4.3
|
hapifhir/hapi-fhir
|
actionPage
|
hapi-fhir-testpage-overlay/src/main/java/ca/uhn/fhir/to/Controller.java
|
adb3734fcbbf9a9165445e9ee5eef168dbcaedaf
| 1
|
Analyze the following code function for security vulnerabilities
|
public static void main(final String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Bad arguments - provide input and output files.");
}
new Sanitiser(Paths.get(args[0]), Paths.get(args[1]));
}
|
Vulnerability Classification:
- CWE: CWE-611
- CVE: CVE-2018-1000651
- Severity: HIGH
- CVSS Score: 7.5
Description: gh-813 Turn on secure processing feature for XML parsers etc
Function: main
File: stroom-pipeline/src/test/java/stroom/util/Sanitiser.java
Repository: gchq/stroom
Fixed Code:
public static void main(final String[] args) {
if (args.length != 2) {
System.out.println("Bad arguments - provide input and output files.");
}
new Sanitiser(Paths.get(args[0]), Paths.get(args[1]));
}
|
[
"CWE-611"
] |
CVE-2018-1000651
|
HIGH
| 7.5
|
gchq/stroom
|
main
|
stroom-pipeline/src/test/java/stroom/util/Sanitiser.java
|
ba30ffd415bd7d32ee40ba4b04035267ce80b499
| 1
|
Analyze the following code function for security vulnerabilities
|
protected String getOrderInForm(String crfVersionIds){
return "(select ordinal as item_order,crf_version_id, item_id from item_form_metadata ifmd )orderInForm";
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getOrderInForm
File: core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
Repository: OpenClinica
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2022-24831
|
HIGH
| 7.5
|
OpenClinica
|
getOrderInForm
|
core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
|
b152cc63019230c9973965a98e4386ea5322c18f
| 0
|
Analyze the following code function for security vulnerabilities
|
private List<List<Object>> parseExcelDataToList(List<List<String>> heads, List<IssueExcelData> excelDataList) {
List<List<Object>> result = new ArrayList<>();
IssueExportHeadField[] exportHeadFields = IssueExportHeadField.values();
//转化excel头
List<String> headList = new ArrayList<>();
for (List<String> list : heads) {
for (String head : list) {
headList.add(head);
}
}
for (IssueExcelData data : excelDataList) {
List<Object> rowData = new ArrayList<>();
Map<String, Object> customData = data.getCustomData();
for (String head : headList) {
boolean isSystemField = false;
for (IssueExportHeadField exportHeadField : exportHeadFields) {
if (StringUtils.equals(head, exportHeadField.getName())) {
rowData.add(exportHeadField.parseExcelDataValue(data));
isSystemField = true;
break;
}
}
if (!isSystemField) {
// 自定义字段
Object value = customData.get(head);
if (value == null || StringUtils.equals(value.toString(), "null")) {
value = StringUtils.EMPTY;
}
rowData.add(parseCustomFieldValue(value.toString()));
}
}
result.add(rowData);
}
return result;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: parseExcelDataToList
File: test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
Repository: metersphere
The code follows secure coding practices.
|
[
"CWE-918"
] |
CVE-2022-23544
|
MEDIUM
| 6.1
|
metersphere
|
parseExcelDataToList
|
test-track/backend/src/main/java/io/metersphere/service/IssuesService.java
|
d0f95b50737c941b29d507a4cc3545f2dc6ab121
| 0
|
Analyze the following code function for security vulnerabilities
|
boolean updateConfigurationLocked(Configuration values,
ActivityRecord starting, boolean persistent, boolean initLocale) {
int changes = 0;
if (values != null) {
Configuration newConfig = new Configuration(mConfiguration);
changes = newConfig.updateFrom(values);
if (changes != 0) {
if (DEBUG_SWITCH || DEBUG_CONFIGURATION) {
Slog.i(TAG, "Updating configuration to: " + values);
}
EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED, changes);
if (values.locale != null && !initLocale) {
saveLocaleLocked(values.locale,
!values.locale.equals(mConfiguration.locale),
values.userSetLocale);
}
mConfigurationSeq++;
if (mConfigurationSeq <= 0) {
mConfigurationSeq = 1;
}
newConfig.seq = mConfigurationSeq;
mConfiguration = newConfig;
Slog.i(TAG, "Config changes=" + Integer.toHexString(changes) + " " + newConfig);
mUsageStatsService.reportConfigurationChange(newConfig, mCurrentUserId);
//mUsageStatsService.noteStartConfig(newConfig);
final Configuration configCopy = new Configuration(mConfiguration);
// TODO: If our config changes, should we auto dismiss any currently
// showing dialogs?
mShowDialogs = shouldShowDialogs(newConfig);
AttributeCache ac = AttributeCache.instance();
if (ac != null) {
ac.updateConfiguration(configCopy);
}
// Make sure all resources in our process are updated
// right now, so that anyone who is going to retrieve
// resource values after we return will be sure to get
// the new ones. This is especially important during
// boot, where the first config change needs to guarantee
// all resources have that config before following boot
// code is executed.
mSystemThread.applyConfigurationToResources(configCopy);
if (persistent && Settings.System.hasInterestingConfigurationChanges(changes)) {
Message msg = mHandler.obtainMessage(UPDATE_CONFIGURATION_MSG);
msg.obj = new Configuration(configCopy);
mHandler.sendMessage(msg);
}
for (int i=mLruProcesses.size()-1; i>=0; i--) {
ProcessRecord app = mLruProcesses.get(i);
try {
if (app.thread != null) {
if (DEBUG_CONFIGURATION) Slog.v(TAG, "Sending to proc "
+ app.processName + " new config " + mConfiguration);
app.thread.scheduleConfigurationChanged(configCopy);
}
} catch (Exception e) {
}
}
Intent intent = new Intent(Intent.ACTION_CONFIGURATION_CHANGED);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY
| Intent.FLAG_RECEIVER_REPLACE_PENDING
| Intent.FLAG_RECEIVER_FOREGROUND);
broadcastIntentLocked(null, null, intent, null, null, 0, null, null,
null, AppOpsManager.OP_NONE, false, false, MY_PID,
Process.SYSTEM_UID, UserHandle.USER_ALL);
if ((changes&ActivityInfo.CONFIG_LOCALE) != 0) {
intent = new Intent(Intent.ACTION_LOCALE_CHANGED);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
broadcastIntentLocked(null, null, intent,
null, null, 0, null, null, null, AppOpsManager.OP_NONE,
false, false, MY_PID, Process.SYSTEM_UID, UserHandle.USER_ALL);
}
}
}
boolean kept = true;
final ActivityStack mainStack = mStackSupervisor.getFocusedStack();
// mainStack is null during startup.
if (mainStack != null) {
if (changes != 0 && starting == null) {
// If the configuration changed, and the caller is not already
// in the process of starting an activity, then find the top
// activity to check if its configuration needs to change.
starting = mainStack.topRunningActivityLocked(null);
}
if (starting != null) {
kept = mainStack.ensureActivityConfigurationLocked(starting, changes);
// And we need to make sure at this point that all other activities
// are made visible with the correct configuration.
mStackSupervisor.ensureActivitiesVisibleLocked(starting, changes);
}
}
if (values != null && mWindowManager != null) {
mWindowManager.setNewConfiguration(mConfiguration);
}
return kept;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: updateConfigurationLocked
File: services/core/java/com/android/server/am/ActivityManagerService.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-284"
] |
CVE-2015-3833
|
MEDIUM
| 4.3
|
android
|
updateConfigurationLocked
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
aaa0fee0d7a8da347a0c47cef5249c70efee209e
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public boolean canStartMoreUsers() {
return mUserController.canStartMoreUsers();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: canStartMoreUsers
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
|
canStartMoreUsers
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
962fb40991f15be4f688d960aa00073683ebdd20
| 0
|
Analyze the following code function for security vulnerabilities
|
private boolean isTargetPermission(@NonNull String permission) {
// null permissions means all permissions are targeted
return (mPermissions == null || ArrayUtils.contains(mPermissions, permission));
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: isTargetPermission
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
|
isTargetPermission
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Analyze the following code function for security vulnerabilities
|
public static UserCapabilities create(Context context) {
UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
UserCapabilities caps = new UserCapabilities();
if (!UserManager.supportsMultipleUsers() || Utils.isMonkeyRunning()) {
caps.mEnabled = false;
return caps;
}
final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId());
caps.mIsGuest = myUserInfo.isGuest();
caps.mIsAdmin = myUserInfo.isAdmin();
DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
Context.DEVICE_POLICY_SERVICE);
// No restricted profiles for tablets with a device owner, or phones.
if (dpm.isDeviceManaged() || Utils.isVoiceCapable(context)) {
caps.mCanAddRestrictedProfile = false;
}
caps.updateAddUserCapabilities(context);
return caps;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: create
File: src/com/android/settings/users/UserSettings.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3889
|
HIGH
| 7.2
|
android
|
create
|
src/com/android/settings/users/UserSettings.java
|
bd5d5176c74021e8cf4970f93f273ba3023c3d72
| 0
|
Analyze the following code function for security vulnerabilities
|
public boolean sessionTokHasExpired() {
return sessionTok == null || sessionTok.hasExpired();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: sessionTokHasExpired
File: src/gribbit/auth/User.java
Repository: lukehutch/gribbit
The code follows secure coding practices.
|
[
"CWE-346"
] |
CVE-2014-125071
|
MEDIUM
| 5.2
|
lukehutch/gribbit
|
sessionTokHasExpired
|
src/gribbit/auth/User.java
|
620418df247aebda3dd4be1dda10fe229ea505dd
| 0
|
Analyze the following code function for security vulnerabilities
|
private SamlProtocol createEcpSamlProtocol() {
return new SamlProtocol() {
// method created to send a SOAP Binding response instead of a HTTP POST response
@Override
protected Response buildAuthenticatedResponse(AuthenticatedClientSessionModel clientSession, String redirectUri, Document samlDocument, JaxrsSAML2BindingBuilder bindingBuilder) throws ConfigurationException, ProcessingException, IOException {
Document document = bindingBuilder.postBinding(samlDocument).getDocument();
try {
Soap.SoapMessageBuilder messageBuilder = Soap.createMessage()
.addNamespace(NS_PREFIX_SAML_ASSERTION, JBossSAMLURIConstants.ASSERTION_NSURI.get())
.addNamespace(NS_PREFIX_SAML_PROTOCOL, JBossSAMLURIConstants.PROTOCOL_NSURI.get())
.addNamespace(NS_PREFIX_PROFILE_ECP, JBossSAMLURIConstants.ECP_PROFILE.get());
createEcpResponseHeader(redirectUri, messageBuilder);
createRequestAuthenticatedHeader(clientSession, messageBuilder);
messageBuilder.addToBody(document);
return messageBuilder.build();
} catch (Exception e) {
throw new RuntimeException("Error while creating SAML response.", e);
}
}
private void createRequestAuthenticatedHeader(AuthenticatedClientSessionModel clientSession, Soap.SoapMessageBuilder messageBuilder) {
ClientModel client = clientSession.getClient();
if ("true".equals(client.getAttribute(SamlConfigAttributes.SAML_CLIENT_SIGNATURE_ATTRIBUTE))) {
SOAPHeaderElement ecpRequestAuthenticated = messageBuilder.addHeader(JBossSAMLConstants.REQUEST_AUTHENTICATED.get(), NS_PREFIX_PROFILE_ECP);
ecpRequestAuthenticated.setMustUnderstand(true);
ecpRequestAuthenticated.setActor("http://schemas.xmlsoap.org/soap/actor/next");
}
}
private void createEcpResponseHeader(String redirectUri, Soap.SoapMessageBuilder messageBuilder) throws SOAPException {
SOAPHeaderElement ecpResponseHeader = messageBuilder.addHeader(JBossSAMLConstants.RESPONSE__ECP.get(), NS_PREFIX_PROFILE_ECP);
ecpResponseHeader.setMustUnderstand(true);
ecpResponseHeader.setActor("http://schemas.xmlsoap.org/soap/actor/next");
ecpResponseHeader.addAttribute(messageBuilder.createName(JBossSAMLConstants.ASSERTION_CONSUMER_SERVICE_URL.get()), redirectUri);
}
@Override
protected Response buildErrorResponse(boolean isPostBinding, String uri, JaxrsSAML2BindingBuilder binding, Document document) throws ConfigurationException, ProcessingException, IOException {
return Soap.createMessage().addToBody(document).build();
}
@Override
protected Response buildLogoutResponse(UserSessionModel userSession, String logoutBindingUri, SAML2LogoutResponseBuilder builder, JaxrsSAML2BindingBuilder binding) throws ConfigurationException, ProcessingException, IOException {
return Soap.createFault().reason("Logout not supported.").build();
}
}.setEventBuilder(event).setHttpHeaders(headers).setRealm(realm).setSession(session).setUriInfo(session.getContext().getUri());
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: createEcpSamlProtocol
File: services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
Repository: keycloak
The code follows secure coding practices.
|
[
"CWE-287"
] |
CVE-2021-3827
|
MEDIUM
| 6.8
|
keycloak
|
createEcpSamlProtocol
|
services/src/main/java/org/keycloak/protocol/saml/profile/ecp/SamlEcpProfileService.java
|
44000caaf5051d7f218d1ad79573bd3d175cad0d
| 0
|
Analyze the following code function for security vulnerabilities
|
@Beta
public static String getNameWithoutExtension(String file) {
checkNotNull(file);
String fileName = new File(file).getName();
int dotIndex = fileName.lastIndexOf('.');
return (dotIndex == -1) ? fileName : fileName.substring(0, dotIndex);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNameWithoutExtension
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
|
getNameWithoutExtension
|
guava/src/com/google/common/io/Files.java
|
fec0dbc4634006a6162cfd4d0d09c962073ddf40
| 0
|
Analyze the following code function for security vulnerabilities
|
@Deprecated
public List<String> getTranslationList(XWikiContext context) throws XWikiException
{
// in few cases like accessing a deleted document, the store might be null.
if (getStore() != null) {
return getStore().getTranslationList(this, context);
} else {
return Collections.emptyList();
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTranslationList
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
|
getTranslationList
|
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 void closeDb(){
wrapper.closeConnection();
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: closeDb
File: HeatMapServer/src/com/datformers/servlet/AddAppUser.java
Repository: ssn2013/cis450Project
The code follows secure coding practices.
|
[
"CWE-89"
] |
CVE-2015-10020
|
MEDIUM
| 5.2
|
ssn2013/cis450Project
|
closeDb
|
HeatMapServer/src/com/datformers/servlet/AddAppUser.java
|
39b495011437a105c7670e17e071f99195b4922e
| 0
|
Analyze the following code function for security vulnerabilities
|
public String getTarget() {
return this.target;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getTarget
File: spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
Repository: spring-projects/spring-framework
The code follows secure coding practices.
|
[
"CWE-79"
] |
CVE-2014-1904
|
MEDIUM
| 4.3
|
spring-projects/spring-framework
|
getTarget
|
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
|
741b4b229ae032bd17175b46f98673ce0bd2d485
| 0
|
Analyze the following code function for security vulnerabilities
|
public static void downloadOntology(String uri, String downloadPath) {
for (String serialization : Constants.POSSIBLE_VOCAB_SERIALIZATIONS) {
logger.info("Attempting to download vocabulary in " + serialization);
try {
URL url = new URL(uri);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty("Accept", serialization);
int status = connection.getResponseCode();
boolean redirect = false;
if (status != HttpURLConnection.HTTP_OK) {
if (status == HttpURLConnection.HTTP_MOVED_TEMP || status == HttpURLConnection.HTTP_MOVED_PERM
|| status == HttpURLConnection.HTTP_SEE_OTHER)
redirect = true;
}
// there are some vocabularies with multiple redirections:
// 301 -> 303 -> owl
while (redirect) {
String newUrl = connection.getHeaderField("Location");
connection = (HttpURLConnection) new URL(newUrl).openConnection();
connection.setRequestProperty("Accept", serialization);
status = connection.getResponseCode();
if (status != HttpURLConnection.HTTP_MOVED_TEMP && status != HttpURLConnection.HTTP_MOVED_PERM
&& status != HttpURLConnection.HTTP_SEE_OTHER)
redirect = false;
}
InputStream in = (InputStream) connection.getInputStream();
Files.copy(in, Paths.get(downloadPath), StandardCopyOption.REPLACE_EXISTING);
in.close();
break; // if the vocabulary is downloaded, then we don't download it for the other
// serializations
} catch (Exception e) {
final String message = "Failed to download vocabulary in RDF format [" + serialization +"]: ";
logger.error(message + e.toString());
throw new RuntimeException(message, e);
}
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: downloadOntology
File: src/main/java/widoco/WidocoUtils.java
Repository: dgarijo/Widoco
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-4772
|
HIGH
| 7.8
|
dgarijo/Widoco
|
downloadOntology
|
src/main/java/widoco/WidocoUtils.java
|
f2279b76827f32190adfa9bd5229b7d5a147fa92
| 0
|
Analyze the following code function for security vulnerabilities
|
protected String processAuthError(String errorCode)
{
//Usually sending null is enough as it is used as a value for auth info
//If more processing is needed, override this method
return processAuthResponse("null", false);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: processAuthError
File: src/main/java/com/mxgraph/online/AbsAuthServlet.java
Repository: jgraph/drawio
The code follows secure coding practices.
|
[
"CWE-601",
"CWE-918"
] |
CVE-2022-1767
|
MEDIUM
| 5
|
jgraph/drawio
|
processAuthError
|
src/main/java/com/mxgraph/online/AbsAuthServlet.java
|
c63f3a04450f30798df47f9badbc74eb8a69fbdf
| 0
|
Analyze the following code function for security vulnerabilities
|
public AssessmentPackage importAssessmentPackageData(final File importSandboxDirectory,
final MultipartFile multipartFile)
throws AssessmentPackageDataImportException {
Assert.notNull(importSandboxDirectory, "importSandboxDirectory");
Assert.notNull(multipartFile, "multipartFile");
AssessmentPackage assessmentPackage = null;
final String contentType = ServiceUtilities.computeContentType(multipartFile);
if ("application/xml".equals(contentType) || "text/xml".equals(contentType) || contentType.endsWith("+xml")) {
/* Looks like an XML content type */
logger.debug("Import data uses a known XML MIME type {} so saving to {} and treating as XML", contentType, importSandboxDirectory);
assessmentPackage = importStandaloneXml(importSandboxDirectory, multipartFile);
}
else {
/* Try to treat as a ZIP */
final boolean zipSuccess = tryUnpackZipFile(importSandboxDirectory, multipartFile);
if (zipSuccess) {
logger.debug("Import data was successfully expanded as a ZIP file");
assessmentPackage = processUnpackedZip(importSandboxDirectory);
}
else {
logger.warn("Import data with MIME type {} was neither a supported XML MIME type nor a ZIP file (containing at least one entry)", contentType);
throw new AssessmentPackageDataImportException(ImportFailureReason.NOT_XML_OR_ZIP);
}
}
logger.info("Successfully imported data for new {}", assessmentPackage);
return assessmentPackage;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: importAssessmentPackageData
File: qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
Repository: davemckain/qtiworks
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2022-39367
|
MEDIUM
| 6.5
|
davemckain/qtiworks
|
importAssessmentPackageData
|
qtiworks-engine/src/main/java/uk/ac/ed/ph/qtiworks/services/AssessmentPackageFileImporter.java
|
1a46d6d842877ba2b824d5c269845827e2e0ccac
| 0
|
Analyze the following code function for security vulnerabilities
|
public static Node getNode(Node node, String... nodePath) {
List<Node> nodes = getNodes(node, nodePath);
if (nodes != null && nodes.size() > 0) {
return nodes.get(0);
} else {
return null;
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: getNode
File: src/edu/stanford/nlp/util/XMLUtils.java
Repository: stanfordnlp/CoreNLP
The code follows secure coding practices.
|
[
"CWE-611"
] |
CVE-2021-3869
|
MEDIUM
| 5
|
stanfordnlp/CoreNLP
|
getNode
|
src/edu/stanford/nlp/util/XMLUtils.java
|
5d83f1e8482ca304db8be726cad89554c88f136a
| 0
|
Analyze the following code function for security vulnerabilities
|
private void maybeHidePublicSettings() {
if(!getIntent().getBooleanExtra(TelephonyManager.EXTRA_HIDE_PUBLIC_SETTINGS, false)){
return;
}
if (DBG) {
log("maybeHidePublicSettings: settings hidden by EXTRA_HIDE_PUBLIC_SETTINGS");
}
PreferenceScreen preferenceScreen = getPreferenceScreen();
preferenceScreen.removePreference(mVoicemailNotificationPreference);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: maybeHidePublicSettings
File: src/com/android/phone/settings/VoicemailSettingsActivity.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-Other",
"CWE-862"
] |
CVE-2023-35665
|
HIGH
| 7.8
|
android
|
maybeHidePublicSettings
|
src/com/android/phone/settings/VoicemailSettingsActivity.java
|
674039e70e1c5bf29b808899ac80c709acc82290
| 0
|
Analyze the following code function for security vulnerabilities
|
private int runGetAppLink() {
int userId = UserHandle.USER_OWNER;
String opt;
while ((opt = nextOption()) != null) {
if (opt.equals("--user")) {
userId = Integer.parseInt(nextOptionData());
if (userId < 0) {
System.err.println("Error: user must be >= 0");
return 1;
}
} else {
System.err.println("Error: unknown option: " + opt);
showUsage();
return 1;
}
}
// Package name to act on; required
final String pkg = nextArg();
if (pkg == null) {
System.err.println("Error: no package specified.");
showUsage();
return 1;
}
try {
final PackageInfo info = mPm.getPackageInfo(pkg, 0, userId);
if (info == null) {
System.err.println("Error: package " + pkg + " not found.");
return 1;
}
if ((info.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_HAS_DOMAIN_URLS) == 0) {
System.err.println("Error: package " + pkg + " does not handle web links.");
return 1;
}
System.out.println(linkStateToString(mPm.getIntentVerificationStatus(pkg, userId)));
} catch (Exception e) {
System.err.println(e.toString());
System.err.println(PM_NOT_RUNNING_ERR);
return 1;
}
return 0;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: runGetAppLink
File: cmds/pm/src/com/android/commands/pm/Pm.java
Repository: android
The code follows secure coding practices.
|
[
"CWE-264"
] |
CVE-2016-3833
|
HIGH
| 9.3
|
android
|
runGetAppLink
|
cmds/pm/src/com/android/commands/pm/Pm.java
|
4e4743a354e26467318b437892a9980eb9b8328a
| 0
|
Analyze the following code function for security vulnerabilities
|
static int convertScanModeFromHal(int mode) {
switch (mode) {
case AbstractionLayer.BT_SCAN_MODE_NONE:
return BluetoothAdapter.SCAN_MODE_NONE;
case AbstractionLayer.BT_SCAN_MODE_CONNECTABLE:
return BluetoothAdapter.SCAN_MODE_CONNECTABLE;
case AbstractionLayer.BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE:
return BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE;
}
//errorLog("Incorrect scan mode in convertScanModeFromHal");
return -1;
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: convertScanModeFromHal
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
|
convertScanModeFromHal
|
src/com/android/bluetooth/btservice/AdapterService.java
|
122feb9a0b04290f55183ff2f0384c6c53756bd8
| 0
|
Analyze the following code function for security vulnerabilities
|
@Override
public Route.Definition patch(final String path, final Route.OneArgHandler handler) {
return appendDefinition(PATCH, path, handler);
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: patch
File: jooby/src/main/java/org/jooby/Jooby.java
Repository: jooby-project/jooby
The code follows secure coding practices.
|
[
"CWE-22"
] |
CVE-2020-7647
|
MEDIUM
| 5
|
jooby-project/jooby
|
patch
|
jooby/src/main/java/org/jooby/Jooby.java
|
34f526028e6cd0652125baa33936ffb6a8a4a009
| 0
|
Analyze the following code function for security vulnerabilities
|
public void finishReceiver(IBinder who, int resultCode, String resultData,
Bundle resultExtras, boolean resultAbort, int flags) {
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST, "Finish receiver: " + who);
// Refuse possible leaked file descriptors
if (resultExtras != null && resultExtras.hasFileDescriptors()) {
throw new IllegalArgumentException("File descriptors passed in Bundle");
}
final long origId = Binder.clearCallingIdentity();
try {
boolean doNext = false;
BroadcastRecord r;
BroadcastQueue queue;
synchronized(this) {
if (isOnFgOffloadQueue(flags)) {
queue = mFgOffloadBroadcastQueue;
} else if (isOnBgOffloadQueue(flags)) {
queue = mBgOffloadBroadcastQueue;
} else {
queue = (flags & Intent.FLAG_RECEIVER_FOREGROUND) != 0
? mFgBroadcastQueue : mBgBroadcastQueue;
}
r = queue.getMatchingOrderedReceiver(who);
if (r != null) {
doNext = r.queue.finishReceiverLocked(r, resultCode,
resultData, resultExtras, resultAbort, true);
}
if (doNext) {
r.queue.processNextBroadcastLocked(/*fromMsg=*/ false, /*skipOomAdj=*/ true);
}
// updateOomAdjLocked() will be done here
trimApplicationsLocked(false, OomAdjuster.OOM_ADJ_REASON_FINISH_RECEIVER);
}
} finally {
Binder.restoreCallingIdentity(origId);
}
}
|
No Vulnerability Detected:
This code is secure and does not contain known vulnerabilities.
Function: finishReceiver
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
|
finishReceiver
|
services/core/java/com/android/server/am/ActivityManagerService.java
|
d10b27e539f7bc91c2360d429b9d05f05274670d
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.