Skip to content

🛡️ Sentinel: [CRITICAL] Fix ReDoS vulnerability in HTML parsing - #32

Merged
miccy merged 2 commits into
v1.3.1from
sentinel-fix-redos-vulnerability-12946479876812775106
Aug 20, 2026
Merged

🛡️ Sentinel: [CRITICAL] Fix ReDoS vulnerability in HTML parsing#32
miccy merged 2 commits into
v1.3.1from
sentinel-fix-redos-vulnerability-12946479876812775106

Conversation

@miccy

@miccy miccy commented Aug 20, 2026

Copy link
Copy Markdown
Owner

🚨 Severity: CRITICAL
💡 Vulnerability: A Regular Expression Denial of Service (ReDoS) vulnerability was identified in packages/github/src/index.ts due to complex, greedy regular expressions used for HTML parsing.
🎯 Impact: Attackers could potentially stall or crash the application by supplying malformed HTML strings that trigger catastrophic backtracking in the regular expressions. Additionally, O(N^2) complexity logic caused further performance hits when evaluating large data sets.
🔧 Fix: Refactored parseContributionCalendar to use a safe two-pass parsing pattern and replaced O(N^2) deduplication array logic with Map for O(N) evaluation. Documented in .jules/sentinel.md.
✅ Verification: bun test passes successfully for packages/github, and bun run test + bun run check execute without error, ensuring regressions were not introduced.

🚨 Severity: CRITICAL
💡 Vulnerability: A Regular Expression Denial of Service (ReDoS) vulnerability was identified in `packages/github/src/index.ts` due to complex, greedy regular expressions used for HTML parsing.
🎯 Impact: Attackers could potentially stall or crash the application by supplying malformed HTML strings that trigger catastrophic backtracking in the regular expressions. Additionally, O(N^2) complexity logic caused further performance hits when evaluating large data sets.
🔧 Fix: Refactored `parseContributionCalendar` to use a safe two-pass parsing pattern and replaced O(N^2) deduplication array logic with `Map` for O(N) evaluation. Documented in `.jules/sentinel.md`.
✅ Verification: `bun test` passes successfully for packages/github, and `bun run test` + `bun run check` execute without error, ensuring regressions were not introduced.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 767b691b-645c-4d49-9074-b7b826a8f217

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4ff7e3f4c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const daysMap = new Map<string, { date: string; level: number; count?: number }>();

// First isolate td tags
const tdPattern = /<td[^>]+>/g;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid quadratic scanning of unterminated td tags

If the fetched HTML is malformed or adversarial and contains many <td prefixes without a closing >, this unanchored pattern scans the remaining input from every prefix, so parsing remains O(N²) and can still stall the process—the denial-of-service behavior this change is intended to remove. Isolate tags with a single-pass parser or otherwise ensure each input character is examined only a bounded number of times.

Useful? React with 👍 / 👎.

…76812775106

Signed-off-by: Miccy <support@miccy.dev>
@miccy
miccy merged commit c48141e into v1.3.1 Aug 20, 2026
3 checks passed
@miccy
miccy deleted the sentinel-fix-redos-vulnerability-12946479876812775106 branch August 20, 2026 12:32
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