
PoC lab for CVE-2026-129357: a role-0 Magma NMS host-org user creates SUPERUSER accounts via POST add_user, with Docker lab, exploit driver, and synthetic fix.
| CVE | CVE-2026-129357 (VDB-437420) |
| Component | Linux Foundation Magma NMS — nms/server/host/middleware.ts (hostOrgMiddleware) and nms/server/host/routes.ts (add_user) |
| Affected | Magma ≤ 1.9.0 (both files byte-identical in master; single commit since 2022) |
| Fixed in | nothing upstream at the time of this laboratory; the fixed side is a hash-checked synthetic remediation (documented as such) |
| CWE | CWE-862 (Missing Authorization), CWE-269 (Improper Privilege Management) |
| Impact | Vertical privilege escalation to NMS SUPERUSER: any authenticated role-0 (read-only) member of the host organization creates SUPERUSER accounts in any organization with a single request |
| Vector | Network, authenticated as the lowest-privilege host-org user — POST /host/organization/async/<org>/add_user with "role": 3 |
| Trigger | the organization of the request is resolved from the Host header (host.<domain> selects the host org); the route stores the request body's role verbatim |
The NMS host-organization subtree gates on "is the requesting tenant the
host organization" and nothing else: hostOrgMiddleware checks only
organization.isHostOrg (the org resolved from the Host header), the
subtree sits behind access(USER) (any authenticated member, any role),
and add_user writes the body's role straight into the Users table.
A read-only user of the host organization therefore creates SUPERUSER
accounts at will.
This laboratory runs the real Magma NMS server (tag v1.9.0, the upstream node/yarn build) with its real local auth stack (passport-local + Sequelize over Postgres — the standalone topology the product's own compose file ships) and proves the escalation end to end: the role-0 victim creates a SUPERUSER, and the manufactured account logs in and lists users as SUPERUSER.
Three pieces compose (all at tag v1.9.0):
// nms/server/middleware/organizationMiddleware.ts — the tenant is the Host header
// customDomains match, else host.split('.')[0] == organization name
// nms/server/host/middleware.ts — the ONLY gate on the /host subtree
export const hostOrgMiddleware = asyncHandler(async (req, res, next) => {
if (req.organization) {
const organization = await req.organization();
if (organization.isHostOrg) { next(); return; }
}
return res.redirect(req.access?.loginUrl || '/user/login');
});
// nms/server/app.ts — the subtree's role gate is just "logged in"
app.use('/', csrfMiddleware(), access(AccessRoles.USER), mainRoutes);
// nms/server/host/routes.ts — the role is attacker data
const USER_PROPS = ['email', 'networkIDs', 'password', 'role', 'organization'] as const;
router.post('/organization/async/:name/add_user', asyncHandler(async (req, res) => {
...
const props = await getPropsToUpdate(USER_PROPS, {organization: req.params.name, ...req.body}, ...);
const user = await User.create(props); // role: 3 stored verbatim
res.status(200).send({user});
}));
isHostOrg() is name === 'host' — a property of the tenant named in
the Host header, not of the caller's privilege. access(USER)
(req.isAuthenticated() plus org equality) admits any role of that
organization. The route never checks req.user.role before honoring an
attacker-supplied one. Result: role 0 → SUPERUSER factory.
| service | image | role |
|---|---|---|
nms-vuln | cve-2026-129357:vuln | Magma v1.9.0 as released (the upstream nms Docker build), standalone with its own Postgres |
nms-fixed | cve-2026-129357:fixed | the same tree with lab/patch-fixed.py (hash-checked): add_user requires a SUPERUSER caller and caps the granted role at the caller's |
nms-db-vuln / nms-db-fixed | postgres:9.5 | one per side, per the product's own compose topology |
poc | cve-2026-129357-poc:local | stdlib-only Python driver |
Seeded with the server's own models: the host organization + admin
superuser (upstream setAdminPassword script), a victimorg, and
[email protected] — role 0 in the host organization. Two environment
adjustments are documented in evidence/versions.txt: the orc8r tenant
mirror is a no-op (applied identically to both sides; it runs after the
org row persists, off the vulnerable path), and the server runs in
dev-mode so the session cookie is not Secure over the lab's plain-HTTP
network (the shipped compose start:dev topology).
./run-lab.sh build # upstream nms build at v1.9.0 (vuln + fixed trees)
./run-lab.sh up # cve129357lab network, two NMS+Postgres stacks
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
poc/poc.py (stdlib only; mirrors the publicly disclosed exploit flow):
add_user with "role": 3.
Exit 1 vulnerable, 0 safe, 3 no worker, 2 unreachable.victimorg
→ the manufactured account logs in under its own org and lists users
(HTTP 200), verifying working elevated access./host subtree to
SUPERUSER at the reverse proxy.| run | nms-vuln (v1.9.0) | nms-fixed (synthetic) |
|---|---|---|
check role-0 add_user(role=3) | HTTP 200, created role=3 | HTTP 403 insufficient role for user administration |
exploit victim lists users directly | 302 (low-priv confirmed) | 302 |
exploit SUPERUSER created | 200, role=3 | 403 |
exploit new account lists users | HTTP 200 — working SUPERUSER | (not created) |
probe roles 0–3 / host-org / cross-org | all 200, requested role stored | all 403 |
probe nonexistent org | 404 (upstream behaviour) | 404 |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve129357lab network.The role/org matrix is the surface sweep (evidence/0day-sweep.txt):
every add_user form is refused on the remediated build, while the
shipped v1.9.0 accepts them all. The stored-XSS sibling in the same
subtree (organization name → rendered configJson) is CVE-2026-129358.