Skip to content

XSS/Script injection vulnerability

High
jonasjabari published GHSA-3jqw-vv45-mjhh Feb 12, 2020

Package

No package listed

Affected versions

<= 0.7.3

Patched versions

>= 0.7.4

Description

Impact

  • matestack-ui-core is vulnerable to XSS/Script injection
  • matestack-ui-core does not excape strings by default and does not cover this in the docs
  • matestack-ui-core should escape strings by default in order to prevent XSS/Script injection vulnerability
class Pages::MyApp::MyExamplePage < Matestack::Ui::Page

  class FakeUser < Struct.new(:name)
  end

  def prepare
    @user = FakeUser.new("<script>alert('such hack many wow')</script>")
  end

  def response
    components {
      div do
        heading size: 1, text: "Hello #{@user.name}" # is not escaped
        plain "Hello #{@user.name}" # is not escaped
      end
    }
  end
end

Patches

patched in 0.7.4

Workarounds

escape string explicitly/manually

References

reported by @PragTob

For more information

If you have any questions or comments about this advisory:

Severity

High

CVE ID

CVE-2020-5241

Weaknesses

No CWEs

Credits