Skip to content

fix(index): anchor unrtf path regex - #622

Merged
Fdawgs merged 1 commit into
mainfrom
fix/redos
Aug 27, 2026
Merged

Fdawgs merged 1 commit into
mainfrom
fix/redos

Conversation

@Fdawgs

@Fdawgs Fdawgs commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Anchored UNRTF_PATH_REG to the start of which/where output.

Prevents large, non-matching output from causing a minor ReDoS.

Checklist

Copilot AI lite review requested due to automatic review settings August 27, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The regex hardening change is not backed by a regression test (and the test helper still uses the pre-fix pattern), so regressions in this behavior could go unnoticed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR mitigates excessive regex backtracking when extracting the UnRTF binary directory from which/where output, reducing the risk of event-loop blocking from large non-matching strings.

Changes:

  • Anchors UNRTF_PATH_REG to the start of the string to avoid retrying the pattern at every input offset.
File summaries
File Description
src/index.js Anchors the UnRTF path-extraction regex to reduce backtracking work on non-matching input.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/index.js Resolved
@Fdawgs
Fdawgs merged commit b77ca2a into main Aug 27, 2026
18 checks passed
@Fdawgs
Fdawgs deleted the fix/redos branch August 27, 2026 07:00
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