Skip to content

extensions: fix heap-buffer-overflow in hibaext_decode. #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

blunderer
Copy link
Collaborator

sshbuf_b64tod expects a NULL terminated string, but base64 encoded extensions may not be since they are extracted from an SSH buffer which manages size as metadata directly.

@blunderer blunderer self-assigned this Mar 10, 2025
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@blunderer blunderer assigned MagnusRingman and unassigned blunderer Mar 10, 2025
sshbuf_b64tod expects a NULL terminated string, but base64 encoded
extensions may not be since they are extracted from an SSH buffer which
manages size as metadata directly.
Copy link
Collaborator

@MagnusRingman MagnusRingman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait now. This null-terminates the initially allocated sshbuf. But what if the base64-encoded thing that gets deserialized, is itself not nul-terminated?

Copy link
Collaborator

@MagnusRingman MagnusRingman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, it's me not keeping the variables straight.

@blunderer
Copy link
Collaborator Author

macos build is broken due to missing u_int type definition that is now used in OpenSSH log.h

This requires either porting the checks to HIBA configure.ac, or figuring out how to depend on OpenSSH config.h

@blunderer blunderer merged commit 91cd29f into main Mar 10, 2025
5 of 6 checks passed
@blunderer blunderer deleted the fix-heap-buffer-overflow branch March 10, 2025 12:56
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.

2 participants