Skip to content

Fix: enforce upload status checks when status is embedded in contentId - #608

Open
akgarg06 wants to merge 3 commits into
developfrom
RBSDMS-upload-status-issue-fix-feature
Open

akgarg06 wants to merge 3 commits into
developfrom
RBSDMS-upload-status-issue-fix-feature

Conversation

@akgarg06

Copy link
Copy Markdown
Contributor

Problem

The readAttachment handler in SDMAttachmentsServiceHandler had a logic bug introduced when upload status was embedded into the contentId (as a 4th colon-separated segment). The new code wrapped all safety checks (virus detected, scan in progress, upload in progress) inside an else block — meaning whenever a contentId contained an upload status (i.e., any attachment created after the change), all three checks were silently bypassed, even if the status was VirusDetected or VirusScanInprogress. This would allow potentially infected or incomplete files to be served.

Changes

SDMAttachmentsServiceHandler.java

  • readAttachment: Fixed the safety check logic to prefer the upload status embedded in contentId (4th segment) and fall back to the DB-queried status. The same virus/scan/upload-in-progress checks now run unconditionally against whichever status value is available.
  • finalizeContext: Appends cmisDocument.getUploadStatus() as a 4th segment to the contentId, making the status available to the read handler without an additional DB lookup.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist before requesting a review

  • I follow Java Development Guidelines for SAP
  • I have tested the functionality on my cloud environment.
  • I have provided sufficient automated/ unit tests for the code.
  • I have increased or maintained the test coverage.
  • I have ran integration tests on my cloud environment.
  • I have validated blackduck portal for any vulnerability after my commit.

Upload Screenshots/lists of the scenarios tested

  • I have Uploaded Screenshots or added lists of the scenarios tested in description

@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 04:56 — with GitHub Actions Active
@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 04:56 — with GitHub Actions Active
@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 07:36 — with GitHub Actions Active
@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 07:36 — with GitHub Actions Active

@rashmiangadi05 rashmiangadi05 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 08:20 — with GitHub Actions Active
@akgarg06
akgarg06 deployed to pr-analysis November 19, 2026 08:20 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
pr-analysis — 6d3f4abd Deployed Nov 19, 2026 by akgarg06 via sonar-scan #2306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ Proxy