Skip to content

michal/ssh/add-packet-alignment-validation/OTP-20137 - #11110

Merged
Mikaka27 merged 1 commit into
erlang:maintfrom
Mikaka27:michal/ssh/add-packet-alignment-validation/OTP-20137
Jul 30, 2026
Merged

michal/ssh/add-packet-alignment-validation/OTP-20137#11110
Mikaka27 merged 1 commit into
erlang:maintfrom
Mikaka27:michal/ssh/add-packet-alignment-validation/OTP-20137

Conversation

@Mikaka27

@Mikaka27 Mikaka27 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Besides implementing packet alignment validation check from RFC 4253 6, so check:

Note that the length of the concatenation of 'packet_length', 'padding_length', 'payload', and 'random padding' MUST be a multiple of the cipher block size or 8, whichever is larger.

This now also implements fix for OpenSSH CVE-2008-5161, so packet discard functionality.

@Mikaka27 Mikaka27 self-assigned this May 19, 2026
@Mikaka27 Mikaka27 added the team:PS Assigned to OTP team PS label May 19, 2026
@Mikaka27
Mikaka27 force-pushed the michal/ssh/add-packet-alignment-validation/OTP-20137 branch from 626c682 to da4abf3 Compare May 19, 2026 15:12
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files     29 suites   29m 41s ⏱️
  515 tests   508 ✅  7 💤 0 ❌
1 736 runs  1 707 ✅ 29 💤 0 ❌

Results for commit 328c280.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@Mikaka27 Mikaka27 added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels May 19, 2026
@Mikaka27
Mikaka27 force-pushed the michal/ssh/add-packet-alignment-validation/OTP-20137 branch from da4abf3 to bb7d02c Compare May 19, 2026 15:16
@Mikaka27 Mikaka27 added the testing currently being tested, tag is used by OTP internal CI label May 19, 2026
@Mikaka27
Mikaka27 force-pushed the michal/ssh/add-packet-alignment-validation/OTP-20137 branch 2 times, most recently from 9561071 to 656d231 Compare May 20, 2026 10:05
@Mikaka27
Mikaka27 requested a review from u3s May 22, 2026 07:53
Comment thread lib/ssh/test/ssh_protocol_SUITE.erl
Comment thread lib/ssh/src/ssh_transport.erl Outdated
Comment thread lib/ssh/src/ssh_connection_handler.erl Outdated
@Mikaka27 Mikaka27 added testing currently being tested, tag is used by OTP internal CI and removed testing currently being tested, tag is used by OTP internal CI labels May 26, 2026
@Mikaka27 Mikaka27 removed the testing currently being tested, tag is used by OTP internal CI label Jun 3, 2026

@u3s u3s 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.

let's check stuff we discussed

@Mikaka27
Mikaka27 requested a review from u3s July 22, 2026 21:13
@Mikaka27
Mikaka27 force-pushed the michal/ssh/add-packet-alignment-validation/OTP-20137 branch from cb227e7 to 778a9fb Compare July 22, 2026 21:22
@Mikaka27 Mikaka27 added the testing currently being tested, tag is used by OTP internal CI label Jul 23, 2026
Comment thread lib/ssh/src/ssh_connection_handler.erl
Comment thread lib/ssh/src/ssh_transport.erl Outdated
Comment thread lib/ssh/src/ssh_connection_handler.erl Outdated
Comment thread lib/ssh/src/ssh_transport.erl Outdated
Comment thread lib/ssh/src/ssh_connection_handler.erl
@u3s
u3s self-requested a review July 24, 2026 15:25
@Mikaka27

Mikaka27 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

I will take a look at 1 more thing. Currently this repurposed the packet_length_too_short and packet_length_too_large tests as the tests which detect incorrect padding, but previously they were followed by another packet and detected the disconnect for some other reason (need to check what was failing exactly).
I think we can restore the old tests if we make the packet longer/shorter by max(8, BlockSize) instead of 4 and add a dedicated test that will create a packet with invalid padding amount, but it's length would be real (just incorrect).

@Mikaka27

Copy link
Copy Markdown
Contributor Author

I will take a look at 1 more thing. Currently this repurposed the packet_length_too_short and packet_length_too_large tests as the tests which detect incorrect padding, but previously they were followed by another packet and detected the disconnect for some other reason (need to check what was failing exactly). I think we can restore the old tests if we make the packet longer/shorter by max(8, BlockSize) instead of 4 and add a dedicated test that will create a packet with invalid padding amount, but it's length would be real (just incorrect).

I don't think there is a point in doing this. The old code failed with "bad_mac" error, so this is covered by new test.

@Mikaka27
Mikaka27 force-pushed the michal/ssh/add-packet-alignment-validation/OTP-20137 branch from 709eb8c to 328c280 Compare July 27, 2026 16:23
@Mikaka27
Mikaka27 merged commit 09c8d57 into erlang:maint Jul 30, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants