root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat opensecret.md
// writeups

OpenSecret

26 Jan 2026 · 2 min read
OpenSecret — HTB challenge
A ticketing portal name-drops JWT as a red herring. The flag is hardcoded in the client-side JavaScript — readable in DevTools ▸ Sources without ever touching the token.

Challenge overview

FieldValue
PlatformHack The Box · Challenge
CategoryWeb
DifficultyVery Easy
StateRetired

Attack map

[Web] helpdesk portal
      │
      ▼
[DevTools ▸ Sources] .js files
      │
      ▼
[JS] hardcoded flag
      │
      ▼
[FLAG]

1. Don't take the bait

The description talks JWT (alg:none, weak secret, role escalation). Before going down that road, the golden web rule is to check the client code first.

2. Open Sources in DevTools

The Sources tab lists every JS/HTML file the browser downloaded. That's where developers accidentally leave secrets.
# F12 ▸ Sources ▸ abrir index / *.js

3. Find the hardcoded flag

const secret = "HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}";

4. Flag

HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}

The name OpenSecret was the hint: a secret in the frontend isn't a secret.

Chain summary

PhaseComponentVulnerabilityImpact
ReconClient-side JavaScriptHardcoded secretFlag exposed in the browser

Lessons learned

  • Everything that reaches the browser — JS, HTML, comments, localStorage — is accessible to the user.
  • On a "Very Easy" web, check Sources, comments, LocalStorage/SessionStorage and Network before attacking the logic.
  • Red herrings (JWT here) exist to waste your time — always start with the simple path.