Plugin Directory: Include findings in security scan alerts - #779
Plugin Directory: Include findings in security scan alerts#779obenland wants to merge 2 commits into
Conversation
b3fe339 to
97f7831
Compare
Completed scan callbacks now carry the individual findings. Show the highest-risk ones in the review team's Slack alert, along with the risk score derived from them, and escape the untrusted scanner and plugin strings for Slack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
97f7831 to
323057a
Compare
|
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. |
There was a problem hiding this comment.
Pull request overview
This PR enhances the Plugin Directory’s Gandalf security-scan Slack alerting by including per-finding details from completed scan callbacks, so the review team can see top findings (and max risk score when provided) directly in the alert.
Changes:
- Persist
findings(array) andmax_risk_scorefrom the callback payload into the Slack notification record. - Escape untrusted strings for Slack output and add formatted “top findings” lines sorted by highest
risk_score. - Add helper methods to sort findings (
top_findings) and generate a one-line excerpt (excerpt).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Group the findings list in a blockquote rail to set it off from the headline and footer. - Pad risk scores to one decimal so 6.0 and 6.5 read as peers. - Restore the investigation result dropped in the restyle: reproduced and conditional findings now carry the result in their badge. - Link the "…and N more" overflow line to the full report. - Decode entity-encoded post titles before escaping; they rendered as literal & in Slack. Follow-up to WordPress#779 and WordPress#781. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaces the text-only alert with a structured message: a header block with the plugin name and version, a findings/installs summary with a View report button, wp-admin and Plugin page context links, and one color-barred attachment per finding (red >=9, orange >=6, yellow >=4) holding the risk score, title, and a File: link to the Trac browser. The plain-text fallback keeps notifications readable, and the sender displays as "Gandalf" instead of the dispatching web host. Requires the notify_slack() array support in the private repository to deploy first; until then the webhook would reject the array payload. Follow-up to WordPress#779 and WordPress#781. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Completed security scan callbacks now carry the individual findings. This surfaces them in the review team's Slack alert:
id), each with severity, risk score, title, and file:line — capped at five, with the investigation outcome when one reproduced.htmlspecialchars( …, ENT_NOQUOTES ), the idiom of the existing Slack integrations — this neutralizes control sequences like<!channel>in author-controlled file names.Callbacks without a
findingsarray behave exactly as before. This is display-only groundwork: observing real finding content and scores in the channel informs the threshold for the automatic suspension follow-up (#777, which builds on this).🤖 Generated with Claude Code