Skip to content

internal: refuse a second session request - #1315

Open
ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:one-session-request
Open

ejohnstown wants to merge 1 commit into
wolfSSL:masterfrom
ejohnstown:one-session-request

Conversation

@ejohnstown

Copy link
Copy Markdown
Contributor

RFC 4254 sec 6.5 lets only one shell, exec or subsystem request succeed per channel. The server now refuses any later one without asking a callback, so the granted session and its command stand.

  • internal: refuse a session request on a channel that already has one granted, generic-callback ACCEPT included
  • ssh.h: document the refusal; wolfsshd's own check stays as defence in depth
  • tests: second exec, shell and subsystem after a grant are refused, and the refused command is scrubbed

RFC 4254 sec 6.5 lets only one shell, exec or subsystem request succeed
per channel. DoChannelRequestSession() now refuses any request after
the first grant without asking a callback, so the granted session and
its command stand.

- a refusal before any grant leaves the channel with no command
- ssh.h documents the refusal; wolfsshd's own check is defence in depth
- regress.c sends a second exec, shell and subsystem after a granted
  exec, and a second exec over a generic-callback grant
- unit.c expects a shell after an exec to be refused and checks that a
  refused exec's command is scrubbed
Copilot AI balanced review requested due to automatic review settings October 12, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #1315

Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 3 of 5 in-scope changed file(s) opened by the reviewer; not opened: apps/wolfsshd/wolfsshd.c, wolfssh/ssh.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

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.

4 participants