Remove inline annotation and add document the new behavior#872
Merged
Conversation
Contributor
There was a problem hiding this comment.
The PR makes a focused and well-motivated security fix — removing the Content-Disposition: inline default to mitigate stored XSS — with matching documentation, a changelog entry, and a regression test. The main issues to address are: the integration test performs a redundant second HTTP request instead of reusing the already-verified Awaitility response, the doesNotStartWithIgnoringCase("inline") assertion is logically redundant given the preceding startsWith("attachment") check, and the README security warning should qualify application/pdf as a potentially scriptable type in certain viewers.
PR Bot Information
Version: 1.29.2
- Event Trigger:
pull_request.opened - Experiment Variant:
control - Correlation ID:
20d41ca0-867a-11f1-80b4-078f025b1838 - File Content Strategy: Full file content
- Agent Instructions:
- LLM:
anthropic--claude-4.6-sonnet
lisajulia
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security: Default
Content-Dispositiontoattachmentto Mitigate Stored XSSSecurity Fix
🔒 Changed the default
Content-Dispositionfor attachment content frominlinetoattachment. This mitigates stored XSS attacks (CWE-79) where user-uploaded SVG or HTML payloads could be executed in the application origin when rendered inline by the browser.Applications that require inline previews can now explicitly opt in via their own CDS model annotation. It is strongly recommended to combine inline disposition with
@Core.AcceptableMediaTypesto restrict content to non-scriptable types (e.g.,image/jpeg,image/png,application/pdf).Changes
attachments-annotations.cds: RemovedType: 'inline'from theCore.ContentDispositionannotation, so attachments now default toattachmentdisposition. TheFilenameproperty is retained.README.md: Added a new Content Disposition section to the Table of Contents and documentation, explaining the new default behavior, the XSS security rationale, and how to opt in to inline rendering with a security warning.doc/CHANGELOG.md: Added anUnreleasedsection documenting the security change, referencing cds-calesi #1263, and providing guidance for applications that need inline previews.OdataRequestValidationWithoutTestHandlerAndWithoutMalwareScannerTest.java: Added a regression test (contentDownloadUsesAttachmentDisposition) that verifies attachment content responses default toContent-Disposition: attachment, guarding against regressions of the XSS mitigation. Also updated the copyright year.PR Bot Information
Version:
1.29.2pull_request.opened20d41ca0-867a-11f1-80b4-078f025b1838anthropic--claude-4.6-sonnet