Tata Nexarc’s OTP Leak: How an “Encrypted” API Response Handed Out Full Admin Access
The login API returned the one-time password inside its own response, encrypted only with client-side JavaScript decryption. Anyone could read the OTP in the browser and log into a victim's account, taking it over.
Published on medium.com
Cybersecurity
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.
Context
Tata Nexarc is a B2B procurement platform used by small and medium businesses across India. The feature at the centre of this report is the platform's login flow, which authenticates users by sending a one-time password (OTP) to a phone number. Accounts on the platform are linked to Tata Business Hub and Tata Steel, and the data behind them includes employee data, order history and licensing information.
Normally an OTP is generated on the server, delivered out of band to the user's phone, and then compared server-side against what the user submits. The client should never see the code before the user types it in. In this case the login API returned the OTP inside its own response, and although the value was described as encrypted, the decryption logic ran entirely in client-side JavaScript.

The image is the article's opening card: a single phone number, no hacking skills required, and a critical login flaw that exposed thousands of Indian businesses to account takeover.
Setup
The report describes no special tooling, accounts or roles. The researcher needed only a browser, a phone number and a few clicks. No phishing, SIM swap or brute force was involved. The precondition is simply that the attacker can reach the login endpoint and observe the response it returns for a given phone number.
Finding it
What made the flaw stand out was that the login API's response contained the OTP itself. The data was technically encrypted, but because the decryption logic was shipped to the browser in client-side JavaScript, the encryption offered no protection: the decryption routine ran in client-side JavaScript, so the plaintext was recoverable by whoever loaded the page. Setting a breakpoint in the browser and reading the value at the point of decryption yields the OTP in plaintext.
Exploitation
Step 1: Trigger the OTP for a target phone number
Start the normal login flow for the victim's phone number so that the server generates and returns an OTP. The report does not include the request itself, only the fact that the login API returns the code in its response.
Step 2: Set a breakpoint on the client-side decryption
Open the browser's developer tools and place a breakpoint in the JavaScript that decrypts the response. When the response is processed, execution pauses and the decrypted OTP can be read in plaintext.
Step 3: Submit the OTP and log in
Enter the recovered OTP into the login form. The server accepts it as a valid code for the victim's number, and the session is authenticated as that user. From there the attacker has full account takeover on the account, including the data linked to Tata Business Hub and Tata Steel.
Root cause
The design mistake is that the OTP is present in a browser-accessible response at all. Encrypting it does not help when the client holds the means to decrypt it: the decryption logic runs in client-side JavaScript, so the plaintext is always recoverable by the person receiving the response. Authentication codes should be validated server-side and never returned to the client in any form. The report calls this a textbook example of broken authentication design; the existing defence, encryption of the response, did not stop the attack because the client could decrypt it too.
Impact
An attacker with a browser and a phone number can take over accounts on the platform. The report states that this exposed employee data, order history and licensing information on accounts linked to Tata Business Hub and Tata Steel, and that thousands of Indian businesses use the platform. The report does not give a count of affected accounts or describe any further escalation beyond full account takeover.
Fix
The researcher reported the issue to CERT-In on 30 July 2026, and it was confirmed fixed the following day, 31 July 2026. The report does not describe the change that was made. The design principle it states is that authentication codes should be validated server-side and never returned to the client in any form, encrypted or otherwise.
Variants to test
- OTP echoed in any auth response. Trigger a login or password reset and inspect every response body and field for a value that matches the code delivered to the phone. A positive result is a response field whose decrypted or decoded value equals the OTP you received.
- Client-side decryption of sensitive fields. Look for JavaScript that decrypts response data before display. A positive result is a breakpoint where a secret such as an OTP, reset token or temporary password appears in plaintext.
- Encryption keys shipped to the browser. Search the client bundle for keys, IVs or passphrases used with the decryption routine. A positive result is a static key that successfully decrypts a captured response offline.
- Reset and verification flows beyond login. Apply the same inspection to password reset, phone verification and email verification endpoints. A positive result is any of those flows returning the code or token to the client before it is used.
- Response fields hidden from the UI. Compare the raw response with what the interface renders. A positive result is a sensitive field present in the JSON but never shown to the user.
What happened, in plain words
Tata Nexarc is a B2B procurement platform: a website where small and medium businesses across India buy and manage supplies. To use it you log in, and the platform's login flow works by sending a one-time password (OTP) to your phone. An OTP is a short code that is valid once and expires quickly, so that knowing a phone number is not enough to get into an account. Accounts on the platform are linked to Tata Business Hub and Tata Steel, and the data behind them includes employee data, order history and licensing information.
Normally an OTP is generated on the server, sent to the user's phone, and then compared on the server against whatever the user types in. The browser should never see the code before the user types it. In this case the login API returned the OTP inside its own response, and although the value was described as encrypted, the decryption logic ran entirely in client-side JavaScript.

The image is the article's opening card: a single phone number, no hacking skills required, and a critical login flaw that exposed thousands of Indian businesses to account takeover.
That is the whole story: no phishing email, no SIM swap, no brute force. Just a browser, a phone number and a few clicks. The researcher reported it to CERT-In on 30 July 2026 and it was confirmed fixed the next day, 31 July 2026.
The words you need first
Before the steps make sense, a few everyday ideas.
- Server and client. The server is the computer in a data centre that holds the accounts and makes the decisions. The client is your browser on your own machine. Anything the server sends to the browser can be read by whoever is using that browser, because it arrives on their computer.
- API. An API is the doorway a website's pages use to talk to the server. When you tap "send OTP", the page sends a request to an address on the server and the server sends back a response, usually in a structured text format called JSON. Think of it as a waiter: you tell the waiter what you want, the waiter goes to the kitchen and comes back with a tray. The problem here is what was on the tray.
- Response. The tray. Everything the server sends back for one request: status, headers and a body. If a secret is in the body, the browser has the secret.
- OTP. A one-time password, a short code sent to your phone to prove you hold that phone. It should live on the server and on your phone, nowhere else.
- Encryption. Scrambling data with a key so that only someone with the key can unscramble it. It is like a locked box. It only helps if the person you are protecting against does not have the key.
- Client-side JavaScript. JavaScript is the programming language browsers run. Code that is "client-side" is delivered to the browser and runs there. Anyone can read it and pause it, because it is running on their own machine.
- Breakpoint. A pause button you can set inside the browser's developer tools on a specific line of JavaScript. When execution reaches that line, everything freezes and you can look at the values in memory.
- Account takeover. Getting into someone else's account and acting as them. It is the worst ordinary outcome of a login flaw, because everything the real user could see, the attacker now sees.
- CERT-In. India's national computer emergency response team, the body researchers report vulnerabilities to.
Setup
The report describes no special tooling, accounts or roles. The researcher needed only a browser, a phone number and a few clicks. No phishing, SIM swap or brute force was involved. The precondition is simply that the attacker can reach the login endpoint and observe the response it returns for a given phone number.
That last sentence is the important one for a beginner. You do not need to break anything to see this bug. You need to be an ordinary visitor, start a login, and look at what comes back.
Finding it
What made the flaw stand out was that the login API's response contained the OTP itself. The data was technically encrypted, but because the decryption logic was shipped to the browser in client-side JavaScript, the encryption offered no protection: the decryption routine ran in client-side JavaScript, so the plaintext was recoverable by whoever loaded the page. Setting a breakpoint in the browser and reading the value at the point of decryption yields the OTP in plaintext.
Compare it to a locked box that arrives with the key taped to the lid. The lock is real. It just does not stop the person holding the box.
Exploitation
Step 1: Trigger the OTP for a target phone number
Start the normal login flow for the victim's phone number so that the server generates and returns an OTP. The report does not include the request itself, only the fact that the login API returns the code in its response.
Why this step: the OTP only exists once the server has generated one, so you begin exactly where a legitimate user would, by asking for a code for the number you want to get into.
Step 2: Set a breakpoint on the client-side decryption
Open the browser's developer tools and place a breakpoint in the JavaScript that decrypts the response. When the response is processed, execution pauses and the decrypted OTP can be read in plaintext.
Why this step: the response is scrambled, so reading it as it arrives shows nothing useful. The browser must unscramble it before it can use it, and that unscrambling happens in code running on your machine. Pausing at that moment means you see the value after the lock is opened and before anything else happens to it. The developer tools are built into every major browser, usually opened with F12 or the browser menu.
Step 3: Submit the OTP and log in
Enter the recovered OTP into the login form. The server accepts it as a valid code for the victim's number, and the session is authenticated as that user. From there the attacker has full account takeover on the account, including the data linked to Tata Business Hub and Tata Steel.
Why this step works: the server has no way to tell your typed code apart from the victim's, because it is the same code. The check the server performs is correct in itself; the mistake was handing the code out earlier.
Root cause
The design mistake is that the OTP is present in a browser-accessible response at all. Encrypting it does not help when the client holds the means to decrypt it: the decryption logic runs in client-side JavaScript, so the plaintext is always recoverable by the person receiving the response. Authentication codes should be validated server-side and never returned to the client in any form. The report calls this a textbook example of broken authentication design; the existing defence, encryption of the response, did not stop the attack because the client could decrypt it too.
In plain terms: encryption protects a message from people in the middle of the road. It does nothing against the person the message is addressed to. Here the browser was the addressee, and the browser belonged to the attacker.
Impact
An attacker with a browser and a phone number can take over accounts on the platform. The report states that this exposed employee data, order history and licensing information on accounts linked to Tata Business Hub and Tata Steel, and that thousands of Indian businesses use the platform. The report does not give a count of affected accounts or describe any further escalation beyond full account takeover.
Fix
The researcher reported the issue to CERT-In on 30 July 2026, and it was confirmed fixed the following day, 31 July 2026. The report does not describe the change that was made. The design principle it states is that authentication codes should be validated server-side and never returned to the client in any form, encrypted or otherwise.
Variants to test
If you want to look for the same class of mistake elsewhere, these are checks in the same spirit. Each one is a variation on a single question: does a secret reach the browser before it is supposed to?
- OTP echoed in any auth response. Trigger a login or password reset and inspect every response body and field for a value that matches the code delivered to the phone. A positive result is a response field whose decrypted or decoded value equals the OTP you received.
- Client-side decryption of sensitive fields. Look for JavaScript that decrypts response data before display. A positive result is a breakpoint where a secret such as an OTP, reset token or temporary password appears in plaintext.
- Encryption keys shipped to the browser. Search the client bundle for keys, IVs or passphrases used with the decryption routine. A positive result is a static key that successfully decrypts a captured response offline.
- Reset and verification flows beyond login. Apply the same inspection to password reset, phone verification and email verification endpoints. A positive result is any of those flows returning the code or token to the client before it is used.
- Response fields hidden from the UI. Compare the raw response with what the interface renders. A positive result is a sensitive field present in the JSON but never shown to the user.
A note on the vocabulary in that list: a token is a value that stands in for proof of identity, like a cloakroom ticket. An IV (initialisation vector) is a random starting value used alongside a key when encrypting, so that the same plaintext does not produce the same ciphertext every time. A client bundle is the collection of JavaScript files the site sends to your browser. "Offline" means decrypting a saved response on your own machine, without the site being involved.
Glossary
- API: the doorway a website's pages use to talk to the server, sending requests and receiving responses.
- Response: everything the server sends back for one request, including the body that may hold data.
- JSON: a plain text format for structured data, used in most API responses.
- Server: the remote computer that holds accounts and makes security decisions.
- Client: the browser on the user's own machine, which receives and can read everything sent to it.
- Client-side JavaScript: code delivered to the browser and run there, readable and pausable by whoever uses that browser.
- OTP: a one-time password, a short code valid once, normally sent to a phone and checked on the server.
- Encryption: scrambling data with a key so only a holder of the key can unscramble it.
- Decryption: turning scrambled data back into readable plaintext using the key.
- Plaintext: data in readable form, before encryption or after decryption.
- Breakpoint: a pause point set on a line of JavaScript in the browser's developer tools, freezing execution so values can be inspected.
- Developer tools: the inspection panel built into browsers, used to view requests, responses and running code.
- Endpoint: a specific address on the server that a request is sent to, such as the login API.
- Account takeover: gaining access to another person's account and acting as them.
- Broken authentication design: a flaw in how a system proves who someone is, rather than in a single line of code.
- Session: the state of being logged in, kept by the server and referenced by the browser after a successful login.
- Token: a value that stands in for proof of identity, like a cloakroom ticket.
- IV (initialisation vector): a random starting value used with an encryption key so identical plaintext does not produce identical ciphertext.
- Client bundle: the collection of JavaScript files a site sends to the browser.
- CERT-In: India's national computer emergency response team, which receives vulnerability reports.
- B2B: business to business, a platform where businesses trade with other businesses rather than consumers.
- Phishing: tricking someone into giving up credentials or codes, typically through a fake message or page.
- SIM swap: a fraud where an attacker takes over a victim's phone number so codes sent by SMS arrive at the attacker's phone.
- Brute force: trying many guesses until one works.