Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch xml_command to work with suhosin #1716

Closed
rcubetrac opened this issue Aug 19, 2008 · 2 comments

Comments

Projects
None yet
1 participant
@rcubetrac
Copy link

commented Aug 19, 2008

Reported by chugadie on 19 Aug 2008 23:50 UTC as Trac ticket #1485286

preg_replace with the /e modifier can be a security hole under some circumstances. The callback code is considered to be just like an "eval" when the suhosin patch is installed. So, protecting eval code and protecting roundcube's normal XML processing functions become intertwined.

This patch changes the parse_xml function of the template library to use preg_replace_callback instead of the /e modifier, thus creating a barrier between real roundcube code and eval()'d code.

Using preg_replace_callback is anectdotely faster than than preg_replace with the /e modifier as well

Keywords: suhosin preg_replace
Migrated-From: http://trac.roundcube.net/ticket/1485286

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 20, 2008

Comment by @alecpl on 20 Aug 2008 06:34 UTC

Patch applied in 6f488bb. Some info about that "/e" problem http://www.procata.com/blog/archives/2005/11/13/two-preg_replace-escaping-gotchas/

@rcubetrac

This comment has been minimized.

Copy link
Author

commented Aug 20, 2008

Status changed by @alecpl on 20 Aug 2008 06:34 UTC

new => closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.