Skip to content

fix(kernel): eliminate ReDoS backtracking in PDF token regex (CodeQL #116) - #2694

Merged
abrichr merged 1 commit into
mainfrom
fix/kernel-oracles-redos
Nov 25, 2026
Merged

abrichr merged 1 commit into
mainfrom
fix/kernel-oracles-redos

Conversation

@abrichr

@abrichr abrichr commented Nov 25, 2026

Copy link
Copy Markdown
Member

Fixes CodeQL alert #116 (py/redos) on packages/kernel/src/openadapt_kernel/oracles.py:26.

  • Exclude \\ from the negated character class in the TJ array branch ([^\\\[\]] instead of [^\[\]]), matching the (...) branch so \\. and the non-escape character class are mutually exclusive and run in strict linear time O(N).
  • Verified with the full packages/kernel pytest suite and a 50k-backslash adversarial input.

@abrichr
abrichr enabled auto-merge November 25, 2026 17:34
@abrichr
abrichr added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit f3a6b1f Nov 25, 2026
41 checks passed
@abrichr
abrichr deleted the fix/kernel-oracles-redos branch November 25, 2026 18:31
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.

1 participant