Changes between Version 7 and Version 8 of GenshiMacro


Ignore:
Timestamp:
Jul 11, 2016, 2:26:22 PM (8 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GenshiMacro

    v7 v8  
    44
    55{{{#!box warn
    6 **Notice:** This plugin has not been developed with security considerations in mind.
     6**Notice:** This plugin has not been developed with security considerations in mind. '''Only enable this macro on sites where you trust *all* users who can edit *any* wiki text with the web server's account.'''
    77}}}
    88
     
    1313Your templates will have access to the request as `req`, which can be useful for tasks like URL generation, rendering form tokens for POST requests, and checking for a logged-in user.
    1414
    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
     17Genshi templates allow executing arbitrary Python code. So you basically
     18give users who can insert the macro anywhere (wiki page, ticket comment,
     19etc) permission to act as the user running Trac, including running run
     20any 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
     37So my advice is, only enable this macro on sites where you trust *all*
     38users who can edit *any* wiki text with the web server's account.
    1639
    1740== Bugs/Feature Requests