Plugin Directory: Block a release when a security scan reports a high risk score - #777
Open
obenland wants to merge 4 commits into
Open
Plugin Directory: Block a release when a security scan reports a high risk score#777obenland wants to merge 4 commits into
obenland wants to merge 4 commits into
Conversation
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
11 times, most recently
from
August 10, 2026 20:34
720e3d1 to
eae73fc
Compare
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
4 times, most recently
from
August 10, 2026 21:38
9f85496 to
e9fa87e
Compare
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
3 times, most recently
from
August 11, 2026 14:38
05834de to
c284616
Compare
This was referenced Aug 11, 2026
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
2 times, most recently
from
August 11, 2026 20:40
b1e5832 to
db30b40
Compare
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
4 times, most recently
from
August 12, 2026 13:07
dd5c180 to
2429313
Compare
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
2 times, most recently
from
August 12, 2026 18:47
8cd0daa to
1ebec61
Compare
This was referenced Aug 12, 2026
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
from
August 13, 2026 18:49
1ebec61 to
374f9c4
Compare
This was referenced Aug 13, 2026
obenland
marked this pull request as ready for review
August 13, 2026 20:37
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
… risk score. Security scan callbacks now carry a max_risk_score and a bounded findings array. A completed scan at or above the threshold blocks the scanned release pending review — the previously served version keeps being served — and the plugin review team receives the findings as context via an internal note, a Slack alert, and a stored evidence snapshot. A verdict for a version already served, or superseded by a newer release, can't un-ship anything and stays advisory. Scanner retries are acknowledged idempotently under a canonical digest: an identical retry repeats no effects, and a completed verdict supersedes an earlier failure report for the same scan. Finding fields beyond the risk score are optional per the callback contract and read defensively. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
obenland
force-pushed
the
feature/gandalf-risk-score-suspension
branch
from
August 14, 2026 19:11
d31aad9 to
70622ec
Compare
…route. The callback contract has two halves that `required` cannot express, being unconditional: a completed scan reports a verdict, a failed one reports an error. Neither was checked, so a payload missing its half reached code that indexes it directly. A completed callback without `findings` fatalled before the delivery was acknowledged, leaving the scanner to retry it forever and the release unblocked; one without `max_risk_score` recorded a fabricated score of zero. The status validator now rejects both with a 400 the scanner can act on. A verdict at or above the threshold also alerts when the release can't be held — already served, or superseded — instead of passing silently whenever it carried no findings of its own. The stored evidence snapshot is slashed so backslashes in finding text survive `update_post_meta()`, and the review note reports the risk score to the same precision as the Slack alert. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing reads `_gandalf_scan_last_result`. The findings reach reviewers through the internal note and the Slack alert, and the release hold carries the scan ID and risk score it needs on the release row itself, so the meta was written on every completed callback and never surfaced. Its findings were bounded and stripped of snippets solely to keep that row small, which the display paths already do for themselves at five and ten. The alert gate goes back to keying on the findings count: a clean scan reports a maximum risk score of zero, so a verdict cannot reach the block threshold without findings behind it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A completed verdict was matched against the plugin's Version header before its release was held, which is the lookup WordPress#807 replaced: the header is author-controlled, so committing a rename into the scanned tag made the scan's version no longer the plugin's and the block was refused. Blocking now resolves the current release the way the updater does, from the stable tag, and applies only when that release is the one the verdict examined. The test environment gains WP_GANDALF_SCAN_SHARED_SECRET so the callback route can be driven by hand; the PHPUnit suite defines it itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Security scan callbacks now include a
max_risk_score(0–10) and a boundedfindingsarray. This builds on the advisory integration and acts on that evidence.Builds on #779. Supersedes the scan-driven half of #720/#729.
What it does
max_risk_score >= 8.0(Plugin_Scan_Gandalf::BLOCK_RISK_SCORE, filterable) blocks the scanned release via Plugin Directory: Add an API to block a release from being served #785'sAPI_Update_Updater::block_release(), regardless of the plugin's install count: the version is held out of the update API — the previously served version keeps being served — until a reviewer force-releases it. The plugin itself stays published; nothing closes.Callback handling
max_risk_scoreis trusted as-is — the scanner is authoritative for it.scan_idunder a canonical (key-order-insensitive) digest: an identical retry is acknowledged without repeating effects, a different body for a consumed scan is rejected as a conflict, and a completed verdict supersedes an earlier failure report for the same scan — the pending entry survives a failure for exactly that reason. A short per-plugin lock (released even if processing throws) prevents concurrent callbacks from double-processing or clobbering each other's records.esc_html()for the wp-admin note,htmlspecialchars( …, ENT_NOQUOTES )for Slack (the idiom of the existing Slack integrations — Slack only decodes&/</>entities).Testing
tests/Security_Scan_Block_Test.php(20 tests) covers the threshold boundary, replay and conflict handling (including a re-marshalled retry with different key order), a completed verdict superseding a failure report, blocking refused for served and superseded versions, blocking independent of install count, a reported score blocking even without findings detail, the snapshot bound, escaping of hostile finding strings, the row holding the served version through a scan-driven block, and force-release closing the loop.🤖 Generated with Claude Code