//nefariousplan

CVE-2021-35036: Zyxel Masked the CLI. The API Returned the Password.

vendor

patterns

cve

proof of concept

CVE-2021-35036's first patch added asterisks to a router's CLI. The bug was that a low-privilege user could send one HTTP request and receive the super-admin password. The asterisks rendered on a code path the request never touched. A later patch added a per-field attribute that excluded the password from the JSON response. The first patch and the last patch closed the same CVE. Only one of them closed the bug.

The endpoint that returned the password returned it by default

Zyxel's CPE firmware exposes a management API at /cgi-bin/DAL?oid=<object>. DAL stands for Data Access Layer, and it is shared code. A single library, libzcfg_fe_dal, implements the getter logic for every object the firmware surfaces. The DSL CPE line, the fiber ONT line, the 4G and 5G CPE lines all link against it. The chipset and the radio change. The library does not.

Inside that library, the login_privilege object is registered with the access flags edit|get. Two lines above the registration, an inline comment reads root_only. The comment is a human telling another human what the field should be. The registration is the machine telling the runtime what it is. The runtime never reads the comment.

When a low-privilege authenticated caller issues GET /cgi-bin/DAL?oid=login_privilege, the DAL dispatcher resolves the oid, calls zcfgFeDal_LoginPrivilege_Get, and serializes the returned object as JSON. The serializer copies every field on the object using a generic helper:

json_object_object_add(paramJobj, "Password",
  JSON_OBJ_COPY(json_object_object_get(loginPrivilegeObj, "Password")));

The same generic copy applies to the tr69 object's Password and ConnectionRequestPassword fields, and to /getDefaultInformation, which returns the factory passwords for the root, supervisor, admin, admin1, and ftps accounts. The shared serializer does not ask whether the caller is privileged to see what is in the response. The only privilege check happens at the gate that lets a caller reach the DAL at all. Once inside, the field list is the response.

The CVE description names this a credential disclosure. The library names it as the absence of a per-field access decision in a framework that decided the field list was a closed set.

The first patch masked asterisks onto a code path the attack never used

Zyxel's advisory went public on September 28, 2022, eleven months after the researcher first reported the issue. The firmware shipped alongside that advisory contained a fix. The fix masked the password field with asterisks in the CLI output and in the TR-98 presentation tree the web UI reads from.

The CLI is not the API. The web UI is not the API. The API is /cgi-bin/DAL?oid=login_privilege, and that endpoint kept returning the cleartext password as a JSON field named Password. The same PoC Zyxel had been holding for eleven months sent that exact request and got the cleartext back. The patch ran on a code path the JSON serializer did not call into. The JSON serializer is a separate file, a separate dispatch, a separate output buffer. It does not consult whether the CLI renderer has decided to print asterisks somewhere else.

This is the artifact of a vendor that read "credential disclosure" and reached for the most familiar mental image of credential disclosure, which is someone reading a screen, and patched the screen.

The real fix was an attribute the framework already supported

The next wave of patches did something different. They added a metadata attribute, PARAMETER_ATTR_PASSWORD, to the field definitions for Password, ConnectionRequestPassword, and the factory credential fields. When the DAL serializer encounters a field carrying that attribute, it omits the field from get responses for callers below a privilege threshold.

That attribute is the actual fix. It is also the admission that Zyxel's framework had always supported a per-field sensitivity classification, and that the developers writing login_privilege and tr69 had simply not applied it. The infrastructure existed. The opt-in did not happen. The default was return-everything, and the default was what shipped.

A serializer that returns every field by default and requires per-field opt-out is a framework that has decided which way it will fail when a developer forgets. Zyxel's framework chose to fail open. The forgetting was inevitable. The framework guaranteed it would matter.

This is the safe-mode-was-opt-in half of the bug. The protective primitive lives in the library; the call site has to remember to invoke it; the default route from "developer writes a new object getter" to "object ships" never passes through that primitive. Every field that was sensitive and got shipped was a developer not reaching for the attribute the framework already had.

The secrets named the audience

The CVE description says the bug discloses "passwords." That word flattens what is in the response. The fields returned by /cgi-bin/DAL?oid=tr69 are not user passwords. TR-069 is the CPE WAN Management Protocol, the channel an ISP's Auto Configuration Server uses to push configuration, firmware, and provisioning into the customer-premises router. Password is the credential the router presents when it logs in to the ACS. ConnectionRequestPassword is the credential the ACS presents when it wakes the router from outside. Both authenticate the management plane in opposite directions on the same WAN.

A low-privilege LAN user who reads those fields holds the management-plane credentials for the device. The fields named the audience: not the human at the keyboard, the operator on the other end of the WAN. The attack does not stay on the LAN; the leak is upstream.

/getDefaultInformation does the same thing for the local privileged accounts. root, supervisor, admin, admin1, ftps. These are not user accounts a customer was ever meant to use. They are operator and service accounts, returned through a user-accessible endpoint. The CVSS vector reads C:H and stops there. The vector does not say which side of the WAN the disclosed credentials authenticate to.

When the first patch added asterisks to the CLI, it patched the surface where the user might see something they should not. The endpoint was never about the user.

One library, more than two dozen products, one bug class

The first Zyxel advisory named one model: the VMG3625-T50B on firmware V5.50(ABTL.0)b2k. The expanded advisory eleven months later named more than two dozen models across DSL CPE, fiber ONT, and 4G and 5G CPE product lines. VMG3625, VMG3927, VMG8623, VMG8825, EMG3525, EMG5523, EMG5723, DX3301, DX5401, EX5401, EX5501, AX7501 series, EP240P, PMG5617GA, PMG5622GA, PMG5317, PMG5617-T20B2, PM7300, LTE3301-PLUS, LTE5388 family, LTE7480 family, LTE7490, NR5101, NR7101, NR7102. Different chipsets, different form factors, different release cadences, one bug.

The bug is in the shared library, and every product that imports libzcfg_fe_dal for its management plane inherits the exposure. This is the standard signature of a design-debt driver: the affected scope is the import graph, not the codebase that names the CVE. The patch is the same on every product because the bug is the same on every product. The CVE was assigned against one model because that was the model the researcher tested. The blast radius was set by the architecture decision to centralize the DAL, a decision Zyxel made years before this bug had a CVE number.

When a vendor's CVE response is "patches for thirty-some products on a staggered schedule," the right question to ask is not "how did this happen to all of them." The right question is "where was this decided," and read that.

NGINX exhibits the same shape across a longer arc. The 2012 patch that closed is_args in one place waited until 2026 for its symmetrical counterpart in the same function. The substrate, not the patch, sets the timeline.

Presentation masking is not access control

The first Zyxel patch understood the bug as "an admin opens the CLI and sees a password." That framing has a fix at the display layer. The framing is wrong. The bug is "a low-privilege caller issues an API request and parses a JSON field." Masking the CLI does not change the API response, because the CLI was never on the request path.

The interval between the cosmetic patch and the attribute-based patch is not a delay in patching. It is the time it took for the vendor's framing to update from "users see a password" to "callers receive a password." The first framing has an answer at the display layer. The second framing has an answer only in the serializer. They are different bugs in the same advisory, and Zyxel patched the first one first because it was the one they recognized.

PoC and writeup: Mina Nageh's research

The CVE closed. The library did not.