Skip to content

Automattic/wordpress-atmosphere / .agents/skills/review

Shared 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.

FileKindSize
SKILL.mdskill md7.1 KB
guidelines/accessibility.mdmarkdown781 B
guidelines/authorization.mdmarkdown2.8 KB
guidelines/content-exposure.mdmarkdown6.8 KB
guidelines/cron.mdmarkdown1.9 KB
guidelines/hooks.mdmarkdown2.3 KB
guidelines/oauth.mdmarkdown3.6 KB
guidelines/output.mdmarkdown610 B
guidelines/records.mdmarkdown2.1 KB
guidelines/remote-fetch.mdmarkdown5.3 KB
guidelines/supply-chain.mdmarkdown582 B
guidelines/uninstall.mdmarkdown2.0 KB
guidelines/well-known.mdmarkdown1.4 KB
judge.mdmarkdown1.2 KB

guidelines/authorization.md

View on GitHub
# Authorization

Who may call a route, change a setting, see a post's projected data or delete a record, and how often.

Applies to: `includes/rest/**`, `includes/wp-admin/**`, `includes/oauth/**`, `includes/class-atmosphere.php`, `includes/transformer/class-preview.php`

## Past issues

- **Generic capability on a per-object surface** (#170 review): the `?atproto` preview gated on blanket `edit_posts`, so any author could read another author's projected records, including saved custom Bluesky text that role cannot otherwise see.

## Capabilities and nonces

- Admin pages check `manage_options` or the fitting capability.
- Every form submission (settings, OAuth connect and disconnect) has a nonce check. Each `phpcs:ignore WordPress.Security.NonceVerification` explains why it is safe.
- Unauthorized users cannot trigger the OAuth callback.
- Per-post controls in the editor check `edit_post`.
- AJAX and REST handlers check capabilities before processing.
- Settings API registrations have proper sanitize callbacks.

## Object-level capabilities

A handler that serves data derived from one post (the REST pre-publish projection, the front-end preview, editor panel data) gates on the meta capability for that post, `current_user_can( 'edit_post', $post->ID )`, not on a blanket capability like `edit_posts`. Mirror whatever the equivalent REST controller gates on. The blanket form lets any author read every author's per-post data.

## Who may delete a record

Files: delete paths in `includes/class-publisher.php` and `includes/class-reaction-sync.php`.

Before deleting on the PDS, the AT-URI's repo DID matches the connected account. A request from one user never deletes records owned by another.

## Rate limiting

Files: `includes/oauth/`, `includes/wp-admin/`, REST handlers.

- Every endpoint that mints, validates or accepts a token has per-IP rate limiting, or relies on a documented WordPress core or hosting-layer protection.
- OAuth start, callback and any retry endpoint are rate-limited. Repeated `state` mismatches or PKCE failures are an abuse signal, not an error to ignore.
- Per-IP buckets trust only the TCP peer by default. Keying on `$_SERVER['HTTP_X_FORWARDED_FOR']` is spoofable on directly exposed sites; default to `$_SERVER['REMOTE_ADDR']`, and honor proxy headers only through an explicit opt-in filter (for example `atmosphere_client_ip_sources`). Sites behind Cloudflare, Akamai or nginx need the filter; sites without a reverse proxy must not have it on.
- Fail closed when the client IP is unknown. An empty `REMOTE_ADDR` or a malformed `X-Forwarded-For` does not share one bucket with every other unidentified request; reject, or give it a conservatively limited bucket of its own.
- The OAuth token and refresh endpoints answer with `429 Too Many Requests` plus `Retry-After`, not a silent 401.
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall