Repository navigation
Wipe channel strings that can carry secrets - #1358
Open
ejohnstown wants to merge 2 commits into
Open
ejohnstown wants to merge 2 commits into
ejohnstown wants to merge 2 commits into
Conversation
The env branch decodes the peer's variable value into a stack buffer that can carry a token. Zero it before it leaves scope, on success and on a parse error alike. Issue: F-8849
The client keeps its exec command line, which can carry credentials, in ssh->channelName. FreeChannelName() wipes and frees it, mirroring FreeChannelCommand() on the server side. - use it in SshResourceFree() and at the three wolfSSH_SetChannelType() release sites - unit test reads back each freed name through a retaining allocator Issue: F-14691
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes intended to reduce credential remnants in memory.
No open issues 🎉
What changed in this PR
This PR reduces credential remnants in memory by wiping channel strings before release in wolfSSH’s request handling and client session cleanup.
Changes:
- Wipes the temporary environment-request value before leaving its handling block.
- Centralizes wiping and freeing stored exec/subsystem names in
FreeChannelName(). - Adds unit coverage that checks released exec-name buffers after channel-type changes, command replacement, and session cleanup.
| File | Description |
|---|---|
wolfssh/internal.h |
Declares the shared FreeChannelName() helper. |
tests/unit.c |
Adds and registers exec-name wiping tests. |
src/ssh.c |
Uses the cleanup helper when replacing or dropping channel names. |
src/internal.c |
Implements channel-name wiping, integrates session cleanup, and wipes environment-request values. |
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1358
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 3 of 4 in-scope changed file(s) opened by the reviewer; not opened: wolfssh/internal.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
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.
Two channel strings that can hold credentials are zeroed before they
are released.
unit test reads back each freed name
Issue: F-8849, F-14691