Skip to content

fix(security): 2 improvements across 2 files#1673

Open
tomaioo wants to merge 2 commits intocogentcore:mainfrom
tomaioo:fix/security/out-of-bounds-read-in-base64-decoder-can
Open

fix(security): 2 improvements across 2 files#1673
tomaioo wants to merge 2 commits intocogentcore:mainfrom
tomaioo:fix/security/out-of-bounds-read-in-base64-decoder-can

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 25, 2026

Summary

fix(security): 2 improvements across 2 files

Problem

Severity: Medium | File: base/iox/imagex/base64.go:L43

FromBase64 indexes eb[76] without checking input length first. If attacker-controlled or malformed input shorter than 77 bytes is passed, this will panic and can be used for denial of service.

Solution

Guard access with a length check before indexing (e.g., if len(eb) > 76 && eb[76] == ' ' { ... }). Also consider robust whitespace normalization that does not rely on fixed offsets.

Changes

  • base/iox/imagex/base64.go (modified)
  • cmd/changed.go (modified)

tomaioo added 2 commits April 25, 2026 11:21
- Security: Out-of-bounds read in Base64 decoder can panic on short input
- Security: Concurrent unsynchronized error collection causes race condition

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
- Security: Out-of-bounds read in Base64 decoder can panic on short input
- Security: Concurrent unsynchronized error collection causes race condition

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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.

1 participant