Critical SQL Injection Vulnerability Discovered in HortusFox (pending CVE-2025-65298)

Featured image

Overview

During a security assessment of HortusFox, I identified a critical SQL injection vulnerability that allows any authenticated user to execute arbitrary SQL queries against the application’s database. This flaw enables attackers to extract sensitive data, modify or delete records, escalate privileges, and potentially take full control of the application.

The vulnerability has been confirmed as exploitable, and a tested patch has been provided to the maintainers to enable rapid remediation. Pending: CVE-2025-65298.


Executive Summary

This issue arises from dynamically constructed SQL queries that directly interpolate user-controlled input without sufficient validation.


Technical Details

The vulnerability exists in logic that accepts an attribute parameter and inserts it directly into a raw SQL statement. Because this parameter is not validated, an attacker can inject arbitrary SQL expressions.

Proof of Concept (Sanitized)

A malicious authenticated user can submit a crafted request similar to the following:

POST /plants/details/edit/ajax
attribute=name = (SELECT VERSION()), notes
value=test

Result:
The database responds with the underlying MariaDB version string, confirming successful SQL injection.

This demonstrates real-world exploitability and confirms that arbitrary SQL expressions can be executed through this vector.


Impact Analysis

If exploited, this vulnerability enables:

Notably, exploitation requires minimal technical skill and can be performed by any authenticated user, making this a high-risk issue for production deployments.


The immediate remediation is to strictly validate the attribute parameter using an explicit whitelist before constructing or executing any SQL query.

Example Patch

$allowed_attributes = [
    'name', 'scientific_name', 'knowledge_link', 'location', 'tags', 'photo',
    'last_watered', 'last_repotted', 'last_fertilised', 'perennial', 'annual',
    'hardy', 'cutting_month', 'date_of_purchase', 'humidity', 'light_level',
    'health_state', 'notes', 'history', 'history_date', 'clone_num', 'clone_origin'
];

if (!in_array($attribute, $allowed_attributes, true)) {
    throw new \Exception('Invalid attribute: ' . htmlspecialchars($attribute));
}

A fully patched version of the affected method has been supplied directly to the maintainers to reduce implementation friction.


Within 24 Hours

Within 1 Week

Within 1 Month


Disclosure Timeline

This timeline follows standard responsible disclosure practices and allows sufficient time for a safe fix rollout.


Conclusion

This vulnerability represents a critical security risk to HortusFox users and deployments:

Immediate action is strongly recommended to protect user data and maintain platform trust.

I appreciate the work that goes into maintaining open-source projects like HortusFox and am committed to coordinating responsibly to ensure this issue is resolved safely.


Juan Soberanes
Security Researcher
Offensive Security & Application Security

Advertisement