Skip to content

enable remote verification by default in RExecClient - #410

Open
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:rexec-remote-verification-default
Open

dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:rexec-remote-verification-default

Conversation

@dxbjavid

@dxbjavid dxbjavid commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

RExecClient documents that verification of the remote host providing a separate error stream is enabled by default, and the sibling FTPClient initialises the same flag to true, but here the field is left uninitialised so it defaults to false. That means the anti-hijacking check in createErrorStream is skipped unless a caller turns it on by hand, so an attacker who is monitoring the rexec or rcmd negotiation can race a connection to the advertised error-stream port and have it accepted as the remote process's stderr. This initialises the flag to true so the documented default is honoured; RCommandClient and RLoginClient inherit the field, and the added tests fail on master and pass with the change.

  • Read the contribution guidelines for this project.
  • Read the ASF Generative Tooling Guidance if you use Artificial Intelligence (AI).
  • I used AI to create any part of, or all of, this pull request. Anthropic's Claude (via Claude Code) helped locate the issue, draft the one-line change and the unit tests, and write this description; I reviewed the change and verified the build and tests.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

The class documents that error-stream peer verification is enabled by default, and FTPClient initialises the same flag to true, but the field was left uninitialised so it defaulted to false and the check in createErrorStream was skipped.
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.

1 participant