symfony 1.2.6: Security fix

In accordance with our security policy, we are releasing today symfony 1.2.6 to fix a security issue that has been spotted by the symfony core team.
This post contains the description of the vulnerability and the description of the changes we have made to fix it. The affected symfony versions are all symfony 1.2 releases and the 1.3 branch.
Description of the vulnerability
The new admin generator can be configured via the generator.yml
configuration file. To create or modify an existing record, the admin
generator uses the form associated with the model class. This form can be
customized via the form
, edit
, and new
sections.
The display
entry of these sections allows the regrouping of form fields in
field sets. If you use this option to hide some fields defined in the form
class, and if these fields are not required, you might think it works
correctly. It does not. As
stated in the documentation,
you must list all form fields in the display
section. The correct way to
hide form fields in the admin generator is to unset them from the form class
itself:
[php]
class ArticleForm extends BaseArticleForm
{
public function configure()
{
// safely remove the is_admin field from the form
unset($this['is_admin']);
}
}
If not, a malicious user can potentially inject values for fields for which he
does not have the right for (as it won't be caught by the security measure
implemented by the allow_extra_fields
setting of the form).
To sum up, you are potentially affected if you use the new admin generator
bundled with symfony 1.2 (Propel or Doctrine) and have removed some form
fields in the display
entry of the generator.yml
form sections without
unsetting them in the corresponding form class.
Resolution
As of symfony 1.2.6, the new admin generator prevents such a problem by automatically unsetting the hiding fields from the form object (but not the hidden fields).
If you are affected, you can fix the problem by:
Upgrading to symfony 1.2.6;
Applying the patch for symfony 1.2.5
Editing your form classes and unsetting the fields you want to hide from the edit or new form (as show above in the small example).
The symfony 1.2.6 release is based on the 1.2.5 version and only contains the security fix as a difference. All other pending changes have been moved to the upcoming 1.2.7 release.
Have found a security issue in Symfony? Send the details to security [at] symfony.com and don't disclose it publicly until we can provide a fix for it.
Help the Symfony project!
As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.
Comments
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.
Thanks!
As others have said, this exists in the admin generator, so it's not a massive vulnerability. Either way, it's good that it's been plugged!
form has fields 'first_name' & 'last_name'
display [_name]
_name partial combines 'first_name' & 'last_name' in one row.
Or am I missing something??
unset($this->widgetSchema['is_admin']);
instead of
unset($this['is_admin']);