Bug 27875 - UMC-Server Absturz durch ungültige request daten
UMC-Server Absturz durch ungültige request daten
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.0
Other Linux
: P3 normal (vote)
: UCS 3.0-2-errata
Assigned To: Alexander Kläser
Jascha Geerds
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-11 12:07 CEST by Florian Best
Modified: 2012-08-15 13:36 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): Troubleshooting
Max CVSS v3 score:
best: Patch_Available+


Attachments
neuer Patch (1.75 KB, patch)
2012-07-30 16:02 CEST, Alexander Kläser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2012-07-11 12:07:07 CEST
# ps aufx | grep univention-management-console-server | grep -v grep
root     18504  0.4  1.9 158352 19724 ?        S    22:04   0:00 /usr/bin/python2.6 /usr/sbin/univention-management-console-server start
# curl -d '{"options": {"":[""]}}' -i -H 'Content-Length: 22' -H 'Content-Type: application/json' -b 'UMCSessionId=cd091228-c1d1-4864-98c1-f73e7464e553' http://10.200.27.101/umcp/get/ucr
^C
# ps aufx | grep univention-management-console-server | grep -v grep
#

Traceback (most recent call last):
  File "/usr/sbin/univention-management-console-server", line 209, in <module>
    umc_daemon.do_action()
  File "/usr/lib/pymodules/python2.6/daemon/runner.py", line 186, in do_action
    func(self)
  File "/usr/lib/pymodules/python2.6/daemon/runner.py", line 131, in _start
    self.app.run()
  File "/usr/sbin/univention-management-console-server", line 192, in run
    notifier.loop()
  File "/usr/lib/pymodules/python2.6/notifier/nf_generic.py", line 284, in loop
    step()
  File "/usr/lib/pymodules/python2.6/notifier/nf_generic.py", line 271, in step
    not __sockets[ cond ][ fd ]( sock_obj ):
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/server.py", line 159, in _receive
    self._handle( state, msg )
  File "/usr/lib/pymodules/python2.6/univention/management/console/protocol/server.py", line 214, in _handle
    if value[ -1 ] == '*':
IndexError: string index out of range
Comment 1 Florian Best univentionstaff 2012-07-11 12:36:30 CEST
Index: univention-management-console/src/univention/management/console/protocol/server.py
===================================================================
--- univention-management-console/src/univention/management/console/protocol/server.py  (Revision 34095)
+++ univention-management-console/src/univention/management/console/protocol/server.py  (Arbeitskopie)
@@ -211,7 +211,7 @@
                        response.status = SUCCESS
                        if 'ucr' in msg.arguments:
                                for value in msg.options:
-                                       if value[ -1 ] == '*':
+                                       if value.endswith('*'):
                                                value = value[ : -1 ]
                                                for var in filter( lambda x: x.startswith( value ), ucr.keys() ):
                                                        response.result[ var ] = ucr.get( var )
Comment 2 Florian Best univentionstaff 2012-07-23 18:55:32 CEST
univention-management-console (5.0.1-1) unstable; urgency=low
   * fixed typo; Bug #27875
Comment 3 Florian Best univentionstaff 2012-07-24 15:21:31 CEST
(In reply to comment #2)
> univention-management-console (5.0.1-1) unstable; urgency=low
>    * fixed typo; Bug #27875
Paket gebaut.
für QA: zum Nachstellen:
umc-get ucr -e -o '{"":""}'
Comment 4 Alexander Kläser univentionstaff 2012-07-30 16:02:42 CEST
Created attachment 4567 [details]
neuer Patch

Guter Ansatz, allerdings kann ein Aufruf von umc.tools.ucr(1) den Server immer noch zum Absturz zwingen. Siehe Patch anbei, diesen habe ich jetzt eingespielt (als Errata und in 3.1)
Comment 5 Alexander Kläser univentionstaff 2012-07-30 16:46:44 CEST
Der Patch wurde dem Errata hinzugefügt, die YAML-Datei (2012-07-24-univention-management-console.yaml) angepasst.

QA: bitte Paketversion noch einmal überprüfen

Die Änderungen wurden auch in 3.1 eingespielt:
====================
 univention-management-console (5.0.4-1) unstable; urgency=low
 .
   * adapted error handling of UCR requests; Bug #27875
   * added script refresh-i18n

 univention-management-console (5.0.5-1) unstable; urgency=low
 .
   * fixed missing translations; Bug #27875
====================

Die Pakete wurden gebaut.
Comment 6 Jascha Geerds univentionstaff 2012-07-31 09:47:13 CEST
- Bug konnte reproduziert werde
- Der Fix funktioniert
- YAML ist in Ordnung
- Änderungen nur unter 3.0-2 einspielbar

- Fix in UCS 3.1 übernommen
- Version vom Sourcepaket wurde erhöht
- Eintrag im Changelog vorhanden
Comment 7 Alexander Kläser univentionstaff 2012-07-31 11:59:02 CEST
Das Errata-Update ist raus.
Comment 8 Jascha Geerds univentionstaff 2012-07-31 12:05:45 CEST
Verified!