Security fix for CVE-2025-12735, CVE-2025-13204, and member function bypass#6
Conversation
…silentmatt#289 - Block arbitrary function calls passed via evaluation context - Block prototype pollution via __proto__, prototype, constructor access - Block member function call bypass vulnerability - Allow inline-defined functions (IFUNDEF) as they are safe - Allow registered functions in parser.functions - Allow safe Math functions (sin, cos, sqrt, etc.) - Update tests to use secure function registration pattern - Add comprehensive security test suite Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
…counter-based keys for inline functions - Add validateAllowedFunction check in IFUNCALL handler to prevent bypassing security - Use monotonically increasing counter for inline function keys instead of user-controlled names - Prevent collision attacks on inline function registration Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
|
@copilot Please update the tests accordingly and document breaking changes in BREAKING_CHANGES.md |
…KING_CHANGES.md - Update remaining 2 tests in operators-logical.ts to register functions in parser.functions - Add comprehensive BREAKING_CHANGES.md documenting security changes and migration guide Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Change empty function to return number to satisfy Value type constraint Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Done in fb3ddbb. Updated all tests to use the secure function registration pattern and added |
|
@copilot Breaking changes mentions Version 4.3.0 → 4.4.0, but I want the version to become 5.0.0 (according to semantic versioning) Also make sure the version number is updated in packages.json and that the lock file is updated accordingly. |
- Update package.json version from 4.2.0 to 5.0.0 - Update BREAKING_CHANGES.md to reference version 5.0.0 - Update package-lock.json accordingly Co-authored-by: Sander-Toonen <5106372+Sander-Toonen@users.noreply.github.com>
Done in 580430c. Updated version to 5.0.0 in package.json, BREAKING_CHANGES.md, and package-lock.json. |
Security Fix for CVE-2025-12735, CVE-2025-13204, and member function bypass
Addresses security vulnerabilities from silentmatt/expr-eval#288 and #290 that affect this fork.
Changes
__proto__,prototype,constructorin variable names and member expressionsparser.functions, safe Math builtins, or inline-defined functionsvalidateAllowedFunctioncheck before function invocationBreaking Change (v5.0.0)
Functions must be registered explicitly instead of passed via context. See BREAKING_CHANGES.md for migration guide.
Test Coverage
Verification
npm run type-checkpasses with no errorsOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.