Skip to content

Instantly share code, notes, and snippets.

@hkdmh
Last active May 19, 2026 15:12
Show Gist options
  • Select an option

  • Save hkdmh/4af513ea7589212cb1d49bc5d972972e to your computer and use it in GitHub Desktop.

Select an option

Save hkdmh/4af513ea7589212cb1d49bc5d972972e to your computer and use it in GitHub Desktop.
Reference for CVE-2026-39250
11

First, review the code related to issuing frontend tokens in innopacks\restapi\src\FrontApiControllers\AuthController.php. During registration, a customer token is created through Sanctum. 11

In innopacks\common\src\Models\Customer.php, Customer is not an ordinary model. It explicitly uses HasApiTokens. Therefore, the customer-token sent from the frontend is mapped by Sanctum to a Customer instance. 13

In the backend API entry logic in innopacks\restapi\routes\panel-api.php, all interface authentication only requires auth:sanctum and is handed over to Sanctum for processing. This is a very risky signal. 14 15

In the dependency component code at vendor\laravel\sanctum\src\Guard.php, the processing logic is confirmed as follows: the incoming token is used to look up personal_access_tokens; after the corresponding tokenable is found, as long as the tokenable supports HasApiTokens, that object is directly returned as the authenticated user. In addition, during the provider check, if $this->provider is null, the check directly returns true.

In other words, as long as the token is valid and the corresponding model supports HasApiTokens, Sanctum recognizes it as an “authenticated user.” If the route does not specify a provider, Sanctum does not distinguish between customer and admin. As a result, a frontend customer user’s token can directly access backend application interfaces, causing privilege bypass.

The reproduction is as follows:

First, register an account on the frontend. After logging in, the corresponding token is returned.
1

Then, in subsequent interface requests, directly include Authorization: Bearer $token$. This allows unauthorized access to backend application interfaces, such as obtaining all frontend user information or editing template files. 2 3

Associated CNVD ID: CNVD-2026-16800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment