RosarioSIS 10.8.4 - CSV Injection

Exploit Author: Ranjeet Jaiswal Analysis Author: www.bubbleslearn.ir Category: WebApps Language: PHP Published Date: 2023-07-28
# Exploit Title: RosarioSIS 10.8.4 - CSV Injection
# Google Dork:NA
# Exploit Author: Ranjeet Jaiswal#
# Vendor Homepage: https://www.rosariosis.org/
# Software Link: https://gitlab.com/francoisjacquet/rosariosis/-/archive/v10.8.4/rosariosis-v10.8.4.zip
# Affected Version: 10.8.4
# Category: WebApps
# Tested on: Windows 10
# 
#
# 1. Vendor Description:
#
# RosarioSIS has been designed to address the most important needs of administrators, teachers, support staff, parents, students, and clerical   personnel. However, it also adds many components not typically found in Student Information Systems. 
#
# 2. Technical Description:
#
# A CSV Injection (also known as Formula Injection) vulnerability in the RosarioSIS web application with version 10.8.4 allows malicious users to execute malicious payload in csv/xls and redirect authorized user to malicious website.

#
# 3. Proof Of Concept:

 3.1. Proof of Concept for CSV injection.

# #Step to reproduce.
Step1:Login in to RosarioSIS 10.8.4
Step2:Go to Periods page
Step3:Add CSV injection redirection payload such as "=HYPERLINK("https://www.google.com","imp")"in the Title field
Step4:click on Save button to save data.
Step5:Go to export tab and export the data
Step6:When user open download Periods.xls file.You will see redirection hyperlink.
Step7:When user click on link ,User will be redirected to Attacker or
malicious website.



# 4. Solution:
 Upgrade to latest release of RosarioSIS.


Understanding CSV Injection in RosarioSIS 10.8.4: A Critical Web Application Vulnerability

CSV Injection, also known as Formula Injection, is a subtle yet potent cybersecurity threat that exploits the way spreadsheet applications interpret data in comma-separated values (CSV) files. In the case of RosarioSIS 10.8.4, this vulnerability enables attackers to manipulate exported data in such a way that malicious payloads are executed when users open the resulting .xls or .csv files.

What Is CSV Injection?

CSV Injection occurs when an attacker injects a formula-like string into a CSV file that is interpreted by spreadsheet software (such as Microsoft Excel or Google Sheets) as executable code. For instance, a string like =HYPERLINK("https://malicious-site.com","Click Here") is not treated as plain text but as a command to create a clickable hyperlink. When the file is opened, the user is automatically redirected to the attacker’s website—without any explicit consent.

This exploit leverages the fact that spreadsheet programs parse certain characters (like =, +, +, +) as formulas, even in plain text fields. The result is a silent redirection that can bypass traditional security measures.

Case Study: RosarioSIS 10.8.4

RosarioSIS is an open-source Student Information System (SIS) widely used in educational institutions. It provides features for managing student records, schedules, grades, and administrative workflows. However, version 10.8.4 has been identified as vulnerable to CSV Injection due to insufficient input validation during data export.

According to security researcher Ranjeet Jaiswal, the vulnerability lies in the Periods module, where users can input custom titles. An attacker can exploit this by inserting a malicious formula into the title field:

=HYPERLINK("https://www.google.com","imp")

When this payload is saved and later exported as a spreadsheet (e.g., Periods.xls), the formula is interpreted by Excel as a hyperlink. Upon opening the file, the user sees a clickable link labeled "imp" that redirects to https://www.google.com—a benign example, but in real-world scenarios, this could point to phishing sites, malware downloads, or command-and-control servers.

Step-by-Step Reproduction of the Attack

  • Step 1: Log in to RosarioSIS 10.8.4 with valid credentials.
  • Step 2: Navigate to the Periods management page.
  • Step 3: In the Title field, enter the malicious payload: =HYPERLINK("https://malicious-site.com","Click").
  • Step 4: Click the Save button to store the data.
  • Step 5: Go to the Export tab and export the Periods data as an Excel file.
  • Step 6: Open the downloaded Periods.xls file using Microsoft Excel or another compatible spreadsheet application.
  • Step 7: The user sees a clickable hyperlink labeled "Click" that redirects to the attacker’s website.

This attack is particularly dangerous because it requires no user interaction beyond opening the file—making it a prime candidate for social engineering and lateral movement in compromised environments.

Technical Underpinnings of the Vulnerability

The root cause of this issue lies in the lack of sanitization or encoding when exporting user-generated content. RosarioSIS 10.8.4 does not validate or escape special characters in fields such as Title, Description, or Notes before generating CSV/XLS output. This oversight allows arbitrary text—especially formula syntax—to be preserved in the exported file.

Spreadsheet software like Excel automatically evaluates strings starting with = as formulas. This behavior is intended for data calculations but becomes exploitable when untrusted data is imported.

Real-World Impact and Risks

Risk Category Description
Phishing Attackers can redirect users to fake login pages, harvesting credentials.
Malware Distribution Hyperlinks can lead to malicious downloads or drive-by attacks.
Command Execution Advanced payloads like =SUM(1,2,3) can trigger remote code execution in some configurations.
Information Disclosure Attackers can exfiltrate sensitive data by embedding commands that trigger network requests.

Even if the payload appears harmless (e.g., a redirect to Google), the act of opening the file can be used to track user behavior, detect system vulnerabilities, or initiate broader attacks.

Expert Recommendations and Mitigation Strategies

While upgrading to a newer version is the most effective solution, organizations using RosarioSIS 10.8.4 should implement immediate safeguards:

  • Input Sanitization: Strip or encode special characters (=, +, +, +) before exporting data.
  • Export Format Restrictions: Avoid exporting data with formula-like content unless explicitly allowed.
  • User Education: Train staff and students to avoid opening untrusted spreadsheet files, especially those downloaded from internal systems.
  • File Validation: Use tools like csvkit or custom scripts to scan exported files for suspicious content before distribution.

For developers, a robust solution involves applying output encoding when generating CSV/XLS files. For example, prefixing all data with a single quote (') ensures that Excel treats it as plain text:

='=HYPERLINK("https://malicious-site.com","Click")

This simple encoding prevents formula execution while preserving data integrity.

Conclusion

CSV Injection in RosarioSIS 10.8.4 is a stark reminder that even seemingly benign features—like exporting data—can become attack vectors if input validation is overlooked. As web applications grow in complexity, developers must prioritize security-by-design, especially in data export functions.

By understanding how formula injection works, organizations can proactively defend against such threats—ensuring that student information systems remain secure, trustworthy, and resilient against evolving cyber risks.