Repository navigation
SimplrSSH - Bug Hunter - 2026-10-17 - #25
Merged
Merged
Conversation
…or a new server Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZQ79Khe8LKPgeyn474r1i
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.
Findings
main/known_hosts.cpp,check_host_keyandload_known_hosts; root cause:char value[160]withnvs_get_str).host:port, key type, SHA256 fingerprint, about 65 bytes plus the host name. A host name of roughly 85 characters or more makes the read fail withESP_ERR_NVS_INVALID_LENGTH.check_host_keythen returnsUnknowninstead ofMatchorMismatch. So a changed (possibly MITM) key for that server shows as a "New server" trust prompt, not a key-changed refusal, andhostsomits the entry.Reviewed and found no defects:
vterm.cpp,ui_page.cpp,command_redact.cpp,connection_profiles.cppand the command dispatch inssh_terminal.cpp.Plan
read_record()inknown_hosts.cpp: size query, then heap read, bounded to 1 KiB. Use it in both places.char value[N]buffer returns inknown_hosts.cpp.Final gap analysis
read_record()replaces both fixed-buffer reads: done.known_hosts.cppdepends on libssh2 andSSHTerminal, so it is not in the host test build. A behavioural unit test would need a refactor, so I added a source guard instead.Deferred
current_inputis unbounded). This needs a product decision on the limits.Verification
scripts/check.shwithSKIP_SAST=1:ctest -L unit): pass, with the sanitizer build.Generated by Claude Code