CVE-2021-47873 Overview
CVE-2021-47873 is a stored cross-site scripting (XSS) vulnerability affecting VestaCP versions prior to 0.9.8-25. The vulnerability exists in the IP interface configuration functionality, specifically in the v_interface parameter when processing POST requests to the add/ip/ endpoint. Attackers with authenticated access can inject malicious JavaScript payloads that are stored server-side and executed when other users view the affected configuration pages.
Critical Impact
Authenticated attackers can inject persistent malicious scripts into the VestaCP admin interface, potentially leading to session hijacking, credential theft, or administrative account compromise when other administrators access the affected pages.
Affected Products
- VestaCP versions prior to 0.9.8-25
- MyVestaCP (fork) - check vendor site for affected versions
Discovery Timeline
- 2026-01-21 - CVE CVE-2021-47873 published to NVD
- 2026-01-21 - Last updated in NVD database
Technical Details for CVE-2021-47873
Vulnerability Analysis
This stored XSS vulnerability stems from insufficient input validation and output encoding in VestaCP's IP interface management functionality. When an authenticated user submits a POST request to the add/ip/ endpoint, the application fails to properly sanitize the v_interface parameter before storing it in the database and rendering it back to users in the administrative interface.
The stored nature of this XSS vulnerability makes it particularly dangerous in multi-administrator environments, as the malicious payload persists in the application and executes every time an administrator views the affected configuration page. This can lead to session token theft, phishing attacks within the trusted admin context, or execution of unauthorized administrative actions on behalf of the victim.
Root Cause
The root cause is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). The VestaCP application does not properly sanitize user-supplied input in the v_interface field before storing it in the database and fails to apply appropriate output encoding when rendering this data back to the browser. This allows HTML and JavaScript content to be interpreted and executed rather than displayed as plain text.
Attack Vector
The attack is network-based and requires authenticated access to the VestaCP administrative panel. An attacker must have valid credentials with permissions to access the IP configuration functionality. The attack flow involves:
- Authenticating to the VestaCP administrative interface
- Navigating to the IP address management section
- Submitting a crafted POST request to the add/ip/ endpoint with malicious JavaScript in the v_interface parameter
- The payload is stored in the application database
- When any administrator views the IP configuration page, the malicious script executes in their browser context
The vulnerability requires user interaction from the victim, who must navigate to the page containing the stored payload. Technical details and a proof-of-concept are available in the Exploit-DB #49662 entry.
Detection Methods for CVE-2021-47873
Indicators of Compromise
- Unexpected JavaScript code or HTML tags present in IP interface configuration fields
- Audit log entries showing unusual POST requests to the add/ip/ endpoint with encoded script content
- User reports of browser behavior anomalies when accessing VestaCP admin pages
- Network traffic containing suspicious payloads targeting the v_interface parameter
Detection Strategies
- Implement Web Application Firewall (WAF) rules to detect XSS patterns in POST requests to VestaCP endpoints
- Monitor HTTP request logs for common XSS payload signatures such as <script>, javascript:, onerror=, and encoded variants
- Review VestaCP database records for stored HTML or JavaScript content in configuration fields
- Enable Content Security Policy (CSP) headers and monitor for CSP violation reports
Monitoring Recommendations
- Configure centralized logging for all VestaCP administrative actions and API calls
- Set up alerting for POST requests containing potentially malicious patterns in form parameters
- Regularly audit IP configuration entries for unexpected content or formatting anomalies
- Monitor browser console errors from administrative users that may indicate XSS execution attempts
How to Mitigate CVE-2021-47873
Immediate Actions Required
- Upgrade VestaCP to version 0.9.8-25 or later immediately
- Audit existing IP interface configurations for any suspicious or unexpected content containing HTML or JavaScript
- Review administrative access logs for evidence of exploitation attempts
- Consider migrating to MyVestaCP which is actively maintained - see MyVestaCP Official Site
Patch Information
The vulnerability has been addressed in VestaCP version 0.9.8-25 and later. Organizations should upgrade to the latest available version from the VestaCP Official Site or consider transitioning to the actively maintained MyVestaCP fork. Additional technical details are available in the VulnCheck VestaCP Advisory.
Workarounds
- Restrict VestaCP administrative panel access to trusted IP addresses only using firewall rules
- Implement a reverse proxy with a Web Application Firewall (WAF) that filters XSS payloads
- Limit administrative user accounts to only those absolutely necessary and enforce strong authentication
- Regularly backup and audit configuration data to detect unauthorized modifications
- Consider disabling the IP interface management feature if not actively required
# Example: Restrict VestaCP admin access to trusted IPs using iptables
iptables -A INPUT -p tcp --dport 8083 -s 10.0.0.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 8083 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


