<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-11-09T03:16:32+00:00</updated><id>/feed.xml</id><title type="html">waonesec.id</title><subtitle>Personal site of Wawan Hermawan - software developer, open source enthusiast and content creator. Go, Rust, Docker and a lot of late nights.</subtitle><author><name>Wawan Hermawan</name></author><entry><title type="html">Password Strength Is Mostly Length, Not Theatre</title><link href="/posts/password-strength-is-mostly-length-not-theatre/" rel="alternate" type="text/html" title="Password Strength Is Mostly Length, Not Theatre" /><published>2026-09-18T14:07:00+00:00</published><updated>2026-09-18T14:07:00+00:00</updated><id>/posts/password-strength-is-mostly-length-not-theatre</id><content type="html" xml:base="/posts/password-strength-is-mostly-length-not-theatre/"><![CDATA[<h3 id="myth">Myth</h3>

<p>“Add a symbol and a number and you are secure.”</p>

<h3 id="reality">Reality</h3>

<p>Attackers do not grade your password like a corporate policy form. They try <strong>guessable structure</strong> first, then <strong>brute force / cracking</strong> against whatever hash they stole. A short password with theatre (<code class="language-plaintext highlighter-rouge">P@ssw0rd1!</code>) is still a short password.</p>

<hr />

<h3 id="myth-1">Myth</h3>

<p>“Complexity rules beat length.”</p>

<h3 id="reality-1">Reality</h3>

<p>Rough mental model for randomly chosen passwords:</p>

<p>[
\text{entropy bits} \approx \log_2(|charset|) \times length
]</p>

<p>Doubling length helps more than sprinkling punctuation on an 8-character base. An 8-character password from a big alphabet can still be weaker than a 20-character password from a slightly smaller alphabet — especially once humans reuse patterns (<code class="language-plaintext highlighter-rouge">Name</code> + <code class="language-plaintext highlighter-rouge">Year</code> + <code class="language-plaintext highlighter-rouge">!</code>).</p>

<p><strong>Length is not magic if the generator is predictable.</strong> Diceware / crypto RNG ≠ “keyboard smash that looks random.”</p>

<hr />

<h3 id="myth-2">Myth</h3>

<p>“Exclude <code class="language-plaintext highlighter-rouge">0OIl1</code> and you weakened the password.”</p>

<h3 id="reality-2">Reality</h3>

<p>You traded a few bits of pool size for <strong>fewer support tickets and fewer mistypes</strong>. For human-entered secrets (Wi‑Fi on a TV remote, recovery codes read aloud, passwords typed on a phone), ambiguous glyphs are a reliability bug.</p>

<p>If the secret is <strong>copied</strong>, not typed, keep the full alphabet. If it is <strong>typed</strong>, excluding lookalikes is often the adult choice.</p>

<hr />

<h3 id="myth-3">Myth</h3>

<p>“Online generators are fine; HTTPS protects me.”</p>

<h3 id="reality-3">Reality</h3>

<p>HTTPS protects the pipe. It does not answer:</p>

<ul>
  <li>who logs the plaintext</li>
  <li>whether the page was compromised</li>
  <li>whether you will reuse that password elsewhere after it left your machine</li>
</ul>

<p>Prefer <strong>local generation</strong>. The <a href="/tools/password/">Password Generator</a> on this site stays in your tab: crypto RNG, length slider, charset toggles, <code class="language-plaintext highlighter-rouge">exclude 0OIl1</code>, and a strength readout in bits.</p>

<hr />

<h3 id="a-boring-policy-that-works">A boring policy that works</h3>

<ol>
  <li><strong>Unique</strong> password per important account (manager required)</li>
  <li><strong>Long</strong> by default (16–20+ for random character passwords; more words for passphrases)</li>
  <li><strong>Random</strong>, not clever</li>
  <li><strong>Typed secrets</strong>: consider excluding ambiguous characters</li>
  <li><strong>Copied secrets</strong>: maximize charset if you want</li>
  <li>Prefer <strong>passkeys / MFA</strong> so a single password is not the whole kingdom</li>
</ol>

<hr />

<h3 id="one-line-takeaway">One-line takeaway</h3>

<p>Complexity theatre is what policies measure. <strong>Entropy and uniqueness</strong> are what attackers notice.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Crypto" /><summary type="html"><![CDATA[A short myth-busting note on entropy, ambiguous characters, and why "P@ssw0rd!" loses to a longer boring string — plus how to generate one without shipping secrets to a website.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/password-strength-cover.jpg" /><media:content medium="image" url="/images/password-strength-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Secure JWT Best Practices That Actually Hold Up</title><link href="/posts/secure-jwt-best-practices-that-actually-hold-up/" rel="alternate" type="text/html" title="Secure JWT Best Practices That Actually Hold Up" /><published>2026-08-27T15:33:00+00:00</published><updated>2026-08-27T15:33:00+00:00</updated><id>/posts/secure-jwt-best-practices-that-actually-hold-up</id><content type="html" xml:base="/posts/secure-jwt-best-practices-that-actually-hold-up/"><![CDATA[<p>JSON Web Tokens feel simple: three Base64url segments, a signature, done. That simplicity is why teams ship them everywhere — and why the same five mistakes keep showing up in incident reports: <code class="language-plaintext highlighter-rouge">alg: none</code>, oversized lifetimes, secrets in repos, skipped <code class="language-plaintext highlighter-rouge">aud</code>/<code class="language-plaintext highlighter-rouge">iss</code> checks, and “we store the JWT in localStorage so the SPA is easier.”</p>

<p>A secure JWT design is boring on purpose. Ideal means predictable verification, minimal claims, and a clear plan for rotation and revocation.</p>

<h3 id="decide-what-the-token-is-allowed-to-prove">Decide what the token is allowed to prove</h3>

<p>Before algorithms and libraries, write the rule in one sentence: <em>this token proves X for audience Y until time Z.</em></p>

<p>Good fits:</p>

<ul>
  <li>Short-lived access tokens for APIs</li>
  <li>Service-to-service assertions with tight <code class="language-plaintext highlighter-rouge">aud</code></li>
  <li>Session continuation when paired with a server-side session or refresh design</li>
</ul>

<p>Poor fits:</p>

<ul>
  <li>“Forever login” without refresh/rotation</li>
  <li>Stuffing authorization databases into the payload</li>
  <li>Treating an unverified JWT as a trusted user object</li>
</ul>

<p class="tip">If you need to revoke access in seconds, a pure self-contained JWT without a denylist/session store is the wrong primary control. Pair short TTL with a revocation strategy you can operate.</p>

<p><img src="/images/jwt-secure-lifecycle.jpg" alt="Abstract JWT lifecycle with rotating signing key" />
<em>Ideal JWT ops: short-lived access, rotatable keys, verification that rejects surprises</em></p>

<h3 id="algorithm-discipline-non-negotiable">Algorithm discipline (non-negotiable)</h3>

<p>Pick one modern family and reject everything else at verify time.</p>

<table>
  <thead>
    <tr>
      <th>Use case</th>
      <th>Prefer</th>
      <th>Avoid</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Single service / shared secret</td>
      <td><code class="language-plaintext highlighter-rouge">HS256</code>+ with a long random secret</td>
      <td>Hard-coded <code class="language-plaintext highlighter-rouge">"secret"</code>, truncated keys</td>
    </tr>
    <tr>
      <td>Multi-service / key distribution</td>
      <td><code class="language-plaintext highlighter-rouge">RS256</code> / <code class="language-plaintext highlighter-rouge">PS256</code> / <code class="language-plaintext highlighter-rouge">ES256</code> + JWKS</td>
      <td>Shipping private keys to browsers</td>
    </tr>
    <tr>
      <td>Explicitly disabled</td>
      <td>—</td>
      <td><code class="language-plaintext highlighter-rouge">none</code>, algorithm confusion, accepting <code class="language-plaintext highlighter-rouge">alg</code> from attackers</td>
    </tr>
  </tbody>
</table>

<p>Rules that hold up in production:</p>

<ol>
  <li><strong>Pin allowed algorithms</strong> in code — never “whatever the header says”</li>
  <li><strong>Separate verify keys from sign keys</strong> for asymmetric setups</li>
  <li><strong>Reject <code class="language-plaintext highlighter-rouge">alg: none</code></strong> and unexpected <code class="language-plaintext highlighter-rouge">alg</code> values before crypto</li>
  <li>Prefer <strong>asymmetric</strong> when more than one service must verify</li>
</ol>

<blockquote>
  <p>Library defaults are not a threat model. Your allowlist is.</p>
</blockquote>

<h3 id="claims-small-intentional-verified">Claims: small, intentional, verified</h3>

<p>An ideal access-token payload is dull:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"iss"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://auth.example.com/"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"aud"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://api.example.com/"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"sub"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1234567890"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"iat"</span><span class="p">:</span><span class="w"> </span><span class="mi">1792155474</span><span class="p">,</span><span class="w">
  </span><span class="nl">"nbf"</span><span class="p">:</span><span class="w"> </span><span class="mi">1792155474</span><span class="p">,</span><span class="w">
  </span><span class="nl">"exp"</span><span class="p">:</span><span class="w"> </span><span class="mi">1792156374</span><span class="p">,</span><span class="w">
  </span><span class="nl">"jti"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1c2a9f0e6b7d4a11"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Practices that matter:</p>

<ul>
  <li>Always validate <strong><code class="language-plaintext highlighter-rouge">exp</code></strong> (and usually <strong><code class="language-plaintext highlighter-rouge">nbf</code></strong>)</li>
  <li>Validate <strong><code class="language-plaintext highlighter-rouge">iss</code></strong> and <strong><code class="language-plaintext highlighter-rouge">aud</code></strong> against an allowlist — strings must match <em>your</em> expected values</li>
  <li>Use <strong><code class="language-plaintext highlighter-rouge">jti</code></strong> when you need replay tracking or denylist entries</li>
  <li>Keep PII out of the payload when a random <code class="language-plaintext highlighter-rouge">sub</code> will do</li>
  <li>Do not put secrets, passwords, or raw permissions dumps in claims you would regret logging</li>
</ul>

<p class="note">JWTs are signed (or encrypted, if you use JWE). Signed ≠ confidential. Anyone holding the token can read the payload unless you encrypt.</p>

<h3 id="lifetimes-refresh-and-rotation">Lifetimes, refresh, and rotation</h3>

<p>Secure defaults look like this:</p>

<ul>
  <li><strong>Access token</strong>: minutes, not days (often 5–15 minutes for browser apps)</li>
  <li><strong>Refresh token</strong>: longer, <strong>opaque</strong>, server-tracked, rotated on use</li>
  <li><strong>Signing keys</strong>: rotatable via JWKS (<code class="language-plaintext highlighter-rouge">kid</code>), with overlap during rollout</li>
  <li><strong>Clock skew</strong>: small leeway (seconds), not “ignore exp in staging forever”</li>
</ul>

<p class="important">If refresh tokens live in a SPA, treat theft as account takeover: bind them, rotate them, detect reuse, and revoke families on anomaly.</p>

<h3 id="storage-and-transport">Storage and transport</h3>

<ul>
  <li>Send tokens only over <strong>HTTPS</strong></li>
  <li>Prefer <strong>HttpOnly + Secure + SameSite</strong> cookies for browser session tokens when XSS is in your threat model</li>
  <li>If you must use headers (<code class="language-plaintext highlighter-rouge">Authorization: Bearer</code>), assume any XSS can exfiltrate them</li>
  <li>Never put long-lived JWTs in <code class="language-plaintext highlighter-rouge">localStorage</code> “for convenience”</li>
  <li>Do not log full tokens in app or proxy logs</li>
</ul>

<h3 id="verification-checklist-ideal-path">Verification checklist (ideal path)</h3>

<p>On every request that trusts a JWT:</p>

<ol>
  <li>Parse compact serialization; require three segments (for JWS)</li>
  <li>Read <code class="language-plaintext highlighter-rouge">kid</code> / header metadata <strong>without</strong> trusting <code class="language-plaintext highlighter-rouge">alg</code> blindly</li>
  <li>Fetch/select key from your allowlist or JWKS</li>
  <li>Verify signature with pinned algorithm</li>
  <li>Validate <code class="language-plaintext highlighter-rouge">iss</code>, <code class="language-plaintext highlighter-rouge">aud</code>, <code class="language-plaintext highlighter-rouge">exp</code>, <code class="language-plaintext highlighter-rouge">nbf</code></li>
  <li>Apply authorization using server-side roles/policies — claims are hints, not a substitute for policy engines when stakes are high</li>
</ol>

<h3 id="debug-and-review-with-jwt-debugger">Debug and review with JWT Debugger</h3>

<p>Before you argue about a token in Slack, decode it, verify the signature path, and run a security review for weak algs, bad lifetimes, and claim gaps. Use <a href="/tools/jwt/">JWT Debugger</a> on this site — encode/decode, HS/RS/PS/ES/EdDSA options, claims view, and misconfig Issue/Fix notes — to inspect <code class="language-plaintext highlighter-rouge">alg</code>, claims, and signature posture before the token hits production traffic.</p>

<p class="tip">Paste a staging token into the debugger and ask: would I accept this <code class="language-plaintext highlighter-rouge">exp</code>, this <code class="language-plaintext highlighter-rouge">aud</code>, and this algorithm in production tonight?</p>

<h3 id="a-minimal-ideal-profile">A minimal “ideal” profile</h3>

<p>If you need a one-screen target state:</p>

<ul>
  <li>Asymmetric signing for multi-service verify (<strong>RS256</strong> or <strong>ES256</strong>)</li>
  <li>JWKS published for verifiers; private key only on the issuer</li>
  <li>Access JWT ≤ 15 minutes; opaque refresh with rotation</li>
  <li>Mandatory <code class="language-plaintext highlighter-rouge">iss</code> + <code class="language-plaintext highlighter-rouge">aud</code> + <code class="language-plaintext highlighter-rouge">exp</code> checks</li>
  <li>Algorithm allowlist enforced in one shared verify helper</li>
  <li>No <code class="language-plaintext highlighter-rouge">none</code>, no shared “dev secret” in prod, no forever tokens</li>
</ul>

<hr />

<p>JWTs fail closed when teams treat them as magic auth. They hold up when teams treat them as <strong>signed bearer credentials with a short fuse</strong> — verified every time, rotated often, and never trusted by shape alone.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Crypto" /><category term="Web" /><summary type="html"><![CDATA[JWTs are compact and easy to misuse. A secure setup is less about clever claims and more about algorithm discipline, short lifetimes, honest audience checks, and treating the token like a bearer credential — because that is what it is.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/jwt-secure-cover.jpg" /><media:content medium="image" url="/images/jwt-secure-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The Link Looked Legit — Until We Unzipped the URL</title><link href="/posts/the-link-looked-legit-until-we-unzipped-the-url/" rel="alternate" type="text/html" title="The Link Looked Legit — Until We Unzipped the URL" /><published>2026-08-12T09:55:00+00:00</published><updated>2026-08-12T09:55:00+00:00</updated><id>/posts/the-link-looked-legit-until-we-unzipped-the-url</id><content type="html" xml:base="/posts/the-link-looked-legit-until-we-unzipped-the-url/"><![CDATA[<p><strong>Case file · WS-URL-0417</strong><br />
<strong>Subject:</strong> “Password reset” SMS → branded login host → unfamiliar landing<br />
<strong>Question we kept asking:</strong> <em>why does a trusted hostname hand the browser to somewhere else?</em></p>

<p>This is not a vendor roundup. It is the walk-through we wish more on-call notes looked like.</p>

<hr />

<h3 id="0914--the-bait-arrives-looking-finished">09:14 — The bait arrives looking finished</h3>

<p>The message was tidy. Logo-ish wording. A single link. Hostname on first glance belonged to “us” — or close enough that a tired thumb would not argue.</p>

<p>Nobody pasted it into a browser first. Good. Someone pasted it into a notepad and stared at the query string until the <code class="language-plaintext highlighter-rouge">%</code> characters started to feel personal.</p>

<p>That is the whole job, sometimes: <strong>refuse the courtesy click</strong>.</p>

<h3 id="0919--the-hostname-was-a-costume-the-parameter-was-the-plot">09:19 — The hostname was a costume; the parameter was the plot</h3>

<p>Stripped of tracking junk, the interesting part looked like this shape:</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>https://login.example.com/oauth/callback
  ?next=https%253A%252F%252Fevil.test%252Fphish
  &amp;return_to=%2Fhome
  #continue=https%3A%2F%2Fphish.test%2F
</code></pre></div></div>

<p>Read it out loud once:</p>

<ol>
  <li>User lands on a <strong>familiar login host</strong></li>
  <li>App reads <code class="language-plaintext highlighter-rouge">next</code> / <code class="language-plaintext highlighter-rouge">continue</code> / <code class="language-plaintext highlighter-rouge">return_to</code> as “where to send them after”</li>
  <li>Value is not a path — it is another origin, sometimes <strong>double-encoded</strong> so casual eyes see soup</li>
  <li>Fragment (<code class="language-plaintext highlighter-rouge">#…</code>) carries a second redirect-shaped gift for client-side routers</li>
</ol>

<p>If your callback trusts that blindly, you did not build OAuth. You built a <strong>branded trampoline</strong>.</p>

<h3 id="0927--what-open-redirect-means-when-humans-are-in-the-loop">09:27 — What “open redirect” means when humans are in the loop</h3>

<p>Engineers argue about whether an open redirect is “critical.” Phishing crews do not. They care that:</p>

<ul>
  <li>the <strong>first</strong> hostname survives corporate URL filters and user intuition</li>
  <li>the <strong>second</strong> hostname collects the password, token, or consent click</li>
  <li>screenshots of the address bar still show something the victim recognizes for half a second too long</li>
</ul>

<p>Severity is not only CVSS. Severity is <em>how much trust you borrowed from your own domain</em>.</p>

<h3 id="0941--unzipping-beats-debating">09:41 — Unzipping beats debating</h3>

<p>We ran the same string through the <a href="/tools/url-inspect/">URL / Redirect Inspector</a> — not because a tool replaces thinking, but because nested percent-encoding is rude at 9 a.m. Demo shape: nested <code class="language-plaintext highlighter-rouge">next=</code>, fragment <code class="language-plaintext highlighter-rouge">continue=</code>, Risk <strong>F</strong> as local heuristic — live hops may say unreachable; the URL is still the story.</p>

<p>Two things mattered in the output:</p>

<ul>
  <li><strong>Risk stayed honest about being heuristic</strong> when the demo host could not be followed live. Unreachable ≠ “safe.” It means “we only have the URL itself.”</li>
  <li><strong>Nested decode</strong> surfaced <code class="language-plaintext highlighter-rouge">https://evil.test/...</code> after more than one pass. That is the part people miss when they only glance at the raw query.</li>
</ul>

<p>If your mental model is “either the site is up and evil, or the link is fine,” you will miss the entire class.</p>

<h3 id="1005--the-boring-fixes-that-end-the-case">10:05 — The boring fixes that end the case</h3>

<p>We did not write a novel. We wrote acceptance rules:</p>

<p><strong>For redirect parameters (<code class="language-plaintext highlighter-rouge">next</code>, <code class="language-plaintext highlighter-rouge">return_to</code>, <code class="language-plaintext highlighter-rouge">continue</code>, <code class="language-plaintext highlighter-rouge">redirect_uri</code>, …)</strong></p>

<ul>
  <li>allow <strong>relative paths</strong> on your origin, or an <strong>explicit allowlist</strong> of absolute URLs</li>
  <li>reject <code class="language-plaintext highlighter-rouge">//evil</code>, <code class="language-plaintext highlighter-rouge">\\evil</code>, <code class="language-plaintext highlighter-rouge">javascript:</code>, <code class="language-plaintext highlighter-rouge">data:</code>, and userinfo tricks (<code class="language-plaintext highlighter-rouge">user@host</code>)</li>
  <li>decode <strong>iteratively</strong> in tests; attackers will encode twice on purpose</li>
  <li>treat fragments as hostile input if your frontend reads them for navigation</li>
</ul>

<p><strong>For humans triaging links</strong></p>

<ul>
  <li>decode before you click</li>
  <li>ask “who controls the <em>final</em> origin?” not “who owns the first label?”</li>
  <li>if marketing needs tracked redirects, give them a <strong>signed, server-side</strong> hop — not an open query param</li>
</ul>

<h3 id="1018--closing-the-file">10:18 — Closing the file</h3>

<p>The breach fantasy is a zero-day. The weekday reality is a parameter named <code class="language-plaintext highlighter-rouge">next</code> and a user who trusts your hostname more than your engineering review did.</p>

<p>Open redirects are not glamorous. They are how glamour gets laundered.</p>

<hr />

<p><em>If you only remember one habit: when a URL looks like your house, check whether the query string is holding someone else’s keys.</em><br />
Try the same habit on a real string with <a href="/tools/url-inspect/">URL / Redirect Inspector</a> — local signals first, live chain when the host actually answers.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Web" /><category term="Redteam" /><summary type="html"><![CDATA[A short case file from a "trusted login" link that was doing something uglier in the query string. Less checklist, more what you actually notice when you slow down and decode.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/open-redirect-cover.jpg" /><media:content medium="image" url="/images/open-redirect-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">It’s Encrypted (Base64) — Inbox Edition</title><link href="/posts/encoding-is-not-encryption-inbox-edition/" rel="alternate" type="text/html" title="It’s Encrypted (Base64) — Inbox Edition" /><published>2026-07-29T11:18:00+00:00</published><updated>2026-07-29T11:18:00+00:00</updated><id>/posts/encoding-is-not-encryption-inbox-edition</id><content type="html" xml:base="/posts/encoding-is-not-encryption-inbox-edition/"><![CDATA[<p><strong>Inbox · triage queue</strong><br />
From: hopeful-researcher@…<br />
Subject: Critical — admin password encrypted in localStorage</p>

<blockquote>
  <p>Hi, I found <code class="language-plaintext highlighter-rouge">cGFzc3dvcmQ9aHVudGVyMiZyb2xlPWFkbWlu</code> in localStorage.<br />
It is Base64 encrypted. Please award Critical.</p>
</blockquote>

<hr />

<h3 id="reply-we-actually-send-short-version">Reply we actually send (short version)</h3>

<p>Thanks for the report. <strong>Base64 is encoding, not encryption.</strong> Anyone can decode it in one step; there is no key. We will treat this as <strong>sensitive data stored client-side in recoverable form</strong> if the decoded content is real — that can still be a finding, but the severity comes from <em>what was stored</em>, not from “breaking Base64.”</p>

<hr />

<h3 id="sticky-note-on-the-monitor">Sticky note on the monitor</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>encoding  →  change of representation (reversible, no secret)
encryption → confidentiality under a key (hard without the key)
hashing   → one-way fingerprint (not reversible by design)
</code></pre></div></div>

<p>If your grandmother can reverse it with a website from 2009, it was not encryption.</p>

<hr />

<h3 id="common-encrypted-sightings-in-bounty-threads">Common “encrypted” sightings in bounty threads</h3>

<p><strong>1. <code class="language-plaintext highlighter-rouge">eyJ…</code> blobs</strong><br />
Often a JWT. Signed ≠ encrypted. The middle segment is readable Base64url JSON.</p>

<p><strong>2. URL-encoded JSON</strong><br />
<code class="language-plaintext highlighter-rouge">%7B%22role%22%3A%22admin%22%7D</code> is not vault material. Decode the URL encoding and you are done.</p>

<p><strong>3. Hex dumps of ASCII</strong><br />
<code class="language-plaintext highlighter-rouge">70617373776f7264</code> → <code class="language-plaintext highlighter-rouge">password</code>. Still not crypto.</p>

<p><strong>4. Double-wrapped candy</strong><br />
URL-encode(Base64(plain)). Looks scary; two peels and it cries.</p>

<p><strong>5. Actual encryption</strong><br />
AES/GCM blobs, proper envelopes, key IDs, nonces. Different conversation. Ask for ciphertext structure, not vibes.</p>

<hr />

<h3 id="how-we-peel-without-theatre">How we peel without theatre</h3>

<p>Use a local chain so you do not paste secrets into random “decoder” sites. <a href="/tools/codec-chain/">Codec Chain</a> stacks URL / HTML / Base64 / Base64URL / hex (and friends) in your browser — default layer is Base64 decode because that is the usual first move. Peel encodings locally; do not confuse the output with “decrypted.”</p>

<p>Triage habit:</p>

<ol>
  <li>Identify wrappers (Base64 charset? <code class="language-plaintext highlighter-rouge">%xx</code>? <code class="language-plaintext highlighter-rouge">\u00xx</code>?)</li>
  <li>Peel <strong>one layer at a time</strong></li>
  <li>Stop when you hit JSON, credentials, or binary noise that needs a real crypto story</li>
  <li>Write the finding about <strong>impact</strong> (“credential in localStorage”) not the costume (“Base64”)</li>
</ol>

<hr />

<h3 id="when-encoding-does-matter-in-a-report">When encoding <em>does</em> matter in a report</h3>

<p>Encoding bugs are still real — just different:</p>

<ul>
  <li>double-encoding bypasses in WAFs / open redirects</li>
  <li>charset confusion in parsers</li>
  <li>“encrypt” buttons in apps that only Base64 before upload (privacy bug, marketing lie)</li>
</ul>

<p>Call those out clearly. Just do not file them as “cryptographic break.”</p>

<hr />

<h3 id="closing-the-ticket">Closing the ticket</h3>

<table>
  <thead>
    <tr>
      <th>Researcher said</th>
      <th>We translate to</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Base64 encrypted password</td>
      <td>Recoverable secret at rest in the client</td>
    </tr>
    <tr>
      <td>Hidden admin JWT</td>
      <td>Readable claims; check signature &amp; authz separately</td>
    </tr>
    <tr>
      <td>Obfuscated script</td>
      <td>Encoding/minification; not a cipher</td>
    </tr>
  </tbody>
</table>

<p>Be kind. Many researchers are learning. Precision helps them level up — and keeps your program’s severity model intact.</p>

<hr />

<p><em>Encoding hides nothing from an attacker who can read. Encryption hides something from an attacker who cannot get the key. Keep the words honest.</em></p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Web" /><category term="Encoding" /><summary type="html"><![CDATA[A bug-bounty triage inbox full of findings that confuse encoding with cryptography. How to answer them without being rude — and how to peel layers when the payload is actually interesting.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/encoding-not-encryption-cover.jpg" /><media:content medium="image" url="/images/encoding-not-encryption-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ship It Only After the Checksum Agrees</title><link href="/posts/ship-it-only-after-the-checksum-agrees/" rel="alternate" type="text/html" title="Ship It Only After the Checksum Agrees" /><published>2026-07-14T16:41:00+00:00</published><updated>2026-07-14T16:41:00+00:00</updated><id>/posts/ship-it-only-after-the-checksum-agrees</id><content type="html" xml:base="/posts/ship-it-only-after-the-checksum-agrees/"><![CDATA[<h2 id="procedure--rel-hash-01">Procedure · REL-HASH-01</h2>
<p><strong>Owner:</strong> whoever pressed “publish”<br />
<strong>Goal:</strong> prove the bytes you ship are the bytes you built</p>

<p>Skip the essay. Follow the steps. Annotate exceptions in the PR.</p>

<hr />

<h3 id="step-0--name-the-threat">Step 0 — Name the threat</h3>

<p>Ask only one question:</p>

<blockquote>
  <p>Am I detecting <strong>accidental corruption</strong>, or also <strong>someone swapping the artifact</strong>?</p>
</blockquote>

<table>
  <thead>
    <tr>
      <th>Threat</th>
      <th>Tool</th>
      <th>Why</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Bit rot, bad mirror, partial download</td>
      <td><strong>Digest</strong> (SHA-256+)</td>
      <td>Same input → same hex; no secret required</td>
    </tr>
    <tr>
      <td>Attacker who can replace file <strong>and</strong> the published checksum on the same site</td>
      <td>Digest alone is weak</td>
      <td>They rewrite both</td>
    </tr>
    <tr>
      <td>Attacker who can replace the file but <strong>not</strong> your signing/HMAC channel</td>
      <td><strong>HMAC</strong> or <strong>signature</strong></td>
      <td>Needs the key / pubkey</td>
    </tr>
  </tbody>
</table>

<p>If the checksum lives next to the malware on the same compromised bucket, you verified nothing but consistency of the lie.</p>

<hr />

<h3 id="step-1--produce-the-digest-at-build-time">Step 1 — Produce the digest at build time</h3>

<p>On the builder (not on a laptop “later”):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sha256sum </span>dist/app-1.4.2.tar.gz | <span class="nb">tee </span>dist/app-1.4.2.tar.gz.sha256
</code></pre></div></div>

<p>Record algorithm + filename + hex in release notes. Prefer <strong>SHA-256</strong> as the default public checksum. Keep SHA-1 for legacy verify only; do not mint new trust on it.</p>

<hr />

<h3 id="step-2--verify-on-the-consumer-side">Step 2 — Verify on the consumer side</h3>

<p>Download artifact + published digest. Compare with a tool that does not “almost match.”</p>

<p>Local option: <a href="/tools/hash/">Hash / Checksum Lab</a> — drop the file or paste text, pick SHA-256, paste expected hex into compare. Timing-safe match/mismatch beats eyeballing the first eight characters.</p>

<hr />

<h3 id="step-3--when-to-switch-to-hmac">Step 3 — When to switch to HMAC</h3>

<p>Use <strong>HMAC-SHA-256</strong> (or stronger) when:</p>

<ul>
  <li>two services share a <strong>secret</strong> and need integrity + authenticity of a payload</li>
  <li>you are protecting API webhooks, signed cookies-of-sorts, or internal manifests</li>
  <li>the verifier must reject bytes altered by anyone without the key</li>
</ul>

<p>Do <strong>not</strong> use HMAC as a public download checksum — readers cannot verify without the secret, and publishing the secret destroys the point.</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Digest  = public fingerprint of bytes
HMAC    = fingerprint bound to a key
Sign    = fingerprint bound to an asymmetric identity (often better for releases)
</code></pre></div></div>

<p>For public software releases, prefer <strong>minisign / Sigstore / GPG</strong> over “HMAC in a README.”</p>

<hr />

<h3 id="step-4--gate-the-release">Step 4 — Gate the release</h3>

<p>Checklist before announcing:</p>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Digest generated on CI from the exact artifact path</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Algorithm named (<code class="language-plaintext highlighter-rouge">SHA-256</code>), not implied</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Verify step reproduced on a clean machine</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Compare is exact match (tool or <code class="language-plaintext highlighter-rouge">sha256sum -c</code>)</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />If high assurance: signature published; digest is secondary</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Secrets for HMAC never landed in the public notes</li>
</ul>

<hr />

<h3 id="failure-modes-worth-a-sticky-note">Failure modes worth a sticky note</h3>

<ul>
  <li>Trailing newline differences → different hash (hash the file, not a retyped string)</li>
  <li>“SHA-256 of the ZIP” vs “of the inner binary” — label which</li>
  <li>Uppercase/lowercase hex — normalize before compare</li>
  <li>Trusting HTTPS hosting alone — TLS delivers whatever the bucket currently contains</li>
</ul>

<hr />

<h3 id="sign-off-line">Sign-off line</h3>

<p><em>Integrity is a procedure, not a feeling.</em> If the checksum disagrees, you do not “mostly ship.” You stop.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Crypto" /><category term="DevOps" /><summary type="html"><![CDATA[A release-desk procedure for digests vs HMAC — when SHA-256 is enough, when you need a key, and how to verify a build without trusting the download page's vibes.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/hash-integrity-cover.jpg" /><media:content medium="image" url="/images/hash-integrity-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How Dangerous SSL/TLS Vulnerabilities Really Are</title><link href="/posts/how-dangerous-ssl-tls-vulnerabilities-really-are/" rel="alternate" type="text/html" title="How Dangerous SSL/TLS Vulnerabilities Really Are" /><published>2026-06-28T10:22:00+00:00</published><updated>2026-06-28T10:22:00+00:00</updated><id>/posts/how-dangerous-ssl-tls-vulnerabilities-really-are</id><content type="html" xml:base="/posts/how-dangerous-ssl-tls-vulnerabilities-really-are/"><![CDATA[<p>HTTPS is the default now. That is good. It is also why teams stop looking. Once the padlock appears, the ticket moves to Done — even when the stack behind it still speaks TLS 1.0, trusts a leftover intermediate, or serves a cipher suite last fashionable in 2014.</p>

<p>SSL/TLS vulnerabilities are dangerous for a boring reason: they sit on the path every user already trusts. Steal that path and you do not need malware on the laptop. You only need a weak handshake.</p>

<h3 id="the-padlock-lies-by-omission">The padlock lies by omission</h3>

<p>Browsers show “secure” when the <em>current</em> connection meets a minimum bar. They do not promise your CDN edge, your legacy API, or your mail submission port are equally healthy. Attackers hunt the weak hop: the forgotten subdomain, the staging host with a real cert, the load balancer still offering <code class="language-plaintext highlighter-rouge">TLS_RSA_WITH_AES_128_CBC_SHA</code>.</p>

<p class="tip">Treat the padlock as “this tab used encryption,” not “this product is safe.” Encryption without integrity, freshness, and a sane certificate story is just private confusion.</p>

<p>Classic failure modes still show up in real estates:</p>

<ul>
  <li>Protocols that should be dead (<code class="language-plaintext highlighter-rouge">SSLv3</code>, <code class="language-plaintext highlighter-rouge">TLS 1.0</code> / <code class="language-plaintext highlighter-rouge">1.1</code>) left enabled “for compatibility”</li>
  <li>Cipher suites that enable downgrade, oracle, or export-grade nonsense</li>
  <li>Certificates that are expired, mismatched, or chained through distrustful intermediates</li>
  <li>Missing or broken HTTP→HTTPS redirects (users arrive on cleartext first)</li>
  <li>HSTS never deployed, so the first visit is always a gamble</li>
</ul>

<blockquote>
  <p>Confidentiality is worthless if an attacker can force the client onto a weaker dialect — or onto no TLS at all.</p>
</blockquote>

<h3 id="what-broken-tls-actually-buys-an-attacker">What “broken TLS” actually buys an attacker</h3>

<p>Not every CVE equals remote code execution. Many TLS bugs are quieter and, for criminals, more useful: they turn trusted channels into observation decks.</p>

<p><img src="/images/ssl-vuln-mitm.jpg" alt="Abstract view of encrypted traffic with a cracked certificate seal between client and server" />
<em>When the handshake is weak, the padlock still shows — the attacker just sits inside the tunnel story</em></p>

<p>Rough mapping from weakness to impact:</p>

<table>
  <thead>
    <tr>
      <th>Weakness</th>
      <th>Typical impact</th>
      <th>Why it hurts</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Protocol downgrade / old TLS</td>
      <td>Passive decrypt or active MITM on legacy clients</td>
      <td>Old phones, scanners, and embedded gear stay online for years</td>
    </tr>
    <tr>
      <td>Weak or null ciphers</td>
      <td>Trivial decryption</td>
      <td>“Compatible” defaults that never got cleaned up</td>
    </tr>
    <tr>
      <td>Certificate validation gaps</td>
      <td>Phishing that looks identical to the real site</td>
      <td>Users are trained to trust the lock, not the hostname</td>
    </tr>
    <tr>
      <td>Heartbleed-class memory leaks</td>
      <td>Credential and key theft from process memory</td>
      <td>One bug, many secrets, long reissue cycles</td>
    </tr>
    <tr>
      <td>Missing redirect / HSTS</td>
      <td>SSL stripping on first visit</td>
      <td>Coffee-shop Wi‑Fi still exists</td>
    </tr>
    <tr>
      <td>Poor private-key hygiene</td>
      <td>Silent impersonation until you rotate</td>
      <td>Compromised keys outlive the sprint that created them</td>
    </tr>
  </tbody>
</table>

<p class="important">If private keys leaked — or you cannot prove they did not — rotate. Waiting for “confirmed exploitation” is how incident timelines get footnotes.</p>

<h3 id="historys-greatest-hits-still-teach-the-same-lesson">History’s greatest hits still teach the same lesson</h3>

<p>You do not need to memorize every CVE number. You need the pattern:</p>

<ol>
  <li><strong>Vendors ship convenience</strong> — old protocols stay on so nothing breaks.</li>
  <li><strong>Researchers publish a clever attack</strong> — BEAST, CRIME, POODLE, Heartbleed, ROBOT, and friends.</li>
  <li><strong>Ops disable the worst options</strong> — usually after a compliance scan turns red.</li>
  <li><strong>Something legacy is exempted</strong> — “just that one payment partner.”</li>
  <li><strong>The exemption becomes permanent</strong> — until it becomes an incident.</li>
</ol>

<p>Heartbleed was not dangerous because it was clever. It was dangerous because TLS terminates everywhere: APIs, VPNs, mail, databases wrapped in stunnel, “temporary” jump hosts. One class of bug, a planet of secrets.</p>

<p>POODLE and friends were not dangerous because CBC is haunted. They were dangerous because enterprises kept SSLv3 alive for a single ancient client and accidentally kept a downgrade ladder for everyone else.</p>

<h3 id="where-teams-get-hurt-in-2026">Where teams get hurt in 2026</h3>

<p>The new shape of the problem is less “enable TLS” and more “prove the whole edge is boringly correct”:</p>

<ul>
  <li><strong>Multi-CDN / multi-IP</strong>: one anycast POP still offers TLS 1.0 while the others look perfect in your laptop test</li>
  <li><strong>mTLS half-configured</strong>: clients skip verification in staging, then the same build ships</li>
  <li><strong>Certificate automation that fails quietly</strong>: renewals error into Slack nobody reads</li>
  <li><strong>Internal services with public exposure</strong>: “it’s only on the VPC” until a path appears</li>
  <li><strong>Mobile and IoT clients</strong>: custom TLS stacks that ignore modern defaults</li>
</ul>

<p class="note">A green result from one scanner against one IP is a screenshot, not a posture. Check every name in the certificate SAN, every address the DNS answers with, and every port that answers <code class="language-plaintext highlighter-rouge">ClientHello</code>.</p>

<h3 id="catch-the-broken-padlock-with-ssltls-checker">Catch the broken padlock with SSL/TLS Checker</h3>

<p>You do not need to guess from the browser chrome. The <a href="/tools/ssl/">SSL/TLS Checker</a> on this site runs a full edge scan — certificate lifetime, chain trust, protocols, ciphers, HSTS, and grade caps — so “secure” stops being a vibe and becomes a report.</p>

<p>Demo against a known-bad lab host (<code class="language-plaintext highlighter-rouge">expired.badssl.com</code>): the padlock story collapses into <strong>Grade F</strong> the moment expiry, deprecated TLS, and weak ciphers show up together. Try it in <a href="/tools/ssl/">SSL/TLS Checker</a>.</p>

<p class="tip">Open <a href="/tools/ssl/">SSL/TLS Checker</a>, paste your production hostname, hit <strong>check</strong>. If the grade is soft-capped by expiry, old protocols, or weak ciphers, fix the terminator before you argue about application CVEs.</p>

<h3 id="a-practical-check-you-can-run-this-week">A practical check you can run this week</h3>

<p>Pair the browser tool with local confirmation when you own the host. Inventory first; reject the indefensible second.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># What does the edge actually speak?</span>
nmap <span class="nt">--script</span> ssl-enum-ciphers <span class="nt">-p</span> 443 example.com

<span class="c"># Certificate dates, SAN, and chain (openssl)</span>
<span class="nb">echo</span> | openssl s_client <span class="nt">-connect</span> example.com:443 <span class="nt">-servername</span> example.com 2&gt;/dev/null <span class="se">\</span>
  | openssl x509 <span class="nt">-noout</span> <span class="nt">-dates</span> <span class="nt">-subject</span> <span class="nt">-ext</span> subjectAltName

<span class="c"># Or re-run the same name in /tools/ssl/ after every CDN / LB change — configs drift.</span>
</code></pre></div></div>

<p>Then enforce policy where you control the terminator:</p>

<ul>
  <li>Disable TLS below 1.2 (prefer 1.3 where clients allow)</li>
  <li>Prefer AEAD suites; remove RSA key-exchange leftovers when you can</li>
  <li>Turn on HSTS with a sane <code class="language-plaintext highlighter-rouge">max-age</code> once HTTPS is universal on that host</li>
  <li>Monitor expiry; page a human before users do</li>
  <li>Store private keys like production secrets — because they are</li>
</ul>

<p class="tip">Wire certificate expiry and unexpected protocol support into the same alerting channel you use for disk full. TLS failures are outages with better press coverage.</p>

<h3 id="danger-is-proportional-to-trust">Danger is proportional to trust</h3>

<p>SSL/TLS vulnerabilities feel abstract until you remember what rides on them: session cookies, password resets, payment forms, admin panels, machine-to-machine tokens. Break the channel and you inherit the trust users already gave the hostname.</p>

<p>The fix is not panic. It is hygiene: modern protocols, short-lived certificates, no nostalgic ciphers, redirects that do not blink, and continuous checks against the real edge — not the lab VIP you tested once in January.</p>

<hr />

<p>A padlock is a UI hint. A healthy TLS posture is operational work. Do the work before someone else schedules it for you.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Network" /><category term="DevOps" /><summary type="html"><![CDATA[A padlock in the browser is not a security strategy. Weak protocols, broken ciphers, and neglected certificates still turn "encrypted" traffic into something an attacker can watch, replay, or quietly rewrite.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/ssl-vuln-cover.jpg" /><media:content medium="image" url="/images/ssl-vuln-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Why Security Headers Matter More Than You Think</title><link href="/posts/why-security-headers-matter-more-than-you-think/" rel="alternate" type="text/html" title="Why Security Headers Matter More Than You Think" /><published>2026-06-09T13:07:00+00:00</published><updated>2026-06-09T13:07:00+00:00</updated><id>/posts/why-security-headers-matter-more-than-you-think</id><content type="html" xml:base="/posts/why-security-headers-matter-more-than-you-think/"><![CDATA[<p>A green padlock answers one question: did this response travel encrypted? It does not answer whether the page can be framed by an attacker, whether scripts may load from anywhere, or whether cookies will ride along on every cross-site request.</p>

<p>That second layer is <strong>HTTP security headers</strong>. They are cheap to ship, easy to ignore, and expensive when missing during an incident review.</p>

<h3 id="encryption-is-not-a-browser-policy">Encryption is not a browser policy</h3>

<p>TLS protects data <em>in transit</em>. Security headers protect assumptions <em>in the client</em>:</p>

<ul>
  <li>Who may embed this page (<code class="language-plaintext highlighter-rouge">X-Frame-Options</code> / <code class="language-plaintext highlighter-rouge">frame-ancestors</code>)</li>
  <li>Which scripts, styles, and connections are allowed (<code class="language-plaintext highlighter-rouge">Content-Security-Policy</code>)</li>
  <li>Whether the browser should ever speak cleartext again (<code class="language-plaintext highlighter-rouge">Strict-Transport-Security</code>)</li>
  <li>How much referrer data leaks to third parties (<code class="language-plaintext highlighter-rouge">Referrer-Policy</code>)</li>
  <li>Whether the browser may invent powerful features (<code class="language-plaintext highlighter-rouge">Permissions-Policy</code>)</li>
</ul>

<p class="tip">If your threat model includes XSS, clickjacking, session fixation, or “users on hostile Wi‑Fi,” headers are not polish. They are controls.</p>

<p><img src="/images/security-headers-layers.jpg" alt="Abstract browser shield built from layered security headers" />
<em>Headers are policy for the browser — encryption alone does not decide what the page may do</em></p>

<h3 id="what-goes-wrong-without-them">What goes wrong without them</h3>

<p>Missing or weak headers do not always look like a CVE with a logo. They look like ordinary bugs getting louder:</p>

<table>
  <thead>
    <tr>
      <th>Gap</th>
      <th>What attackers gain</th>
      <th>Typical symptom</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>No CSP (or <code class="language-plaintext highlighter-rouge">unsafe-inline</code> everywhere)</td>
      <td>XSS becomes full account takeover faster</td>
      <td>Inline script gadgets, stolen tokens</td>
    </tr>
    <tr>
      <td>No framing defense</td>
      <td>Clickjacking / UI redress</td>
      <td>Invisible iframe over a “Confirm” button</td>
    </tr>
    <tr>
      <td>No HSTS</td>
      <td>SSL stripping on first visit</td>
      <td>Users land on <code class="language-plaintext highlighter-rouge">http://</code> after a bookmark or ad</td>
    </tr>
    <tr>
      <td>Soft cookie flags</td>
      <td>Session theft via XSS or mixed contexts</td>
      <td>Cookies without <code class="language-plaintext highlighter-rouge">Secure</code> / <code class="language-plaintext highlighter-rouge">HttpOnly</code> / <code class="language-plaintext highlighter-rouge">SameSite</code></td>
    </tr>
    <tr>
      <td>Verbose server banners</td>
      <td>Faster fingerprinting</td>
      <td><code class="language-plaintext highlighter-rouge">Server</code> + framework versions in every response</td>
    </tr>
    <tr>
      <td>Open CORS</td>
      <td>Data exfil from authenticated browsers</td>
      <td><code class="language-plaintext highlighter-rouge">Access-Control-Allow-Origin: *</code> with credentials mistakes</td>
    </tr>
  </tbody>
</table>

<blockquote>
  <p>A header will not fix bad authorization. It will raise the cost of turning a small front-end bug into a full incident.</p>
</blockquote>

<h3 id="the-headers-that-earn-their-keep">The headers that earn their keep</h3>

<p>You do not need twenty exotic fields on day one. You need a short, enforced baseline:</p>

<ol>
  <li><strong><code class="language-plaintext highlighter-rouge">Strict-Transport-Security</code></strong> — once HTTPS is solid, lock the host (and usually <code class="language-plaintext highlighter-rouge">includeSubDomains</code>) with a sane <code class="language-plaintext highlighter-rouge">max-age</code></li>
  <li><strong><code class="language-plaintext highlighter-rouge">Content-Security-Policy</code></strong> — start report-only if you must, then enforce; prefer nonces/hashes over blanket <code class="language-plaintext highlighter-rouge">unsafe-inline</code></li>
  <li><strong><code class="language-plaintext highlighter-rouge">X-Content-Type-Options: nosniff</code></strong> — stop MIME confusion tricks</li>
  <li><strong><code class="language-plaintext highlighter-rouge">Referrer-Policy</code></strong> — default to something tighter than the historical free-for-all</li>
  <li><strong><code class="language-plaintext highlighter-rouge">Permissions-Policy</code></strong> — disable camera, mic, geolocation, payment APIs you do not use</li>
  <li><strong>Framing control</strong> — <code class="language-plaintext highlighter-rouge">Content-Security-Policy: frame-ancestors 'none'</code> (or a tight allowlist) instead of hoping nobody embeds you</li>
  <li><strong>Cookie hygiene</strong> — <code class="language-plaintext highlighter-rouge">Secure</code>, <code class="language-plaintext highlighter-rouge">HttpOnly</code>, and a deliberate <code class="language-plaintext highlighter-rouge">SameSite</code> for session cookies</li>
</ol>

<p class="note">Legacy <code class="language-plaintext highlighter-rouge">X-Frame-Options</code> still helps older clients. Modern policy belongs in CSP <code class="language-plaintext highlighter-rouge">frame-ancestors</code>. Shipping both during migration is fine.</p>

<h3 id="misconfiguration-is-as-bad-as-absence">Misconfiguration is as bad as absence</h3>

<p>A header that is present but wrong creates false confidence:</p>

<ul>
  <li>HSTS with a tiny <code class="language-plaintext highlighter-rouge">max-age</code> teaches the browser nothing useful</li>
  <li>CSP that ends in <code class="language-plaintext highlighter-rouge">'unsafe-inline' 'unsafe-eval'</code> is mostly theatre</li>
  <li><code class="language-plaintext highlighter-rouge">Access-Control-Allow-Origin: *</code> next to credentialed APIs is a foot-gun</li>
  <li><code class="language-plaintext highlighter-rouge">Clear-Site-Data</code> or cache headers used blindly can break logout or leak private responses into shared caches</li>
</ul>

<p>Treat headers like code: review them, test them, and alert when they disappear after a CDN change.</p>

<h3 id="check-your-edge-with-hsts--secure-header-check">Check your edge with HSTS &amp; Secure Header Check</h3>

<p>Browsers hide most of this behind “Details” panels nobody opens. The <a href="/tools/headers/">HSTS &amp; Secure Header Check</a> tool on this site scans the live response for HSTS/preload posture, redirect hygiene, CSP (including Report-Only), CORS, cookies, leakage headers, and per-finding Issue/Fix notes — paste a URL and grade the headers the padlock never mentions.</p>

<p class="tip">Run the checker after every CDN, reverse-proxy, or “temporary” staging expose. Headers often die quietly when a new cache layer strips them.</p>

<h3 id="a-rollout-that-does-not-wake-up-on-call">A rollout that does not wake up on-call</h3>

<p>A sensible sequence for most product sites:</p>

<ol>
  <li>Inventory current headers on apex, <code class="language-plaintext highlighter-rouge">www</code>, and the API host</li>
  <li>Fix HTTPS redirect and enable HSTS only when HTTPS is universal on that host family</li>
  <li>Ship CSP in <strong>Report-Only</strong>, watch violations for a week, then enforce</li>
  <li>Tighten cookies and framing once CSP is not on fire</li>
  <li>Add monitoring: fail CI or alert if production responses lose HSTS/CSP</li>
</ol>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Quick local peek (complement the browser tool)</span>
curl <span class="nt">-sI</span> https://example.com | <span class="nb">grep</span> <span class="nt">-iE</span> <span class="se">\</span>
  <span class="s1">'strict-transport|content-security|x-frame|x-content-type|referrer-policy|permissions-policy|set-cookie'</span>
</code></pre></div></div>

<p class="important">Do not enable HSTS preload until you understand subdomain coverage. Preload is powerful and deliberately hard to undo.</p>

<h3 id="headers-are-leverage">Headers are leverage</h3>

<p>Security headers will not replace authn, authz, or patching. They <em>will</em> shrink the blast radius when something else fails — which is exactly when you need leverage.</p>

<p>Ship the boring baseline. Verify it on the real edge. Then keep verifying after every “small” infrastructure change.</p>

<hr />

<p>TLS keeps the conversation private. Security headers decide whether the browser remains on your side.</p>]]></content><author><name>Waone and AI Friends</name></author><category term="Security" /><category term="Web" /><category term="DevOps" /><summary type="html"><![CDATA[TLS encrypts the pipe. Security headers tell the browser what it is allowed to do with the page. Skip them and you leave clickjacking, XSS amplification, mixed content, and cookie theft on the table — even on a "secure" site.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/images/security-headers-cover.jpg" /><media:content medium="image" url="/images/security-headers-cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>