Skip to content

Plugin Directory: Include findings in security scan alerts - #779

Closed
obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:feature/security-scan-findings-alerts
Closed

Plugin Directory: Include findings in security scan alerts#779
obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:feature/security-scan-findings-alerts

Conversation

@obenland

@obenland obenland commented Aug 10, 2026

Copy link
Copy Markdown
Member

Completed security scan callbacks now carry the individual findings. This surfaces them in the review team's Slack alert:

  • The top findings, highest risk score first (the callback orders them by id), each with severity, risk score, title, and file:line — capped at five, with the investigation outcome when one reproduced.
  • A max-risk-score line, when the callback reports one.
  • Untrusted scanner and plugin strings (titles, file paths, severity keys) are escaped for Slack with htmlspecialchars( …, ENT_NOQUOTES ), the idiom of the existing Slack integrations — this neutralizes control sequences like <!channel> in author-controlled file names.

Callbacks without a findings array 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

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>
@obenland
obenland force-pushed the feature/security-scan-findings-alerts branch from 97f7831 to 323057a Compare August 10, 2026 20:42
@obenland
obenland marked this pull request as ready for review August 10, 2026 20:52
Copilot AI lite review requested due to automatic review settings August 10, 2026 20:52
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and max_risk_score from 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.

@bazza bazza closed this in 6a1bd3f Aug 10, 2026
obenland added a commit to obenland/wordpress.org that referenced this pull request Aug 11, 2026
- 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 &amp; in Slack.

Follow-up to WordPress#779 and WordPress#781.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
obenland added a commit to obenland/wordpress.org that referenced this pull request Aug 11, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants