p PatchFirst

CVE-2020-5217

CVE-2020-5217 · Directive injection when using dynamic overrides with user input in RubyGems secure_headers

CVSS 4.4 · Medium · EPSS 1.8% · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

Check the installed version:

dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="ruby-secure-headers"'

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

In Secure Headers (RubyGem secure_headers), a directive injection vulnerability is present in versions before 3.8.0, 5.1.0, and 6.2.0. If user-supplied input was passed into append/override_content_security_policy_directives, a semicolon could be injected leading to directive injection. This could be used to e.g. override a script-src directive. Duplicate directives are ignored and the first one wins. The directives in secure_headers are sorted alphabetically so they pretty much all come before script-src. A previously undefined directive would receive a value even if SecureHeaders::OPT_OUT was supplied. The fixed versions will silently convert the semicolons to spaces and emit a deprecation warning when this happens. This will result in innocuous browser console messages if being exploited/accidentally used. In future releases, we will raise application errors resulting in 500s. Depending on what major version you are using, the fixed versions are 6.2.0, 5.1.0, 3.8.0.

Published
Updated

Fixes in distributions

  • RHSA-2020:4366 · Red Hat satellite 6.8 el7, Red Hat satellite capsule 6.8 el7 ·

Stack: system · ruby

Affected products and versions

  • secure_headers

    Versions
    • < 3.8.0: Affected
    • >= 5.0.0, < 5.1.0: Affected
    • >= 6.0.0, < 6.2.0: Affected

    No fix published

  • ruby-secure-headers Debian 12

    Affected ranges
    • ECOSYSTEM: < 6.3.1-1

    Update to 6.3.1-1

  • ruby-secure-headers Debian 13

    Affected ranges
    • ECOSYSTEM: < 6.3.1-1

    Update to 6.3.1-1

  • ruby-secure-headers Debian 14

    Affected ranges
    • ECOSYSTEM: < 6.3.1-1

    Update to 6.3.1-1

  • secure_headers RubyGems

    Versions
    • 6.0.0
    • 6.1.0
    • 6.1.1
    • 6.1.2
    Affected ranges
    • ECOSYSTEM: ≥ 6.0.0, < 6.2.0

    Update to 6.2.0

  • secure_headers RubyGems

    Versions
    • 5.0.1
    • 5.0.2
    • 5.0.3
    • 5.0.4
    • 5.0.5
    Affected ranges
    • ECOSYSTEM: ≥ 5.0.0, < 5.1.0

    Update to 5.1.0

  • secure_headers RubyGems

    Versions
    • 0.1.0
    • 0.1.1
    • 0.2.0
    • 0.2.1
    • 0.3.0
    • 0.4.0
    All versions (76)
    • 0.4.1
    • 0.4.2
    • 0.4.3
    • 0.5.0
    • 1.0.0
    • 1.1.0
    • 1.1.1
    • 1.2.0
    • 1.3.0
    • 1.3.1
    • 1.3.2
    • 1.3.3
    • 1.3.4
    • 1.4.0
    • 1.4.1
    • 2.0.0
    • 2.0.0.pre
    • 2.0.0.pre2
    • 2.0.1
    • 2.0.2
    • 2.1.0
    • 2.2.0
    • 2.2.1
    • 2.2.2
    • 2.2.3
    • 2.2.4
    • 2.3.0
    • 2.4.0
    • 2.4.1
    • 2.4.2
    • 2.4.3
    • 2.4.4
    • 2.5.0
    • 2.5.1
    • 2.5.2
    • 2.5.3
    • 3.0.0
    • 3.0.0.pre
    • 3.0.0.pre1
    • 3.0.0.pre2
    • 3.0.0.pre3
    • 3.0.0.rc1
    • 3.0.1
    • 3.0.2
    • 3.0.3
    • 3.1.0
    • 3.1.1
    • 3.1.2
    • 3.2.0
    • 3.3.0
    • 3.3.1
    • 3.3.2
    • 3.4.0
    • 3.4.1
    • 3.5.0
    • 3.5.0.pre
    • 3.5.1
    • 3.6.0
    • 3.6.1
    • 3.6.2
    • 3.6.3
    • 3.6.4
    • 3.6.5
    • 3.6.6
    • 3.6.7
    • 3.7.0
    • 3.7.1
    • 3.7.2
    • 3.7.3
    • 3.7.4
    Affected ranges
    • ECOSYSTEM: < 3.8.0

    Update to 3.8.0

  • ruby-secure-headers Ubuntu 18.04 LTS

    Versions
    • 3.7.1-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • ruby-secure-headers Ubuntu 20.04 LTS

    Versions
    • 6.0.0-1
    • 6.1.1-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →