iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔐

Have You Ever Thought About Where Your JWT Goes When You Paste It into Developer Tools?

に公開
2026/08/30

That Day, My Fingers Stopped

I paste a JWT token into an online decoder. I feed API response JSON into a formatter. I compare code diffs using an online tool.

I believe these are tasks that developers perform every single day.

I was the same. One day, as I went to decode a JWT as usual, it suddenly hit me.

"This token contains the user's email address and role information... where exactly was this sent just now?"

I opened the Network tab in DevTools. A POST request was flying out. The data I had entered was being sent to a server.

There is no malicious intent. It is natural since it is designed to be processed on the server side. But when you think about it, it's a scary story.

It Is Actually Happening — Information Leaks via Online Tools

"Aren't you overthinking it?" you might say. But accidents are actually happening.

80,000 AWS Keys Leaked (November 2025)

An investigation by the security firm watchTowr Labs revealed that over 80,000 AWS keys, passwords, and API secrets were leaked from jsonformatter.org and codebeautify.org. This involved five years of stored data, totaling over 5GB. Organizations in government, banking, telecommunications, and aerospace were affected.

Developers pasted data into these sites for JSON formatting or validation, and that data was stored on the server. Although it was provided as a "save" feature, most users were unaware that authentication credentials contained within the data were also being saved.

Mentioned in a previous article: JSON Formatter Development Record: Zero-Click Formatting and the Trap of the Clipboard API

Samsung ChatGPT Incident (March 2023)

A Samsung engineer input internal confidential source code and meeting minutes into ChatGPT, resulting in information leaking externally. Three leaks occurred in just one month, forcing Samsung to ban the use of ChatGPT within the company.

While this isn't about online developer tools specifically, it shares the same structure regarding the risk of sending data to external services.

Structural Issues

Comparison of data flow between server-side and client-side tools

I don't mean to criticize. Many online developer tools are designed to process on the server side because it is easier to implement and can handle complex processing. It is a rational choice.

The problem is that users are unaware of it.

  • JWT tokens contain claims like sub (user ID), email, and role
  • API response JSON can contain customer data or internal IDs
  • The code pasted into a diff might be an implementation of a feature not yet released

Even if the privacy policy says "we do not save data," the risk is not zero the moment it is sent.

It Could All Be Done Client-Side

For PureMark, I made all six tools run entirely within the browser. There isn't a single line of server-side code.

To be honest, I initially wondered, "Is that even possible?" But after investigating, I found that you can do a surprising amount with just standard browser APIs.

JSON Formatting: Finished in 2 lines

const parsed = JSON.parse(raw);
const formatted = JSON.stringify(parsed, null, 2);

Validation, formatting, and minification can all be completed with JSON.parse + JSON.stringify. There is absolutely no need to send it to a server.

Base64: Browser Native API

const encoded = btoa(input);   // Encode
const decoded = atob(encoded); // Decode

I needed to combine this with encodeURIComponent to support Unicode, but even then, it is entirely self-contained within the browser.

JWT: Just Base64 Decoding

The structure of a JWT is simply three parts—header.payload.signature—separated by dots. Since the header and payload are Base64URL-encoded JSON, you can read the claims by decoding them.

const [header, payload] = token.split('.');
const claims = JSON.parse(atob(payload.replace(/-/g, '+').replace(/_/g, '/')));

Signature verification using a secret key isn't performed on the frontend anyway (you can't keep a secret key in a browser). If you only need to decode it, no server is required.

Diff: 130 Lines of Custom Implementation

This was the one part where "2 lines with standard APIs" didn't cut it.

Displaying text diffs requires the Myers diff algorithm. While you could use an external library to get it done in an instant, I was committed to zero external dependencies. Consequently, I ended up writing about 130 lines in TypeScript.

Challenges of a "Serverless" Approach

Client-side completion sounds ideal, but it comes with significant constraints in practice. Here are some lessons from my failures.

The Off-by-One Bug in Myers Diff

My custom implementation of the Myers diff algorithm had a bug where the highlighting position would shift in specific patterns.

The cause was a classic off-by-one error in the backtrace index calculation, where I used k instead of k - 1.

The tests had passed. But it broke in edge cases.

I realized it the day after deployment and broke into a cold sweat. If I had used an external library, I could have used battle-tested code, but custom implementations come with these risks. I chose zero external dependencies nonetheless to keep the bundle size minimal and eliminate licensing risks.

The 2000-Character Limit on Shared URLs

Since there is no server, I cannot save shortened URLs in a database.

I came up with a "recipe URL" approach: Base64-encoding the tool's input data and embedding it into the URL hash.

https://json.puremark.app/#d=eyJhYmMiOiJkZWYifQ&m=format

With this, I can restore the tool's state just by using the URL. No server needed.

…Or so I thought. As soon as I tried to share slightly longer JSON, the URL exceeded 2000 characters. It hit the browser's URL length limit, and the share button would grey out.

At the moment, I am accepting this limitation. For sharing long data, I have users use the file download feature as an alternative. If I had a server, I could solve this by saving URLs with short keys in a database, but that contradicts the principle of "not sending data." It was a trade-off.

Disadvantage in SEO

SPAs cannot be server-side rendered (SSR), which puts them at a disadvantage for search engine indexing.

I served static HTML via Cloudflare Pages and handled OGP images and meta tags by pre-generating them. Even then, compared to SSR-capable frameworks (like Next.js), it falls behind in SEO.

Reasons to Choose Client-Side Anyway

There are constraints, but the benefits are greater.

Perspective With Server PureMark (Serverless)
Data Destination Sent to server Never leaves browser
Monthly Server Cost Thousands of yen or more $0 (Cloudflare Pages free tier)
Offline Operation Not possible Possible as PWA
Response Speed Network round-trip required Instant processing
User Verifiability Impossible if closed-source Verifiable via DevTools Network tab

User Trust > SEO Score.

This was my conclusion after finishing six tools in two weeks.

Before / After

Before After
Wondering "Is this okay?" every time I paste a JWT into an online tool Verifying with my own eyes that no requests are flying to the Network tab
Hesitating to paste customer data into a JSON formatter Using it without hesitation as data never leaves the browser
Scared to paste unreleased code into a diff tool Not worrying as it is processed locally
Opening separate sites for each tool Switching with one click via the PureMark navbar

Data pasted into developer tools is more confidential than you might think. Ever since I realized that fact, I have become conscious of the back end of the tools I use.

PureMark is a tool born from that realization—a tool I want to use with peace of mind.

👉 puremark.app — JSON / Base64 / URL / Diff / Timestamp / JWT, all browser-completed.


Discussion