@astralkit/cli 4.6.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/lib/validators.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to the `@astralkit/cli` package.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [4.6.2] — 2026-10-14
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Install Next.js catch-all and optional catch-all routes used by authentication boosters. Dots within route names no longer trigger the directory-traversal guard.
|
|
12
|
+
- Continue rejecting parent-directory traversal with either slash convention, absolute paths, Windows drive-relative paths and null bytes. Existing route files remain preserved by create-if-missing merges.
|
|
13
|
+
|
|
8
14
|
## [4.6.1] — 2026-10-11
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/package.json
CHANGED
package/src/lib/validators.js
CHANGED
|
@@ -97,8 +97,12 @@ export function isSafePath(basedir, filepath) {
|
|
|
97
97
|
*/
|
|
98
98
|
export function isSafeInstallDir(cwd, requestedDir) {
|
|
99
99
|
if (typeof requestedDir !== 'string' || !requestedDir) return false;
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// Check both separator conventions on every host. Next.js catch-all route
|
|
101
|
+
// names contain dots ([[...slug]]), but only a complete '..' segment is
|
|
102
|
+
// traversal. Reject drive-relative paths too (C:foo on Windows).
|
|
103
|
+
if (path.posix.isAbsolute(requestedDir) || path.win32.isAbsolute(requestedDir)) return false;
|
|
104
|
+
if (/^[a-z]:/i.test(requestedDir) || requestedDir.includes('\0')) return false;
|
|
105
|
+
if (requestedDir.split(/[\\/]/).includes('..')) return false;
|
|
102
106
|
const resolved = path.resolve(cwd, requestedDir);
|
|
103
107
|
const relative = path.relative(cwd, resolved);
|
|
104
108
|
return !relative.startsWith('..') && !path.isAbsolute(relative);
|