Skip to content

dns: prevent creation of cross-tenant conflicting DNS zones in the same server - #13946

Open
winterhazel wants to merge 2 commits into
apache:mainfrom
winterhazel:fix-cross-tenant-dns-shadowing
Open

dns: prevent creation of cross-tenant conflicting DNS zones in the same server#13946
winterhazel wants to merge 2 commits into
apache:mainfrom
winterhazel:fix-cross-tenant-dns-shadowing

Conversation

@winterhazel

Copy link
Copy Markdown
Member

Description

allocateDnsZone allows users to register DNS zones that conflict with DNS zones from the same server belonging to other users, which consequently allows them to shadow DNS records belonging to other users.

Example: Victim tenant runs tenant1.cloud.example with www → 203.0.113.10 on a shared public server (suffix cloud.example). A co-tenant calls createDnsZone name=www.tenant1.cloud.example dnsserverid=<shared> — accepted as-is — then adds an apex A record to their own IP; every resolver using that PowerDNS now resolves the victim's hostname to the attacker.

This patch rejects zones that overlap another tenant's zone as either a DNS parent or child, and also requires a non-blank publicDomainSuffix for public servers. It was mostly generated using AI tools, but reviewed and tested by a human.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I reproduced the example scenario before the patch, and verified that it is not reproducible anymore after the changes.

@winterhazel winterhazel added this to the 4.23.0 milestone Aug 21, 2026
@winterhazel

Copy link
Copy Markdown
Member Author

@blueorangutan package

@weizhouapache

Copy link
Copy Markdown
Member

lgtm

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.73%. Comparing base (ba67a62) to head (dde2653).

Files with missing lines Patch % Lines
.../apache/cloudstack/dns/DnsProviderManagerImpl.java 50.00% 4 Missing and 7 partials ⚠️
.../org/apache/cloudstack/dns/dao/DnsZoneDaoImpl.java 61.53% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #13946   +/-   ##
=========================================
  Coverage     19.72%   19.73%           
- Complexity    19944    19951    +7     
=========================================
  Files          6371     6371           
  Lines        575738   575765   +27     
  Branches      70471    70478    +7     
=========================================
+ Hits         113587   113614   +27     
+ Misses       449805   449798    -7     
- Partials      12346    12353    +7     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests 21.01% <54.28%> (+<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.

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18952

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants