Описание
Yamcs has Reflected XSS in the URL of the Authorize Endpoint
Attack type:
Unauthenticated remote
Impact:
Attackers can execute arbitrary JavaScript in a user's browser, including obtaining a user's session token and refresh token.
Affected components: authorize.html, AuthHandler.java, HandlerContext.java
A Reflected Cross-Site Scripting vulnerability exists in Yamcs <=5.8.6, allowing an attacker to execute arbitrary JavaScript in a Yamcs user's browser. This vulnerability can be exploited to exfiltrate a logged-in user's access token and send it to a remote server, leading to the takeover of the user's account.
Using a specially crafted URL, you are able to execute a JavaScript alert() call in the browser:
You then use JavaScript to obtain the user's cookies and display them in the alert:
Finally, use the fetch function to send the user's cookies to a remote server which we controlled:
Now you can set these cookies in our own browser and login to Yamcs as the user.
Steps to Reproduce
- Start Yamcs
- Login as a user
- In a terminal, start a netcat listener:
- Paste the following URL payload in the browser
- You will receive a connection on your netcat listener containing the user's access token and refresh token.
Acknowledgements
This vulnerability was discovered by Abderrahim Dahmani while solving a STARPWN 2025 CTF challenge at DEFCON 33 offered by VisionSpace Technologies.
Пакеты
org.yamcs:yamcs-core
< 5.9.4
5.9.4
Связанные уязвимости
Yamcs is a mission control framework. Prior to 5.9.4, Yamcs reflects an attacker-controlled redirect_uri parameter from GET /auth/authorize into yamcs-core/src/main/resources/auth/templates/authorize.html without adequate HTML escaping by yamcs-core/src/main/java/org/yamcs/http/auth/AuthHandler.java and yamcs-core/src/main/java/org/yamcs/http/HandlerContext.java. A crafted authorization URL can execute JavaScript when opened by a Yamcs user. The script can access browser-held authentication material and transmit it to an attacker, enabling account compromise. This issue is fixed in version 5.9.4.