G
YouTube TikTok Games
Skip to content

fix(security): charge pop filter allocation to memoryLimit - #907

Merged
harttle merged 2 commits into
masterfrom
fix/pop-filter-memory-limit
Jun 14, 2026
Merged

harttle merged 2 commits into
masterfrom
fix/pop-filter-memory-limit

Conversation

@harttle

@harttle harttle commented Jun 14, 2026

Copy link
Copy Markdown
Owner

The pop array filter cloned the input via [...toArray(v)] without charging this.context.memoryLimit.use(...), bypassing the memoryLimit DoS guard that its sibling filters (shift, unshift, compact, etc.) apply. Mirror shift to account for the O(N) allocation.

The `pop` array filter cloned the input via `[...toArray(v)]` without
charging `this.context.memoryLimit.use(...)`, bypassing the memoryLimit
DoS guard that its sibling filters (shift, unshift, compact, etc.) apply.
Mirror `shift` to account for the O(N) allocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@harttle harttle changed the title fix(security): charge pop filter allocation to memoryLimit (CWE-770) fix(security): charge pop filter allocation to memoryLimit Jun 14, 2026
@coveralls

coveralls commented Jun 14, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 27492309498

Coverage remained the same at 99.543%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 5 of 5 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3018
Covered Lines: 3011
Line Coverage: 99.77%
Relevant Branches: 1143
Covered Branches: 1131
Branch Coverage: 98.95%
Branches in Coverage %: Yes
Coverage Strength: 22602.75 hits per line

💛 - Coveralls

…mit (CWE-770)

Co-authored-by: Cursor <cursoragent@cursor.com>
@harttle
harttle merged commit 8a0c74a into master Jun 14, 2026
13 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 23, 2026
## [10.27.1](v10.27.0...v10.27.1) (2026-06-23)

### Bug Fixes

* improve round function; improvement to [#873](#873) ([#901](#901)) ([956b51e](956b51e))
* **security:** charge pop filter allocation to memoryLimit ([#907](#907)) ([8a0c74a](8a0c74a))
* **strip_html:** infinite loop for strip_html ([5c3522f](5c3522f))

### Performance Improvements

* **parser:** memoize createTrie to avoid rebuilding tries per Tokenizer ([#911](#911)) ([3a0d80d](3a0d80d))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 10.27.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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