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.
fix: harden peer-supplied atoi parsing #1095
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
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
fix: harden peer-supplied atoi parsing #1095
Changes from all commits
5405bcbFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 [Medium] SCP numeric parser lacks regression tests for malformed and overflow fields
💡 SUGGEST
testThe PR adds
ScpParseUInt64and routes SCP file size, mtime, and atime through it, but there are no tests covering the new parser behavior. Existing SCP internal tests only exposeGetScpFileModeandExtractFileName, so the new rejection paths for empty fields, non-digits, and overflows are untested.Recommendation: Add a
WOLFSSH_TEST_INTERNALwrapper for the changed SCP numeric parsing path or forReceiveScpMessage, then cover valid max values, overflow by one, empty fields, signs, and embedded garbage for file size and timestamps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 [Medium] VT100 argument bounds behavior lacks targeted Windows tests
💡 SUGGEST
testThe PR changes Windows VT100 argument parsing semantics for negative and out-of-range values, but the existing
wolfSSH_ConvertConsoletests only cover basic/truncated escape handling. There is no targeted coverage proving that-1,65536, overflow strings, empty args, and malformed params clamp to 0 while valid params still pass through.Recommendation: Extend the
USE_WINDOWS_APIconsole tests with CSI sequences that exercise valid values,-1,65536, very large decimal strings, empty args, and trailing-junk malformed args.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 [Medium] VT100 parser still accepts trailing junk after digits
💡 SUGGEST
bugThe PR introduces
parseArgas the new bounded parser and the comment says invalid params are clamped to 0, but the implementation only checks whetherstrtolconsumed at least one character. Inputs such as12x,12-3, or1?parse as12or1instead of being treated as invalid. SincegetArgspasses the whole VT100 parameter substring toparseArg, this leaves a class of malformed peer-controlled parameters accepted by the new validation boundary.Suggestion:
Uh oh!
There was an error while loading. Please reload this page.