Skip to content

Fix 404 on AI Triage results by URL-encoding group_id - #224

Merged
cx-happy-yang merged 2 commits into
masterfrom
fix/ai-triage-url-encode-group-id
Sep 2, 2026
Merged

Fix 404 on AI Triage results by URL-encoding group_id#224
cx-happy-yang merged 2 commits into
masterfrom
fix/ai-triage-url-encode-group-id

Conversation

@cx-happy-yang

Copy link
Copy Markdown
Contributor

retrieve_ai_triage_results() built the request path as "{base_url}/triage/{project_id}/{group_id}" without encoding group_id. SCA group ids can contain reserved URL characters, e.g. "CVE-2015-4852#-#Maven-commons-collections:commons-collections-3.2.1#-#", and '#' starts a URL fragment, so the server received a truncated path and returned 404.

group_id is now percent-encoded with urllib.parse.quote before being substituted into the path, so callers pass the raw value instead of having to pre-encode it themselves. Updated the existing integration tests (which previously pre-encoded group_id, which would now double- encode it) and added unit tests covering the encoding behavior.

retrieve_ai_triage_results() built the request path as
"{base_url}/triage/{project_id}/{group_id}" without encoding group_id.
SCA group ids can contain reserved URL characters, e.g.
"CVE-2015-4852#-#Maven-commons-collections:commons-collections-3.2.1#-#<uuid>",
and '#' starts a URL fragment, so the server received a truncated path
and returned 404.

group_id is now percent-encoded with urllib.parse.quote before being
substituted into the path, so callers pass the raw value instead of
having to pre-encode it themselves. Updated the existing integration
tests (which previously pre-encoded group_id, which would now double-
encode it) and added unit tests covering the encoding behavior.
@cx-happy-yang cx-happy-yang added the workflows-approved A PR needs the label workflows-approved to run any workflows. label Sep 2, 2026
@cx-happy-yang cx-happy-yang self-assigned this Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details70b6cd95-226d-404d-a23f-ff35f44594c7

Great job! No new security vulnerabilities introduced in this pull request

Covers the SAST case reported with a negative similarity_id
(e.g. -501015144): '-' is an unreserved URL character, so quote()
must leave it unchanged rather than encoding it.

Verified end-to-end against a live tenant:
- SCA case from the original report (CVE-...#-#...#-#...): 200 OK, was 404
- SAST positive similarity_id (existing integration test): PASSED
- SAST negative similarity_id (-501015144): 200 OK, unchanged

@cx-james-bostock cx-james-bostock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @cx-happy-yang,
Looks good to me.

@cx-happy-yang
cx-happy-yang merged commit 4952c19 into master Sep 2, 2026
9 checks passed
@cx-happy-yang
cx-happy-yang deleted the fix/ai-triage-url-encode-group-id branch September 2, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workflows-approved A PR needs the label workflows-approved to run any workflows.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants