Cyber Security News

Zyxel RCE Flaw Lets Attackers Run Commands Without Authentication

Security researcher Alessandro Sgreccia (aka “rainpwn”) has revealed a set of critical vulnerabilities in Zyxel’s USG FLEX-H firewall series that enable remote code execution (RCE) and privilege escalation—without authentication.

The findings, affecting models including the FLEX 100H and FLEX 700H, threaten the security of organizations relying on these devices for network defense.

How the Exploit Works

 root of the flaw root of the flaw
root of the flaw

The root of the flaw lies in the misconfiguration of a third-party component: PostgreSQL. Although the database itself was up-to-date and secure, Zyxel’s implementation left it exposed to attack due to improper access controls:

  • PostgreSQL Service Exposure: The database runs on localhost:5432, theoretically shielded from remote attacks. However, if an attacker gains even momentary access (e.g., via a valid SSH session), they can establish an SSH tunnel to forward port 5432, exposing the database externally.
  • No Authentication: Critically, the PostgreSQL instance was not password-protected. Attackers could connect as the ‘postgres’ user and run arbitrary SQL commands.

By tunneling the database port and connecting via psql, the researcher could list database tables and, more alarmingly, abuse the COPY FROM PROGRAM function.

This PostgreSQL feature allows the execution of system commands directly from SQL, intended for legitimate data import tasks but ripe for abuse here.

For example:

COPY read_files FROM PROGRAM 'cat /etc/passwd';

This command reads sensitive files. More dangerously, it’s possible to spawn a reverse shell, providing the attacker with interactive access to the firewall’s operating system under the ‘postgres’ user context.

Privilege Escalation: From Postgres to Root

The RCE flaw was compounded by additional misconfigurations:

  • Log File Exposure: Attackers can read /tmp/webcgi.log, which contains active admin authentication tokens. With these, an attacker can impersonate an admin via HTTP or WebSocket APIs and escalate their privileges.
  • SetUID Privilege Escalation: The system mishandled SetUID binaries. By injecting a statically compiled SetUID shell (via the device’s Recovery Manager ZIP mechanism), the attacker could gain full root access after a device reboot.

Sample SetUID exploit code:

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

int main() {

    setuid(0); setgid(0); system("/bin/sh"); return 0;

}

The vulnerabilities have been assigned CVEs CVE-2025-1731 and CVE-2025-1732. The impact is extensive:

  • Remote attackers can execute arbitrary commands with no authentication.
  • Attackers can escalate privileges to root, persist on the device, steal VPN credentials, or completely compromise the network perimeter.

All organizations using affected Zyxel FLEX-H firewalls (especially USG FLEX 100H and 700H, firmware 1.31) should consider themselves at risk. The exploit is practical for threat actors with any level of credential, even a mere VPN user, due to race conditions in authentication.

This disclosure highlights the systemic risk posed by architectural and configuration flaws, even when third-party components are up-to-date.

The Zyxel RCE flaw is a stark reminder that security is a process, not a product—a motto echoed by researcher rainpwn and expert Marco Ivaldi, who contributed to the analysis.

Find this News Interesting! Follow us on Google NewsLinkedIn, & X to Get Instant Updates!

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Blinded from Above: How Relentless Cyber-Attacks Are Knocking Satellites Out of Sight

According to the Center for Strategic & International Studies' (CSIS) 2025 Space Threat Assessment, space…

1 hour ago

Google Chrome Vulnerability Allows Attackers to Bypass Sandbox Restrictions – Technical Details Revealed

A severe vulnerability, identified as CVE-2025-2783, has been discovered in Google Chrome, specifically targeting the…

1 hour ago

Threat Actors Accelerate Transition from Reconnaissance to Compromise – New Report Finds

Cybercriminals are leveraging automation across the entire attack chain, drastically reducing the time from reconnaissance…

2 hours ago

ResolverRAT Targets Healthcare and Pharmaceutical Sectors Through Sophisticated Phishing Attacks

A previously undocumented remote access trojan (RAT) named ResolverRAT has surfaced, specifically targeting healthcare and…

3 hours ago

Europol Launches Taskforce to Combat Violence-as-a-Service Networks

Europol has announced the launch of a powerful new Operational Taskforce (OTF), codenamed GRIMM, to confront…

3 hours ago

JokerOTP Platform Linked to 28,000+ Phishing Attacks Dismantled

Law enforcement agencies from the UK and the Netherlands have dismantled the notorious JokerOTP cybercrime…

6 hours ago