Skip to content

fix: reject invalid base64 binary values - #1816

Open
alethbedoyya-dot wants to merge 1 commit into
frictionlessdata:mainfrom
alethbedoyya-dot:fix/strict-binary-base64-validation
Open

alethbedoyya-dot wants to merge 1 commit into
frictionlessdata:mainfrom
alethbedoyya-dot:fix/strict-binary-base64-validation

Conversation

@alethbedoyya-dot

Copy link
Copy Markdown

Summary

StringField with format="binary" decoded values without strict validation.
Python therefore discarded non-Base64 characters before checking padding, so
values such as !!!!, @@@@, and ()() were accepted as valid binary data.

Enable strict decoding and add regression coverage for those inputs.

Fixes #1804.

Validation

  • hatch run spec — 1860 passed, 361 skipped, 28 deselected; 82.90% coverage
  • hatch run type — 0 errors, 0 warnings
  • ruff check frictionless

Use strict base64 decoding so string fields with the binary format reject non-alphabet characters instead of silently discarding them.

Fixes frictionlessdata#1804.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

String field binary format accepts non-base64 values (b64decode called without validate=True)

1 participant