CVE-2026-54635
pytonapi has a Webhook Custom Path Authentication Bypass
pytonapi is a Python SDK for TONAPI that provides REST API, streaming, and webhook access to the TON blockchain. From 2.0.0 to 2.2.0, TonapiWebhookDispatcher fails to validate the Authorization header when a webhook handler is registered with the documented path argument, because setup() stores bearer tokens only under the default suffix paths and never adds the custom path to the token map, so self._tokens.get(path) returns None and the authentication guard is skipped. An unauthenticated remote attacker can POST forged payloads to the custom webhook endpoint and trigger victim-defined handlers. This issue is fixed in version 2.2.1.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.5
pytonapi has a Webhook Custom Path Authentication Bypass
pytonapi is a Python SDK for TONAPI that provides REST API, streaming, and webhook access to the TON blockchain. From 2.0.0 to 2.2.0, TonapiWebhookDispatcher fails to validate the Authorization header when a webhook handler is registered with the documented path argument, because setup() stores bearer tokens only under the default suffix paths and never adds the custom path to the token map, so self._tokens.get(path) returns None and the authentication guard is skipped. An unauthenticated remote attacker can POST forged payloads to the custom webhook endpoint and trigger victim-defined handlers. This issue is fixed in version 2.2.1.
- Record
CVE-2026-54635- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-287
- Updated
- 2026-11-02
EUVDEUVD-2026-49907
7.5
pytonapi is a Python SDK for TONAPI that provides REST API, streaming, and webhook access to the TON blockchain. From 2.0.0 to 2.2.0, TonapiWebhookDispatcher fails to validate the Authorization header when a webhook handler is registered with the documented path argument, because setup() stores bearer tokens only under the default suffix paths and never adds the custom path to the token map, so self._tokens.get(path) returns None and the authentication guard is skipped. An unauthenticated remote attacker can POST forged payloads to the custom webhook endpoint and trigger victim-defined handlers. This issue is fixed in version 2.2.1.
- Record
EUVD-2026-49907- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3fcr-jvgp-7f58
7.5
pytonapi has a Webhook Custom Path Authentication Bypass
Webhook Custom Path Authentication Bypass in pytonapi
Summary
TonapiWebhookDispatcher in pytonapi 2.2.0 fails to validate the Authorization header when a webhook handler is registered with the documented path= argument. During setup(), bearer tokens are stored only under the default suffix paths (e.g., /hook/account-tx), but the custom path (e.g., /hook/custom) is never added to the token map. When an incoming request arrives at the custom path, self._tokens.get(path) returns None, causing the if expected_token is not None guard to evaluate to False and silently skip authentication entirely. An unauthenticated remote attacker can POST arbitrary forged payloads to the custom webhook endpoint and trigger victim-defined handlers with full integrity impact.
Details
The vulnerability is a fail-open authentication check in pytonapi/webhook/dispatcher.py.
Token registration (setup) stores tokens only under default suffix paths:
# dispatcher.py lines 109-112
suffix = self.DEFAULT_SUFFIXES[event_type]
local_path = self._path + suffix # e.g., "/hook/account-tx"
webhook = await self._client.ensure(f"{self._url}{suffix}")
self._tokens[local_path] = webhook.token # custom path is NEVER stored here
Handler registration preserves the custom path in the handler tuple:
# dispatcher.py lines 339, 342
resolved_path = path or self._resolve_path(event_type) # -> "/hook/custom"
self._handlers[event_type].append((account_filter, fn, resolved_path))
Path routing (_build_path_map) correctly maps the custom path to the event type:
# dispatcher.py line 182
return {handlers[0][2]: et for et, handlers in self._handlers.items() if handlers}
# -> {"/hook/custom": WebhookEventType.ACCOUNT_TX}
Authentication check (fail-open):
# dispatcher.py lines 286-288
expected_token = self._tokens.get(path) # "/hook/custom" -> None
if expected_token is not None and authorization != f"Bearer {expected_token}":
raise TONAPIError("Invalid webhook token") # SKIPPED because expected_token is None
Because expected_token is None for any custom path, the condition expected_token is not None is always False. The raise is never reached regardless of what the Authorization header contains — or whether it is absent entirely. Execution continues to lines 291 and 297 where the attacker's payload is parsed and the victim handler is invoked.
The path= argument is an officially documented feature (see docs/webhooks/guide.mdx lines 140 and 153), meaning any user following the public documentation is vulnerable.
PoC
Requirements: Python 3.12, pytonapi 2.2.0 installed from source (commit e46c4a4).
Build and run with Docker:
# From the repository root
docker build -t vuln001-pytonapi -f vuln-001/Dockerfile .
docker run --rm vuln001-pytonapi
The Dockerfile installs pytonapi from the local source tree and executes poc.py.
What the PoC does:
- Creates a
TonapiWebhookDispatcherwith a custom-path handler (path="/hook/custom"). - Calls
setup()— tokens are registered only for/hook/account-tx. - Case A — calls
process("/hook/custom", forged_payload, authorization=None): noAuthorizationheader, handler fires. - Case B — calls
process("/hook/custom", forged_payload, authorization="Bearer totally-wrong-token"): wrong token, handler still fires. - Case C (control) — same attack against the default path
/hook/account-txwith no auth: correctly raisesTONAPIError. - Case D (control) — default path with valid token: correctly accepted.
Simulated malicious HTTP request routed to the victim dispatcher:
POST /hook/custom HTTP/1.1
Host: victim.example
Content-Type: application/json
# No Authorization header
{"event_type":"account_tx","account_id":"0:victim","lt":1,"tx_hash":"FORGED_TX_HASH"}
Expected output confirming the vulnerability: …
- Record
GHSA-3fcr-jvgp-7f58- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-287
- Updated
- 2026-11-02
NVD
7.5
pytonapi is a Python SDK for TONAPI that provides REST API, streaming, and webhook access to the TON blockchain. From 2.0.0 to 2.2.0, TonapiWebhookDispatcher fails to validate the Authorization header when a webhook handler is registered with the documented path argument, because setup() stores bearer tokens only under the default suffix paths and never adds the custom path to the token map, so self._tokens.get(path) returns None and the authentication guard is skipped. An unauthenticated remote attacker can POST forged payloads to the custom webhook endpoint and trigger victim-defined handlers. This issue is fixed in version 2.2.1.
- Record
CVE-2026-54635- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-287
- Updated
- 2026-11-02
OSV
7.5
pytonapi has a Webhook Custom Path Authentication Bypass
pytonapi is a Python SDK for TONAPI that provides REST API, streaming, and webhook access to the TON blockchain. From 2.0.0 to 2.2.0, TonapiWebhookDispatcher fails to validate the Authorization header when a webhook handler is registered with the documented path argument, because setup() stores bearer tokens only under the default suffix paths and never adds the custom path to the token map, so self._tokens.get(path) returns None and the authentication guard is skipped. An unauthenticated remote attacker can POST forged payloads to the custom webhook endpoint and trigger victim-defined handlers. This issue is fixed in version 2.2.1.
- Record
CVE-2026-54635- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-287
- Updated
- 2026-11-02
OSVGHSA-3fcr-jvgp-7f58
7.5
pytonapi has a Webhook Custom Path Authentication Bypass
Webhook Custom Path Authentication Bypass in pytonapi
Summary
TonapiWebhookDispatcher in pytonapi 2.2.0 fails to validate the Authorization header when a webhook handler is registered with the documented path= argument. During setup(), bearer tokens are stored only under the default suffix paths (e.g., /hook/account-tx), but the custom path (e.g., /hook/custom) is never added to the token map. When an incoming request arrives at the custom path, self._tokens.get(path) returns None, causing the if expected_token is not None guard to evaluate to False and silently skip authentication entirely. An unauthenticated remote attacker can POST arbitrary forged payloads to the custom webhook endpoint and trigger victim-defined handlers with full integrity impact.
Details
The vulnerability is a fail-open authentication check in pytonapi/webhook/dispatcher.py.
Token registration (setup) stores tokens only under default suffix paths:
# dispatcher.py lines 109-112
suffix = self.DEFAULT_SUFFIXES[event_type]
local_path = self._path + suffix # e.g., "/hook/account-tx"
webhook = await self._client.ensure(f"{self._url}{suffix}")
self._tokens[local_path] = webhook.token # custom path is NEVER stored here
Handler registration preserves the custom path in the handler tuple:
# dispatcher.py lines 339, 342
resolved_path = path or self._resolve_path(event_type) # -> "/hook/custom"
self._handlers[event_type].append((account_filter, fn, resolved_path))
Path routing (_build_path_map) correctly maps the custom path to the event type:
# dispatcher.py line 182
return {handlers[0][2]: et for et, handlers in self._handlers.items() if handlers}
# -> {"/hook/custom": WebhookEventType.ACCOUNT_TX}
Authentication check (fail-open):
# dispatcher.py lines 286-288
expected_token = self._tokens.get(path) # "/hook/custom" -> None
if expected_token is not None and authorization != f"Bearer {expected_token}":
raise TONAPIError("Invalid webhook token") # SKIPPED because expected_token is None
Because expected_token is None for any custom path, the condition expected_token is not None is always False. The raise is never reached regardless of what the Authorization header contains — or whether it is absent entirely. Execution continues to lines 291 and 297 where the attacker's payload is parsed and the victim handler is invoked.
The path= argument is an officially documented feature (see docs/webhooks/guide.mdx lines 140 and 153), meaning any user following the public documentation is vulnerable.
PoC
Requirements: Python 3.12, pytonapi 2.2.0 installed from source (commit e46c4a4).
Build and run with Docker:
# From the repository root
docker build -t vuln001-pytonapi -f vuln-001/Dockerfile .
docker run --rm vuln001-pytonapi
The Dockerfile installs pytonapi from the local source tree and executes poc.py.
What the PoC does:
- Creates a
TonapiWebhookDispatcherwith a custom-path handler (path="/hook/custom"). - Calls
setup()— tokens are registered only for/hook/account-tx. - Case A — calls
process("/hook/custom", forged_payload, authorization=None): noAuthorizationheader, handler fires. - Case B — calls
process("/hook/custom", forged_payload, authorization="Bearer totally-wrong-token"): wrong token, handler still fires. - Case C (control) — same attack against the default path
/hook/account-txwith no auth: correctly raisesTONAPIError. - Case D (control) — default path with valid token: correctly accepted.
Simulated malicious HTTP request routed to the victim dispatcher:
POST /hook/custom HTTP/1.1
Host: victim.example
Content-Type: application/json
# No Authorization header
{"event_type":"account_tx","account_id":"0:victim","lt":1,"tx_hash":"FORGED_TX_HASH"}
Expected output confirming the vulnerability: …
- Record
GHSA-3fcr-jvgp-7f58- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-287
- Updated
- 2026-11-02
OSVPYSEC-2026-3614
7.5
pytonapi has a Webhook Custom Path Authentication Bypass
Webhook Custom Path Authentication Bypass in pytonapi
Summary
TonapiWebhookDispatcher in pytonapi 2.2.0 fails to validate the Authorization header when a webhook handler is registered with the documented path= argument. During setup(), bearer tokens are stored only under the default suffix paths (e.g., /hook/account-tx), but the custom path (e.g., /hook/custom) is never added to the token map. When an incoming request arrives at the custom path, self._tokens.get(path) returns None, causing the if expected_token is not None guard to evaluate to False and silently skip authentication entirely. An unauthenticated remote attacker can POST arbitrary forged payloads to the custom webhook endpoint and trigger victim-defined handlers with full integrity impact.
Details
The vulnerability is a fail-open authentication check in pytonapi/webhook/dispatcher.py.
Token registration (setup) stores tokens only under default suffix paths:
# dispatcher.py lines 109-112
suffix = self.DEFAULT_SUFFIXES[event_type]
local_path = self._path + suffix # e.g., "/hook/account-tx"
webhook = await self._client.ensure(f"{self._url}{suffix}")
self._tokens[local_path] = webhook.token # custom path is NEVER stored here
Handler registration preserves the custom path in the handler tuple:
# dispatcher.py lines 339, 342
resolved_path = path or self._resolve_path(event_type) # -> "/hook/custom"
self._handlers[event_type].append((account_filter, fn, resolved_path))
Path routing (_build_path_map) correctly maps the custom path to the event type:
# dispatcher.py line 182
return {handlers[0][2]: et for et, handlers in self._handlers.items() if handlers}
# -> {"/hook/custom": WebhookEventType.ACCOUNT_TX}
Authentication check (fail-open):
# dispatcher.py lines 286-288
expected_token = self._tokens.get(path) # "/hook/custom" -> None
if expected_token is not None and authorization != f"Bearer {expected_token}":
raise TONAPIError("Invalid webhook token") # SKIPPED because expected_token is None
Because expected_token is None for any custom path, the condition expected_token is not None is always False. The raise is never reached regardless of what the Authorization header contains — or whether it is absent entirely. Execution continues to lines 291 and 297 where the attacker's payload is parsed and the victim handler is invoked.
The path= argument is an officially documented feature (see docs/webhooks/guide.mdx lines 140 and 153), meaning any user following the public documentation is vulnerable.
PoC
Requirements: Python 3.12, pytonapi 2.2.0 installed from source (commit e46c4a4).
Build and run with Docker:
# From the repository root
docker build -t vuln001-pytonapi -f vuln-001/Dockerfile .
docker run --rm vuln001-pytonapi
The Dockerfile installs pytonapi from the local source tree and executes poc.py.
What the PoC does:
- Creates a
TonapiWebhookDispatcherwith a custom-path handler (path="/hook/custom"). - Calls
setup()— tokens are registered only for/hook/account-tx. - Case A — calls
process("/hook/custom", forged_payload, authorization=None): noAuthorizationheader, handler fires. - Case B — calls
process("/hook/custom", forged_payload, authorization="Bearer totally-wrong-token"): wrong token, handler still fires. - Case C (control) — same attack against the default path
/hook/account-txwith no auth: correctly raisesTONAPIError. - Case D (control) — default path with valid token: correctly accepted.
Simulated malicious HTTP request routed to the victim dispatcher:
POST /hook/custom HTTP/1.1
Host: victim.example
Content-Type: application/json
# No Authorization header
{"event_type":"account_tx","account_id":"0:victim","lt":1,"tx_hash":"FORGED_TX_HASH"}
Expected output confirming the vulnerability: …
- Record
PYSEC-2026-3614- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-54635 is a high vulnerability (CVSS 7.5) in Nessshon Tonapi, published July 28, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.51%, the 44th percentile. Fixed in pytonapi 2.2.1.
References
github.com/nessshon/tonapi/security/advisories/GHSA-3fcr-jvgp-7f58
github.com/nessshon/tonapi/commit/854222b7ee68d3fb7b4d6d899d200f388483bd86
github.com/nessshon/tonapi/releases/tag/v2.2.1
github.com/pypa/advisory-database/tree/main/vulns/pytonapi/PYSEC-2026-3614.yaml
nvd.nist.gov/vuln/detail/CVE-2026-54635
github.com/advisories/GHSA-3fcr-jvgp-7f58
github.com/CVEProject/cvelistV5/tree/main/cves/2026/54xxx/CVE-2026-54635.json
github.com/nessshon/tonapi
pypi.org/project/pytonapi
Left out here: the rest of 3 source descriptions. The JSON record has them.