Skip to content

fix(sourceconfig): reject unsafe source paths#76

Merged
samzong merged 1 commit into
mainfrom
fix/spec-source-path-traversal
Jun 26, 2026
Merged

fix(sourceconfig): reject unsafe source paths#76
samzong merged 1 commit into
mainfrom
fix/spec-source-path-traversal

Conversation

@samzong

@samzong samzong commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #18.

  • Reject unsafe source path values in specs/sources.yaml for Swagger, OpenAPI 3, GraphQL, and proto backends.
  • Add a sync-layer safeJoin guard before copying configured files or passing proto paths to protoc.
  • Cover all configured source path fields with focused validation tests.

Verification

  • make check
  • /pre-ship --committed manual gate: no MUST-FIX findings; sentinel written

Compatibility

Invalid source configs with absolute paths, parent traversal, or empty path segments now fail during load or sync. No generated command shape, catalog schema, auth, body, output, or generated code changes.

Checklist

  • Tests or focused verification cover the changed surface.
  • User-facing behavior changes are described in this PR; no generated workflow docs needed.
  • Generated output under internal/generated/, .cache/, and ad-hoc skills/<cli-name>/ directories is not committed.
  • Commits are signed off when this is ready to merge.

Signed-off-by: samzong <samzong.lu@gmail.com>
@samzong samzong merged commit feab4ad into main Jun 26, 2026
3 checks passed
@samzong samzong deleted the fix/spec-source-path-traversal branch June 26, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: reject path traversal in spec source paths

1 participant