Skip to content
FmtTools

Workflow toolkit

Encoding Tools with Security Consequences

Every normalisation bug that has a security label on it: canonical base64, double decoding, "+" versus space, formula injection, and unverified tokens.

Updated
November 17, 2026
Reading time
18 min read
Length
3,800 words
Reviewer note
Checked against the published specification
A flat vector diagram of one byte stream branching into three encoded representations above a filter panel that inspects only one branch.

Encoding is not encryption

Four panels: plain text, its base64 and percent-encoded forms, a filter that inspects only one layer, and the same value after normalisation matching the blocklisted string.
Every finding on this page comes from the same gap: a filter looks at one representation while the program acts on another. The encodings themselves are boring and perfectly reversible.

Four primitives get confused with each other in code review, and the confusion is where the incidents are. Encoding is a reversible, key-free representation change: base64, percent-encoding, punycode, the quoting rules of CSV. Its only job is to move bytes through a channel that cannot carry them. Encryption is reversible with a key and is the only one of the four that provides confidentiality. A hash is one-way and detects modification. A signature is a hash or a MAC made with a key, and it detects modification by someone who does not hold that key.

RFC 4648 is explicit about the first of these: the base16, base32 and base64 encodings do not provide computational confidentiality, and the document recommends protecting the data before encoding it when confidentiality matters. That sentence is worth testing against your own code. Paste an opaque-looking value into the Base64 tool and read what comes back: the decoded bytes, a hex dump, a printable-text verdict, and a magic-byte match when the payload is a recognisable file type. If the field is meant to be secret, the tool has already told you that it is not.

encoding
Key-free, reversible representation change. Same bytes, different characters.
encryption
Key-dependent reversible transform. Confidentiality only while the key is secret.
normalisation
Rewriting an encoded value into one canonical spelling without changing what it means.
canonical form
The single legal spelling of a value under a specification that permits only one.
decoding pass
One application of a decoder. Layers of encoding need layers of passes to reach the payload.
integrity check
A comparison proving two inputs are the same bytes, usually a hash or a MAC.
What each primitive guarantees, and what a reviewer usually assumes
PrimitiveReversible?Needs a key?GuaranteesSeen by the tools here
base64, percent, punycodeYes, by anyoneNoNothing about secrecy or originDecoded output plus warnings about legal-but-odd spellings
encryptionYes, with the keyYesConfidentialityNot offered: these tools do not encrypt
hashNoNoChange detection onlyThe round-trip check compares re-encoded text
signature or MACNoYes, a verification keyOrigin and change detectionJWT segment split and signature byte count, never a verdict

The mistake that turns an encoding bug into a security bug is treating the first row as if it belonged in the third or the fourth.

Canonical base64 and the plus sign problem

Base64 packs three bytes into four characters, six bits per character. That is exact when the input length is a multiple of three. When it is not, the last character carries fewer data bits than it can hold, and those leftover bits are still present in the symbol you wrote. RFC 4648 handles this with two statements that belong next to each other: on output the unused bits MUST be set to zero, and an implementation MAY check that on input and reject a value that fails.

The consequence is that a legal-looking base64 string is not necessarily the encoding of one particular thing, because the same bytes have several spellings. A one-byte payload has sixteen distinct strings that all decode to it, and a three-byte payload has exactly one. The looseness lives entirely in the tail group.

Every spelling of three payloads, computed with the RFC 4648 bit regrouping
PayloadCanonicalOther legal-looking spellingsUnused bitsDecoded bytes
"no", 2 bytesbm8=bm9= and bm+= and bm/=26e 6f every time
"a", 1 byteYQ==YR== through Yf==: fifteen of them461 every time
"abc", 3 bytesYWJjnone061 62 63

Two programs that compare base64 as text will disagree about values that decode identically, and a filter that only checks whether a blob is base64-shaped will accept spellings its own encoder would never have produced.

The decoder reports this precisely instead of generally. When the leftover bits are non-zero it emits a non-canonical warning, quotes the specification clause, and points at the position of the offending character. There is also a round-trip flag: the tool re-encodes the bytes it just produced and states whether the result equals the text you pasted, which is the cheapest possible canonical-form test. MIME wraps base64 at 76 characters and PEM at 64, so real-world payloads contain newlines that are not part of the data; the decoder drops whitespace and says how many characters it dropped, and turning the strict option on makes that an error.

The three meanings of a plus sign

A plus in transmitted text can mean three things, and the difference between them has caused more field corruption than most syntax errors. In a URI query a plus is a plus: RFC 3986 lists it among the sub-delims, legal to appear literally. In an application/x-www-form-urlencoded body a plus means a space, and MDN states the rule as a serialisation requirement, encode U+0020 as a plus. In a base64 payload a plus is the 62nd value of the standard alphabet and has no business appearing in a base64url segment at all. All three travel through the same request line and the same form bodies, so the same character gets different treatment depending on which parser is on the other end.

One base64 payload followed through a query string
StageTextWhat the next reader sees
original bytesfb fftwo bytes with no safe text form
standard base64+/8=four characters, one of them a plus
placed in a query unencoded /8=the plus became a space
decoded with whitespace droppedffone byte, not the original two
the tool verdictround trip falseplus-in-url-safe warning on the way back up

Nothing here is malformed: each step is a legal reading of the previous one under some convention. The decoder has a warning naming this exact round trip as the usual cause of a token or cookie failing to verify after passing through a URL.

The URL encoder has five modes, and the mode decides which characters it leaves alone. Component encodes the slash. Query-value treats ampersand and equals sign as structure but does not turn a space into a plus. Form matches URLSearchParams: it writes a space as a plus. URI follows RFC 3986, where a space must become %20. Choosing the wrong set produces two symmetric failures: use form mode on a path segment and a space arrives as a plus, so the server looks for a file with a plus in its name; use component mode on a form body and C++ arrives as C followed by two spaces.

three spellings3 lines
q=C%2B%2B  read as a URI query value:  C++
q=C++      read as a form body:         C  
q=C%20%20  read either way:               C  

Three spellings, two meanings, and only one of them survives both readers.

Layered decoding, base64 in URLs, and path traversal

Percent-encoding is idempotent in one direction only. Encoding a value twice and decoding it once leaves a string that still looks encoded while having already defeated a single-pass check. The character that reveals the layering is the percent sign itself, because %25 is a literal percent: a double-encoded space is %2520, and a double-encoded dot-dot-slash is a string no naive filter recognises. The analyser answers the layering question by iteration: it decodes repeatedly until the output stops changing, up to six passes, and reports the count as a nested-encoding finding.

Decode passes for one input, counted until the text stops changing
PassText after the passIs it traversal yet?
0, as pasted%252e%252e%252fetc%252fpasswdno, it is not yet dot-dot-slash
1%2e%2e%2fetc%2fpasswdno, still percent-escaped
2../etc/passwdyes, this is the payload
3../etc/passwdunchanged, so the loop stops

A filter that decodes once validates the string from pass 1, which contains neither a slash nor a dot-dot sequence.

RFC 3986 section 6.2.2.1 defines syntax-based normalisation, and it is exactly two rewrites that preserve meaning for every URI: uppercase the hex digits in each escape, and decode any escape that happens to name an unreserved character. The normalise function in the URL tool implements those two steps and nothing else. Section 2.3 adds the producer-side rule: a URI producing application must not percent-encode unreserved characters. When the decoder finds%41 where A would do, it reports the value as over-encoded, which is legal but unusual, and unusual encodings are what allowlist mismatches are made of.

Base64 inside a URL: which layer moves first

Base64 and percent-encoding collide by construction. Three characters a base64 string can produce have other jobs in a URI: plus and slash are the 62nd and 63rd values of the standard alphabet, and the equals sign is its padding. RFC 3986 section 2.2 gives the resolution rule: if data for a URI component would conflict with a reserved character's purpose as a delimiter, then the conflicting data must be percent-encoded before the URI is formed. Section 2.4 fixes the order on the way back in: components must be parsed and separated before the percent-encoded octets within those components can be safely decoded. Put the two clauses together and there is exactly one correct sequence: split the query into pairs, decode the escapes in the pair you want, then base64-decode the result.

One four-byte payload in seven transports, and what the decoder returns for each
Text handed to the decoderHow it came aboutDecoded outputWhat the report adds
YWJj/g==the canonical padded spelling4 bytes, 61 62 63 fenot-utf8, so a binary payload; round trip true
YWJj/g=one pad character where two belongthe same 4 bytesnothing except a round trip that now reads false
YWJj_gbase64url with the padding skippedthe same 4 bytesa base64url-normalised info line; round trip true
YWJj-ga slash replaced with a dash instead of an underscore4 bytes, 61 62 63 faan alphabet note only, and a decoded payload that changed
YWJj%2Fg%3Descapes handed over undecoded6 bytes, 61 62 63 d8 58 37invalid-character for each percent sign, plus non-canonical
++8=a two-plus value written into a query raw2 bytes, fb efthe correct answer, because nothing decoded it
8=the same value after a form decode and a whitespace drop0 bytesbad-length and non-canonical, so a hard error

Rows two and four are the ones that pass every check. A lost pad character moves only the round-trip flag, and a mis-mapped alphabet character changes the decoded payload while the report stays clean.

RFC 7515 defines its encoding as base64url with the padding characters omitted, and its appendix C.3 gives the recovery rule: add nothing when the length is divisible by four, two pads when the remainder is two, one pad when the remainder is three, and call the input illegal when the remainder is one. That last branch cannot be reached by a correct encoder, because three input bytes always produce exactly four characters, so a remainder of one means a character was lost rather than that a convention was chosen. This is why the length rule is an error rather than a warning here.

Path traversal that survives one normalisation pass

OWASP describes the traversal attack as dot-dot-slash sequences together with encoded variants, and states the mitigation as normalising the input before validating it. The engineering detail that makes this hard is that before is a single point in a pipeline that usually contains several decoders, and each of them changes what the string looks like.

Representations of one intent, and what a single-pass validator sees
InputAfter one decode passAfter two passesTool finding
../etc/passwd../etc/passwdunchangednothing: already plain text
..%2fetc%2fpasswd../etc/passwdunchangeddelimiters are reserved, so encoding them is legal and not reported
%2e%2e%2f%65tc..//etcunchangednormalise rewrites it; lowercase hex noted
%252e%252e%252fetc%2e%2e%2fetc../etcmulti-layer, two passes
%25252e%25252e%25252f%252e%252e%252f../ after the thirdmulti-layer, three passes
%c0%afetc%2fpasswdbytes c0 af, not textnot applicableinvalid UTF-8: an overlong encoding is not a character

The last row is the one people forget. An overlong encoding of a slash is not valid UTF-8 at all, so a decoder that is strict about UTF-8 refuses it, while a decoder that maps bytes through a single-byte charset produces a slash and calls it success.

Identity and tokens: punycode, homoglyphs, unverified JWTs

A host name can contain characters that DNS cannot store. RFC 3492 solves that with an ASCII Compatible Encoding: a label that needs non-ASCII code points is rewritten with the prefix xn-- followed by an encoding of the differences, and the specification itself acknowledges that visually ambiguous code points exist. That acknowledgement is the origin of the homoglyph problem, and the prefix is the visible trace of the mechanism. The analyser reports both forms and explains the gap: the string you compare against an allowlist is the ASCII form, the string your user reads is the Unicode form, and a check written against one is not a check on the other.

Two host spellings, one DNS name
RepresentationWhat it isGood forDangerous for
Unicode labelwhat the user typed or readrendering, copying, matching intentstring comparison, because code points can look identical and differ
ASCII xn-- labelwhat DNS and TLS certificates seeallowlists, subject matching, logshuman review, because nobody can eyeball a homoglyph inside it
percent-encoded hostnot legalnothingit signals that somebody form-encoded the wrong component of the URI

Percent-encoding is not how a non-ASCII label gets into a URI host; punycode is. A percent sign inside the host component means an encoder was applied to a component that does not take escapes.

Case matters for a different reason. RFC 3986 forbids percent-decoding the scheme, so hTTP:// and http:// are the same scheme, and a filter comparing strings will miss it. The same panel reports an unencrypted scheme as a finding of its own, because plain HTTP exposes cookies and passwords to anyone on the path no matter how carefully the encoding was handled upstream. If the authority contains a user-info part, the note says RFC 3986 deprecates it and RFC 7230 forbids it in a URI sent over HTTPS, because user-info is where people paste credentials and the escape rules for that component are not the rules for a query.

Unverified tokens: base64url with a claim set

A JSON Web Token is three base64url segments separated by dots, and nothing about that makes it a lock. The first two segments are plain JSON, and the third is a signature produced with a key the reader does not have. The decoder recognises the shape, splits the segments, prints the header and the payload as JSON, reports the signature length in bytes, and lists the registered claims it found with an interpretation attached to each time value. What it deliberately does not do is verify, and it says so in the output.

When the header algorithm is none or absent, the warning states that a verifier accepting that algorithm treats any signature as valid. When a MAC algorithm header carries a key id, the warning names key confusion as the risk if the server looks the key up from an attacker-influenced value. Those map onto requirements in RFC 8725, which says a library MUST let the caller specify a supported set of algorithms and MUST NOT use any other algorithm, and that each key MUST be used with exactly one algorithm. Time claims are read as UTC seconds; expiry is reported as elapsed or remaining time, and a token with no expiry gets a warning of its own, because an indefinitely valid bearer token is a revocation problem.

Header and payload observations against the requirement each one corresponds to
What the decoder printsWhat it provesWhat it does not proveRequirement behind the warning
the alg valuewhat the sender asked forwhat the verifier will accepta caller-specified algorithm set, nothing else used
absent or none algorithma token a weak verifier would trustvalidity of anything at alldo not consume unsecured tokens unless explicitly requested
kid alongside a MACthe server may look up a key from itthat the key is the right kind of keyone key, one algorithm, checked at operation time
exp, iat, nbf in UTC secondsthe sender intended a lifetimethat either party has the right clockvalidate the time claims
signature byte countthat there is something to checkthat the algorithm or key is rightthe algorithm must match the key type

Signature length is derived from the segment character count, so it is an observation about the text rather than a verdict on the token.

Data URIs and compressed payloads

RFC 2397 defines the data URL as a scheme, an optional media type, an optional base64 flag, a comma and the data, with the default media type being plain text in the US-ASCII charset when no media type is supplied. The base64 flag is the reason this belongs on a page about encodings: a data URI is a container of base64 carrying a declared content type, and a declaration is not a check. The decoder recognises the prefix, splits the media type from the payload and puts the payload through the same pipeline as any other base64 value, which includes magic-byte sniffing. A data URI that declares one media type while its leading bytes match another is reported with what the bytes say.

On the URL side the analyser treats scripting schemes as an error rather than a warning. A value whose scheme is a script or a data scheme is reported as using a scripting scheme, and the note says that assigning it to an anchor href or to a redirect target that has no allowlist executes script in your own origin, recommending that http and https be allow-listed instead of script schemes being block-listed, because a block-list of the literal word is bypassed by case changes and by a numeric character reference for the first letter.

Compressed payloads: the layer that throws information away

A base64 string whose decoded bytes begin 1f 8b is a gzip stream, and gzip is the container in which most encoded payloads actually travel. RFC 1952 gives it a ten-byte header, an optional extension block, a DEFLATE body and an eight-byte trailer. The trailer holds a CRC-32 of the uncompressed data and a field called ISIZE. ISIZE stores the size of the original input modulo 2 to the 32, because four bytes is all the format has. A payload that came from a ten-byte file and one that came from a file of four gigabytes plus ten bytes carry the same trailer. So ISIZE is a consistency check on the low thirty-two bits of a length, not a length, and a decoder that allocates a buffer from it is right for small inputs and wrong in a way that only shows up on large ones.

The CRC in the trailer deserves the same care, because it is the field most often mistaken for a security control. CRC-32 is a linear checksum designed to catch a flipped bit on a tape. Two different inputs can be made to share a CRC by solving for the tail bytes, and nothing about the algorithm involves a key, so a matching CRC proves that the sender and the receiver agree on the arithmetic, not that the payload is the payload you expected. Three header fields exist to describe the file that was compressed, and they arrive in the payload of a transport that was not supposed to know about it: MTIME is the source file's modification time, FNAME is the original file name, FCOMMENT is free text. An endpoint that gzips a generated report and hands it back in a data URI is therefore publishing the build host's filesystem layout and clock unless the compressor was told not to record them, which is what gzip -n exists for.

The gzip header fields a decoder reads, and what each one actually licenses it to conclude
FieldWidthSafe to use forNot safe to use for
ID1 ID22 bytesdeciding that this is a gzip stream, which is exactly what magic-byte sniffing doesdeciding the stream is well formed or safe
CM1 byterejecting a method other than 8 instead of guessingnegotiating anything, there is nothing to negotiate
FLG plus FNAME, FCOMMENT, FEXTRA1 byte plus variableskipping past the body correctlylogging without redaction, they carry source paths
MTIME4 bytesnothing a recipient needsanything, it is a fingerprint of the producing host
CRC324 bytesdetecting an accidental truncation or bit flipauthenticating the payload, it is unkeyed and linear
ISIZE4 bytesa low-32-bit consistency check on the decoded lengthsizing a buffer, it wraps at four gibibytes

Two of these fields are the reason a decoder can be correct about the bytes and still wrong about the intent: the container describes a file, and the transport only carried an opaque blob.

On the wire, HTTP splits the question in two. Content-Encoding is end-to-end: it describes the selected representation, survives proxies, and is what the media type is a modifier of. Transfer-Encoding is hop-by-hop: it describes that one message on that one connection, and every intermediate node may apply a different one. When both are present, the decoding order is fixed regardless of the order the fields appear in the header block: reassemble the chunks, then inflate. A server that receives a request body in a content coding it cannot undo responds 415 Unsupported Media Type, so request-side compression is a supported feature to negotiate and not a hint.

Which encoding am I holding

Before any of the previous sections can be applied to a value you found in a log, one question has to be answered: which decoder is this. The engine on this site answers it with a fixed sequence of tests, and knowing the order is useful because it tells you which claims are cheap and which are guesses. Three wrapper patterns are tried first, before any alphabet checking: three runs of URL-safe characters separated by dots is read as a JSON Web Token, a leadingdata: is read as a data URL, and a matched begin-and-end marker line is read as PEM. Then whitespace is counted and removed, dash and underscore are mapped to the standard alphabet if either is present, padding is checked, and the length modulo four is checked. Only then does the bit regrouping run, followed by the leftover-bit test, a strict UTF-8 attempt, a magic-byte match on the decoded bytes, and a re-encode comparison.

The last three of those tests all work on bytes rather than on text, and that is the whole design decision worth copying. A container format fixes its opening bytes, so the encoded spelling of those bytes is equally fixed: a gzip stream begins H4sI, a ZIP archive and therefore every DOCX, XLSX, APK and EPUB file UEsDB, a PNG iVBOR, a PDF JVBER. The prefix eyJ is the same fact about a different layer: it is what an opening brace followed by a quotation mark encodes to, which is why every JWT header and payload segment starts with those three characters. These are prefixes of the text and not of the bytes, so they are a hint about which decoder to try and never a verdict; the verdict comes from the decoded leading bytes.

The other half of the question is which shapes look like base64 and are not, because that is what an allowlist built on a shape test gets wrong. A hex digest is a subset of the base64 alphabet and its lengths are all multiples of four: an MD5 string is 32 characters and decodes to 24 bytes, SHA-256 is 64 and decodes to 48, and each of those passes without an error and round-trips as though it were a proper encoding. Ordinary words pass too: test decodes to three bytes and data to three more, none of them text.

Inputs that a shape test accepts, and what the same bytes mean under the format they came from
InputLength mod 4What this site reportsWhat it is
d41d8cd98f00b204e9800998ecf8427e024 bytes, binary, round trip truean MD5 hex digest of the empty string
test03 bytes, not valid UTF-8an English word
MZXW6YTB06 bytes, round trip true, no warningbase32 of the word fooba, per RFC 4648 test vectors
MY======0too-much-padding error, non-canonicalbase32 of the letter f, six pads to a group of eight
YWJjZ1bad-length error and non-canonicala truncated value: five characters cannot come from any encoder
H4sIAAAAAAAACstIzcnJVyjPL8pJAQCFEUoNCwAAAA==031 bytes, magic bytes match gzipthe string hello world, compressed then encoded

Four of these six rows decode without an error and none of the four is a base64 payload of text. Shape can prove a value is decodable, never that it was produced by the encoder you have in mind.

Formula injection and XXE: normalisation inside the parser

The format is a grid and the reader is an expression evaluator, which is the whole problem. OWASP describes the result: a cell beginning with one of four characters is treated as a formula by the spreadsheet, and the mitigations it lists are wrapping fields in double quotes, prefixing with a single quote, or inserting a tab inside the quoted field. The four leading characters are =, +, - and @. That is a normalisation problem of exactly the same shape as the ones above, with the twist that the decoder is a spreadsheet and the encoding layer is the CSV quoting rule. RFC 4180 says a field containing a delimiter, a quote or a line break must be quoted, and says nothing about the first character of the content, because a grid format has no opinion about execution. Quoting therefore protects the value on the way in and does nothing on the way out: the same text is handed to the evaluator intact.

Cell content, whether it is a finding, and why
CellAudit verdictReason in the report
=1+1formula injectionfirst character is one of the four
+3584012345678formula injectionfirst character is a plus, and international phone numbers are the common accidental case
-45not flaggeda minus followed by a digit or a point reads as a negative number
-45;anythingformula injectiona minus followed by something that is not a number
@SUM(A1)formula injectionfirst character is an at sign
00123leading zero droppeda number-typed cell stores it as 123
123456789012345678precision lossspreadsheets keep about fifteen significant digits

The fourth row is the reason the auditor does not simply test for a leading minus: arithmetic-looking values are legitimate and formula-looking ones are not, and the difference is the character after the minus.

XXE: normalisation happening inside the parser

Everything above happens between the payload and the parser. XML external entities happen inside the parser, which is why they are the hardest to reason about and the easiest to miss in review. OWASP describes the impact as disclosure of confidential data, denial of service and other system impacts, and describes the mitigation as configuring the XML processor to disallow external entity resolution and DTD validation. The mechanism is a normalisation step the format requires: a document may declare entities, and entity references are replaced before the document is presented to the application. Once a reference may point at a name outside the document, the parser performs a fetch on your behalf and the application sees only the resulting text. The encoding-adjacent part is that the payload reaching the parser is often an encoded layer of something else, so the parser you hardened carefully may not be the parser that receives the document.

Reference resolution across the formats covered here
FormatResolution featureWhat it enablesControl available in this site
XMLentities and an external DTD subsetreading data outside the document, and unbounded expansion costnone: there is no XML parser here
YAMLanchors, aliases and merge keysa small document describing a much larger valuealias expansion capped at a thousand by the parser this site uses
JSONnothingno reference mechanism exists in the grammarnot applicable: RFC 8259 has no resolution step
CSVnothing in the format, but the reader evaluates formulasexecution inside the spreadsheetwriter quoting plus the audit report
base64 and data URIsnothing themselvesa document arriving at the wrong parsermagic-byte identification of the decoded payload

The absence of a resolution step is a genuine security property of JSON, and the presence of one is a genuine cost of the formats that are pleasant to write by hand.

Review checklist

The findings above come from four recurring decisions, and each one is checkable in an hour of code reading with a decoder window open beside you. None of this needs a live system: every case reproduces by pasting your own values into the tools and reading what the reports say about them.

Four questions, the tool that answers them, and the finding to expect
Question about your codeToolFinding that answers it
Which spelling do we compare: encoded text or decoded bytes?Base64a non-canonical warning naming the position, plus a round-trip flag
How many decode passes before this value stops changing?URL analysera multi-layer finding carrying the pass count
Which component of the URI did we mean to encode?URL encoder modesdifferences between component, query-value, form, path and URI output
Does the reader resolve references or evaluate expressions?CSV audit and base64 sniffingformula injection rows and a magic-byte media type
Does the token algorithm come from the token or from our configuration?Base64 JWT viewunsecured-algorithm and key-confusion warnings

The ordering rule that covers all five: decode fully, normalise to one canonical form, then compare or authorise. A pipeline that validates between two decoders is validating a string its recipient never sees.

The invariants worth writing down: encode once, with the mode that matches the component. Decode fully, with strict settings, and refuse anything that needs more than one pass to settle. Normalise with the two meaning-preserving rewrites and nothing else. Compare decoded bytes or canonical text rather than two arbitrary spellings. Allow-list schemes, media types, algorithms and character sets, because every block-list on this page has its escape documented in the tool hint that flags it. Configure the parser instead of auditing the text, because resolution and evaluation both happen inside the parser. And keep the reports, because a round-trip flag, a pass count and a magic-byte verdict are cheap evidence about an input long after the request that carried it has gone.

Answers

Questions about encoding and security

Is base64 encryption?

No. RFC 4648 states these encodings provide no computational confidentiality. The Base64 tool prints the decoded bytes, a hex dump and a magic-byte match for anything recognisable. A secret needs a cipher and a key; a value that merely needs to be unreadable to a human is exactly what base64 is for.

How do I check whether a value is double-encoded?

Decode it repeatedly until the output stops changing, and count the passes. The URL analyser does this up to six times and reports a multi-layer finding with the count. %252e%252e%252f needs two passes to become ../, so a filter that decodes once and validates immediately is validating a string the recipient never sees.

Can I tell whether a JWT is safe by decoding it?

No. Decoding reads the header and payload, which are integrity-protected but never confidential. Verification needs the key and the algorithm set your verifier was configured with. Use the decoder to inspect your own tokens and to find alg values your verifier should refuse.

Does quoting a CSV field stop formula injection?

Quoting is a parsing rule, not a sandbox. The writer quotes any field starting with =, +, - or @ so the value arrives intact, but OWASP lists quoting as one option alongside a leading single quote or a tab inside the quoted field. Treat any spreadsheet that opens your export as an evaluator.

Related

Next up

Sources and further reading

  1. [1]RFC 7515: JSON Web Signature (JWS) — Section 2 defining BASE64URL as the base64url alphabet of RFC 4648 section 5 with the padding characters omitted and no line breaks, the compact serialisation as three such segments joined by periods, and appendix C.3 giving the deterministic recovery of the padding from the length modulo four. (accessed November 12, 2026)
  2. [2]RFC 1950: ZLIB Compressed Data Format Specification version 3.3 — The two-byte zlib header holding the compression method in the low nibble of the first byte and the check bits in the second, with the requirement that the sixteen-bit value formed by the two bytes be a multiple of 31. (accessed November 12, 2026)
  3. [3]RFC 1952: GZIP File Format Specification version 4.3 — The ten-byte header of identifier bytes, compression method, flags, modification time, extra flags and operating system code; and the eight-byte trailer holding a CRC-32 of the uncompressed data and ISIZE, the original input size modulo 2 to the 32. (accessed November 12, 2026)
  4. [4]RFC 9110: HTTP Semantics, section 8.4 on content codings — Content-Encoding as a modifier to the media type that is applied to the selected representation and travels end to end, in contrast with the hop-by-hop Transfer-Encoding of a single message; the rule that a list of codings is undone from right to left. (accessed November 12, 2026)
  5. [5]RFC 3986: Uniform Resource Identifier (URI): Generic Syntax — The gen-delims and sub-delims sets in section 2.2, the unreserved set and the rule that a producer must not percent-encode unreserved characters in section 2.3, section 2.4 on leading and trailing spaces, the syntax-based normalisation of section 6.2.2.1, and the prohibition on decoding the scheme. (accessed November 12, 2026)
  6. [6]RFC 4648: The Base16, Base32, and Base64 Data Encodings — The 24-bit group procedure and equals-sign padding, the canonical rule that unused trailing bits MUST be zero on output with parsers allowed to reject otherwise, the base64url alphabet of section 5, and the statement that the scheme provides no computational confidentiality. (accessed November 12, 2026)
  7. [7]RFC 8725: JSON Web Token Best Current Practices — The requirement that libraries let the caller specify a supported algorithm set and MUST NOT use any other algorithm for cryptographic operations, and the guidance against generating or consuming tokens whose algorithm is none. (accessed November 12, 2026)
  8. [8]MDN: URLSearchParams — The serialisation rules for application/x-www-form-urlencoded that the form mode of the URL encoder implements: U+0020 becomes a plus sign, and the percent-encode set is every code point except ASCII alphanumerics and star, hyphen, full stop and underscore. (accessed November 12, 2026)
  9. [9]OWASP: CSV Injection — The four leading characters that make a cell a formula, and the mitigation list of double quoting, a single quote prefix, or a tab inserted inside the quoted field so Excel does not evaluate it. (accessed November 12, 2026)
  10. [10]OWASP: XML External Entity Processing — The impact classes attributed to external entity resolution, including disclosure of confidential data and denial of service, and the mitigation of configuring the XML processor to disallow external entity resolution and DTD validation. (accessed November 12, 2026)
  11. [11]OWASP: Path Traversal — The dot-dot-slash sequences and their percent-encoded forms, and the recommendation to normalise input before validating it, which is why decoding order is treated here as a security property rather than a style preference. (accessed November 12, 2026)
  12. [12]RFC 2397: The "data" URL Scheme — The syntax of a data URL, the default media type of plain text with the US-ASCII charset when none is given, percent-encoding of characters that cannot appear, and the statement that an application should not interpret a data URL whose media type has been disallowed by configuration. (accessed November 12, 2026)
  13. [13]RFC 3492: Punycode: A Bootstring Encoding of Unicode for Internationalized Domain Names — The xn-- ASCII Compatible Encoding prefix for labels that need non-ASCII code points, and the acknowledgement that visually ambiguous code points exist, which is the reason the analyser reports a non-ASCII host in both forms. (accessed November 12, 2026)
  14. [14]Microsoft: Excel specifications and limits — The worksheet grid of 1,048,576 rows by 16,384 columns, the 32,767 character ceiling for a cell and the fifteen digit numeric precision behind the spreadsheet-damage findings in the CSV audit. (accessed November 12, 2026)