Skip to content

fix(udm): sanitize SDM processor errors - #94

Merged
Alonza0314 merged 3 commits into
free5gc:mainfrom
wiwi878:fix/1122-supi-validation
Aug 20, 2026
Merged

fix(udm): sanitize SDM processor errors#94
Alonza0314 merged 3 commits into
free5gc:mainfrom
wiwi878:fix/1122-supi-validation

Conversation

@wiwi878

@wiwi878 wiwi878 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Depends on #91

Summary

  • Sanitize non-GenericOpenAPIError responses in the six Issue #1122-related SDM processor paths.
  • Keep internal UDR URLs and parser details in server logs instead of ProblemDetails.detail.
  • Use one shared error-to-ProblemDetails helper, including GetTraceData.
  • Add a regression test proving internal URL details are not exposed.

Relationship to #91

PR #91 adds the SUPI validation in the six Nudm_SDM GET handlers. This PR is a follow-up defense-in-depth change at the processor error boundary and intentionally does not duplicate the handler validation or API tests from #91.

Related issue: free5gc/free5gc#1122

Validation

  • go test ./...
  • go vet ./...
  • golangci-lint run
  • git diff --check

Six GET handlers forwarded the supi path parameter to UDR without
calling validator.IsValidSupi(), unlike HandleGetAmData in the same
file. A crafted supi containing control characters makes UDM build an
invalid internal UDR URL, fail net/url parsing, and return a 500 that
leaks the full internal UDR URL in the response body (CVE-2026-42459,
missed fix of CVE-2026-27642).

Apply the same validation block used by HandleGetAmData to
HandleGetSmfSelectData, HandleGetSupi, HandleGetTraceData,
HandleGetUeContextInSmfData, HandleGetNssai and HandleGetSmData.

Fixes #1122
arccat-114 and others added 2 commits August 18, 2026 15:43
The SUPI validation added in this PR rejects non-IMSI values, so the
plmn-id conformance test must use a well-formed SUPI to reach the
query-param check. Also switch httptest.NewRequest to
NewRequestWithContext to satisfy noctx.
@wiwi878
wiwi878 force-pushed the fix/1122-supi-validation branch from 183e244 to b98ead2 Compare August 20, 2026 06:33
@wiwi878 wiwi878 changed the title fix(udm): prevent SDM SUPI error leakage fix(udm): sanitize SDM processor errors Aug 20, 2026

@d11nn d11nn 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.

@Alonza0314
Alonza0314 merged commit a2b5bcf into free5gc:main Aug 20, 2026
3 checks passed
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.

4 participants