Skip to content
Get started
View all products → One platform · one sign-in · every product on dcsai.ai
View full sitemap → DCS AI Technologies L.L.C, Dubai · parent of DCS Network + DCS Labs
ENGINEERING · WEEKLY ACHIEVEMENTS · JULY 17, 2026

Two P0s, one root cause: identity comes from a verified token

The two most serious open items in the estate this week turned out to be the same bug wearing two faces — a service reading who you are from the request instead of from a verified token. The TRD gateway and the DCS intelligence engine got the same fix, two days apart. The rule is now written into the code itself.

Most weeks the achievement I want on the record is a surface going out. This week it's a bug going away — the same bug, twice, on two different services, closed with the same idea. It is not glamorous work. It is the kind of work that, done right, no user ever notices, and done wrong ends a company. So I'd rather write it down plainly than dress it up.

The root cause, stated once: a service was deciding who you are by reading the request, instead of by verifying a token. When identity comes from the request, anyone who can type a URL can be anyone. When it comes from a cryptographically verified token, they can only be themselves. That single sentence is the whole post.

The same bug, twice

On July 12 an internal code-read audit of the TRD gateway (api.trdn.io) found that its auth path base64-decoded the JWT payload and checked only that a subject field existed and the token hadn't expired — it never verified the signature. Behind that gate sit money-adjacent routes. A token you can decode but never verify is a lock that checks the shape of the key, not the key.

The very next day, July 13, the DCS intelligence engine (our adaptive memory service, AIE) turned out to have the same disease in a blunter form. Its production instance was reading userId straight from the query string. GET /aie/profile?userId=<any-uuid> would read that user's memory; the edit and reset endpoints would write and wipe it — no token required at all. It had gone unnoticed for the most uncomfortable reason there is: everything worked. As the fix commit puts it, an open door opens for everyone, including the people testing it.

Two services, two days, one root cause. That coincidence is the reason this is a single post and not two.

The TRD gateway: verify the signature

The gateway fix landed as four commits on the afternoon of July 12 — the first code on that surface in ten days. In order:

I'll be honest about the state of it: the migration isn't finished. A handful more routes — payments, subscriptions, vendor-spend — carry the same verifyToken() change in the working tree, uncommitted, as I write this. They are not done until they're committed and pushed, and I'm not going to call them done.

The intelligence engine: the open door, closed

The AIE fix takes identity from a verified JWT that overwrites whatever the caller sent, and it adds two guards that matter more than the fix: the service now refuses to boot if it's marked live with no signing secret, and it rejects the "auth off" switch whenever it's running live, so that shortcut can never quietly become the production default. A kill-flag that lets the server keep serving is not a kill-flag; these close that gap.

Two more changes from the same day are worth naming because they're the load-bearing ones:

One correction I owe you, because it cuts against us: this file had earlier recorded the intelligence engine as "not deployed." It was deployed — reachable and serving — and our own record was wrong. The status flag moved to live not because something shipped, but because we found it already was, and had mislabelled it. Getting that on the record is part of the point.

Identity comes from a verified token. Never from the request. It's now a comment at the top of the auth file, because a rule you have to remember is a rule you'll eventually forget.

The verifiable trail

What's committed, and what's verified

Everything above is git-verified: I'm describing commits read directly out of the repositories, not a status page. What is not yet verified is the deploy. The gateway and the intelligence engine both fix the bug in code; confirming the live effect — the one-line check that a forged token now returns a 401 instead of a 200 — could not be run from where this work is integrated, and until it is, the honest word is "assumed, not proven." A fix you haven't verified is a fix you're assuming.

That's also why the discipline around it hasn't moved. The intelligence engine's receipts are durable now, but they're still unsigned — the signing path exists in code and is switched off, so nothing it emits yet counts as a verified receipt. No product flag flipped this week on the strength of any of this. The work is hardening underneath the existing flags, not new capability reaching a new surface.

What is not done yet (and we want you to know it)

Honest limits

All test and check counts here are internal, integrator-rerun. The audits and code reads that surfaced and closed these bugs were produced and re-run by us against our own repositories. They are real, but they are ours — not a third-party audit — and I'm labelling them that way.

Committed and pushed does not mean deploy-verified. Both fixes are in the code. Neither has had its live effect independently network-verified from our environment this week; the forged-token 401 proof is still owed. The remaining gateway routes carrying the same change are uncommitted working-tree changes as of this writing.

Signed receipts are still off. The intelligence engine issues durable but unsigned receipts. Signing exists in code and is not switched on. Nothing it emits today should be treated as a verified receipt.

The standing labels are unchanged. There is no production zero-knowledge system and no live federation network here. This week was authentication plumbing — verifying tokens on two services — not a change to any of those maturity labels.

Why it's worth a post

Because the failure mode is the same one every time, and naming it is the only defence that scales. Both of these bugs passed their tests. Both looked healthy. Both did precisely what they were told — the trouble was that they were being told by whoever was asking. The fix isn't clever; it's a rule, applied twice, and written into the code so it survives the next person who's in a hurry. When the deploy proofs are in hand, they'll get their own honest line here — with what we checked, and who checked it.

— Deepak

Follow the build

The bug is closed in code. The deploy proof is still owed — and it'll be written down when it lands.