<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sagar Agarwal</title>
    <description>The latest articles on DEV Community by Sagar Agarwal (@sagarwaal).</description>
    <link>https://dev.to/sagarwaal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4277462%2Fc9d41340-a72c-4554-ab35-e46c67c5be57.png</url>
      <title>DEV Community: Sagar Agarwal</title>
      <link>https://dev.to/sagarwaal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sagarwaal"/>
    <language>en</language>
    <item>
      <title>Why 'We Don't Store Your Data' Means Nothing Without DevTools Proof</title>
      <dc:creator>Sagar Agarwal</dc:creator>
      <pubDate>Wed, 02 Dec 2026 03:47:05 +0000</pubDate>
      <link>https://dev.to/sagarwaal/why-we-dont-store-your-data-means-nothing-without-devtools-proof-1j5h</link>
      <guid>https://dev.to/sagarwaal/why-we-dont-store-your-data-means-nothing-without-devtools-proof-1j5h</guid>
      <description>&lt;p&gt;Almost every developer I know has done this at least once. You grab a staging JWT out of a terminal log, or a freshly generated database password, or a release binary that needs a SHA-256 checksum, and you paste it into the first free web utility Google hands you.&lt;/p&gt;

&lt;p&gt;Right above the footer, there is usually a reassuring line: &lt;em&gt;"We respect your privacy and never store your data."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The problem is that a footer sentence is a social promise, not an architecture. If the tool sends your input in a POST request to a backend API, that payload hits a CDN, an ingress proxy, an application container, and probably an error tracker or access log before the response ever comes back. Even if the site owner has good intentions, you have no way to verify what happens on their server.&lt;/p&gt;

&lt;p&gt;Even worse, plenty of "client-side" tools run the math in JavaScript while loading third-party ad networks and session-replay scripts into the same DOM as your pasted bearer token. Any third-party script running in the same browser window can read &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; values and form inputs straight out of memory.&lt;/p&gt;

&lt;p&gt;When I built the security utilities on &lt;a href="https://omnitools.live/" rel="noopener noreferrer"&gt;OmniTools.live&lt;/a&gt;, I wanted zero-upload behavior to be something a skeptical engineer could verify in 30 seconds with DevTools instead of taking my word for it. Here is how that architecture works across three tools (password generation, file hashing, and JWT inspection), where the real security boundaries sit, and two rough edges in my own live setup that I have not fixed yet.&lt;/p&gt;




&lt;h2&gt;
  
  
  Remove the Backend First, Then Gate Third-Party Scripts
&lt;/h2&gt;

&lt;p&gt;The cleanest way to avoid leaking user input on a server is to have no server route that can accept input in the first place.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Typical Online Utility (Trust-Based)
====================================
[You paste a JWT or drop a file]
        |
        v  HTTPS POST (payload crosses the network)
[CDN / Proxy / API] --&amp;gt; access logs, APM traces, third-party analytics
        |
        v  Server decodes or hashes input
[JSON Response] --&amp;gt; Browser renders result


Zero-Backend Static Utility (Inspectable)
=========================================
Build Time (Static HTML + JS Island + SHA-256 CSP)
        |
        v  One-time static GET
+---------------------------------------------------------------+
| Browser Tab Sandbox (privacy: 'sensitive', 0 ad scripts)      |
|                                                               |
|  [JWT String]   --&amp;gt; Base64URL + TextDecoder --&amp;gt; Claims UI     |
|  [Password Req] --&amp;gt; crypto.getRandomValues  --&amp;gt; RAM state     |
|  [File / HMAC]  --&amp;gt; Uint8Array (&amp;lt;= 50 MB)                     |
|                     --&amp;gt; crypto.subtle.{digest,sign} --&amp;gt; Hex   |
|                                                               |
|  Guardrails:                                                  |
|  - Static host only (no backend endpoint exists)              |
|  - connect-src 'self' blocks outbound fetch/XHR/sendBeacon    |
|  - Secrets never written to localStorage or URL fragments     |
+---------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three design decisions make this work in practice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Static output only (&lt;code&gt;output: 'static'&lt;/code&gt;).&lt;/strong&gt; Every page compiles to plain HTML and JavaScript at build time. There is no &lt;code&gt;/api/decode&lt;/code&gt; or &lt;code&gt;/api/hash&lt;/code&gt; endpoint to log a payload by mistake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manifest-level privacy tiers instead of pretending ads do not exist.&lt;/strong&gt; Keeping a static site online costs money, so I split the 59 tools into two explicit manifest classes. Standard utilities (like CSS builders or math calculators) load Google AdSense (&lt;code&gt;privacy: 'standard'&lt;/code&gt;). Tools that touch secrets, local files, or sensitive payloads declare &lt;code&gt;privacy: 'sensitive'&lt;/code&gt; in their manifest, and the layout checks that flag at build time to omit &lt;code&gt;adsbygoogle.js&lt;/code&gt; from the rendered HTML completely. On sensitive pages, no third-party ad code shares the DOM with your inputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volatile memory only.&lt;/strong&gt; Pasted tokens, HMAC keys, and generated passwords live inside component RAM state (&lt;code&gt;useState&lt;/code&gt;). They are never written to &lt;code&gt;localStorage&lt;/code&gt;, &lt;code&gt;sessionStorage&lt;/code&gt;, or URL query/hash strings.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Three Native Browser Primitives That Replace Backend Code
&lt;/h2&gt;

&lt;p&gt;Modern browsers ship solid cryptographic and binary APIs out of the box. You do not need a Node server or a heavy npm crypto wrapper to do this well, though a few subtle bugs trip people up every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Unbiased Passwords Without Modulo Bias (&lt;code&gt;crypto.getRandomValues&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Math.random()&lt;/code&gt; is a non-cryptographic PRNG designed for speed, not unpredictability, so it has no place in credential generation. Most tutorials correctly switch to &lt;code&gt;crypto.getRandomValues(new Uint32Array(1))&lt;/code&gt;, then immediately introduce modulo bias by doing &lt;code&gt;val % charset.length&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Because &lt;code&gt;2^32&lt;/code&gt; (&lt;code&gt;4294967296&lt;/code&gt;) is not evenly divisible by most character set sizes (say, 94 printable characters), the lower characters in the pool get picked slightly more often than the upper ones. Rejection sampling fixes this in six lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getRandomInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;range&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;range&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4294967296&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4294967296&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;range&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getRandomUint32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getRandomUint32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;range&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any 32-bit value falling in the uneven tail above &lt;code&gt;limit&lt;/code&gt; is discarded and redrawn. After guaranteeing at least one character from each selected character class, a Fisher-Yates shuffle using the same &lt;code&gt;getRandomInt&lt;/code&gt; removes positional bias (otherwise the first four characters would always follow the same class order).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Hashing Binary Files Without UTF-8 Corruption (&lt;code&gt;Uint8Array&lt;/code&gt; + &lt;code&gt;SubtleCrypto&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;A common mistake in browser checksum tools is reading dropped files with &lt;code&gt;FileReader.readAsText()&lt;/code&gt; and encoding the string back to bytes. That silently mangles binary files (PDFs, images, &lt;code&gt;.tar.gz&lt;/code&gt; archives) by replacing invalid UTF-8 sequences with &lt;code&gt;U+FFFD&lt;/code&gt;, producing the wrong SHA-256 digest.&lt;/p&gt;

&lt;p&gt;Instead, read raw bytes with &lt;code&gt;await file.arrayBuffer()&lt;/code&gt;, wrap them in a &lt;code&gt;Uint8Array&lt;/code&gt;, enforce a memory cap (50 MB, or &lt;code&gt;50 * 1024 * 1024&lt;/code&gt; bytes, so someone dropping a 4 GB ISO does not crash the tab), and pass the buffer straight into &lt;code&gt;crypto.subtle.digest&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;MAX_HASH_FILE_BYTES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 50 MB&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sha1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sha384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sha512&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="kc"&gt;globalThis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'SHA-1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BufferSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="kc"&gt;globalThis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'SHA-256'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BufferSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="kc"&gt;globalThis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'SHA-384'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BufferSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="kc"&gt;globalThis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'SHA-512'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BufferSource&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For keyed HMAC digests, importing the secret with &lt;code&gt;extractable: false&lt;/code&gt; and &lt;code&gt;['sign']&lt;/code&gt; keeps the raw key material non-exportable inside the browser's Web Crypto boundary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;cryptoKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kc"&gt;globalThis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;importKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'raw'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;keyBytes&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;BufferSource&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'HMAC'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hashName&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// extractable: false&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'sign'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. UTF-8 Safe JWT Decoding and Minimal Cross-Tool Handoffs
&lt;/h3&gt;

&lt;p&gt;Calling &lt;code&gt;atob()&lt;/code&gt; directly on a Base64URL JWT segment breaks as soon as a claim contains non-ASCII UTF-8 characters (like accented names or emoji), because &lt;code&gt;atob()&lt;/code&gt; treats output bytes as Latin-1. Converting the padded Base64URL string into a &lt;code&gt;Uint8Array&lt;/code&gt; and decoding it with &lt;code&gt;new TextDecoder().decode(bytes)&lt;/code&gt; avoids that corruption.&lt;/p&gt;

&lt;p&gt;One small privacy detail that is easy to overlook: cross-tool links. When a JWT inspector links out to a Unix timestamp converter so you can inspect the &lt;code&gt;exp&lt;/code&gt; claim, never pass the raw JWT in the URL. Extract only the numeric &lt;code&gt;exp&lt;/code&gt; integer (for example, &lt;code&gt;1708355123&lt;/code&gt;) and pass that alone.&lt;/p&gt;




&lt;h2&gt;
  
  
  Enforcing the Rules Automatically With CSP and CI
&lt;/h2&gt;

&lt;p&gt;Privacy rules written only in a README decay as soon as someone adds a library or refactors a layout. Two automated checks keep regressions from shipping:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build-time Content Security Policy.&lt;/strong&gt; Astro hashes every inline script at build time and emits &lt;code&gt;connect-src 'self'&lt;/code&gt;, &lt;code&gt;object-src 'none'&lt;/code&gt;, and &lt;code&gt;form-action 'self'&lt;/code&gt;. Even if a dependency tried to call &lt;code&gt;fetch('https://analytics.example.com')&lt;/code&gt; or &lt;code&gt;navigator.sendBeacon(...)&lt;/code&gt;, the browser blocks the request before a packet leaves the machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A post-build HTML verifier in CI.&lt;/strong&gt; After &lt;code&gt;astro build&lt;/code&gt;, a Node script (&lt;code&gt;scripts/verify-production-build.ts&lt;/code&gt;) walks every generated HTML file in &lt;code&gt;dist/&lt;/code&gt; and fails the build if any page is missing &lt;code&gt;connect-src 'self'&lt;/code&gt;, allows unhashed &lt;code&gt;'unsafe-inline'&lt;/code&gt; scripts, or breaks canonical/footer checks.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Honest Threat Model (And Two Gaps in My Own Code)
&lt;/h2&gt;

&lt;p&gt;Client-side execution gets oversold all the time. Here is what this design prevents and what it does not:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Threat or Risk&lt;/th&gt;
&lt;th&gt;Mitigated Here?&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Server breach, API access logs, or cloud data retention&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No backend exists; payloads stay in browser memory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Third-party ad script reading pasted tokens&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes (on &lt;code&gt;sensitive&lt;/code&gt; pages)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;privacy: 'sensitive'&lt;/code&gt; omits &lt;code&gt;adsbygoogle.js&lt;/code&gt; from the HTML.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accidental outbound &lt;code&gt;fetch&lt;/code&gt;, &lt;code&gt;XHR&lt;/code&gt;, &lt;code&gt;WebSocket&lt;/code&gt;, or &lt;code&gt;sendBeacon&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;connect-src 'self'&lt;/code&gt; blocks cross-origin connections in the browser.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Malicious browser extension with host permissions&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Extensions share DOM access regardless of CSP.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compromised build pipeline, CDN, or local OS malware&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Static JS is still served over HTTPS by the host; client-side code cannot defend against a compromised host or OS.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you open View Source on my live pages right now, you will also spot &lt;strong&gt;two real trade-offs&lt;/strong&gt; I have not cleaned up yet:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Global &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; CSP allowlist.&lt;/strong&gt; Astro's built-in CSP config emits one global &lt;code&gt;&amp;lt;meta http-equiv="content-security-policy"&amp;gt;&lt;/code&gt; tag across all routes. Because the &lt;code&gt;standard&lt;/code&gt; tools are ad-supported, that global &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag still lists &lt;code&gt;pagead2.googlesyndication.com&lt;/code&gt; and &lt;code&gt;googleads.g.doubleclick.net&lt;/code&gt; in &lt;code&gt;script-src&lt;/code&gt;/&lt;code&gt;img-src&lt;/code&gt; even on &lt;code&gt;sensitive&lt;/code&gt; pages where zero ad script tags are rendered. Moving CSP to per-route HTTP headers in &lt;code&gt;vercel.json&lt;/code&gt; is the cleaner long-term fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fail-open RNG fallback.&lt;/strong&gt; In &lt;code&gt;password-generator/engine.ts&lt;/code&gt;, if &lt;code&gt;globalThis.crypto?.getRandomValues&lt;/code&gt; is missing in some exotic runtime, &lt;code&gt;getRandomUint32()&lt;/code&gt; falls back to &lt;code&gt;Math.random()&lt;/code&gt; instead of throwing an error. For a password generator, failing closed with an explicit error is better security hygiene.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Calling those out upfront is better than waiting for someone on Hacker News to find them in 90 seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Audit Any "Client-Side" Web Tool in 30 Seconds
&lt;/h2&gt;

&lt;p&gt;Before you paste a production token or drop a private file into &lt;em&gt;any&lt;/em&gt; online utility, run this quick four-step check in Chrome or Firefox:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;DevTools -&amp;gt; Network&lt;/strong&gt;, clear the log, and check &lt;strong&gt;Preserve log&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Toggle network throttling to &lt;strong&gt;Offline&lt;/strong&gt; (or disconnect Wi-Fi) after the page finishes loading.&lt;/li&gt;
&lt;li&gt;Run the tool with a dummy token, password length, or local file. If it stops working offline or logs failed outbound requests, it is talking to a server.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Application -&amp;gt; Storage&lt;/strong&gt; (Local Storage / Session Storage) and &lt;strong&gt;View Source&lt;/strong&gt; to verify nothing was persisted and inspect the &lt;code&gt;&amp;lt;meta http-equiv="content-security-policy"&amp;gt;&lt;/code&gt; tag (or HTTP response headers).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to test those four steps on live pages built with the patterns above, try them on the &lt;a href="https://omnitools.live/jwt-decoder/" rel="noopener noreferrer"&gt;client-side JWT decoder and Web Crypto verifier&lt;/a&gt;, the &lt;a href="https://omnitools.live/password-generator/" rel="noopener noreferrer"&gt;Web Crypto password generator&lt;/a&gt;, or the &lt;a href="https://omnitools.live/hash-generator/" rel="noopener noreferrer"&gt;browser-local SHA-256 and HMAC file hash generator&lt;/a&gt;. Every one of those three runs in the &lt;code&gt;privacy: 'sensitive'&lt;/code&gt; tier with zero ad scripts and zero network calls after load.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>javascript</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
