Re: BUG #19702: decode() accepts Base64 payload after terminal padding - Mailing list pgsql-bugs

From shihao zhong
Subject Re: BUG #19702: decode() accepts Base64 payload after terminal padding
Date
Msg-id CAGRkXqQ1oavtxsq8y7Be63ig=iXic+ogTU2UoH9FQMBcqYi6iQ@mail.gmail.com
Whole thread
In response to BUG #19702: decode() accepts Base64 payload after terminal padding  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
Hi Qifan,

Thanks for reporting that issue.

I can reproduce this on master. The decoder sets "end" at the first "="
and never looks at it again, so later data and later "=" all pass

0001 raises an error for anything but whitespace after the padding, the
same rule base32hex already has. 0002 adds tests. 0003 fixes the two
copies of this code, pg_b64_decode() in src/common and the armor decoder
in pgcrypto. dearmor() shows the same bug when the CRC matches.

This rejects input that used to pass, so I am not sure about the back
branches. I would leave that to the committer.

Thanks,
Shihao

Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19704: ispell dictionary accepts trailing junk in numeric COMPOUNDFLAG
Next
From: PG Bug reporting form
Date:
Subject: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows