Skip to content

fix(aws-bucket-takeover): exclude S3 account regional namespace bucke…#15608

Merged
pussycat0x merged 4 commits intoprojectdiscovery:mainfrom
venjaku:s3-regional-namespace-update
Mar 25, 2026
Merged

fix(aws-bucket-takeover): exclude S3 account regional namespace bucke…#15608
pussycat0x merged 4 commits intoprojectdiscovery:mainfrom
venjaku:s3-regional-namespace-update

Conversation

@venjaku
Copy link
Copy Markdown
Contributor

@venjaku venjaku commented Mar 16, 2026

Summary

Updates the AWS S3 bucket takeover detection template to properly exclude AWS Account
Regional Namespace buckets, which are account-bound and cannot be taken over.

Changes Made

  • Added regex matcher to exclude Account Regional Namespace format:
    <name>-<account-id>-<region>-an.s3...amazonaws.com
  • Maintained detection for classic S3 endpoints (still vulnerable)
  • Added documentation explaining why these are excluded

Technical Details

AWS introduced Account Regional Namespace for S3 in March 2026. These buckets:

  • Are bound to a specific AWS Account ID
  • Are bound to a specific Region
  • Cannot be registered/claimed by a different AWS account
  • Therefore, the classic S3 takeover vector doesn't apply

Related

…ts from scope

AWS introduced Account Regional Namespaces for S3 general purpose buckets on 12 March 2026. Bucket names using this feature are suffixed with a per-account, per-region token (-<12-digit-account-id>-<region>-an), making them cryptographically bound to a single AWS account. Unlike global-namespace buckets, these cannot be registered by a different AWS account, so traditional subdomain takeover is not possible. Without this fix, the template would produce false positives against regional namespace buckets.

A negative regex matcher has been added on the host part to exclude regional namespace buckets from scope. This only addresses the direct CNAME takeover path (Case 2). The hostname-mismatch variant (Case 3 — where a CNAME points to a regional bucket but the Host header resolves a different unclaimed global bucket) is a distinct attack vector and should be covered in a separate template.

References: https://aws.amazon.com/about-aws/whats-new/2026/03/amazon-s3-account-regional-namespaces/ and https://docs.aws.amazon.com/AmazonS3/latest/userguide/gpbucketnamespaces.html
@neo-by-projectdiscovery-dev
Copy link
Copy Markdown

neo-by-projectdiscovery-dev bot commented Mar 16, 2026

Neo - Nuclei Template Review

No security issues found

Highlights

  • Author field formatting cleaned up: removed extra space before 'venjaku' (line 4: pdteam,pwnhxl,zy9ard3,venjaku)
  • Account Regional Namespace exclusion regex unchanged from approved version at c853d19
  • Pattern at line 39 remains correct: '^[a-z0-9][a-z0-9-]+-[0-9]{12}-[a-z0-9-]+-an.s3.[a-z0-9-]+.amazonaws.com'
  • Properly handles all AWS region formats: standard (us-east-1), GovCloud (us-gov-west-1), China (cn-north-1)
Hardening Notes
  • Incremental diff shows 18 lines changed (6 insertions, 12 deletions) but represents formatting/reorganization only
  • No functional changes to the regex pattern or template logic
  • Previously identified issues remain fixed with no regression

Comment @pdneo help for available commands. · Open in Neo

…ts from scope

AWS introduced Account Regional Namespaces for S3 general purpose buckets on 12 March 2026. Bucket names using this feature are suffixed with a per-account, per-region token (-<12-digit-account-id>-<region>-an), making them cryptographically bound to a single AWS account. Unlike global-namespace buckets, these cannot be registered by a different AWS account, so traditional subdomain takeover is not possible. Without this fix, the template would produce false positives against regional namespace buckets.

A negative regex matcher has been added on the host part to exclude regional namespace buckets from scope. This only addresses the direct CNAME takeover path (Case 2). The hostname-mismatch variant (Case 3 — where a CNAME points to a regional bucket but the Host header resolves a different unclaimed global bucket) is a distinct attack vector and should be covered in a separate template.

References: https://aws.amazon.com/about-aws/whats-new/2026/03/amazon-s3-account-regional-namespaces/ and https://docs.aws.amazon.com/AmazonS3/latest/userguide/gpbucketnamespaces.html
Copy link
Copy Markdown
Contributor Author

@venjaku venjaku left a comment

Choose a reason for hiding this comment

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

Updated the brand, please review

Updated regex pattern to - '^[a-z0-9][a-z0-9-]+-[0-9]{12}-[a-z0-9-]+-an\.s3\.[a-z0-9-]+\.amazonaws\.com'
Copy link
Copy Markdown
Contributor Author

@venjaku venjaku left a comment

Choose a reason for hiding this comment

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

made changes to the branch

@theamanrawat theamanrawat added the Done Ready to merge label Mar 25, 2026
@pussycat0x
Copy link
Copy Markdown
Contributor

Hi @venjaku, Thank you for updating this template with the community and for your contribution to this project. Your efforts are greatly appreciated. Cheers!

@pussycat0x pussycat0x merged commit 9607153 into projectdiscovery:main Mar 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Done Ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants