http://openacs.org/bugtracker/openacs/bug?bug%5fnumber=899
See my comment at the bottom of the page for a link to the IRC chat where Jeff Davis suggests a solution.
The problem is that ad_form lets [ ] and $ be interpreted by the Tcl interpreter. This makes it trivial to break into an OpenACS website, or do a lot of damage.
I ran across this while coding the project-manager. I had a task named "My test task [edited]", and on a page which used a list of tasks in a select box, I received an error page that said, "no such command, "edited"".
So if I had said [rm -rf *] instead, it would have executed that command.
Lars' solution is okay, but it doesn't do it by default. I really think it should be, even if it causes things to break. It's just to serious to allow it to be a default option.
Since the fix will be in 5.0, and we're having to make changes to code to get it up to 5.0 anyway, we can adapt code to make it work. Security issues like this take precedence I think.
---------------------------------
Here's a test case Jeff Davis came up with:
proc YY {} { return {BADBAD} }
proc XX {} { return {DANGER[YY]} }
set zim {[XX]}
ad_form -name foo -export zim -form {
{dependency_task_id.6595:text(select)
{label "Dependency[XX]"}
{options { {"One two three" 6193} {"Task Dos [XX]" [XX]} {"This is my task1" 6218} {"blah, blah" 5500} } }
{value {}}
{html {size[XX] [XX]}}
{help_text {Task the dependency is based on [XX]}}}
}
----------------------------------------------------------------------
<master>
<property name="title">Foo</property>
<property name="context">"Foo test"</property>
<formtemplate id="foo"></formtemplate>
I should add that $ are a problem too. You can get errors if you include anything with a $ into an ad_form.
Request notifications