/** * Copyright (c) 2025 Ofri Peretz * Licensed under the MIT License. Use of this source code is governed by the * MIT license that can be found in the LICENSE file. */ /** * ESLint Rule: no-redos-vulnerable-regex * Detects ReDoS-vulnerable regex patterns in literal regex patterns * CWE-400: Uncontrolled Resource Consumption * * Complements detect-non-literal-regexp by checking literal regex patterns * * @see https://cwe.mitre.org/data/definitions/400.html * @see https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS */ import type { TSESLint } from '@interlace/eslint-devkit'; type MessageIds = 'redosVulnerable' | 'useAtomicGroups' | 'usePossessiveQuantifiers' | 'restructureRegex' | 'useSafeLibrary'; export interface Options { /** Allow certain common patterns. Default: false */ allowCommonPatterns?: boolean; /** Maximum pattern length to analyze. Default: 500 */ maxPatternLength?: number; } type RuleOptions = [Options?]; export declare const noRedosVulnerableRegex: TSESLint.RuleModule & { name: string; }; export {};