All vulnerabilities
CriticalA05:2021CWE-732Infrastructure & Cloud

Cloud Storage Misconfiguration

Publicly accessible S3 buckets, GCS buckets, and Vercel/Netlify deployments expose sensitive files, environment variables, and internal build artifacts — a critical risk in AI-generated apps.

What Is Cloud Storage Misconfiguration?

AI coding tools (Lovable, Bolt, Cursor, Replit) frequently deploy apps to cloud platforms — AWS S3, Google Cloud Storage, Vercel, Netlify, or Railway. When storage buckets or platform-specific endpoints are misconfigured, anyone on the internet can read, list, or even write to them.

This is one of the most common critical vulnerabilities in vibe-coded apps because:

  • S3/GCS bucket names are often derived from the app name and guessable
  • Build artifacts and .env files are accidentally included in deployments
  • Vercel preview deployments expose internal routes and API data

Attack Scenarios

Open S3 Bucket — File Listing

GET https://s3.amazonaws.com/my-app-assets/

Response:

<ListBucketResult>
  <Name>my-app-assets</Name>
  <Contents>
    <Key>.env.production</Key>
    <Key>backup_2024-01-15.sql</Key>
    <Key>admin_credentials.txt</Key>
  </Contents>
</ListBucketResult>

An attacker now has your database credentials, API keys, and full user data.

Vercel _next/data Leak

Next.js apps deployed on Vercel expose server-side props via:

GET /_next/data/{buildId}/index.json

This endpoint can return data that was intended only for server-side rendering — including internal API responses, auth tokens passed as props, or user-specific data baked into the initial render.

Netlify Functions — Unauthenticated Internal API

GET /.netlify/functions/admin-report

Functions deployed without auth middleware are accessible to anyone. Common in AI-generated backends where authentication is added to the frontend but not the serverless function itself.

Real-World Impact

  • Database dump download.sql backups left in open S3 buckets
  • API key exfiltration.env files with STRIPE_SECRET_KEY, DATABASE_URL
  • Admin route discovery — build manifests reveal /admin, /internal routes
  • User data breach — objects containing exported user records

How to Fix

S3 — Block all public access:

aws s3api put-public-access-block \
  --bucket my-app-bucket \
  --public-access-block-configuration \
  "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"

Vercel — Protect _next/data endpoints:

// middleware.ts — protect sensitive data routes
export function middleware(request: NextRequest) {
  if (request.nextUrl.pathname.startsWith('/_next/data')) {
    // Verify session token for sensitive pages
    const token = request.cookies.get('session')?.value;
    if (!token || !verifyToken(token)) {
      return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
    }
  }
}

Netlify Functions — require auth header:

exports.handler = async (event) => {
  const token = event.headers.authorization?.replace('Bearer ', '');
  if (!token || !isValidToken(token)) {
    return { statusCode: 401, body: JSON.stringify({ error: 'Unauthorized' }) };
  }
  // ... handler logic
};

Never commit secrets to deployments:

# .gitignore
.env
.env.local
.env.production
*.sql
*_backup*

Use environment variable management (Vercel dashboard, AWS Secrets Manager, Doppler) instead of .env files in deployed artifacts.

What VibeWShield Detects

VibeWShield's Level 2 Cloud Misconfiguration scanner:

  • Extracts S3/GCS bucket names from JavaScript bundles and page content
  • Tests each bucket for public listing and access to 15 common sensitive files (.env, backup.sql, id_rsa, etc.)
  • Detects Vercel deployments and probes /_next/data/{buildId}/index.json for exposed server-side data
  • Probes 14 common Netlify Functions endpoints and checks /_redirects for proxy rules to internal services
  • Detects Railway/Render environment variable leakage in JavaScript bundles
#s3#cloud#aws#gcp#vercel#netlify#misconfiguration#infra

Free security scan

Test your app for Cloud Storage Misconfiguration

VibeWShield automatically checks for Cloud Storage Misconfiguration and 40+ other vulnerabilities using 63 scanners — in under 3 minutes, no signup required.

Scan your app free