Repository navigation
Conversation
Automated security fix generated by OrbisAI Security
There was a problem hiding this comment.
🟡 Changes recommended
Redirect enforcement and pending-request cleanup leave unresolved security and correctness issues.
2 open issues
What changed in this PR
Adds URL validation to the remote-input element to restrict requests derived from src to the page’s origin.
Changes:
- Reject cross-origin destinations before fetching.
- Emit a bubbling
remote-input-errorevent when validation fails.
| File | Description |
|---|---|
src/index.ts |
Adds the same-origin check and rejection event. |
Review effort: Max
| state.currentQuery = query | ||
|
|
||
| const url = new URL(src, window.location.href) | ||
| if (url.origin !== window.location.origin) { |
| remoteInput.dispatchEvent( | ||
| new CustomEvent('remote-input-error', { bubbles: true }) | ||
| ) | ||
| return |
This branch has not been deployed
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.

The component builds a fetch destination from the remote-input element's src attribute and sends a request without validating the destination against an approved origin or URL policy. If an attacker can influence that attribute, the victim's browser may send requests to internal or otherwise unintended resources. Because this is browser-side code, response access is also subject to browser same-origin and CORS restrictions; the scan does not establish that internal responses or credentials can necessarily be read. The affected code is
src/index.ts:108. This change is the fix I would apply.Reference: CWE-918
What changed
src/index.tsVerification
No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.
Automated security fix by OrbisAI Security