🚨 [security] [ruby] Update rails-html-sanitizer: 1.4.2 → 1.4.3 (patch)
This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!
Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.
What changed?
↗ ️ rails-html-sanitizer (indirect, 1.4.2 → 1.4.3) · Repo · Changelog
Security Advisories 🚨
🚨 Possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer
There is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer.
This vulnerability has been assigned the CVE identifier CVE-2022-32209.Versions Affected: ALL
Not affected: NONE
Fixed Versions: v1.4.3Impact
A possible XSS vulnerability with certain configurations of
Rails::Html::Sanitizer may allow an attacker to inject content if the
application developer has overridden the sanitizer's allowed tags to allow
bothselectandstyleelements.Code is only impacted if allowed tags are being overridden. This may be done via application configuration:
# In config/application.rb config.action_view.sanitized_allowed_tags = ["select", "style"]see https://guides.rubyonrails.org/configuring.html#configuring-action-view
Or it may be done with a
:tagsoption to the Action View helpersanitize:<%= sanitize @comment.body, tags: ["select", "style"] %>see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize
Or it may be done with Rails::Html::SafeListSanitizer directly:
# class-level option Rails::Html::SafeListSanitizer.allowed_tags = ["select", "style"]or
# instance-level option Rails::Html::SafeListSanitizer.new.sanitize(@article.body, tags: ["select", "style"])All users overriding the allowed tags by any of the above mechanisms to include both "select" and "style" should either upgrade or use one of the workarounds immediately.
Releases
The FIXED releases are available at the normal locations.
Workarounds
Remove either
selectorstylefrom the overridden allowed tags.Credits
This vulnerability was responsibly reported by windshock.
Release Notes
1.4.3
1.4.3 / 2022-06-09
Address a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer.
Prevent the combination of
selectandstyleas allowed tags in SafeListSanitizer.Fixes CVE-2022-32209
Mike Dalessio
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 10 commits:
version bump to v1.4.3update CHANGELOG for v1.4.3Merge pull request #137 from rails/flavorjones-prevent-select-style-combination_v1.4.xfix: modify safelist option if it contains both `select` and `style`test: clean up tests by using the helperstest: ensure we pass with libxml 2.9.14test: ensure tests pass when nokogiri uses system libxml2ci: add coverage for system libxml2ci: include coverage of ruby 3.1 and jruby 9.3test: finally use the CSS hex encoding originally intended
↗ ️ loofah (indirect, 2.15.0 → 2.18.0) · Repo · Changelog
Release Notes
2.18.0
2.18.0 / 2022-05-11
Features
2.17.0
2.17.0 / 2022-04-28
Features
- Allow ARIA attributes. [#232, #233] (Thanks, @nick-desteffen!)
2.16.0
2.16.0 / 2022-04-01
Features
- Allow MathML elements
mencloseandms, and MathML attributesdir,href,lquote,mathsize,notation, andrquote. [#231] (Thanks, @nick-desteffen!)
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 15 commits:
version bump to v2.18.0Merge pull request #237 from flavorjones/flavorjones-fix-2.5-cici: do not fail fastMerge pull request #236 from louim/patch-1Add aspect-ratio to the list of css propertiesupdate README to remove pledgie linkMerge pull request #235 from flavorjones/flavorjones-update-tests-for-libxml_2_9_14test: ensure we pass with libxml 2.9.14version bump to 2.17.0Merge pull request #233 from flavorjones/flavorjones-aria-attributesfeat: add the remaining aria attributes and an ad-hoc testAdds ARIA attributesversion bump to v2.16.0Merge pull request #231 from watermelonexpress/mathml-updatesAdds menclose and ms MathML elements and supported attributes
↗ ️ nokogiri (indirect, 1.13.4 → 1.13.6) · Repo · Changelog
Security Advisories 🚨
🚨 Improper Handling of Unexpected Data Type in Nokogiri
Summary
Nokogiri
< v1.13.6does not type-check all inputs into the XML and HTML4 SAX parsers.
For CRuby users, this may allow specially crafted untrusted inputs to cause illegal
memory access errors (segfault) or reads from unrelated memory.Severity
The Nokogiri maintainers have evaluated this as High 8.2 (CVSS3.1).
Mitigation
CRuby users should upgrade to Nokogiri
>= 1.13.6.JRuby users are not affected.
Workarounds
To avoid this vulnerability in affected applications, ensure the untrusted input is a
Stringby calling#to_sor equivalent.
🚨 Integer Overflow or Wraparound in libxml2 affects Nokogiri
Summary
Nokogiri v1.13.5 upgrades the packaged version of its dependency libxml2 from
v2.9.13 to v2.9.14.libxml2 v2.9.14 addresses CVE-2022-29824.
This version also includes several security-related bug fixes for which CVEs were not created,
including a potential double-free, potential memory leaks, and integer-overflow.Please note that this advisory only applies to the CRuby implementation of Nokogiri
< 1.13.5, and only if the packaged libraries are being used. If you've overridden
defaults at installation time to use system libraries instead of packaged libraries,
you should instead pay attention to your distro'slibxml2andlibxsltrelease announcements.Mitigation
Upgrade to Nokogiri
>= 1.13.5.Users who are unable to upgrade Nokogiri may also choose a more complicated mitigation:
compile and link Nokogiri against external libraries libxml2>= 2.9.14which will also
address these same issues.Impact
libxml2 CVE-2022-29824
- CVSS3 score:
- Unspecified upstream
- Nokogiri maintainers evaluate at 8.6 (High) (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H). Note that this is different from the CVSS assessed by NVD.
- Type: Denial of service, information disclosure
- Description: In libxml2 before 2.9.14, several buffer handling functions in buf.c (xmlBuf*) and tree.c (xmlBuffer*) don't check for integer overflows. This can result in out-of-bounds memory writes. Exploitation requires a victim to open a crafted, multi-gigabyte XML file. Other software using libxml2's buffer functions, for example libxslt through 1.1.35, is affected as well.
- Fixed: https://gitlab.gnome.org/GNOME/libxml2/-/commit/2554a24
All versions of libml2 prior to v2.9.14 are affected.
Applications parsing or serializing multi-gigabyte documents (in excess of INT_MAX bytes) may be vulnerable to an integer overflow bug in buffer handling that could lead to exposure of confidential data, modification of unrelated data, or a segmentation fault resulting in a denial-of-service.
References
Release Notes
1.13.6
1.13.6 / 2022-05-08
Security
- [CRuby] Address CVE-2022-29181, improper handling of unexpected data types, related to untrusted inputs to the SAX parsers. See GHSA-xh29-r2w5-wx8m for more information.
Improvements
{HTML4,XML}::SAX::{Parser,ParserContext}constructor methods now raiseTypeErrorinstead of segfaulting when an incorrect type is passed.
sha256:
58417c7c10f78cd1c0e1984f81538300d4ea98962cfd3f46f725efee48f9757a nokogiri-1.13.6-aarch64-linux.gem a2b04ec3b1b73ecc6fac619b41e9fdc70808b7a653b96ec97d04b7a23f158dbc nokogiri-1.13.6-arm64-darwin.gem 4437f2d03bc7da8854f4aaae89e24a98cf5c8b0212ae2bc003af7e65c7ee8e27 nokogiri-1.13.6-java.gem 99d3e212bbd5e80aa602a1f52d583e4f6e917ec594e6aa580f6aacc253eff984 nokogiri-1.13.6-x64-mingw-ucrt.gem a04f6154a75b6ed4fe2d0d0ff3ac02f094b54e150b50330448f834fa5726fbba nokogiri-1.13.6-x64-mingw32.gem a13f30c2863ef9e5e11240dd6d69ef114229d471018b44f2ff60bab28327de4d nokogiri-1.13.6-x86-linux.gem 63a2ca2f7a4f6bd9126e1695037f66c8eb72ed1e1740ef162b4480c57cc17dc6 nokogiri-1.13.6-x86-mingw32.gem 2b266e0eb18030763277b30dc3d64337f440191e2bd157027441ac56a59d9dfe nokogiri-1.13.6-x86_64-darwin.gem 3fa37b0c3b5744af45f9da3e4ae9cbd89480b35e12ae36b5e87a0452e0b38335 nokogiri-1.13.6-x86_64-linux.gem b1512fdc0aba446e1ee30de3e0671518eb363e75fab53486e99e8891d44b8587 nokogiri-1.13.6.gem
1.13.5
1.13.5 / 2022-05-04
Security
- [CRuby] Vendored libxml2 is updated to address CVE-2022-29824. See GHSA-cgx6-hpwq-fhv5 for more information.
Dependencies
- [CRuby] Vendored libxml2 is updated from v2.9.13 to v2.9.14.
Improvements
- [CRuby] The libxml2 HTML4 parser no longer exhibits quadratic behavior when recovering some broken markup related to start-of-tag and bare
<characters.Changed
- [CRuby] The libxml2 HTML4 parser in v2.9.14 recovers from some broken markup differently. Notably, the XML CDATA escape sequence
<![CDATA[and incorrectly-opened comments will result in HTML text nodes starting with<!instead of skipping the invalid tag. This behavior is a direct result of the quadratic-behavior fix noted above. The behavior of downstream sanitizers relying on this behavior will also change. Some tests describing the changed behavior are intest/html4/test_comments.rb.
sha256sum:
aa1bfd0fd0b33110729d4a063b7b02de9419c559eb48a1f8940b74fc638d60ea nokogiri-1.13.5-aarch64-linux.gem d0b872786d6c2b44c10a389e585a77c07274a2b5e7211a470f76909c0711f218 nokogiri-1.13.5-arm64-darwin.gem 3f1434c198f0daf46d24c4696a53504beb69b8c15efe0548a7aa17a8378be21d nokogiri-1.13.5-java.gem 0e60dc107c7e289dd3817acff14a12c9f4447a994a2411f772d6dd1220a35ae6 nokogiri-1.13.5-x64-mingw-ucrt.gem c9897dd7236738d260b66ac99ea93950fd3a6375f11a9927bf345eec4ec1fde6 nokogiri-1.13.5-x64-mingw32.gem a81586845f99a16a85586717b0051ce1508a68722a56486582ab09b3255d3b17 nokogiri-1.13.5-x86-linux.gem e2abaef3af396adee3b0995693d5e690eb826782f7ecddf8b1b6a5a706075cff nokogiri-1.13.5-x86-mingw32.gem 19360ba28f31562691926d1c542c783fc0ed5f2a145f1329206f8c09e46a85ea nokogiri-1.13.5-x86_64-darwin.gem a598598163233ee907472808c0bc7ae4354999e77409e1711b61406066a7afb4 nokogiri-1.13.5-x86_64-linux.gem e15570ec6d46921a3de5f5b057b027cc0c4f32775353c00e8c8dfbe443741e78 nokogiri-1.13.5.gem
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 11 commits:
version bump to v1.13.6Merge pull request #2530 from sparklemotion/flavorjones-check-parse-memory-types_v1.13.xfix: {HTML4,XML}::SAX::{Parser,ParserContext} check arg typesversion bump to v1.13.5doc: update CHANGELOG for v1.13.5Merge pull request #2527 from sparklemotion/2525-update-libxml-2_9_14-v1_13_xdep: update libxml2 to v2.9.14test: unpend the LIBXML_LOADED_VERSION test on freebsddev: require yamlstyle(rubocop): pend Style/FetchEnvVar for nowstyle(rubocop): Style/RedundantInitialize is smarter now
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
- @depfu rebase
- Rebases against your default branch and redoes this update
- @depfu recreate
- Recreates this PR, overwriting any edits that you've made to it
- @depfu merge
- Merges this PR once your tests are passing and conflicts are resolved
- @depfu close
- Closes this PR and deletes the branch
- @depfu reopen
- Restores the branch and reopens this PR (if it's closed)
- @depfu pause
- Ignores all future updates for this dependency and closes this PR
- @depfu pause [minor|major]
- Ignores all future minor/major updates for this dependency and closes this PR
- @depfu resume
- Future versions of this dependency will create PRs again (leaves this PR as is)