This is a major version release of Brakeman which introduces some backwards-incompatible changes. Very likely this release will cause many changes in reports, including fingerprints on existing warnings.
Changes since 2.6.3:
--exit-on-warn --compareonly returns error code on new warnings (Jeff Yip)
- Sort warnings by fingerprint in JSON report (Jeff Yip)
- CVEs report correct line and file name (Gemfile/Gemfile.lock) (Rob Fletcher)
--separate-modelsto be the default
- Local variables are no longer formatted as
- Actually skip skipped before filters
- Remove “fake filters” from warning fingerpints
- Index calls in
- Handle symmetric multiple assignment
- Do not branch for self attribute assignment
x = x.y(#552)
- Move Symbol DoS to optional checks
- Add check for cross site scripting via inline renders
- Add check for CVE-2014-7829
- Fix parsing of
- Fix output format of command interpolation
- Fix CVE for CVE-2011-2932
Exit Code When Comparing
--exit-on-warn --compare, Brakeman will only return a non-zero exit code when there are new warnings. Previous behavior was to return non-zero exit code if there were any differences between reports (including fixed warnings).
Sort Warnings in JSON Report
Warnings are now sorted by their fingerprint in the JSON report to provide more stable output.
Report Line Numbers for CVEs
Previously, CVE warnings typically pointed to
Gemfile with no line number information. Now CVEs should point to
Gemfile.lock as appropriate and include the line number for the vulnerable gem dependency.
Mass Assignment Warnings Default to per Model
--separate-models option is now on by default. This means warnings about missing
attr_accessible will be reported for each model instead of rolling them into a single warning.
Local Variable Format
Local variables are no longer formatted as
(local var) in warning output.
Skip Skipped Filters
Before filters which are skipped are now actually skipped during data flow analysis.
Fake Filter Change
Before filters defined as blocks (instead of methods) are internally represented as methods with random names prepended by
fake_filter. Since the method names were not stable, any warnings inside the filters would have inconsistent fingerprints. Now warnings inside of before filters will always be reported with
before_filter as the method name.
Index Calls in Libraries
Classes defined in
lib/ files will now be included in the method call index and searched for vulnerabilities. As these files were already being processed, this has not added any significant overhead in testing.
Handle Multiple Assignment
Simple symmetric multiple assignments (also called “parallel assignment”) like
x, y = 1, 2 are now handled like normal assignments.
Avoid Branching on Self Assignment
Brakeman no longer creates new union values for self assignment of attributes.
Symbol DoS is an Optional Check
In this release the check for denial of service via symbol creation has been changed to an optional check. Memory exhaustion by creating lots of new symbols is an unlikely attack and easily mitigated by having at least two web servers. Additionally
Warn on Inline XSS
Unescaped user input in
render :text or
render :inline should now generate warnings.
Brakeman will warn about CVE-2014-7829 (file existence disclosure) for applications using affected versions of Rails and setting
config.serve_static_assets = true.
ERB Parsing Fix
<%== in ERB templates no longer causes errors.
Command Interpolation Format Fix
Brakeman was formatting
This has been fixed.
The ancient CVE-2011-2932 was being mis-reported as CVE-2011-2931. Hopefully this affects no one.
The certificate used to sign the Brakeman gem expired in December. A new certificate is available here.
This command can be used to add the new certificate:
gem cert --add <(curl -Ls https://raw.github.com/presidentbeef/brakeman/master/brakeman-public_cert.pem)
The SHA1 sums for this release are
4180238f8de503e7ad0f2ca952ea38ccc1c6530b brakeman-3.0.0.gem b5cefd6f14edb57f12d1fe9fcc0fb24e05a05aaf brakeman-min-3.0.0.gem