Whitehat tests a Payload site for security holes using plain functions that run in your test suites, plus a plugin that adds a whitehat-alerts collection to the admin. It checks read and write access per role with canary records, forged credentials, and a checklist of header, cookie, CORS, GraphQL and secrets checks. It only reports findings and never fixes anything; some probes write, so use a throwaway database. Requires Payload 3.80 or newer.
Whitehat for Payload: finds security holes in a Payload site, its database, code and UI, with severity-ranked alerts and a checklist that grows with every incident.
Installation
npm i @extantape/payload-plugin-whitehat0
Stars
0
Forks
0
Open Issues
1 weeks ago
Last Updated
295
Weekly Downloads
v0.5.0
npm Version
247.1 KB
Unpacked Size
0
Dependencies
00 since Nov 8
| Date | Stars |
|---|---|
| Dec 6, 2026 | 0 |
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
316+316 since Nov 11
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 316 |
| Dec 5, 2026 | 472 |
| Dec 4, 2026 | 629 |
| Dec 3, 2026 | 608 |
| Dec 2, 2026 | 595 |
| Dec 1, 2026 | 570 |
| Nov 30, 2026 | 380 |
| Nov 29, 2026 | 354 |
| Nov 28, 2026 | 190 |
| Nov 27, 2026 | 30 |
| Nov 26, 2026 | 33 |
| Nov 25, 2026 | 36 |
| Nov 24, 2026 | 38 |
| Nov 23, 2026 | 197 |
| Nov 22, 2026 | 192 |
| Nov 21, 2026 | 189 |
| Nov 20, 2026 | 182 |
| Nov 19, 2026 | 174 |
| Nov 18, 2026 | 169 |
| Nov 17, 2026 | 161 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 441 |
| Nov 14, 2026 | 441 |
| Nov 13, 2026 | 403 |
| Nov 12, 2026 | 166 |
| Nov 11, 2026 | 0 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1451881672-root)<a href="https://payloaddirectory.dev/plugins/1451881672-root"><img src="https://payloaddirectory.dev/badge/1451881672-root.svg" alt="Payload Directory"></a>README
Whitehat for Payload: finds security holes in a Payload site, its database, code and UI, with severity-ranked alerts and a checklist that grows with every incident.
Status: early. 0.5.0 is the latest release. Releases go to npm as @extantape/payload-plugin-whitehat. 272 tests.
CHECKLIST.md says which).payloadReadPaths), plus any REST or GraphQL paths you add through your route handlers. You also declare forbidden writes: things a role must not be able to do. It tries each one, and fails it if it's allowed, or if the refusal's message says something it mustn't. Only a real refusal passes: HTTP 401 or 403 by default, or what you describe with refusal (a pattern or a function) when the site refuses another way. Any other error, such as a validation error from a probe missing a field, is not checked, because an allowed write that failed for another reason looks the same.runCredentialCheck asks each page, endpoint, action or gate you list as a signed-out visitor, then again with forged credentials (fake, expired, malformed and foreign session cookies; forged role, tenant or preview cookies you name; forged x-forwarded-* and Vercel bypass headers). A forgery that gets more than the signed-out request is a finding: high if data or an action is behind it, medium for a courtesy gate. Where a signed-out visitor already gets a 2xx (a sign-in page served as 200), a bypass looks the same, so give secretMarkers (text only someone let through would see); without them that target is not checked.checkHeaders, checkCookies, checkCors, checkOpenRedirects, checkGraphql, checkAdminExposure, checkClientSecrets, checkUploads, scanUserContent): each takes plain answers or config, so it runs the same against dev, test or (read-only) a live site.
whitehat plugin, whitehat-alerts).
onCritical once, so the site can tell the owner.access, and only an answer of exactly true lets someone in. Anything else is a no: false, 1, 'yes', an object (one shaped like a query included, so it can't become a read filter), or an error thrown or rejected. A broken rule refuses with 403 instead of a 500, and nobody who isn't signed in gets in, whatever access says. Since 0.2.2: before, any truthy answer let someone in, and an object went to Payload as the alerts' read and update access.runServerBackDoorCheck) need allowWrites: true. Others run the writes you give them, such as the access check's forbidden writes, without it. Run anything that writes on a throwaway database. The whitehat plugin also stores its alerts in the site's database.disableTransaction, overrideAccess), host rules that replace defaults, flags a plugin leaves on the caller's req.context, and a small source lint. They report and never fix, but the probes write: they try to create, change and delete rows in the collections you name, so run them on a throwaway database. Only the marker (an APIError your plugin throws with status 403 and { refusal: 'transactions-required' }), or an error with a bare 401, 403 or 404 status, counts as a refusal; any other error, text included, is reported as not checked, never as a pass. See docs/review-checks.md. runServerBackDoorCheck needs allowWrites: true too. The other checks only run the callbacks you give them, and Whitehat can't stop those callbacks from writing.allowWrites: true, and inside a site suite only when the suite is declared { run, writes: true } and allowWriteProbes is true. Anything else is reported as not checked and nothing is written. Each check deletes the records it made itself, and only those, when it finishes, even after an error, and reports any it couldn't delete. Rows that appear in the checked collection during a check and that the check didn't make itself (from your writes, operations, hooks or other writers) are listed by id in a left-behind finding and never deleted. Rows added to other collections aren't seen. Rows that appear at other moments, such as while your seed runs, during the create-rules check's two test creates, while a check reads the stored record, or during clean-up aren't listed, and they aren't deleted either. Updates and deletes that got through are the hole being shown, and they aren't undone. What they can't judge is not checked. Your delete hooks, afterDelete included, run during clean-up.Run it against a throwaway or test database. Never point write probes at a live site. A suite that tries writes is declared as { run, writes: true }, and the plugin refuses to start with one unless allowWriteProbes: true, which belongs only on a throwaway test copy: Retest selected runs suites inside the site.
On its own: the checks are plain functions that take your site's read and write functions, so they run with no other plugin. The whitehat plugin adds the alerts collection and needs your access.
Needs: Payload ^3.80.0 as a peer dependency, with @payloadcms/ui ^3.80.0, Next.js >=15 and React ^19.0.0 optional. No other EXTANT APE plugin is required.
Works with: nothing is wired to another plugin. It tests whatever access rules the site has, including ones other plugins add. Hats' design plans a Whitehat canary for it: an admin wearing Member must not read admin-only records.
Color Theory: no direct link. Its one admin control, the retest button, uses Payload's button styles and --theme-* colors, so it follows Color Theory's admin colors when its applyToAdmin option is on.
Family: It's part of the Defense family (a working draft): plugins designed to sit together to find and stop abuse. The other member, Guardrails (rate limits), isn't built yet.
import { formatReport, payloadReadPaths, runAccessCheck } from '@extantape/payload-plugin-whitehat'
const findings = await runAccessCheck({
viewers: [{ role: 'signed-out', user: null }, { role: 'member', user: member }, { role: 'staff', user: admin }],
canaries: [
{
id: 'private-note',
title: 'A private note is readable by others',
marker: privateNote.id,
visibleTo: ['staff'],
paths: payloadReadPaths(payload, { collection: 'notes', ids: [privateNote.id], where: { site: { equals: site.id } } }),
},
],
writes: [{ id: 'edit-others', title: 'A member edits someone else’s note', role: 'member', attempt: (v) => payload.update({ collection: 'notes', id: othersNote.id, data: { text: 'x' }, overrideAccess: false, user: v.user as never }) }],
})
console.log(formatReport(findings))
npm test # Vitest
npm run typecheck
npm run build # dist/
Releasing: see RELEASING.md.
MIT
Tags
payload plugin audit log
Append-only audit log of document, global and auth changes with CSV and NDJSON export
72394/wk37v3
audit logs
Read-only audit trail of create, update, delete and login events with field-level diffs and sensitive-field redaction
67660/wk0v3
payload audit logs
Automatically log create, read, update and delete operations on selected collections
5068/wk6v3
activity log
Record create, update and delete activity on selected collections and globals in a dedicated log collection
87639/wk115v4
payload auditor
Hook-based audit logging for Payload collections and globals with buffered writes and automatic log cleanup
811.4k/wk82v3
payload hooks
Identifier-only audit logging hooks for Payload collections, plus a helper to run callbacks after transaction commit
77225/wk3v3