Skip to main content
HighCodeOWASP A05:2021CWE-284

How to fix: S3 upload without ACL restriction

s3.upload({ Bucket, Key, Body, ACL: 'public-read' }) or PutObjectCommand with explicit public ACLs creates world-readable objects. Worse, buckets without Block Public Access can leak every object.

Why it matters

Public S3 objects leak customer data, backups, or sensitive logs at internet scale.

The `code-cloud-aws-s3-upload-no-acl` check verifies that the server does not expose the `cloud-aws-s3-upload-no-acl` weakness in the code category. The detection runs against the response headers, body, or auxiliary probes (DNS, TLS, async fetch) as appropriate.

How to fix it

  1. 1Default to ACL 'private' and serve downloads via short-lived presigned URLs.
  2. 2Enable S3 Block Public Access at the account and bucket level.
  3. 3Use SSE-KMS with a key policy that denies unencrypted uploads.

Code examples

Set explicit ACL or bucket policy for S3 uploads

TypeScript
import { PutObjectCommand } from "@aws-sdk/client-s3";

await s3.send(new PutObjectCommand({
  Bucket: process.env.S3_BUCKET!,
  Key: objectKey,
  Body: fileBuffer,
  // Explicitly deny public access, never omit ACL on user-uploaded files
  ACL: "private",
  ContentType: mimeType,
}));
// Also enable "Block Public Access" at the bucket and account level

References

Detected automatically by VulnRadar. The check id is code-cloud-aws-s3-upload-no-acl, stable across every scan so you can filter or diff on it.

See every code check

Questions

How severe is S3 upload without ACL restriction?
VulnRadar rates this high severity in the code category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id code-cloud-aws-s3-upload-no-acl, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does S3 upload without ACL restriction map to?
It maps to CWE-284. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for s3 upload without acl restriction

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: S3 upload without ACL restriction | VulnRadar