GitNexus/gitnexus/test
Rin 6a8947217c
fix(server): sanitize repo name to prevent argument injection (#1305)
* fix(server): sanitize repo name to prevent argument injection

Sanitizes the extracted repository name to prevent argument injection during git clone operations and ensures compatibility with various file systems.

1. Strips leading dashes to prevent git command-line argument injection.

2. Replaces unsafe directory characters with underscores.

3. Blocks path traversal segments ('.' and '..') and Windows reserved names.

4. Fixes ReDoS vulnerability in parseRepoNameFromUrl regex.

5. Added unit tests for sanitization and path traversal edge cases.

* fix(server): expand Windows reserved name check to include extensions

- Updated sanitizeRepoName to block Windows reserved names (CON, NUL, etc.) even when they have extensions (e.g., CON.txt).
- Corrected regex and added unit tests for these edge cases to resolve CI failures on Windows.
- Ref: https://github.com/abhigyanpatwari/GitNexus/pull/1305#issuecomment-4407200914

---------

Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
2026-05-11 09:38:07 +01:00
..
fixtures feat: migrate C to scope-based resolution (RFC #909 Ring 3) (#1481) 2026-05-11 09:02:00 +01:00
helpers fix(windows): 32767-char tree-sitter crash + VECTOR extension SIGSEGV (#1433) 2026-05-10 16:00:36 +01:00
integration feat: migrate C to scope-based resolution (RFC #909 Ring 3) (#1481) 2026-05-11 09:02:00 +01:00
unit fix(server): sanitize repo name to prevent argument injection (#1305) 2026-05-11 09:38:07 +01:00
utils ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00