Repository navigation
fix(safety): O107 credential path realpath / symlink follow-up (#100 O105) - #102
Merged
Merged
Conversation
isMossCredentialPath only path.resolve'd, so a workspace symlink into .moss/config.json, devices.json, ~/.moss/*, ~/.config/moss/*, or .apikey-key bypassed the O105 readFileTool.execute redaction gate. Follow realpath (and readlink when dangling) like protected-paths / canonicalPath; tighten isRawApiKeyFile the same way. Ordinary file symlinks stay ungated. No kill-switch; O105 asserts unchanged. Tests: symlink→config/devices redact; notes symlink plaintext; dangling→config fail-closed; revert-red without follow.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
O107 (P3) — follow-up to #100 (O105).
isMossCredentialPathonly usedpath.resolve, so a workspace symlink pointing at.moss/config.json,.moss/devices.json,~/.moss/*,~/.config/moss/*, or.apikey-keybypassed the O105readFileTool.execute→presentToolOutputgate and returned plaintext secrets.O105 合入后 QA PASS-WITH-CONDITIONS:软链 / realpath 跟进。本 PR 只加严:对 credential 路径做 realpath(及 dangling 时的 readlink),与
protected-paths/canonicalPath同精神。无 kill-switch,不放宽任何 O105 断言。Changes / 改动
src/safety/read-scope.ts:credentialPathFollowCandidates+isMossCredentialPathfollows realpath / readlink targetsrc/safety/credential-path.ts:isRawApiKeyFileuses the same follow so symlink→.apikey-keystill withholdstest/o107-credential-realpath.spec.mjs: symlink→config/devices redact; ordinary notes symlink plaintext; dangling→config fail-closed; revert-red smokeAcceptance / 验收
.moss/config.json(fake apiKey): execute no plaintext,[REDACTED];isMossCredentialPath(link)true.moss/devices.jsonpasswordnotes.txtisMossCredentialPath+ basename-onlyisRawApiKeyFile→ 6/8 fail; restore → 8/8 passread-scope.spec.mjsnpm run checkTest plan
Head:
d5aec5ca· Base:9629e423(#100 merge).