From 9e1dc75a616a7ac5b2804ffb2543303fb8cfdb43 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Wed, 7 Oct 2026 18:24:52 +0200 Subject: [PATCH] deps: parser v0.13.0, which bounds nested source instead of crashing on it main was on parser v0.11.1, so rbgo did NOT have the nesting limit even though it merged upstream two days ago. Deeply nested source still overflowed the Go stack here -- a fatal runtime error, not a panic, so recover() cannot contain it and the process dies. run.go calls parser.Parse as its FIRST statement, so a host that merely compiles untrusted Ruby was exposed without executing it. Worth saying why it was missed: parser v0.12.0 existed and looked like the newest release, but it was cut BEFORE the fix. `compare v0.11.1...v0.12.0` contains one commit, "build: raise the Go floor to 1.27.1", and nothing else; the nesting fix sat on the parser's main, one commit past that tag, untagged. A higher tag number is not the same as newer code. Tagged v0.13.0 for this. Measured through rbgo, with `x = ` + `f(`*N: depth 20000 60 KB parse error: nesting of 32769 is too deep exit 1 depth 70000 210 KB parse error: nesting of 32769 is too deep exit 1 depth 100000 300 KB parse error: nesting of 32769 is too deep exit 1 main, depth 100000 fatal error: stack overflow exit 2 20000 errors because `f(` is a 2x production -- 20000 levels is 40001 frames, past the 32768 ceiling. That is still well above anything MRI accepts: MRI refuses `f(`*8000 already, with a Prism SyntaxError. So nothing MRI would have parsed is newly rejected. Full suite green (internal/vm 206s), gofmt and vet clean. Refs go-ruby-parser/parser#48, go-embedded-ruby/ruby#768. Co-Authored-By: Claude Opus 5 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b0995e1c..3a6941c0 100644 --- a/go.mod +++ b/go.mod @@ -129,7 +129,7 @@ require ( github.com/go-ruby-pagy/pagy v0.0.0-20260717071719-997d15eee011 github.com/go-ruby-paper-trail/paper-trail v0.0.0-20260717071745-42a249656e5a github.com/go-ruby-parquet/parquet v0.0.0-20260923211642-bc75bcb9031e - github.com/go-ruby-parser/parser v0.11.1 + github.com/go-ruby-parser/parser v0.13.0 github.com/go-ruby-pathname/pathname v0.0.0-20260916100446-0824484b665f github.com/go-ruby-pg/pg v0.0.0-20260916100523-3831ec811a67 github.com/go-ruby-prawn/prawn v0.0.0-20260927145511-370d5985305c diff --git a/go.sum b/go.sum index 50ecea0a..f43c1add 100644 --- a/go.sum +++ b/go.sum @@ -533,8 +533,8 @@ github.com/go-ruby-paper-trail/paper-trail v0.0.0-20260717071745-42a249656e5a h1 github.com/go-ruby-paper-trail/paper-trail v0.0.0-20260717071745-42a249656e5a/go.mod h1:z370KNJcUH8n39yLdlT0Y1QvHukxjsq1XjGpIzvfqWE= github.com/go-ruby-parquet/parquet v0.0.0-20260923211642-bc75bcb9031e h1:pxhP3nIRxTpj99e74JAVpGj7JQtRSNqLb+B5x2WT5N4= github.com/go-ruby-parquet/parquet v0.0.0-20260923211642-bc75bcb9031e/go.mod h1:wC+J6qfQ8C0aKgi5qsbR03DYrLLuXXezUBHl967am/E= -github.com/go-ruby-parser/parser v0.11.1 h1:8gov5+nyKxY9NUTJI5sVvammrNOdJ32aylrASdjP2js= -github.com/go-ruby-parser/parser v0.11.1/go.mod h1:NRbX4dYcQ6CgcaSaMmu1dh95QuKGq+RdenUoWU73214= +github.com/go-ruby-parser/parser v0.13.0 h1:JspoqXWvdv1J1LSknUZmCKWwO5x1xT+1CbhFfRaEtNA= +github.com/go-ruby-parser/parser v0.13.0/go.mod h1:Se+ZvnD/4Vm0RRe1U5kZi0GmPSvSczJJXdZLiB0PlJY= github.com/go-ruby-pathname/pathname v0.0.0-20260916100446-0824484b665f h1:9pt89wlAp12vbCNGFYmbSqp/PJTHRwUx1yNDXW5hWRI= github.com/go-ruby-pathname/pathname v0.0.0-20260916100446-0824484b665f/go.mod h1:IvW5q5Kyl5l3hrYwiHylOEmk5hpGSo7XqcmUXBHF5H0= github.com/go-ruby-pg/pg v0.0.0-20260916100523-3831ec811a67 h1:X9MKhEAV60oYoL94tqb11lfLw3yW097mVqfjDdy5PK0=