Summary
Improper Input Validation in simple_form
Incorrect Access Control in file_method? in lib/simple_form/form_builder.rb; a user-supplied string is invoked as a method call
Workarounds
The issue only happens with pages that build forms based on user-provided input. If your application doesn't do that, you're not affected.
A workaround is to explicitly pass which type you want for an input since the issue lies on Simple Form's automatically discovery of input types. This can be done using the as option, like the following:
<%= form.input :avatar, as: :file %>
References
[TDB]
For more information
If you have any questions or comments about this advisory:
- Open an issue in https://github.com/plataformatec/simple_form
- Email us at [email protected]
Impact
For pages that build a form using user input, it is possible for an attacker to manipulate the input and send any method present in the form object. For example:
<%= simple_form_for @user do |f| %>
<%= f.label @user_supplied_string %>
...
<% end %>
The string provided in the variable @user_supplied_string would be invoked as a method call inside the @user object (unless the string contains any of the following: password, time_zone, country, email, phone and url).
By manipulation that input, an attacker could do any of the following:
- Code execution (call actions like
#destroy) - Denial of Service (by executing a computation intensive method)
- Information Disclosure (check the presence of methods, leak user information)
The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.
CVE-2019-16676 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.0.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The problem was fixed in version 5.0. Although it's a major version, there should be no issues with upgrading for 4.x. The reason it was released in a major version is that the configuration SimpleForm.file_methods was deprecated in order to fix the problem.
Frequently Asked Questions
- What is CVE-2019-16676? CVE-2019-16676 is a critical-severity improper input validation vulnerability in simple_form (rubygems), affecting versions < 5.0.0. It is fixed in 5.0.0. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.
- How severe is CVE-2019-16676? CVE-2019-16676 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of simple_form are affected by CVE-2019-16676? simple_form (rubygems) versions < 5.0.0 is affected.
- Is there a fix for CVE-2019-16676? Yes. CVE-2019-16676 is fixed in 5.0.0. Upgrade to this version or later.
- Is CVE-2019-16676 exploitable, and should I be worried? Whether CVE-2019-16676 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2019-16676 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2019-16676? Upgrade
simple_formto 5.0.0 or later.