Bug 31523 - eval() → getattr()
eval() → getattr()
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 3.1
Other Linux
: P3 normal (vote)
: UCS 3.2
Assigned To: Florian Best
Alexander Kläser
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-27 20:09 CEST by Florian Best
Modified: 2021-06-23 07:29 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Security Issue
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): Security
Max CVSS v3 score:
best: Patch_Available+


Attachments
eval.patch (3.12 KB, patch)
2013-05-27 20:09 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2013-05-27 20:09:07 CEST
Created attachment 5241 [details]
eval.patch

The attached patch replaces the usage of eval(user_input) with getattr() which
leads in case of the pkgdb module to the ability of executing code as root
user.

poc (untested): 
umc-command pkgdb/query -o
"key=incomplete_packages(__import__('subprocess').call('touch /tmp/foo'))"
Comment 1 Alexander Kläser univentionstaff 2013-05-29 11:15:55 CEST
Good catch!
Comment 2 Moritz Muehlenhoff univentionstaff 2013-05-31 10:46:14 CEST
We will not ship a UCS 3.1-2 release; the next UCS release will be UCS 3.2.

As such, this bug is moved to the new target milestone.
Comment 3 Florian Best univentionstaff 2013-06-17 13:55:24 CEST
patch applied, things are still working as expected.

univention-management-console-module-udm (4.0.0-1)
univention-management-console-module-ucr (3.0.0-1)
univention-pkgdb (7.0.1-1)

(In reply to comment #0)
> umc-command pkgdb/query -o
> "key=incomplete_packages(__import__('subprocess').call('touch /tmp/foo'))"
→ umc-command pkgdb/query -o "key=incomplete_packages(__import__('subprocess').call(['touch', '/tmp/foo']))"

Changelog created
Comment 4 Alexander Kläser univentionstaff 2013-07-29 15:43:57 CEST
QA:
* changes OK
* changelog OK
Comment 5 Stefan Gohmann univentionstaff 2013-11-19 06:42:50 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".