Skip to content

Correctly apply the end-of-contents octets to the right level - #134

Merged
Lukasa merged 1 commit into
mainfrom
cb-correctly-associate-indefinitely-length-end-sequence
Oct 8, 2026
Merged

Lukasa merged 1 commit into
mainfrom
cb-correctly-associate-indefinitely-length-end-sequence

Conversation

@Lukasa

@Lukasa Lukasa commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Motivation

In #125 we attempted to apply a hardening fix that would avoid allowing truncation of BER content by applying an end-of-contents octets at the wrong parse depth to a higher-level object. This fix was incomplete.

Modifications

Re-write the code to handle the end-of-contents octets as part of the loop instead of attempting to detect it after the fact. Add defense-in-depth for unexpected nodes.

Results

More robust against issues with end-of-contents octets.

Motivation

In #125 we attempted to apply a hardening fix that would avoid allowing
truncation of BER content by applying an end-of-contents octets at the
wrong parse depth to a higher-level object. This fix was incomplete.

Modifications

Re-write the code to handle the end-of-contents octets as part of the
loop instead of attempting to detect it after the fact.
Add defense-in-depth for unexpected nodes.

Results

More robust against issues with end-of-contents octets.
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Oct 8, 2026
@Lukasa
Lukasa merged commit 917b472 into main Oct 8, 2026
58 of 60 checks passed
@Lukasa
Lukasa deleted the cb-correctly-associate-indefinitely-length-end-sequence branch October 8, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants