Skip to content

fix: validate DNN static IP before subscriber writes - #223

Merged
Alonza0314 merged 3 commits into
free5gc:mainfrom
carlhus:fix/dnn-static-ip
Aug 5, 2026
Merged

fix: validate DNN static IP before subscriber writes#223
Alonza0314 merged 3 commits into
free5gc:mainfrom
carlhus:fix/dnn-static-ip

Conversation

@carlhus

@carlhus carlhus commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

fix(webconsole): validate DNN static IP before subscriber writes (#720)

  • This PR fixes issue #720 in WebConsole subscriber management.
    It prevents invalid Static IPv4 addresses from being saved when creating or updating subscribers.

  • Root cause:

    • Static IP validation was only performed through the optional /verify-staticip request.
    • Subscriber Create and Update APIs did not enforce the same validation before writing subscription data, allowing addresses outside the configured DNN Static IP Pool to be stored.
  • Changes:

    • Reuse Static IPv4 validation across Verify and Subscriber Create/Update APIs.
    • Aggregate and cache matching UPF pools; skip pool lookup when no Static IP is configured.
    • Return 400 for invalid addresses and 500 for SMF or pool configuration errors.
    • Pass the current SUPI to avoid self-collision during verification.
    • Extend api_verify_test.go to cover pool aggregation and address validation.
  • This is reported in GitHub Issue #720.

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

Hi @carlhus,
Please validate static IPs in PatchSubscriberByID as well

The new validation is applied to POST and PUT, but PATCH /subscriber/:ueId/:servingPlmnId still writes SessionManagementSubscriptionData without calling validateSubscriberStaticIPsForWrite.

@carlhus
carlhus force-pushed the fix/dnn-static-ip branch from 1abe982 to 22bcd8b Compare August 4, 2026 11:28

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

@Alonza0314
Alonza0314 merged commit 70d282f into free5gc:main Aug 5, 2026
4 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.

3 participants