payment-widget: fix NaCl bundle + harden against XSS/callback/iframe#143
Closed
liu971227-sys wants to merge 1 commit intoScottcjn:masterfrom
Closed
payment-widget: fix NaCl bundle + harden against XSS/callback/iframe#143liu971227-sys wants to merge 1 commit intoScottcjn:masterfrom
liu971227-sys wants to merge 1 commit intoScottcjn:masterfrom
Conversation
Contributor
|
Security-focused review (PR #143)
Overall: direction is solid for DOM injection + callback safety; please fix the BOM/garbled checkmark before merge. |
Contributor
David-code-tang
left a comment
There was a problem hiding this comment.
Security direction looks good (textContent for user-controlled fields, iframe default-deny, callback URL restriction, PoCs included).
Two issues to fix before merge:
- UTF-8 BOM / encoding regressions
- payment-widget/README.md and payment-widget/rustchain-pay.js appear to start with a BOM (shows as an invisible U+FEFF in diff). Please remove; it can cause tooling/display issues.
- fileLabel.textContent changed from a checkmark to a garbled string (looks like "鉁?" prefix). That looks like encoding corruption. Suggest using ASCII (e.g. "OK " + file.name) or a unicode escape ("\u2713 " + file.name).
- Minor callback hardening nit
- safeCallbackUrl() is good; consider explicitly rejecting URL usernames/passwords (u.username/u.password) or document the behavior, to avoid surprising callback handling.
Otherwise LGTM after the encoding fix.
Scottcjn
requested changes
Feb 13, 2026
Owner
Scottcjn
left a comment
There was a problem hiding this comment.
Closing — Duplicate of #152
This PR addresses the same payment widget XSS issue as #152 (David-code-tang), but #152 is cleaner, more focused, and was submitted first. Closing this as duplicate.
@liu971227-sys — You have several other open PRs (#155, #148, #140) that need work. Please focus on quality over quantity.
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.
Fixes bounty #67 (payment widget hardening).
Key changes
PoCs (in-repo)
Notes