Skip to content

fix(#27,#28,#30): input validation, import name sanitization, no redirect following#50

Merged
FZ2000 merged 2 commits intomainfrom
fix/security-input-validation-27-28-30
Mar 8, 2026
Merged

fix(#27,#28,#30): input validation, import name sanitization, no redirect following#50
FZ2000 merged 2 commits intomainfrom
fix/security-input-validation-27-28-30

Conversation

@FZ2000
Copy link
Copy Markdown
Owner

@FZ2000 FZ2000 commented Mar 8, 2026

Fixes #27, Fixes #28, Fixes #30

Added tests/test_security_input_validation.py with 13 tests. All 256 tests pass.

Frank added 2 commits March 7, 2026 18:01
…, no redirect following

- #27: Add _validate_repo() and _validate_branch() with strict regex allowlists
  - Repo must match owner/repo pattern with safe chars only
  - Branch validated against safe character set, rejects '..' traversal
- #28: Apply sanitize_skill_name() to every skill directory during 'apc import'
  - Traversal paths like '../../etc' are safely stripped to their basename
  - Names failing sanitization are skipped with a warning
- #30: Replace follow_redirects=True with follow_redirects=False in httpx calls
  - Introduced _safe_get() helper in skills.py to centralise this policy
  - Prevents SSRF via open-redirect chains from GitHub API/raw URLs
@FZ2000 FZ2000 merged commit fd6d0a4 into main Mar 8, 2026
5 checks passed
@FZ2000 FZ2000 deleted the fix/security-input-validation-27-28-30 branch March 8, 2026 02:05
forge-fz2000 added a commit that referenced this pull request Mar 9, 2026
… diff

Removed incorrectly listed items that are NOT in main:
- apc skill remove / apc unsync (PR #72 was merged into a feature branch,
  not main)
- Windsurf/Copilot native sync support (same)
- --target/-t removal from apc install (same)

Added missing items that ARE in main since v0.1.1:
- Security fixes: input validation, chmod 600 MCP configs, scrub secrets
  from export (#27,#28,#30 via #50; #32,#35 via #52)
- Bug fixes: LLM write guard, expanduser paths, Copilot absolute paths
  (#37,#38-#43,#42 via #53; #36,#45 via #54)
- Fix: ~/.apc/skills/ always created after apc install
- Fix: --version reads from importlib.metadata
- Docs: README shell completion, CLI basics (#23,#26 via #67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant