{"id":"CVE-2024-28199","aliases":["CVE-2024-28199","GHSA-242p-4v39-2v8g"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site Scripting (XSS) possible with maliciously formed HTML attribute names and values in Phlex","summary":"phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks. If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user. If you splat user-provided attributes when rendering any HTML tag, malicious event attributes could be included in the output, executing JavaScript when the events are triggered by another user. Patches are available on RubyGems for all 1.x minor versions. Users are advised to upgrade. Users unable to upgrade should consider configuring a content security policy that does not allow `unsafe-inline`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks. If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user. If you splat user-provided attributes when rendering any HTML tag, malicious event attributes could be included in the output, executing JavaScript when the events are triggered by another user. Patches are available on RubyGems for all 1.x minor versions. Users are advised to upgrade. Users unable to upgrade should consider configuring a content security policy that does not allow `unsafe-inline`.","source":"cvelist"},{"lang":"en","text":"There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks.\n\n### Impact\n\nIf you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user.\n\n```ruby\na(href: user_profile) { \"Profile\" }\n```\n\nIf you splat user-provided attributes when rendering any HTML or SVG tag, malicious event attributes could be included in the output, executing JavaScript when the events are triggered by another user.\n\n```ruby\nh1(**JSON.parse(user_attributes))\n```\n\n### Patches\nPatches are [available on RubyGems](https://rubygems.org/gems/phlex) for all `1.x` minor versions. The patched versions are:\n\n- [1.9.1](https://rubygems.org/gems/phlex/versions/1.9.1)\n- [1.8.2](https://rubygems.org/gems/phlex/versions/1.8.2)\n- [1.7.1](https://rubygems.org/gems/phlex/versions/1.7.1)\n- [1.6.2](https://rubygems.org/gems/phlex/versions/1.6.2)\n- [1.5.2](https://rubygems.org/gems/phlex/versions/1.5.2)\n- [1.4.1](https://rubygems.org/gems/phlex/versions/1.4.1)\n- [1.3.3](https://rubygems.org/gems/phlex/versions/1.3.3)\n- [1.2.2](https://rubygems.org/gems/phlex/versions/1.2.2)\n- [1.1.1](https://rubygems.org/gems/phlex/versions/1.1.1)\n- [1.0.1](https://rubygems.org/gems/phlex/versions/1.0.1)\n\nIf you are on `main`, it has been patched since [`aa50c60`](https://github.com/phlex-ruby/phlex/commit/aa50c604cdee1d0ce7ef068a4c66cbd5d43f96a1)\n\n### Workarounds\nConfiguring a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) that does not allow [`unsafe-inline`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline) would effectively prevent this vulnerability from being exploited.\n\n### References\n\nIn addition to upgrading to a patched version of Phlex, we strongly recommend configuring a Content Security Policy header that does not allow `unsafe-inline`. Here’s how you can configure a Content Security Policy header in Rails. https://guides.rubyonrails.org/security.html#content-security-policy-header","format":"markdown","source":"ghsa"},{"lang":"es","text":"Phlex es un framework de código abierto para crear vistas orientadas a objetos en Ruby. Existe una posible vulnerabilidad de secuencias de comandos entre sitios (XSS) que puede explotarse mediante datos de usuario creados con fines malintencionados. Esto se debió a una distinción inadecuada entre mayúsculas y minúsculas en el código destinado a prevenir estos ataques. Si representa una etiqueta `<a rel=\"nofollow\">` con un atributo `href` establecido en un enlace proporcionado por el usuario, ese enlace podría potencialmente ejecutar JavaScript cuando otro usuario haga clic en él. Si agrega atributos proporcionados por el usuario al representar cualquier etiqueta HTML, se podrían incluir atributos de eventos maliciosos en la salida, ejecutando JavaScript cuando los eventos sean activados por otro usuario. Los parches están disponibles en RubyGems para todas las versiones menores 1.x. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar deben considerar configurar una política de seguridad de contenido que no permita \"inseguro en línea\".</a>","source":"nvd"}],"published":"2024-03-11T22:50:38.789Z","modified":"2026-09-10T03:50:00.390Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"= 1.9.0","status":"affected"},{"version":">= 1.8.0, < 1.8.2","status":"affected"},{"version":"= 1.7.0","status":"affected"},{"version":">= 1.6.0, < 1.6.2","status":"affected"},{"version":">= 1.5.0, < 1.5.2","status":"affected"},{"version":"= 1.4.0","status":"affected"},{"version":">= 1.3.0, < 1.3.3","status":"affected"},{"version":">= 1.2.0, < 1.2.2","status":"affected"},{"version":"= 1.1.0","status":"affected"},{"version":"< 1.0.1","status":"affected"}],"vendor":"phlex-ruby","product":"phlex","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.9.0","status":"affected","fixed":"1.9.1"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.8.0","status":"affected","fixed":"1.8.2"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.7.0","status":"affected","fixed":"1.7.1"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.6.0","status":"affected","fixed":"1.6.2"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.5.0","status":"affected","fixed":"1.5.2"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.4.0","status":"affected","fixed":"1.4.1"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.3.0","status":"affected","fixed":"1.3.3"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.2.0","status":"affected","fixed":"1.2.2"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.1.0","status":"affected","fixed":"1.1.1"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.0.1"}],"ecosystem":"RubyGems","package":"phlex","purl":"pkg:gem/phlex","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.0.1"},{"status":"affected","introduced":"1.2.0","fixed":"1.2.2"},{"status":"affected","introduced":"1.3.0","fixed":"1.3.3"},{"status":"affected","version":"1.1.0"},{"status":"affected","version":"1.4.0"},{"status":"affected","version":"1.7.0"},{"status":"affected","version":"1.9.0"}],"vendor":"phlex","product":"phlex","cpe":"cpe:2.3:a:phlex:phlex:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/phlex-ruby/phlex/security/advisories/GHSA-242p-4v39-2v8g","tags":["patch","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/phlex-ruby/phlex/commit/aa50c604cdee1d0ce7ef068a4c66cbd5d43f96a1","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy","tags":["technical-description","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline","tags":["technical-description","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-28199","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/phlex-ruby/phlex","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/phlex/CVE-2024-28199.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-03-12T15:49:25.218Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-28199","url":"https://www.cve.org/CVERecord?id=CVE-2024-28199","licence":"CVE Terms of Use","modified":"2024-08-02T00:48:49.443Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-242p-4v39-2v8g","url":"https://github.com/advisories/GHSA-242p-4v39-2v8g","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.390Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-28199","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-28199","licence":"Public domain","modified":"2026-06-17T07:21:11.490Z"}],"updatedAt":"2026-11-25T22:58:37.422Z","epss":{"score":0.00604,"percentile":0.5026,"date":"2026-12-01T12:00:22.000Z"}}