[PR #1347] [MERGED] Enforce max message length [SECURITY VULNERABILITY CVE-2021-42076] #1784

Closed
opened 2026-05-05 08:01:53 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/1347
Author: @p12tic
Created: 11/1/2021
Status: Merged
Merged: 11/1/2021
Merged by: @p12tic

Base: masterHead: enforce-max-message-length


📝 Commits (5)

  • 7ab8e01 lib/server: Add a note about taking pointer to virtual member function
  • cc36982 lib/server: Remove unused code
  • e33c81b lib: Enforce a maximum length of input messages
  • af90f39 lib/net: Limit the maximum size of TCP or SSL input buffers
  • fd5295e lib/barrier: Disconnect client on too long input packets

📊 Changes

13 files changed (+106 additions, -31 deletions)

View changed files

doc/newsfragments/enforce-maximum-message-length.bugfix (+6 -0)
📝 src/lib/barrier/PacketStreamFilter.cpp (+16 -6)
📝 src/lib/barrier/PacketStreamFilter.h (+3 -1)
📝 src/lib/barrier/ProtocolUtil.cpp (+10 -0)
📝 src/lib/barrier/protocol_types.h (+8 -0)
📝 src/lib/base/EventTypes.cpp (+1 -0)
📝 src/lib/base/EventTypes.h (+6 -0)
📝 src/lib/client/ServerProxy.cpp (+20 -9)
📝 src/lib/net/SecureSocket.cpp (+5 -0)
📝 src/lib/net/TCPSocket.cpp (+5 -3)
📝 src/lib/server/ClientListener.cpp (+0 -9)
📝 src/lib/server/ClientProxy1_0.cpp (+20 -3)
📝 src/lib/server/ClientProxyUnknown.cpp (+6 -0)

📄 Description

This PR fixes a number of places where a malicious client serving large amount of data could have caused excessive memory allocations and denial of service by resource exhaustion.

This PR fixes the following security vulnerability:

  • CVE-2021-42076 DoS via excess length messages

The issue has been reported by Matthias Gerstner mgerstner@suse.de @mgerstner. Matthias also provided insights into how best to fix the issues, precise reproduction steps and any used tools and made the maintainer's life as pleasant as possible. Thank you!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/1347 **Author:** [@p12tic](https://github.com/p12tic) **Created:** 11/1/2021 **Status:** ✅ Merged **Merged:** 11/1/2021 **Merged by:** [@p12tic](https://github.com/p12tic) **Base:** `master` ← **Head:** `enforce-max-message-length` --- ### 📝 Commits (5) - [`7ab8e01`](https://github.com/debauchee/barrier/commit/7ab8e0101da31237adc7cc50dabe8a441a0ad91c) lib/server: Add a note about taking pointer to virtual member function - [`cc36982`](https://github.com/debauchee/barrier/commit/cc369820d45166a93972ecd0faf3aa1049a09b5a) lib/server: Remove unused code - [`e33c81b`](https://github.com/debauchee/barrier/commit/e33c81b835e14ca1534e3f375c17707f10a29152) lib: Enforce a maximum length of input messages - [`af90f39`](https://github.com/debauchee/barrier/commit/af90f39b4a00acf12def036b7ec4362b4c3404c7) lib/net: Limit the maximum size of TCP or SSL input buffers - [`fd5295e`](https://github.com/debauchee/barrier/commit/fd5295eb3199e7693c67b4b7116f47f50f876ef5) lib/barrier: Disconnect client on too long input packets ### 📊 Changes **13 files changed** (+106 additions, -31 deletions) <details> <summary>View changed files</summary> ➕ `doc/newsfragments/enforce-maximum-message-length.bugfix` (+6 -0) 📝 `src/lib/barrier/PacketStreamFilter.cpp` (+16 -6) 📝 `src/lib/barrier/PacketStreamFilter.h` (+3 -1) 📝 `src/lib/barrier/ProtocolUtil.cpp` (+10 -0) 📝 `src/lib/barrier/protocol_types.h` (+8 -0) 📝 `src/lib/base/EventTypes.cpp` (+1 -0) 📝 `src/lib/base/EventTypes.h` (+6 -0) 📝 `src/lib/client/ServerProxy.cpp` (+20 -9) 📝 `src/lib/net/SecureSocket.cpp` (+5 -0) 📝 `src/lib/net/TCPSocket.cpp` (+5 -3) 📝 `src/lib/server/ClientListener.cpp` (+0 -9) 📝 `src/lib/server/ClientProxy1_0.cpp` (+20 -3) 📝 `src/lib/server/ClientProxyUnknown.cpp` (+6 -0) </details> ### 📄 Description This PR fixes a number of places where a malicious client serving large amount of data could have caused excessive memory allocations and denial of service by resource exhaustion. This PR fixes the following security vulnerability: - CVE-2021-42076 DoS via excess length messages The issue has been reported by Matthias Gerstner <mgerstner@suse.de> @mgerstner. Matthias also provided insights into how best to fix the issues, precise reproduction steps and any used tools and made the maintainer's life as pleasant as possible. Thank you! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 08:01:53 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1784
No description provided.