Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update brakeman to fix false positive warning #41

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

AlanGabbianelli
Copy link
Contributor

We recently came across a strange warning in a frontend build:

== Warnings ==

Confidence: High
Category: Cross-Site Scripting
Check: SanitizeMethods
Message: loofah gem 2.10.0 is vulnerable (CVE-2018-8048). Upgrade to 2.2.1
File: Gemfile.lock
Line: 187

Version 2.10.0 is clearly more recent than 2.2.1. This came from how
brakeman was doing a check:

loofah_version and loofah_version < "2.2.1"

but in ruby '2.10.0' < '2.2.1' is true:

[2] pry(main)> '2.10.0' < '2.2.1'
=> true

This has been fixed in version 5.0.2 so let's upgrade brakeman to
this new version.

govuk_test.gemspec Outdated Show resolved Hide resolved
@AlanGabbianelli AlanGabbianelli changed the title Update brakeman to fix false positive warning [WIP][DO NOT MERGE]Update brakeman to fix false positive warning Jun 8, 2021
We recently came across a [strange warning][0] in a `frontend` build:

```
== Warnings ==

Confidence: High
Category: Cross-Site Scripting
Check: SanitizeMethods
Message: loofah gem 2.10.0 is vulnerable (CVE-2018-8048). Upgrade to 2.2.1
File: Gemfile.lock
Line: 187
```

Version 2.10.0 is clearly more recent than 2.2.1. This came from how
brakeman was doing a check:
```
loofah_version and loofah_version < "2.2.1"
```
but in ruby `'2.10.0' < '2.2.1'` is true:
```
[2] pry(main)> '2.10.0' < '2.2.1'
=> true
```

This [has been fixed][1] in [version 5.0.2][2] so let's upgrade brakeman to
this new version.

[0]: https://ci.integration.publishing.service.gov.uk/job/frontend/job/update-rubocop/6/console
[1]: https://github.com/presidentbeef/brakeman/pull/1607/files
[2]: https://github.com/presidentbeef/brakeman/blob/main/CHANGES.md#502---2021-06-07
@barrucadu barrucadu changed the title [WIP][DO NOT MERGE]Update brakeman to fix false positive warning Update brakeman to fix false positive warning Jun 8, 2021
@AlanGabbianelli AlanGabbianelli merged commit 53a8c72 into main Jun 8, 2021
@AlanGabbianelli AlanGabbianelli deleted the upgrade-brakeman branch June 8, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants