Skip to content

Instantly share code, notes, and snippets.

@pyuysig
Last active June 13, 2026 15:42
Show Gist options
  • Select an option

  • Save pyuysig/72acb62a9973fa394581f662c0f12704 to your computer and use it in GitHub Desktop.

Select an option

Save pyuysig/72acb62a9973fa394581f662c0f12704 to your computer and use it in GitHub Desktop.
Reference for CVE-2026-50884

Summary

statping-ng 0.93.0 treats any valid user API key as full authentication for routes protected by the admin middleware. A non-admin user API key can be used to invoke administrative endpoints such as user creation.

Details

handlers/authentication.go::hasAPIQuery() accepts the api query parameter when it matches either the global core.App.ApiSecret or a value in users.api_key. It does not require the matched user key to belong to an administrator.

handlers/handlers.go::IsFullAuthenticated() accepts hasAPIQuery() as sufficient full authentication. Routes such as POST /api/users are protected by authenticated(...), so they trust that result before any administrator-role boundary is enforced.

The attacker-controlled input is the api query parameter containing a normal user's API key. The missing rule is distinguishing user API keys from administrator-grade credentials before allowing admin-only route handlers to run.

PoC

  1. Obtain the API key for a normal non-admin statping-ng 0.93.0 user.
  2. Send POST /api/users?api=<non_admin_user_api_key> with a request body for a new user account marked as administrator.
  3. Observe that the request passes IsFullAuthenticated() through hasAPIQuery().
  4. Query the user list or log in as the newly created account.
  5. Confirm that the new administrator user exists and can access administrative functionality.

Impact

The observed result is administrative account creation using a non-admin user's API key. An attacker with any valid non-admin API key can gain persistent full administrative control of the Statping instance.

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