mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
Address findings from automated security review: 1. Validate rootPath via validatePath/isPathAccessible before recursing, matching the pattern used by read-file/write-file. 2. Cap query length at 1024 chars to bound regex compilation cost. 3. Reject regexes matching classic ReDoS shapes (nested quantifiers and similar) before invoking RegExp. 4. Use realpathSync to resolve symlinks and verify containment under rootPath; drop symlinks that point outside the search root. 5. Cap total files traversed at 10000, in addition to existing 1000-result and 2MB-per-file caps. Add regression tests for each guard.