p PatchFirst

CVE-2020-5216

CVE-2020-5216 · Limited header injection when using dynamic overrides with user input in RubyGems secure_headers

CVSS 4.4 · Medium · EPSS 1.2% · 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.9.0, 5.2.0, and 6.3.0. If user-supplied input was passed into append/override_content_security_policy_directives, a newline could be injected leading to limited header injection. Upon seeing a newline in the header, rails will silently create a new Content-Security-Policy header with the remaining value of the original string. It will continue to create new headers for each newline. This has been fixed in 6.3.0, 5.2.0, and 3.9.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.9.0: Affected
    • >= 5.0.0, < 5.2.0: Affected
    • >= 6.0.0, < 6.3.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
    • 6.2.0
    Affected ranges
    • ECOSYSTEM: ≥ 6.0.0, < 6.3.0

    Update to 6.3.0

  • secure_headers RubyGems

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

    Update to 5.2.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 (77)
    • 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
    • 3.8.0
    Affected ranges
    • ECOSYSTEM: < 3.9.0

    Update to 3.9.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 →