403 on everything, and it still leaked
The bucket denies every GET. The file names are the data.
The scene
Reported: a security researcher emails security@: "Your sudosec-backups bucket lists every customer's invoice filename to anonymous users. FYI." She attaches her terminal:
$ curl -s 'https://sudosec-backups.s3.us-east-va.io.cloud.ovh.us/?list-type=2' | head
<?xml version="1.0"?><ListBucketResult><Name>sudosec-backups</Name>
<Key>invoices/2026-09/acme-corp_dan@acme.com_INV-8841.pdf</Key>
<Key>invoices/2026-09/blueteam_io_billing@blueteam.io_INV-8849.pdf</Key>
<Key>db-snapshots/2026-12-07/forums.dump.zst</Key>
<IsTruncated>true</IsTruncated>…
$ curl -si '…/invoices/2026-09/acme-corp_dan_dan@acme.com_INV-8841.pdf' | head -1
HTTP/1.1 403 ForbiddenSupport's first instinct: GET an object, watch the 403, and close the ticket with "objects are private". The researcher is right anyway.
Bucket policy (current):
{
"Version": "2012-10-17",
"Statement": [
{ "Sid": "PartnerUpload", "Effect": "Allow", "Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::sudosec-backups/incoming/*" },
{ "Sid": "AuditReadIndex", "Effect": "Allow", "Principal": "*",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::sudosec-backups" }
]
}git blame on the IaC repo: PartnerUpload added 14 months ago so a bookkeeping vendor could drop nightly exports — the commit message says "temporary, replace with a role next sprint." AuditReadIndex added 4 months ago so an external auditor could "verify objects exist" — marked TODO in the ticket, which is still open. The scoped IAM role for the vendor exists in the same module, commented out.
Public-access-block configuration:
BlockPublicAcls: true IgnorePublicAcls: true
BlockPublicPolicy: false RestrictPublicBuckets: falseBlockPublicPolicy is off, so nothing evaluates — let alone rejects — a wildcard Principal in the bucket policy.
Access log (log-bucket, last 30 days):
$ awk '$6=="REST.GET.BUCKET"' access.log | wc -l
11482
$ awk '$6=="REST.GET.BUCKET"{print $3}' access.log | sort -u | wc -l
214 # ~half residential proxies; several IPs poll hourly
$ awk '$6=="REST.GET.OBJECT" && $11=="403"' access.log | wc -l
9,771 # the world tried the keys too — all deniedBucket stats: 214,006 keys under invoices/ and db-snapshots/; versioning enabled; incoming/ is a live drop prefix for the vendor.
What the index leaks without a single successful GET:
- Key names embed PII:
invoices/<yyyy-mm>/<customer>_<contact-email>_INV-<n>.pdf— every customer's billing contact, cadence, and invoice count going back two years. db-snapshots/YYYY-MM-DD/*.dump.zst— the backup schedule, host names, which databases exist, and how big they are.?versionslistsDeleteMarker-covered keys too: "deleted" snapshots still enumerate, going back further than the 30-day retention the policy claims to keep.incoming/shows the vendor's PUT cadence and filenames — including quarter-end totals that haven't been announced.- A colleague notices the
ListBucketResultresponses carryCache-Control: public, max-age=300— three CDN edge nodes now hold copies of the index.
Checks that came back clean: TLS fine, signed-URL validation fine, s3:GetObject granted to nobody external, the bucket's billing report is flat, every other bucket in the org denies anonymous listing. This one statement, on this one bucket, is the whole problem.
Repro, anonymous, from a coffee shop IP:
$ aws s3api list-objects-v2 --bucket sudosec-backups \
--endpoint-url https://s3.us-east-va.io.cloud.ovh.us \
--no-sign-request --max-items 3
{
"Contents": [
{"Key": "db-snapshots/2026-12-07/forums.dump.zst", "Size": 4120033172},
{"Key": "invoices/2026-09/acme-corp_dan@acme.com_INV-8841.pdf",
"Size": 88412}
],
"KeyCount": 214006
}
$ aws s3api list-object-versions --bucket sudosec-backups --no-sign-request \
--endpoint-url https://s3.us-east-va.io.cloud.ovh.us | grep -c DeleteMarker
30112The IaC module shows the intended end state was already written — just never applied:
# resource "aws_iam_role" "bookkeeper_drop" {
# assume_role_policy = data.aws_iam_policy_document.vendor.json
# # TODO: wire after audit window closes
# }
resource "aws_s3_bucket_policy" "backups" {
policy = data.aws_iam_policy_document.backups_public.json # wildcards inside
}The auditor's ticket (from the tracker, still open): "Need to verify snapshot objects exist for Q3. Don't need contents — just the key list for the sampling spreadsheet." The acceptance criterion was literally the listing.
Sibling-bucket sweep (sudosec-cdn, sudosec-logs, sudosec-artifacts): all deny anonymous listing — the policy lint job only checks ACLs, and ACLs are disabled on every bucket, so it reports green across the board.
Timing: the first anonymous REST.GET.BUCKET in the log is from four months and one day ago — the day after AuditReadIndex shipped. Since then the index has been fetched 11,482 times; the hourly pollers look like search-engine crawlers and at least two academic scanners. Whoever wanted the customer list has had it since summer.
- The
ListBucketResultXML leaks bucket name, prefix structure, per-keySize,LastModified, andETag— enough to fingerprint when each customer signed and how their bill is trending. - The invoice-key convention
customer_contact-email_INV-nwas chosen for humans browsing the console; nobody considered the namespace a security boundary.
What it's not:
-
Not an ACL problem — bucket ACLs are disabled entirely;
BlockPublicAclswas already on and did nothing because there were no ACLs to block. -
Not object-level exposure — every
GetObjectfrom outside the org returns 403; the 9,771 denied GETs prove the world found the keys anyway. -
Not a leak of file contents — nothing internal was ever downloaded; the breach is enumerable metadata plus a writable drop prefix.
-
The audit ticket's acceptance criterion was "auditor confirms object names exist" — the only thing a listing is for.
-
s3:PutObjectonincoming/*means anyone on the internet can also write into the drop prefix — the access log shows 37 unexplained PUTs this month, all 1–3 KB.
Diagnoses — hidden until the incident closes
Sign in to post your root-cause diagnosis.