A severe pre-authentication SQL injection vulnerability in Fortinet FortiWeb’s Fabric Connector component allow unauthenticated attackers to perform remote code execution (RCE) on vulnerable appliances by exploiting improper input handling in a REST API endpoint. Public proof-of-concept (PoC) exploits have been released, significantly increasing the likelihood of exploitation in the wild.
The vulnerability stems from unsafe usage of user-supplied input in SQL queries, specifically the Authorization: Bearer header. The function get_fabric_user_by_token() constructs SQL statements using snprintf() without input sanitization or parameter binding:snprintf(s, 0x400u, “select id from fabric_user.user_table where token=’%s'”, a1);This enables attackers to inject arbitrary SQL payloads directly into the database query.
Phase 1: SQL Injection via HTTP HeaderAttackers send specially crafted HTTP requests to the /api/fabric/device/status endpoint:
This bypasses authentication.
Phase 2: File Write via MySQL INTO OUTFILEUsing MySQL’s INTO OUTFILE, attackers write a malicious .pth file into Python’s site-packages directory. This file includes:
Phase 3: RCE TriggerThe .pth file is executed when Fortinet’s exposed CGI script (/cgi-bin/ml-draw.py) runs, leading to full remote code execution.
Constraints Overcome:
Enjoyed reading this Threat Intelligence Advisory? Stay updated with our latest exclusive content by following us on Twitter and LinkedIn
No related posts found.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
This website uses the following additional cookies:
(List the cookies that you are using on the website here.)
More information about our Cookie Policy