Skip to content

fix: validate buffer bounds in geometry parser#4159

Merged
wellwelwel merged 2 commits intosidorares:masterfrom
wellwelwel:geo
Mar 8, 2026
Merged

fix: validate buffer bounds in geometry parser#4159
wellwelwel merged 2 commits intosidorares:masterfrom
wellwelwel:geo

Conversation

@wellwelwel
Copy link
Collaborator

@wellwelwel wellwelwel commented Mar 8, 2026

parseGeometryValue now checks remaining buffer length before each read.

Malformed geometry payloads with inflated point/ring counts previously caused uncaught RangeError crashes and now return null.

  • Just a TOC: I resolved all // eslint-disable-next-line no-case-declarations comments in parseGeometryValue 🙋🏻‍♂️

cc @peaktwilight, please see also 7c2ae00 🤝

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.41%. Comparing base (1490783) to head (65a5dc4).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4159      +/-   ##
==========================================
+ Coverage   90.40%   90.41%   +0.01%     
==========================================
  Files          86       86              
  Lines       13954    13977      +23     
  Branches     1705     1728      +23     
==========================================
+ Hits        12615    12638      +23     
  Misses       1339     1339              
Flag Coverage Δ
compression-0 89.66% <100.00%> (+0.01%) ⬆️
compression-1 90.39% <100.00%> (+0.01%) ⬆️
static-parser-0 88.05% <100.00%> (+0.01%) ⬆️
static-parser-1 88.80% <100.00%> (+0.01%) ⬆️
tls-0 89.84% <100.00%> (+0.01%) ⬆️
tls-1 90.19% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wellwelwel wellwelwel marked this pull request as ready for review March 8, 2026 18:48
@wellwelwel wellwelwel merged commit 7c2ae00 into sidorares:master Mar 8, 2026
130 of 133 checks passed
@wellwelwel wellwelwel deleted the geo branch March 8, 2026 18:54
@peaktwilight
Copy link

@wellwelwel awesome thanks for fixing it! If you need help with fixing the rest the findings I mentioned by email, I'll gladly help out :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants