{"id":9352,"date":"2019-09-27T14:19:27","date_gmt":"2019-09-27T17:19:27","guid":{"rendered":"http:\/\/blog.plataformatec.com.br\/?p=9352"},"modified":"2019-09-27T17:07:36","modified_gmt":"2019-09-27T20:07:36","slug":"incorrect-access-control-in-simple-form-cve-2019-16676","status":"publish","type":"post","link":"http:\/\/blog.plataformatec.com.br\/2019\/09\/incorrect-access-control-in-simple-form-cve-2019-16676\/","title":{"rendered":"Incorrect Access Control in Simple Form (CVE-2019-16676)"},"content":{"rendered":"\n

Simple Form version 5.0<\/code> was released today with a fix for a security issue that could allow an attacker to execute methods on form objects. The issue is explained in details below.<\/p>\n\n\n\n

Description<\/h2>\n\n\n\n

The issue applies only to forms that are built using user-supplied input. For example, the following form that builds a label based on user input:<\/p>\n\n\n

<%=<\/span> simple_form_for<\/span> @user<\/span> do<\/span> |form<\/span>| %><\/span>\n <%=<\/span> form.label<\/span> @user_supplied_string<\/span> %><\/span>\n ...\n<%<\/span> end<\/span> %><\/span>\n<\/code><\/div>Code language:<\/span> HTML, XML<\/span> (<\/span>xml<\/span>)<\/span><\/small><\/pre>\n\n\n

In this case, the @user_supplied_string<\/code> would be invoked as a method call in the @user<\/code> object (unless the string contains any of the following: password<\/code>, time_zone<\/code>, country<\/code>, email<\/code>, phone<\/code> or url<\/code>).<\/p>\n\n\n\n

If you build your forms with backend-provided information only, your application is not affected by this issue.<\/p>\n\n\n\n

Possible implications<\/h2>\n\n\n\n

By knowing that this breach exists, an attacker could invoke any method on the form object. This means that they could do any of the following:<\/p>\n\n\n\n