ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.79k stars 465 forks source link

[Vulnerability] Stored Cross site scripting (XSS) on Wireguard Clients function. #443

Open lavie3k opened 9 months ago

lavie3k commented 9 months ago

Detail: The Stored Cross-Site Scripting (XSS) vulnerability in the Wireguard Clients function is a security flaw that allows an attacker to inject malicious code into the Wireguard client interface. This vulnerability occurs when user-supplied input, such as client names or descriptions, is not properly sanitized or validated before being displayed on the Wireguard client interface. As a result, an attacker can craft a malicious payload that, when executed by a victim user, can lead to unauthorized access, data theft, or further exploitation.

For more information on XSS vulnerabilities, you can refer to the following resources:

Steps to reproduce:

  1. User demo has manager permission to log in to the application and access functions Wireguard Clients at Main. image

  2. Click New client to create wireguard clients with the Name parameter value as <script>alert("Hacked!")</script>. Then press Save. image

  3. Log in to the admin administrative account and access the Wireguard Clients function at Main. The javascript code will execute. Once the victim user accesses the affected page, the injected payload will be executed, potentially leading to successful exploitation. image

Solution: To mitigate the Stored XSS vulnerability in the Wireguard Clients function, it is crucial to implement proper input validation and output sanitization techniques. Here are a few steps that can help address the issue:

systemcrash commented 9 months ago

Potentially mitigated by #427

MarcusWichelmann commented 9 months ago

@systemcrash Not mitigated by #427, but #435 might at least partially help to mitigate this (but probably not sufficient).

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lavie3k commented 5 months ago

Bug won't fix.