swico / www.swiss-qr-invoice.org

Website for Swiss QR Invoice organization.
https://www.swiss-qr-invoice.org
11 stars 1 forks source link

Three garbage bytes found in the QR-bill payload #19

Open epsitec opened 4 years ago

epsitec commented 4 years ago

A customer has sent us an invalid QR-bill, which gets (incorrectly) validated by the SWICO QR-bill validator.

The payload does not start with SPC but with the three bytes 0xEF, 0xBB and 0xBF.

It appears that an early version of the ERP developed by BMC included by error the Unicode BOM (byte order mark, or \ufeff) encoded as UTF-8, which produces the byte sequence EFBBBF at the beginning of the payload. To our knowledge, BMC fixed the issue and released an update. There might, however, very well be other ERPs in the wild which have the same issue.

The SWICO QR-bill validator does not report the BOM because it gets stripped while converting the byte array of the QR code to a string representation.