Skip to content

v0.11.3

Latest

Choose a tag to compare

@marcoroth marcoroth released this 02 Dec 23:13
· 11 commits to main since this release
5341800

Important

Security: This release fixes GHSA-6jg4-2m63-p9xr, a cross-site scripting issue in the JavaScript escaper of Herb::Engine. ERB output inside a JavaScript template literal in a <script> element was not escaped for backticks and $, so a value could close the literal or run a ${...} expression. Versions 0.7.0 through 0.11.2 are affected.

Only applications that render templates with Herb::Engine directly are affected. ReActionView and Rails applications are not, since ReActionView leaves escaping to Action View. If you use Herb::Engine directly, upgrade to 0.11.3. See the advisory for details, detection steps and workarounds.

Thanks to the Artiphishell team for reporting this.

Engine

  • Escape backticks and $ in Herb::Engine.js (GHSA-6jg4-2m63-p9xr)
  • Escape block expressions like <%= helper do %> inside <script>, <style> and attribute values with the matching context escape function (GHSA-6jg4-2m63-p9xr)
  • Quote unquoted attribute values that contain ERB output, so the output can't add attributes
  • Remove redundant guard and keep parked statics within the template's lines by @Stiwyy in #2924

Parser

  • Fix two crashes in ActionView tag helper transforms by @marcoroth in #2945
  • Fix dot-notation tag names reading past the source by @marcoroth in #2946
  • Fix crash on ERB attribute names without a value by @marcoroth in #2947
  • Fix leaking the helper name of a void element helper with a block by @marcoroth in #2953
  • Fix dropped branches when case and its condition share an ERB tag by @marcoroth in #2954
  • Fix leaking the attributes of a tag.attributes call without static attributes by @marcoroth in #2956
  • Fix dropping the left side of || around an Action View helper by @marcoroth in #2958
  • Keep partial and locals of render with interpolated name by @marcoroth in #2959
  • Make the advice in render errors valid Ruby by @marcoroth in #2962

Ruby

  • Keep one line comments in extracted Ruby when the ERB tag is alone on its line by @radanskoric in #2789
  • Fix diffing elements with a conditional open tag by @marcoroth in #2948

Linter

Rule Updates

  • Check nested output and require outermost serialization in erb-no-unsafe-script-interpolation by @marcoroth in #2970
  • Fix erb-no-extra-newline autofix deleting the wrong character by @kataokatsuki in #2918
  • Fix erb-no-trailing-whitespace autofix at end of file by @davidenglishmusic in #2923
  • Fix html-no-duplicate-attributes false positives in loops by @htetwunsan in #2969
  • Don't flag adjacent string literals in actionview-no-dynamic-partial-path by @marcoroth in #2961
  • Use the framework option from global config by @palkan in #2922

Linter CLI

  • Disable the generic JS-to-WASM wrapper to avoid SIGILL in workers by @marcoroth in #2974

Formatter

Client

  • Read $value from the element that carries the action by @marcoroth in #2901
  • Send each copy of a partial its own state in server mode by @marcoroth in #2902
  • Ask the server on every change to a state a server-rendered conditional reads by @marcoroth in #2904

Dev Tools

Internals

  • C: Add AFL++ and libFuzzer fuzzers for the C library by @marcoroth in #2949
  • CI: Fuzz the C library every night with seeds from herb-corpus by @marcoroth in #2950
  • Linter: Test javascript_tag when only the config names Action View by @viktorianer in #2853
  • Linter: Use isPositionEqual instead of comparing line and column by hand by @marcoroth in #2938

Dependencies

New Contributors

Commits

Full Changelog: v0.11.2...v0.11.3