[Bug 7787] New: SIP server closes the TCP connection when it receives an invalid message
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Priority: P5 - low Change sponsored?: --- Bug ID: 7787 Assignee: colin.campbell@ptfs-europe.com Summary: SIP server closes the TCP connection when it receives an invalid message QA Contact: koha.sekjal@gmail.com Severity: normal Classification: Unclassified OS: All Reporter: marc@msys.ch Hardware: All Status: NEW Version: unspecified Component: SIP2 Product: Koha When the SIP server receives an invalid message, it closes the TCP connection. It should keep the connection open, but ignore the message and reply with a RESEND message (96). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #1 from Marc Balmer <marc@msys.ch> --- Created attachment 8475 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8475&action=edit Make the SIP server more robust by not exiting on invalid input, but rather issue a resend response. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Marc Balmer <marc@msys.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Marc Balmer <marc@msys.ch> --- Tested by me, needs signoff. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #3 from Marc Balmer <marc@msys.ch> --- To test this patch, you need to first start the SIP server, use the following command: # perl -IC4/SIP/ -MILS C4/SIP/SIPServer.pm C4/SIP/SIPconfig.xml In SIPconfig, you need to add a login and institution to be able to login: <accounts> <login id="arcapos" password="arcapos" delimiter="|" error-detect="enabled" institution="kohadev" /> </account> <institutions> <institution id="kohadev" implementation="ILS" parms=""> <policy checkin="true" renewal="true" checkout="true" status_update="false" offline="false" timeout="100" retries="5" /> </institution> </institutions> Then you need to create a patron with the same name (arcapos in the example above) and give that patron circulation rights. Now you can use telnet to login to the SIP server: # telnet localhost 8023 It will prompt for username/password. Note how the server closes the connection when you just hit enter 3 time or send any garbage. With the patch applied, the server will not close the connection. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Marc Balmer <marc@msys.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8475|0 |1 is obsolete| | --- Comment #4 from Marc Balmer <marc@msys.ch> --- Created attachment 8501 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8501&action=edit Make the SIP server more robust by not exiting on invalid input, but rather issue a resend response. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #5 from Marc Balmer <marc@msys.ch> --- Created attachment 8502 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8502&action=edit RAW login can be as robust as telnet login -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Marc Balmer <marc@msys.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8501|0 |1 is obsolete| | Attachment #8502|0 |1 is obsolete| | --- Comment #6 from Marc Balmer <marc@msys.ch> --- Created attachment 8511 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8511&action=edit Combined diff for telnet and raw connections -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #7 from Marc Véron <veron@veron.ch> --- I applied patch 8511. Then I followed Marc Balmers test senario with following differences: - Took /debian/templates/SIPconfig.xml as configuration file for SIPServer.pm (without changes) - Created a patron koha/koha with circulation permisssions (as found in SIPconfig.xml) - run script SIPServer.pm in console #1 -> console #1 displays something like: --Snip------------------- SIPServer config: $VAR1 = bless( { (...) 'syslog_facility=local6' ]; --Snip------------------- - then started telnet in console #2 - telnet localhost 8023 - was prompted for login ->console #1 says: Use of uninitialized value $var in hash element at /usr/share/kohaclone/C4/Context.pm line 1024, <STDIN> chunk 2. - Enter some garbage value in (telnet) console #2 -> telnet answer in console #2: 96 -> repeat several times, same answer - Hit return (without input) ->Telnet connection closes (Connection closed by foreign host.) If I repeat again an hit return just after login, connection closes immediately. Fazit: - Entering garbage does not close connection - Hit "Enter" immediately closes connection - Error (Warning?) in Context.pm as mentioned above. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8511|0 |1 is obsolete| | --- Comment #8 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 10012 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10012&action=edit Reformatted Patch The original patch gave some whitespace errors on being applied. The reformatted patch fixes these. I also reformatted the commit message so that it was all readable on a standard screen (It was a single line) ... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #9 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Not sure of the telnet logic as the connection is not broken after three failed logins sending garbage to a telnet port will permanently occupy that session(?) could it generate a kind of DOS against a sip port in this way. Will try testing this. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dpavlin@rot13.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10012|0 |1 is obsolete| | --- Comment #10 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 10362 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10362&action=edit Signed off patch I removed the update to VERSION from the patch as it conflicts with a recently pushed patch which set VERSION to match the Koha Version -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #11 from Colin Campbell <colin.campbell@ptfs-europe.com> --- I've run this against various scenarios with a test client and it does behave in a more standard compliant way. Shutdown is cleaner in most cases and it avoids the 'die mysteriously' behaviour that can cause clients to hang -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #12 from Ian Walls <koha.sekjal@gmail.com> --- Removes 3 strikes logic in favour of continuous monitoring of the input. If bad input is passed, the RESEND message is returned, rather than the system hanging. This seems like a solid way to go, in my opinion, but I don't have sufficient SIP clients to test against. Personally, I'm inclined to sign off on this, but I'm not 100% it should pass QA just on my say so. Would another member of the QA team please review this patch as well, preferably running it through some kind of live SIP client? This is one of those occasions where having an extra set of QA-eyes will be very helpful. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #13 from Ian Walls <koha.sekjal@gmail.com> --- Created attachment 10392 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10392&action=edit [SIGNED OFF] Bug 7787: Make the SIP server much more robust. Be liberal in what we accept, but strict in what we send: Never exit the server process, but send a SC_RESEND message (96) to the client if we received anything we don't understand. This is consistent with SIP server implementations of other ILSs. Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> Signed-off-by: Ian Walls <koha.sekjal@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10362|0 |1 is obsolete| | --- Comment #14 from Ian Walls <koha.sekjal@gmail.com> --- Comment on attachment 10362 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10362 Signed off patch Minor conflict with perl critic fixes... fixed now -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |paul.poulain@biblibre.com --- Comment #15 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: This patch removes more code than it adds, ++ I can't test it on a true SIP server, but looking at the code, I agree with Ian, so I set passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 --- Comment #16 from Paul Poulain <paul.poulain@biblibre.com> --- QA comment: This patch removes more code than it adds, ++ I can't test it on a true SIP server, but looking at the code, I agree with Ian, so I set passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7787 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|unspecified |rel_3_8 Assignee|colin.campbell@ptfs-europe. |marc@msys.ch |com | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org