Skip to content

fix(network): refine address classification - #45230

Merged
aminghadersohi merged 5 commits into
apache:masterfrom
mikebridge:sc-126317-network-hardening
Oct 13, 2026
Merged

aminghadersohi merged 5 commits into
apache:masterfrom
mikebridge:sc-126317-network-hardening

Conversation

@mikebridge

@mikebridge mikebridge commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

is_safe_ip now classifies a few more IPv6 address forms by what they actually point at:

  • NAT64 (64:ff9b::/96) addresses are checked using their embedded IPv4 address.
  • Local-use NAT64 (64:ff9b:1::/48), IPv4-compatible (::/96), 6to4 (2002::/16) and Teredo (2001::/32) addresses are refused.

Callers are unchanged: OAuth2 token requests, webhooks, URL dataset import and the Impala checks keep their request paths and their existing *_ALLOW_INTERNAL_HOSTS settings. UPDATING.md notes the change.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (backend).

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/utils/test_network.py: new rows pin the classification of each address form; the public-embedded 6to4 refusal regression fails on the prior PR head and passes after this correction.
  • pytest tests/unit_tests/utils

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

@netlify

netlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 0093a30
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6acd75cf4f6f76a892577d64
😎 Deploy Preview https://deploy-preview-45230--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.08%. Comparing base (f154d23) to head (b3e0f12).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #45230   +/-   ##
=======================================
  Coverage   83.08%   83.08%           
=======================================
  Files        3028     3028           
  Lines      196549   196555    +6     
  Branches    45899    45902    +3     
=======================================
+ Hits       163310   163316    +6     
  Misses      30015    30015           
  Partials     3224     3224           
Flag Coverage Δ
hive 35.06% <12.50%> (-0.01%) ⬇️
mysql 53.31% <25.00%> (-0.01%) ⬇️
postgres 53.32% <25.00%> (-0.01%) ⬇️
presto 36.84% <12.50%> (-0.01%) ⬇️
python 86.71% <100.00%> (+<0.01%) ⬆️
sqlite 53.07% <25.00%> (-0.01%) ⬇️
unit 80.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aminghadersohi
aminghadersohi self-requested a review October 12, 2026 23:36

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

One change: the 6to4 branch loosens the check on current Python patch releases instead of tightening it; the three linked suggestions refuse 2002::/16 outright.

Comment thread superset/utils/network.py Resolved
Comment thread tests/unit_tests/utils/test_network.py Resolved
Comment thread UPDATING.md Resolved
@mikebridge
mikebridge marked this pull request as ready for review October 13, 2026 00:00
Comment thread UPDATING.md Resolved
Comment thread superset/utils/network.py Resolved
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging because deployment-specific NAT64 prefixes can still allow checks to accept addresses embedding private IPv4 targets.
  • superset/utils/network.py only unwraps the well-known NAT64 prefix; assess whether affected deployments need configured-prefix checks or another mitigation.

Assessed commit: b3e0f12679f9

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

Approving at 149c2d7: the 6to4 refusal, test row and UPDATING.md note landed, CI is green, and the check is never looser than master on Python 3.11.9 or 3.11.15. Non-blocking: the is_safe_ip docstring still mentions only the IPv4-mapped unwrap.

@mikebridge

Copy link
Copy Markdown
Member Author

On the CodeAnt risk summary: operator-specific NAT64 prefixes can't be recognised from the address alone, so detecting them would need operator configuration, which is out of scope for this is_safe_ip change. UPDATING.md now states that limit explicitly (details in this thread).

@mikebridge

Copy link
Copy Markdown
Member Author

Thanks @aminghadersohi — addressed the non-blocking docstring note from your approval in b3e0f12679. The docstring matches UPDATING.md: mapped and well-known NAT64 addresses are checked via embedded IPv4; local-use translation, IPv4-compatible, 6to4 and Teredo forms are refused outright; operator-specific prefixes are not detected. Docstring only, no classification behavior changed. All 1,293 utils tests and changed-file hooks passed. Updated and reviewed with Codex.

@aminghadersohi
aminghadersohi merged commit 0f875ca into apache:master Oct 13, 2026
71 checks passed
villebro pushed a commit that referenced this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants