Skip to content
Access control Write-up Intermediate

How it started

The administrative web application of the ASUS GT-AC2900 router incorrectly treats a request as authenticated when the session cookie starts with a null byte, the User-Agent matches an internal service, and no IFTTT token is configured. An attacker could bypass authentication and access protected endpoints.

atredis.com

Published on atredis.com

In a previous blog post I had presented a creative method to resurrect a bricked device, in this post I will go over a vulnerability discovered within the running firmware.

The author, on atredis.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the authentication check compares the user-supplied token with an empty default value using a string comparison that stops at the null byte, so a token starting with a null byte matches the empty string and is accepted.

Impact

An attacker could bypass authentication and access administrative endpoints, but only if the device has not been configured with an IFTTT token and the request uses the internal service User-Agent.

What the attacker needed

Device has no ifttt_token configured; request uses internal service User-Agent; attacker can send HTTP requests to the admin interface

The fix

ASUS released an updated firmware image that addresses this vulnerability.

How it was found

  1. Send a request to an authenticated endpoint with a valid session cookie to confirm normal access.
  2. Send the same request with an invalid session cookie to confirm it is rejected.
  3. Send the request again with a session cookie whose value starts with a null byte, using the internal service User-Agent, and observe that it is accepted.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This router's admin website uses a cookie to check if you are logged in. The code that checks the cookie has a bug: if the cookie value starts with a special invisible character (a null byte) and the request looks like it comes from a built-in service, the router thinks you are logged in even though you are not. That means someone could get into the admin area without a password.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.