15 | | '''Note: no security considerations whatsoever went into the making of this plugin. If you happen to know how it can be improved, please let me know.''' |
| 15 | '''Note: no security considerations whatsoever went into the making of this plugin. Remy Blank gave some advice:''' |
| 16 | |
| 17 | Genshi templates allow executing arbitrary Python code. So you basically |
| 18 | give users who can insert the macro anywhere (wiki page, ticket comment, |
| 19 | etc) permission to act as the user running Trac, including running run |
| 20 | any shell command. |
| 21 | |
| 22 | {{{ |
| 23 | {{{ #!Genshi |
| 24 | <div>${open('/etc/apache2/htpasswd').read()}</div> |
| 25 | }}} |
| 26 | }}} |
| 27 | |
| 28 | {{{ |
| 29 | {{{#!Genshi |
| 30 | <?python |
| 31 | import os |
| 32 | os.system("rm /path/to/env/db/trac.db") |
| 33 | ?> |
| 34 | }}} |
| 35 | }}} |
| 36 | |
| 37 | So my advice is, only enable this macro on sites where you trust *all* |
| 38 | users who can edit *any* wiki text with the web server's account. |