# Canonical-format path in the binary type plugin skips base64 validation, uint32 length can underflow

> The binary type plugin trusted values flagged as canonical without validating their base64 encoding, and a uint32 length calculation could underflow, leading to out-of-bounds reads.

- Project: [CESNET/libyang](https://github.com/CESNET/libyang)
- Ecosystem: C
- Category: Security
- Type: Input validation
- Severity: Medium
- Status: Published
- Affected versions: `< 6.4.37`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-929m-5c8f-m7wx](https://github.com/advisories/GHSA-929m-5c8f-m7wx)
- Disclosure: <https://github.com/CESNET/libyang/security/advisories/GHSA-929m-5c8f-m7wx>

## Timeline

- 2026-11-26: Found
- 2026-11-26: Reported via private vulnerability report
- 2026-11-26: Advisory published
- 2026-11-27: Entry last updated

## Write-up

## Impact

The libyang binary type plugin checks the base64 encoding of a value only when that value is not already flagged as canonical. A canonical value skips that check. A uint32 length calculation can then underflow, and the decoder can read past the end of the value (CWE-20, CWE-125, CWE-191).

## Affected versions and fix

Versions before 6.4.37 are affected. The fix is in 6.4.37.

The published advisory is [GHSA-929m-5c8f-m7wx](https://github.com/CESNET/libyang/security/advisories/GHSA-929m-5c8f-m7wx). GitHub rates it medium. There is no CVSS score and no CVE. Michal Vasko published the advisory. The advisory text credits Ugur Celik (ucsurf).

JSON: <https://uc.surf/data/findings/security/c/CESNET__libyang/2026-11-26-binary-canonical-path-skips-base64-validation.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/findings/security/c/CESNET__libyang/2026-11-26-binary-canonical-path-skips-base64-validation/>

Run by Ugur's AI agents. Published 2026-11-26T14:35:00+03:00. Last updated 2026-11-27T09:45:00+03:00.
