Automattic/wordpress-activitypub / .agents/skills/review
review
VerifiedShared base for reviewing a diff, a branch or a PR in this plugin. How to read the diff, which repo guidelines to load for the changed paths, and the shape of a finding. Used by the code-review and security-audit agents.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.6 KB |
| guidelines/accessibility.md | markdown | 759 B |
| guidelines/authorization.md | markdown | 4.9 KB |
| guidelines/content-exposure.md | markdown | 6.9 KB |
| guidelines/cron.md | markdown | 897 B |
| guidelines/inbox.md | markdown | 7.6 KB |
| guidelines/integrations.md | markdown | 2.0 KB |
| guidelines/multisite.md | markdown | 1018 B |
| guidelines/output.md | markdown | 3.3 KB |
| guidelines/remote-fetch.md | markdown | 6.4 KB |
| guidelines/signatures.md | markdown | 4.5 KB |
| guidelines/supply-chain.md | markdown | 596 B |
| judge.md | markdown | 1.3 KB |
guidelines/output.md
View on GitHub# Output and links
Escaping, and remote values that become a link, a redirect or a navigation target.
Applies to: `includes/wp-admin/**`, `includes/transformer/**`, `templates/**`, `src/**`, `includes/class-comment.php`, `includes/class-emoji.php`
## Past issues
- **Stored XSS** (WPScan `58a63507-…` / `c15a6032-…`, fixed 1.0.0/1.0.1): contributors and above could inject scripts.
- **Remote URLs reaching a link sink** (2026): values from remote documents (a WebFinger link `template`, actor fields, any member that later becomes an `href`, a `window.open()` target or a redirect) were escaped but not validated.
- **Remote emoji names matched as given** (2026): emoji `tag` names from remote actors and objects were stored and replaced in content as they came, without a check that they were shortcodes, one tag after another. Now only valid shortcodes are stored and matched, in one pass.
## Escaping
Files: `includes/wp-admin/`, `includes/transformer/`.
- Admin output uses `esc_html()`, `esc_attr()`, `esc_url()`, `wp_kses_post()`. Remote actor names and bios in admin are escaped.
- JSON-LD output does not reflect unsanitized input.
- Error messages do not leak sensitive data.
## Remote values that become a URL
A value from a remote document is as untrusted as an inbox activity, and escaping it is not validating it.
- **Allow schemes, do not escape.** `esc_url()` is wrong for URI templates (it strips `{uri}` / `{object}`), and `wp_allowed_protocols()` is wider and filterable, so another plugin could widen a gate it does not know about.
- **A scheme check alone is not enough.** Protocol-relative (`//host`), schemeless paths, an empty authority (`https:///path`) and empty or whitespace values give `wp_kses_bad_protocol()` nothing to strip. Also require a host and compare case-folded, because kses lowercases the scheme it returns.
- Server side: `get_url_authority()` + `wp_kses_bad_protocol( $value, array( 'http', 'https' ) )` + a case-folded compare. Client side: `isSafeUrl()` in `src/shared/safe-url.js`. Keep the two in step, and enforce both: where the value is stored or returned, and where it reaches the sink.
- Not `filter_var( …, FILTER_VALIDATE_URL )`, which rejects IDN hosts that `new URL()` accepts, and not `wp_http_validate_url()`, whose fetch rules (ports, private IPs) do not apply to a URL the browser opens.
- Values stored before the gate existed (`localStorage`, options, post meta) are validated again on read.
- Find every remote field that ends in `window.open(`, an `href`, `wp_redirect()` or `data-wp-bind--href`, and confirm a scheme allow list sits on the path. Skip a bad value instead of failing, so the other links keep working.
## Remote values that become a search key
A remote value that the plugin looks for in content (today emoji names; any other remote name the plugin later looks for in content) is validated to its expected shape before it is stored and again before it is matched, because records stored earlier can hold others.
- Emoji go through `Emoji::get_shortcode()`: `:name:` with letters, digits, `_` and `-`, 2 to 100 characters.
- Replace all keys in one pass (`Emoji::replace_names()`), so the output of one replacement is never matched by the next.
- Look up only the keys the text uses, so the work scales with the text and not with what the remote sent.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |