Skip to content

Address post-review findings: Safari resources, plugin URI safety, stale comment#23

Merged
jakemgold merged 1 commit into
mainfrom
fix/post-review-cleanup
Jun 7, 2026
Merged

Address post-review findings: Safari resources, plugin URI safety, stale comment#23
jakemgold merged 1 commit into
mainfrom
fix/post-review-cleanup

Conversation

@jakemgold

Copy link
Copy Markdown
Collaborator

Summary

Three small follow-ups from a read-only sweep against #18 / #20.

1. Safari Resources options/ was left untracked (P1)

The Xcode project file (`project.pbxproj`) added in #18 references `Resources/options/`, but the three files inside that folder were never staged. A fresh clone hits the same "Unable to find options/options.html" error we saw before #18 fixed the Xcode side — just from the other direction. Stage them.

2. Plugin URI scheme validation (P2)

`lib/site-info.js` was happily forwarding whatever `plugin_uri` the REST response carried. That value comes from a plugin's own "Plugin URI" header — site-authored, and attacker-controllable when a site runs untrusted plugins. `SiteInfoPanel` then opened those URIs in new tabs.

Add `safePluginUri()` that rejects anything outside `http:` / `https:`. The existing `wordpress.org/plugins/{slug}/` fallback in `SiteInfoPanel` covers the rejected cases. A new `[23]` smoke scenario covers javascript:, data:, malformed, and empty.

3. Stale comment in `lib/early.js` (P3)

The header doc still said the admin bar default was hidden. The per-origin default flipped to shown in #17 and the global override landed in #18. Rewrite the paragraph so future maintainers don't follow the wrong mental model.

Test plan

  • `npm run build:safari` — clean
  • `npm test --prefix test` — all green (existing scenarios + new [23])
  • Fresh clone + `npm install` + open the Safari project in Xcode without running `build:safari` first — should no longer error on missing options page resources

Credit: findings from a Codex read-only sweep.

…ale comment

Three small follow-ups from a read-only sweep of #18 + #20:

1. The Safari Resources mirror of `options/` was never staged in #18.
   Xcode's project file already references `Resources/options/` (added
   in #18), but the files themselves were left untracked, so a fresh
   clone hits "Unable to find options/options.html in the extension's
   resources" — the same error pattern we hit before the Xcode project
   was updated, just from the other direction. Stage the three files
   so Xcode resolves them out of the box.

2. The Site Information panel happily opened whatever `plugin_uri` the
   REST response carried. That value comes from a plugin's own
   "Plugin URI" header — site-authored, attacker-controllable when
   sites run untrusted plugins. Add `safePluginUri()` in `lib/site-info.js`
   that rejects anything other than `http:` / `https:`; SiteInfoPanel's
   existing fallback to `wordpress.org/plugins/{slug}/` covers the
   rejected cases. New `[23]` smoke scenario covers javascript:, data:,
   malformed, and empty inputs.

3. The header comment in `lib/early.js` still said the admin bar default
   was hidden. That was the original behavior, but the per-origin default
   flipped to shown in #17 and the global override added in #18. Rewrite
   the doc paragraph so future maintainers don't follow the wrong mental
   model.

Reported by Codex sweep against #18 / #20.
@jakemgold jakemgold requested a review from fabiankaegy as a code owner June 7, 2026 00:17
@jakemgold jakemgold merged commit 2b29d7f into main Jun 7, 2026
@jakemgold jakemgold deleted the fix/post-review-cleanup branch June 7, 2026 00:17
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.

1 participant