Skip to content

HuggingFace inference operator: _read_binary_value misclassifies plain text as base64 #7200

Description

@PG1204

What happened?

_read_binary_value's fallback calls base64.b64decode(val) without validate=True. Since b64decode ignores non-alphabet characters by default, many ordinary strings "successfully" decode into garbage bytes, so the intended UTF-8 fallback rarely fires, a plain-text column value can be turned into garbage and sent as image/audio bytes.

File: .../huggingFace/codegen/HuggingFaceCodegenBase.scala (_read_binary_value). Fix: pass validate=True and catch binascii.Error so only genuine base64 decodes.

How to reproduce?

Put a non-data-URL, non-base64 string in an image/audio column -> it's decoded to garbage bytes instead of being treated as text.

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

No response

What browsers are you seeing the problem on?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions