Repository navigation
fix(logs): build logs alert links when a filter holds a regex - #127939
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details. |
🤖 CI report
|
|
Risk: No findings Fixes logs alert notification links and legacy webhook bodies for regex filters by passing only the page path to absolute_uri and appending the urlencoded query afterwards, so the %5C of an encoded backslash no longer trips the ambiguous-authority guard. The change is safe: the validated host is fixed before the query is appended, and the query itself is fully percent-encoded via urlencode, so no attacker-influenced data can alter the link's authority. Sentinel reviewed |
There was a problem hiding this comment.
Approved.
The security-sensitive change has current-head independent review, owning-team authorship, and strong familiarity. Source inspection supports the stated safety rationale, and there are no outstanding substantive concerns.
- Author wrote 100% of the modified lines and has 25 merged PRs in these paths (familiarity STRONG).
- PostHog Review (Standard) reviewed the current head: no findings.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 10L, 1F substantive, 17L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1a-trivial (17L, 2F, single-area, fix) |
| stamphog 2.7.0 | .stamphog/policy.yml @ e60eb63 · reviewed head e60eb63 |
|
/trunk merge |
Problem
^4\d{2}$, gets a degraded notification from the alerts platform.%5C, andabsolute_urirefuses any URL that holds%5C.Changes
absolute_uriand append the query after it. A query cannot change the host, so the host guard still covers the part it protects.products/data_catalogandproducts/tasksalready build links this way.How did you test this code?
Test rationale: extended
test_a_logs_link_opens_the_window_and_filters_the_check_queried, for both the message link and the legacy webhook body, with a regex filter. It asserts the filter survives in the link. Without the fix, both cases raisePotentialSecurityProblemException.Not checked: a real delivery to Slack or a webhook.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5
Skills:
/writing-tests,/writing-code-comments,/simplify,/code-review,/writing-pr-descriptions, CodeRabbit CLI (no findings)More context for AI agents
%5Ccheck inhas_ambiguous_authorityto the authority is the deeper fix, but it guards OAuth and redirect URLs and needs a security review.%5Ccheck inposthog/security/url_validation.py; otherabsolute_uricallers with user data in the query, such as the AI observability eval report links.products/logs/backend/platform_alert_wording.py.🤖 Generated with Claude Code