fix: validate src URL scheme in slash command composer preview popup#40686
fix: validate src URL scheme in slash command composer preview popup#40686ggazzo wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 6bdee93 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe PR adds URL validation to the ChangesComposerBoxPopupPreview URL Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #40686 +/- ##
===========================================
- Coverage 69.63% 69.61% -0.03%
===========================================
Files 3338 3338
Lines 123289 123289
Branches 22005 21972 -33
===========================================
- Hits 85850 85824 -26
- Misses 34073 34097 +24
- Partials 3366 3368 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
67113a7 to
7cc802e
Compare
ComposerBoxPopupPreview rendered `item.value` directly into the `src` attribute of `<img>`, `<audio>`, and `<video>` tags without scheme validation. If `/v1/commands.preview` ever returned a `javascript:` (or other non-media) URI, the unsafe value would land in the DOM. Add a scheme allowlist (`http`, `https`, `data`, `blob`); skip the media element when the value fails validation.
7cc802e to
6bdee93
Compare
Summary
`ComposerBoxPopupPreview` rendered the `value` field from `/v1/commands.preview` straight into the `src` attribute of `
`, ``, and `
Fix
Origin
Spotted by hacktron during review of #40659. The component predates that PR (Feb 2025 refactor, commit 5f9adcd), so a standalone fix.
Test plan
Summary by CodeRabbit