Skip to content

Latest commit

 

History

History
574 lines (371 loc) · 6.79 KB

tokens.md

File metadata and controls

574 lines (371 loc) · 6.79 KB

Tokens

This document describes all authentication, validation, and anti-abuse tokens discovered during reverse engineering of the ГдеБЕНЗ web client.

The API does not use user accounts or OAuth. Instead, it relies on several lightweight anonymous tokens that help validate requests and reduce abuse.


Overview

Token Lifetime Location Purpose
VT 30 minutes JSON Body Visitor validation
RT 30 minutes HTTP Header Report validation
CVT ~150 s (client cache) JSON Body Station-specific validation
FP Persistent JSON Body Anonymous device identifier
CF Short-lived JSON Body Cloudflare Turnstile verification
gas_cid Persistent Local Storage Client identifier

Visitor Token (VT)

Endpoint

GET /api/vt

Response

{
    "vt":"2f8819c09b094bb48d4aa407",
    "ttl":1800
}

Purpose

The Visitor Token validates normal API requests.

It is primarily used when submitting station comments and fuel status reports.

The client always attempts to keep the token fresh.


Lifetime

1800 seconds

30 minutes.


Refresh

Automatically refreshed every

900 seconds

(15 minutes)

Client implementation

setInterval(vtRefresh,900000)

Storage

window.__VT

Usage

Included in

POST /api/comments

Example

{
    "vt":"2f8819c09b094bb48d4aa407"
}

Report Token (RT)

Endpoint

GET /api/rt

Response

{
    "rt":"06b2295cbf9d79b7ed51490e",
    "ttl":1800
}

Purpose

Used only for reporting incorrect content.


Lifetime

1800 seconds

Refresh

Automatically refreshed every

600 seconds

10 minutes.


Storage

window.__RT

Usage

RT is not sent in the request body.

Instead it becomes an HTTP header.

Example

X-RT: 06b2295cbf9d79b7ed51490e

Generated by

function rtH(){
    return {
        "X-RT":window.__RT||""
    }
}

Comment Validation Token (CVT)

The Comment Validation Token is different from VT.

Unlike VT, it belongs to a specific station.


Issuance

The CVT is returned by the station-detail endpoint:

GET /api/comments/{osm_id}?fp={fingerprint}

The cvt field is part of the JSON body (..."cvt":"23d19b9683fd373b1ff7e415"), not a separate token endpoint. It is re-issued on every detail fetch and cached client-side for 15e5 ms (150 s).

Example

window._cvt={
    osm:"268902927",
    tok:"9d55291b963b052d3567d04d"
}

Fields

Field Description
osm Station identifier
tok Validation token (the cvt value from /api/comments/{osm_id})

Purpose

Protects comment submission.

Likely prevents:

  • replay attacks
  • forged requests
  • stale vote submissions

Storage

window._cvt

Usage

Only included if the stored osm matches the target station. Attached to /api/comments and /api/comments-onsite bodies.

Example

{
    "cvt":"9d55291b963b052d3567d04d"
}

Fingerprint (FP)

The fingerprint uniquely identifies a browser without requiring login.


Generation

The client first checks

localStorage["gas_cid"]

If missing

crypto.getRandomValues(...)

creates a random identifier.


Persistent Identifier

Example

gas_cid

7e8bc15c3ad15df0dbf74f8bc42d53c9

Fallback Fingerprint

If Local Storage cannot be used, the browser fingerprint is generated using

  • Canvas rendering
  • Screen size
  • Browser language
  • Timezone
  • Platform
  • CPU threads

The resulting string is hashed using

SHA-256

Storage

localStorage["gas_cid"]

and

window._fp

Usage

Included in

POST /api/comments

POST /api/station-suggestions

Example

{
    "fp":"7e8bc15c3ad15df0dbf74f8bc42d53c9"
}

Cloudflare Token (CF)

Cloudflare Turnstile provides bot protection.

The client stores

window._cfToken

Usage

Included only when available.

Example

{
    "cf":"0.xxxxxxxxxxxxxxxxx"
}

Purpose

Verifies that the request originated from a human visitor.


gas_cid

Persistent client identifier.


Storage

localStorage

Key

gas_cid

Example

83b50d16b4e0460fbfe973dfd0ce3f84

Purpose

Anonymous client identification.

Survives browser restarts.


Local Vote Storage

The client also stores voting history.

Keys

gas_votes

gas_votes_t

Example

{
    "268902927":"yes"
}

Timestamp storage

{
    "268902927":1751742801000
}

These are not authentication tokens but influence client-side cooldown behavior.


Token Lifecycle

Browser opens

↓

GET /api/vt

↓

GET /api/rt

↓

Generate Fingerprint

↓

Load station

↓

Receive CVT

↓

Submit vote

Token Usage Matrix

Token Comments Reports Suggestions
VT ✓ — —
RT — ✓ —
CVT ✓ — —
FP ✓ ✓ ✓
CF ✓ ✓ ✓

Automatic Refresh

Token Interval
VT 15 minutes
RT 10 minutes
FP Never
gas_cid Never
CVT Per station
CF As required

Expiration

Token TTL
VT 1800 s
RT 1800 s
FP Persistent
gas_cid Persistent
CVT Unknown
CF Managed by Cloudflare

Security Characteristics

Token Predictable Persistent Client Generated
VT No No No
RT No No No
CVT No No No
FP Yes Yes Yes
gas_cid Yes Yes Yes
CF No No No

Example Vote Request

POST /api/comments
Content-Type: application/json
{
    "osm_id":268902927,
    "status":"yes",
    "fp":"7e8bc15c3ad15df0dbf74f8bc42d53c9",
    "vt":"2f8819c09b094bb48d4aa407",
    "cvt":"9d55291b963b052d3567d04d",
    "cf":"0.xxxxxxxxx",
    "vlat":55.755,
    "vlon":37.617
}

Example Report Request

POST /api/comments/145/report
X-RT: 06b2295cbf9d79b7ed51490e

Notes

No evidence of the following authentication mechanisms was found during analysis:

  • User accounts
  • Password authentication
  • Sessions
  • Cookies for authentication
  • OAuth 2.0
  • OpenID Connect
  • JWT access tokens
  • Refresh tokens
  • API keys
  • Bearer tokens

The ГдеБЕНЗ API relies entirely on anonymous validation tokens combined with browser fingerprinting, Cloudflare protection, request throttling, and station-specific validation to mitigate abuse while preserving user anonymity.