Get the latest tech news

Beware of Base64 Encoded Strings


base64 encoded strings I just encountered a fun little bug that I thought is worth sharing. TL;DR: the base64 util breaks lines after a certain number of columns.

It started when we noticed that a cronjob that used wget to regularly call an endpoint failed on one specific environment. Curl has this functionality built in, but to keep the attack surface as small as possible, we decided to stick to wget, which is part of busybox, to keep the container image size under 1 MB (!). After digging around for a while and separating out the individual pieces of the commands, I noticed that the subcommand to build the header value ( echo -n $BASIC_AUTH_USERNAME:$BASIC_AUTH_PASSWORD | base64) behaved differently on prod vs. non-prod.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Encoded Strings

Encoded Strings

Photo of Base64

Base64