T09 · Insecure Skill Coding Practices
- Location
references/graph-api-overview.md:12- Finding
Bearer Access Tokens Permitted in URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
references/graph-api-overview.md, line 12
Vulnerability Type: Exposure of bearer credentials through URL query strings
Risk Level: MediumVulnerable Snippet:
markdown - Access token in query (`access_token`) or `Authorization: Bearer` header.Technical Analysis
The guidance permits Facebook Graph API access tokens to be supplied through the
access_tokenURL query parameter. URLs are commonly recorded in browser history, HTTP client diagnostics, reverse-proxy and gateway access logs, application monitoring platforms, and server logs. Consequently, placing a bearer credential in a URL unnecessarily expands the number of systems and personnel that may gain access to it.A Facebook access token is a bearer credential: possession may be sufficient to exercise its authorized Graph API permissions. Although the document also identifies the safer
Authorization: Bearerheader mechanism, it does not require that mechanism or warn against query-string credentials.Attack Path
- A user or agent follows the documented query-parameter option and sends a request containing
?access_token=<token>. - An intermediary, HTTP client, gateway, diagnostic system, or access-logging service records the full request URL.
- An unauthorized party with access to those records extracts the token.
- The party submits Graph API requests using the exposed bearer token.
- Facebook Page operations succeed to the extent allowed by the token's type, scopes, Page association, validity, and platform controls.
Impact Assessment
A leaked token may expose Page data or enable Page operations according to its effective permissions. Based on the documented workflows, potential actions include reading Page content, publishing or editing posts, deleting posts, adding comments, and hiding or deleting comments. The exact scope is constrained by the token's granted permissions, associated Pages, expiration, an ...[truncated 34 chars]
- A user or agent follows the documented query-parameter option and sends a request containing
- Remediation
View remediation
Remediation Suggestions
- Require access tokens to be transmitted exclusively through the
Authorization: Bearer <token>header. - Remove the recommendation to place
access_tokenin query strings and explicitly state that credentials must never appear in URLs. - Configure HTTP clients, gateways, proxies, and application logging to redact authorization headers and sensitive parameters.
- Avoid logging complete requests or token-bearing error objects.
- Store tokens in an approved secret manager, grant only the permissions required for the workflow, and rotate or revoke any token suspected of exposure.
- Add a safe request example such as:
http GET /vXX.X/{page-id}/posts HTTP/1.1 Host: graph.facebook.com Authorization: Bearer <page-access-token>- Require access tokens to be transmitted exclusively through the
