fix(ignore): harden final .html4ignore open against symlink traversal - #623
fix(ignore): harden final .html4ignore open against symlink traversal#623seonghobae wants to merge 1 commit into
Conversation
* `File.useLines` internally resolves symbolic links. We need to prevent following symlinks when reading `.html4ignore`. * Replaced `ignore_file.useLines` with `Files.newInputStream(ignore_file.toPath(), StandardOpenOption.READ, LinkOption.NOFOLLOW_LINKS).bufferedReader().useLines`. * Appended findings to `.jules/sentinel.md` journal.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reachedNext included review available in 46 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fleet review
master@728f0f33323e43573d6664209891099502827d5d62fc79b9391f918f9feeafcd39a68039dcbedf8e현재 source delta는
.html4ignore를 실제 open하는 지점에서Files.newInputStream(..., LinkOption.NOFOLLOW_LINKS)를 사용하므로 final path component가 open 직전에 symlink로 바뀌는 경우의 traversal을 줄이는 defense-in-depth로는 유효합니다.다만 기존 설명의 “TOCTOU 취약점 해결”은 현재 evidence보다 넓습니다.
isFile,Files.isSymbolicLink,canRead,length검사는 여전히 open과 분리되어 있고, opened file identity/size를 동일 descriptor에 결박하지 않습니다. 다른 regular file로의 교체나 ancestor-path mutation까지 이 한 줄이 해결한다고 주장할 수 없습니다.또한
./gradlew test jacocoTestReport와 100% coverage는 이 race/security contract의 GREEN이 아닙니다. current tests에는 validation→open 사이에서.html4ignore를 실제로 교체해 predecessorFile.useLines가 sensitive target을 읽고 hardened open이 이를 거부하는 deterministic RED/GREEN fixture가 없습니다. 정적인 symlink fixture만 추가하면 protected base의 기존!Files.isSymbolicLink(...)pre-check에서도 통과하므로 causal test가 아닙니다.Required before Ready
.html4ignoreparsing contract를 보존해야 합니다.SecureDirectoryStream/descriptor-bound attributes 등 대안을 평가합니다..jules/sentinel.md의 repository-wide “TOCTOU 해결” 교리는 위 GREEN이 성립하기 전 protected-base 내용으로 복원하거나 final-component hardening 범위로 좁혀야 합니다.Self-approval, admin bypass, gate weakening, force push, destructive rebase, no-op retrigger는 사용하지 않습니다.