You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
12
12
- No changes yet.
13
13
14
-
## [3.1.0] - 2026-04-01
14
+
## [3.1.0] - 2026-04-02
15
+
16
+
### Security
17
+
18
+
-**CLI: Path traversal protection** — `type-generator`, `swagger-generator`, and `ddd-boilerplate` now validate output paths are within `process.cwd()` via `assertSafeOutputPath()`. Prevents writing files outside the working directory.
19
+
-**CLI: SSRF redirect protection** — `assertResponseUrl()` re-validates the final URL after `fetch()` follows redirects. Prevents redirect-based SSRF from landing on internal/insecure hosts.
20
+
-**CLI: Response size limit** — `readResponseWithLimit()` enforces a 50 MB cap on response bodies for all CLI fetches. Prevents OOM from malicious or misconfigured endpoints.
21
+
-**CLI: Recursion depth limits** — Type inference (`type-generator`) and OpenAPI schema resolution (`swagger-generator`) are now capped at 20 levels of depth, with circular `$ref` detection. Prevents stack overflow from deeply nested or cyclic schemas.
22
+
-**SafeSerialization: Prototype pollution defense** — `safeSerialize()` now skips `__proto__`, `constructor`, and `prototype` keys during object traversal.
23
+
-**SafeSerialization: Stack trace redaction** — Error objects serialized via `safeSerialize()` no longer include `stack` traces, preventing filesystem path leakage.
24
+
-**RequestCache: ReDoS prevention** — `patternToRegex()` now uses bounded character classes (`[^?#]*`) instead of greedy `.*`, preventing catastrophic backtracking on crafted cache keys.
25
+
-**Debounce/Throttle: Race condition fix** — Both utilities now track a `generation` counter to prevent stale promise resolution when rapid re-invocations race with pending async work.
26
+
27
+
### Added
28
+
29
+
-`assertSafeOutputPath(output)` — Validates and resolves output paths within `cwd`.
30
+
-`assertResponseUrl(response, purpose)` — Post-redirect URL validation for fetch responses.
31
+
-`readResponseWithLimit(response, maxBytes?)` — Byte-limited response body reader with streaming support.
32
+
-`MAX_CLI_RESPONSE_BYTES` constant (50 MB).
33
+
-`RequestQueue`: `maxQueueSize` option to cap queued tasks (default: `Infinity`).
34
+
-`RequestBatcher`: `maxPending` option to cap pending batch items (default: `Infinity`).
35
+
- 20 new security-specific tests covering all hardening features (`tests/security-hardening.test.ts`).
36
+
37
+
### Tests
38
+
39
+
- Restored **100% coverage** (statements, branches, functions, lines) across all 47 source files:
40
+
- Added tests for `createSensitiveKeySet()` default args, anonymous function name fallback, `Object.create(null)` depth limit, and 22-level deep JSON for `inferInlineType` depth guard.
41
+
- Applied `/* v8 ignore start/end */` to genuinely unreachable branches (`inferType` undefined/depth guards in type-generator, `catch` clause in `ApiClient.toString()`, proto-key guards in `DiffUtils` and `UrlHelper`).
0 commit comments