fuzz: add sshconfig_fuzz harness for SSH client config parser#680
Open
XananasX7 wants to merge 1 commit into
Open
fuzz: add sshconfig_fuzz harness for SSH client config parser#680XananasX7 wants to merge 1 commit into
XananasX7 wants to merge 1 commit into
Conversation
Add a libfuzzer harness covering the SSH client configuration file parser (readconf.c). The parser handles complex directives including Match blocks, ProxyCommand, IdentityFile patterns, and many other options that represent a large attack surface for malformed input. The new harness: - Writes fuzz input to a tempfile and calls read_config_file() - Exercises process_config_line_depth() across all config keywords - Covers Match block evaluation and conditional parsing - Builds against readconf.o, addrmatch.o, misc.o, krl.o Also adds sshconfig_fuzz to the TARGETS list in Makefile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a new libfuzzer harness
sshconfig_fuzz.ccthat covers the SSH client configuration file parser (readconf.c).Motivation
The SSH client config parser (
readconf.c, 3957 lines) handles complex and security-sensitive directives:Matchblocks with arbitrary criteriaProxyCommand/ProxyJumpargumentsIdentityFile/CertificateFilepath patternsThis parser is exercised whenever a client reads
~/.ssh/configor/etc/ssh/ssh_config. It is currently not covered by any OSS-Fuzz harness.Changes
regress/misc/fuzz-harness/sshconfig_fuzz.cc: new harness callingread_config_file()with fuzz input written to a tempfile. Exercisesprocess_config_line_depth()across all config keywords and Match blocks.regress/misc/fuzz-harness/Makefile: addsshconfig_fuzztoTARGETSwith correct link deps (readconf.o,addrmatch.o,misc.o,krl.o).Testing
Harness builds cleanly following the existing Makefile pattern. Verified locally that
initialize_options()+read_config_file()is the correct entry point used by the SSH client binary.