S3 and MinIO Bucket Misconfigurations and Content-Type XSS: Cloud Storage Exposure in CTEM
Public S3 and MinIO buckets are both a data-loss and an execution problem: anonymous access leaks data, while content-type confusion turns stored objects into rendered HTML, XHTML, or SVG on trusted domains. This guide covers the mechanism, the telemetry that confirms exposure, and the controls that close it.

S3 and MinIO Bucket Misconfigurations and Content-Type XSS: Cloud Storage Exposure in CTEM
TL;DR
Public object storage is usually discussed as a data-loss problem, but it is just as often an execution problem: if the bucket is served from a domain your users trust, an attacker can get the browser to render markup from that origin. Two misconfiguration families dominate: anonymous access (open bucket policies, legacy ACLs, MinIO anonymous presets) and content-type confusion (attacker-controlled Content-Type metadata that turns a stored object into rendered HTML, XHTML, or SVG). Content-type XSS chains into session theft, phishing with a valid TLS certificate, JavaScript bundle overwrite, and SEO poisoning, often without touching a single line of application code. Because buckets are created by teams who never open a cloud console, the storage estate grows faster than the controls around it.
What this is
Amazon S3 and S3-compatible stores such as MinIO are object storage: a bucket holds keys, keys hold objects, and every object carries metadata, including a Content-Type the browser will trust when that object is served over HTTP. A bucket misconfiguration is any combination of policy, identity, and metadata settings that lets someone who should not have access read, list, write, or reinterpret your objects.
In practice, four problems recur:
- Anonymous read. A bucket policy with Principal: "*" and s3:GetObject, a public ACL on individual objects, or a MinIO anonymous preset set to download.
- Anonymous list. s3:ListBucket granted to everyone. Read access to one known key is a leak; list access turns it into a searchable index of everything you store.
- Anonymous write. s3:PutObject (or MinIO's public preset, which grants read and write) lets an attacker plant objects, overwrite assets, and delete data.
- Metadata confusion. The upload path does not constrain Content-Type, so an .html, .svg, .xhtml, or .js object is served back with a renderable or executable MIME type.
Content-type XSS is the stored-XSS variant that follows from that last item. Instead of injecting a payload into a template, the attacker uploads a file with a renderable MIME type and gets the storage origin, which your users and sometimes your own front end treat as trusted, to deliver it. No server-side vulnerability is required. The bucket is the injection point.
Why it matters
The storage estate is growing faster than the controls around it. Data lakes, ML pipelines, log archives, CI build artifacts, customer uploads, database exports, and Terraform state all land in buckets, and most buckets are created by teams who never open a cloud console. Every new bucket is a new exposure candidate.
Several shifts make this worse rather than better:
- Trusted-domain delivery. Buckets are usually fronted by cdn., static., assets., or files. hostnames, frequently on the same registrable domain as the application. Cookies scoped to .example.com are sent to those hostnames, phishing filters treat them as legitimate, and the TLS certificate is valid.
- Write is the new read. Read access leaks data; write access enables supply chain attacks. Replace the JavaScript bundle your customers load, or plant an HTML page that harvests credentials on a domain they already trust.
- Automation removed the skill barrier. Bucket discovery is a script, not a research project. Certificate transparency logs, JavaScript bundles, mobile app strings, DNS records, and predictable naming conventions all point at storage endpoints.
- Regulatory weight. Customer PII, payment data, health records, and source code in a world-readable bucket is a breach notification event, not a configuration ticket.
- Presigned URLs age badly. Signed URLs generated with long expirations and passed through logs, browsers, and chat tools effectively become public access objects.
How it works

Discovery. Attackers start from data you already publish: DNS CNAMEs pointing at *.s3.amazonaws.com or a storage gateway, hostnames in certificate transparency logs, URLs inside JavaScript bundles and mobile binaries, error messages that leak bucket names, and response headers such as Server: MinIO or x-amz-bucket-region. Common naming patterns (company-backups, company-dev, company-tfstate) are brute-forceable at negligible cost.
Access verification. A HEAD request confirms the bucket exists and is reachable. A GET with ?list-type=2&max-keys=1000 confirms whether listing is anonymous. Individual object reads confirm whether content is exposed. All of it is unauthenticated, quiet, and indistinguishable from ordinary CDN traffic unless you are logging it.
Metadata abuse. When the upload path does not pin the MIME type, an object can be stored as text/html, application/xhtml+xml, or image/svg+xml. Two variants matter:
- Direct storage. The object is served with the stored Content-Type, and the browser renders it inline.
- Response-header override. S3-compatible APIs allow a signed GET to override response headers, response-content-type and response-content-disposition, so an object that normally downloads can be made to render, in the response the browser actually sees.
If the same origin also serves the application (path-based routing, a reverse proxy, or a shared hostname), the injected document inherits that origin's authority: it can read localStorage, call same-origin APIs with the victim's cookies, register a broader service worker scope, and slip past CSP rules that allow self.
MinIO specifics. MinIO's footguns are operational rather than conceptual. The console (typically port 9001) and API (typically port 9000) are frequently exposed to the internet; quickstart documentation normalizes minioadmin:minioadmin root credentials; and the mc anonymous presets make it a one-line change to grant download, upload, or public (read and write) access to an entire bucket. Because MinIO is self-hosted, it rarely appears in cloud-native posture tooling.
Impact. Anonymous read exposes backups, .env files, terraform.tfstate, private keys, and customer data. Anonymous write enables asset replacement and destructive operations. Content-type XSS converts either one into session theft, credential phishing on a trusted domain, defacement, and search-engine poisoning.
Detection and response
The hypothesis to test is whether any bucket you own serves a renderable object anonymously from a hostname your users trust. Good telemetry comes from three directions, and you need all three.
Storage-side audit. Enable CloudTrail data events for GetObject, PutObject, and DeleteObject, plus S3 server access logs for buckets that matter. Alert on management events that change exposure: PutBucketPolicy, PutBucketAcl, DeletePublicAccessBlock, PutAccountPublicAccessBlock. On MinIO, forward audit webhooks to your SIEM and watch for anonymous principals in the access log.
Content-side inspection. For every bucket you know about, record the HTTP response for a sample of objects: status code, Content-Type, Content-Disposition, X-Content-Type-Options, and the hostname that served it. Objects returning text/html, application/xhtml+xml, or image/svg+xml from a hostname on a trusted domain are the highest-value signal in this entire workflow, because that is content-type XSS waiting to happen.
External vantage point. Anonymous access is only visible from outside your network. A continuous, rate-limited probe of known buckets, unauthenticated list and read attempts, plus checks for dangling CNAMEs that point at deleted buckets, tells you whether the exposure is real rather than theoretical. Combined with asset inventory, this is what separates a finding from a risk.
Metrics that hold up in a board deck: number of buckets with anonymous read, number with anonymous write, number of renderable objects served from trusted domains, percentage of bucket findings validated as actionable, and mean time from discovery to remediation.
What to do
- Enforce Block Public Access at the organization and account level. Bucket-level settings are too easy to undo; the account-level controls (BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, RestrictPublicBuckets) are the backstop.
- Treat Principal: "*" as a finding, not a design choice. Review every bucket policy for wildcard principals, wildcard actions, and missing aws:SourceArn / aws:SourceVpce conditions.
- Never grant ListBucket anonymously. Long random key names are a reasonable compensating control; a public listing endpoint is not.
- Pin the Content-Type on upload. Validate it server-side against an allow-list, and never accept a client-supplied MIME type for anything you serve back.
- Force download for user content. Set Content-Disposition: attachment and X-Content-Type-Options: nosniff at the bucket, CDN, or reverse-proxy layer.
- Serve untrusted content from a cookieless origin. Use a separate registrable domain, not just a subdomain, for user uploads, with no session cookies scoped to it and a strict CSP that includes sandbox.
- Harden MinIO like production infrastructure. Rotate off default root credentials, restrict the console port to an admin network, set explicit IAM policies rather than anonymous presets, and audit mc anonymous state on a schedule.
- Shorten presigned URLs. Reduce expiry, avoid logging full signed URLs, and never let a client control response-header overrides for renderable types.
- Watch for dangling references. When a bucket is decommissioned, remove the CNAME the same day. A dangling record pointing at a re-registerable bucket name is subdomain takeover.
- Make exposure continuous. Inventory, probe anonymously from the outside, validate, and re-check on a schedule. A quarterly review of a cloud estate that changes daily is not a control.
FAQ
Is a bucket ACL the same thing as a bucket policy? No. ACLs are legacy per-object and per-bucket grants; bucket policies are JSON documents evaluated by the service. Modern S3 defaults new buckets to Bucket Owner Enforced, which disables ACLs entirely. If ACLs are still active in your account, assume both surfaces need auditing.
Does enabling Block Public Access make my bucket safe? It closes the anonymous path, but not every exposure. Overly broad authenticated policies, long-lived presigned URLs, CDN misrouting, and dangling CNAMEs all survive it. Block Public Access is a required control, not a complete one.
How does content-type XSS work if the bucket is on a different subdomain? Browsers treat subdomains as separate origins, which blocks direct same-origin API access. But cookies scoped to .example.com are sent to cdn.example.com, and the page is served over your valid TLS certificate on your domain, enough for phishing, credential harvesting, and SEO poisoning. If storage is path-based or proxied on the application origin, the impact escalates to full session theft.
Is MinIO as risky as S3? The risks are the same class; the operations differ. Because MinIO is self-hosted, it often runs outside cloud-native posture tooling, with default root credentials, exposed consoles, and one-line anonymous policies. That combination is frequently worse than a misconfigured S3 bucket, not better.
How do I find publicly readable buckets before attackers do? Work from the external references you already publish, DNS CNAMEs, JavaScript bundles, mobile app strings, and certificate transparency, then probe unauthenticated list and read requests continuously. Anything you can discover without credentials is discoverable by anyone.
Can I tell if someone has already read or overwritten my objects? Sometimes. CloudTrail data events, S3 server access logs, MinIO audit logs, and GuardDuty S3 Protection findings are your evidence trail. Buckets created without logging enabled are effectively blind spots, which is itself a finding worth fixing before you need it.
Where this fits in a program
Object storage belongs in the same continuous exposure graph as the domains, services, and web and API endpoints that reference it. Inventory keeps storage endpoints and the assets that reference them in one place, validation keeps a scanner hit from being treated as proof, and API surface testing plus deeper web application testing cover the paths where content-type confusion and stored-XSS patterns actually land. Trusteed keeps bucket findings tied to real reachability and business context instead of an analyst queue.

Sources
- Trusteed CTEM platform
- Trusteed tenant app
- Trusteed vulnerability intelligence blog
- AWS: Blocking public access to your Amazon S3 storage
- MinIO: Identity and access management
- OWASP: Cross Site Scripting Prevention Cheat Sheet
- CISA: Cloud Security Technical Reference Architecture
- NIST SP 800-210: General Access Control Guidance for Cloud Systems