What is kong & why we’re relying on it
Konga, an unmaintained web UI for Kong, used a hard-coded fallback JWT secret and had broken access control, letting an unauthenticated attacker sign a token, enable signup, register a low-privileged account and escalate to admin. From Konga admin, the Kong Lua sandbox could be abused because the sandboxed code received objects containing PostgreSQL credentials and an ngx socket module, allowing credential theft and a TCP tunnel to the database.
If you’re an occasional reader of the manomano-tech Medium blog, you might already be familiar with Kong API Gateway thanks to previous articles more developer-focused like this one: Improve your Kong Plugin Experience…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a hard-coded fallback JWT secret plus missing server-side role checks in Konga, and a Kong sandbox that passed live objects containing secrets and the ngx socket module into untrusted Lua.
Impact
An attacker could take over Konga as admin and, through the Kong sandbox, steal PostgreSQL credentials and open a tunnel to the internal database, though Kong's position is that this requires an unprotected Admin API and is not a vulnerability.
What the attacker needed
Konga reachable with default secret; Kong Admin API reachable by Konga; A plugin that runs sandboxed Lua
The fix
Konga should refuse to start without a strong random secret and enforce role checks on the server; Kong should not pass secrets or the ngx socket module into the sandbox, but the text says Kong considers this not a bug and no patch is on the way.
How it was found
- Sign the value 1 with the weak default JWT secret.
- Send a WebSocket message to the settings endpoint to enable the signup page.
- Register an unprivileged account through the signup page and log in.
- Change the role value in local storage so the GUI shows admin options.
- Tick the admin checkbox and save, which sends a request that grants admin on the backend.
- As Kong admin, drop Lua code into a plugin that reads database credentials and sends them out via the ngx socket.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Konga is a web interface used to manage Kong, a gateway that sits in front of internal services. It signed login tokens with a secret that was written into its source code, so anyone who read the code could create a valid token. Separately, Kong runs small Lua scripts in a restricted box, but that box was handed objects that still contained database passwords and a way to open network connections.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.