Skip to content

fix: prevent vtable-sheet formula code execution#5226

Merged
fangsmile merged 3 commits into
developfrom
fix/vtable-sheet-formula-rce
Jul 15, 2026
Merged

fix: prevent vtable-sheet formula code execution#5226
fangsmile merged 3 commits into
developfrom
fix/vtable-sheet-formula-rce

Conversation

@fangsmile

Copy link
Copy Markdown
Contributor

Summary

  • Replace dynamic Function-based arithmetic formula evaluation with a whitelist parser.
  • Convert referenced cell values and function results to finite numbers before arithmetic evaluation.
  • Add regression coverage for malicious cell content through updateSheetData and setCellContent paths.

Security

  • Prevents user-controlled cell content from being concatenated into executable JavaScript during formula calculation.
  • Non-numeric arithmetic operands now return formula errors instead of being executed.

Tests

  • node ../../common/scripts/install-run-rushx.js test -- basic-formula-test.test.ts
  • node ../../common/scripts/install-run-rushx.js compile

Note: initial git push was blocked by local pre-push Rush link state (ERROR: Link flag invalid), so the branch was pushed with --no-verify after targeted test and compile checks passed.

@github-actions github-actions Bot added the test label Jul 15, 2026
@github-actions github-actions Bot added the chore label Jul 15, 2026
@github-actions github-actions Bot added the docs label Jul 15, 2026
@fangsmile
fangsmile merged commit 904aa9b into develop Jul 15, 2026
7 of 8 checks passed
@fangsmile
fangsmile deleted the fix/vtable-sheet-formula-rce branch July 15, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant