@mandujs/core 0.54.26 → 0.54.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/core",
3
- "version": "0.54.26",
3
+ "version": "0.54.27",
4
4
  "description": "Mandu Framework Core - Spec, Generator, Guard, Runtime",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -56,6 +56,8 @@ const DEFAULT_OPTIONS: Required<NetworkProxyOptions> = {
56
56
  ignorePatterns: [
57
57
  // DevTools 자체 요청
58
58
  /__mandu/,
59
+ // DevTools 에러 리포트 엔드포인트 (자기추적/피드백 루프 방지)
60
+ /__kitchen/,
59
61
  // HMR
60
62
  /__vite/,
61
63
  /\.hot-update\./,
@@ -174,11 +174,22 @@ export class SourceContextProvider {
174
174
  * 안전한 경로 확인 (Path Traversal 방지)
175
175
  */
176
176
  private resolveSafePath(file: string): string | null {
177
+ // Reject absolute inputs outright: path.resolve(root, "/etc/passwd")
178
+ // returns "/etc/passwd", escaping the project root.
179
+ if (path.isAbsolute(file)) {
180
+ return null;
181
+ }
182
+
177
183
  const absolutePath = path.resolve(this.options.projectRoot, file);
178
184
  const normalizedRoot = path.normalize(this.options.projectRoot);
179
-
180
- // 확인된 경로가 프로젝트 루트 내에 있는지 확인
181
- if (!absolutePath.startsWith(normalizedRoot)) {
185
+ // Compare with a trailing separator so a sibling sharing the root's
186
+ // prefix (e.g. "/app/project-secrets" vs root "/app/project") is NOT
187
+ // treated as inside the root. Allow the root itself.
188
+ const rootWithSep = normalizedRoot.endsWith(path.sep)
189
+ ? normalizedRoot
190
+ : normalizedRoot + path.sep;
191
+
192
+ if (absolutePath !== normalizedRoot && !absolutePath.startsWith(rootWithSep)) {
182
193
  return null;
183
194
  }
184
195
 
@@ -245,6 +245,8 @@ export class WorkerManager {
245
245
  { source: '[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}', label: 'EMAIL' },
246
246
  { source: '\\\\+?[1-9]\\\\d{1,14}', label: 'PHONE' },
247
247
  { source: '\\\\b(?:\\\\d{1,3}\\\\.){3}\\\\d{1,3}\\\\b', label: 'IP' },
248
+ { source: '\\\\b(?:\\\\d{4}[- ]?){3}\\\\d{4}\\\\b', label: 'CARD' },
249
+ { source: '\\\\b\\\\d{3}-\\\\d{2}-\\\\d{4}\\\\b', label: 'SSN' },
248
250
  ];
249
251
 
250
252
  function applyPattern(text, pattern) {