Bug 41084 - UMC-Server: hanging connection when protocol parsing fails
UMC-Server: hanging connection when protocol parsing fails
Status: RESOLVED DUPLICATE of bug 42114
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
:
: 38765 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-20 13:44 CEST by Florian Best
Modified: 2016-09-13 14:49 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-04-20 13:44:49 CEST
The connection between the UMC-Server and the UMC-Webserver hangs if the UMC-Moduleprocess sends a malformed UMCP message.

We had the case that the message length information was calculated wrong due to returning a unicode object containing german umlauts which caused a parsing error of the next message because of some pending bytes (from the last message) in the buffer were parsed as new message.

A hotfix is this:
diff --git a/management/univention-management-console/src/univention/management/console/protocol/message.py b/management/univention-management-console/src/univention/management/console/protocol/message.py
index 101ed38..e8b2a28 100644
--- a/management/univention-management-console/src/univention/management/console/protocol/message.py
+++ b/management/univention-management-console/src/univention/management/console/protocol/message.py
@@ -132 +132 @@ def _formattedMessage(_id, _type, mimetype, command, body, arguments):
-                       data = body
+                       data = bytes(body)
@@ -210,0 +211 @@ def parse(self, msg):
+                       PROTOCOL.error('Unparsable message header: %r' % (header,))

But we should fix a little bit more so that the error is communicated to the UMC-Webserver instead of a hanging connection.
Comment 1 Florian Best univentionstaff 2016-04-22 20:33:20 CEST
*** Bug 38765 has been marked as a duplicate of this bug. ***
Comment 2 Florian Best univentionstaff 2016-09-13 14:49:11 CEST
Fixed during Bug #42114 to enhance security.

*** This bug has been marked as a duplicate of bug 42114 ***