If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Address Formats eval Allows for arbitrary code execution

Address Formats eval Allows for arbitrary code execution

Started by robryan on 7 Mar 2013, 2:56 AM · Views: 675

Results 1 to 1 of 1
7 Mar 2013, 2:56 AM
#1
robryan avatar

robryan

New Zenner

Join Date:
May 2012
Posts:
2
Plugin Contributions:
0

Post #1 by robryan

An address format is populated with eval, without any input checks.
So if you provide an address format of say:
〒$postcode$cr$country$cr$state $city$cr$streets$cr$lastname $firstname";$x=1;echo $x."
It will output 1 to the screen.

There is no way to alter address formats without database access so in order to execute code someone would have to have the ability to modify the database. It does provide a way for someone who gains database control (SQL injection possibly) depending on settings to gain much wider server access.

Easy solution to this would just to make an array of possible address fields, loop over it and replace in the format.