Skip to content

AC-940 fix forest-express-sequelize ReDoS finding - #1143

Open
AlexandreFauchard wants to merge 2 commits into
ForestAdmin:mainfrom
kezios:feature/ac-940-medium-forest-express-sequelize-1-vulnerabilities
Open

AC-940 fix forest-express-sequelize ReDoS finding#1143
AlexandreFauchard wants to merge 2 commits into
ForestAdmin:mainfrom
kezios:feature/ac-940-medium-forest-express-sequelize-1-vulnerabilities

Conversation

@AlexandreFauchard

@AlexandreFauchard AlexandreFauchard commented May 29, 2026

Copy link
Copy Markdown

Summary

  • Fixes AC-948 by replacing dynamic RegExp construction in record search decoration with case-insensitive literal substring matching.
  • Preserves escaped-regex behavior for literal user search strings while avoiding non-literal regex evaluation.

Test plan

  • yarn install --frozen-lockfile
  • yarn lint (passes with existing warnings)
  • yarn build
  • Focused Node smoke test for literal search containing regex metacharacters
  • yarn test --runInBand (fails: existing DB connection failures for integration suites and unrelated query-options failures)

Made with Cursor

Note

Fix ReDoS vulnerability in decorateForSearch by replacing regex matching with toLowerCase().includes

  • Replaces regex-based case-insensitive matching in records-decorator.js with a hasCaseInsensitiveMatch helper that uses toLowerCase().includes, eliminating the ReDoS risk from user-controlled search strings being passed to new RegExp.
  • Also fixes search-builder.js so that smart field search handlers can return a modified query object; the returned value is now reassigned and passed forward instead of being discarded.

Macroscope summarized ab7525d.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants