Please don't tell anyone about this commit. It's a secret.#4465
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSecurePathController now validates incoming paths, rejects traversal-like input, and resolves files with ChangesSecure path handling
Release updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/Feature_v2/SecureImageLinksTest.php (1)
125-132: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winCover every rejected traversal sequence.
The production helper rejects
..,%2e,%2f, and\, but this test only exercises../.env. A small data provider would lock the full security contract.🧪 Proposed test expansion
+ /** + * `@return` array<string, array{string}> + */ + public static function forbiddenPathProvider(): array + { + return [ + 'parent traversal' => ['../.env'], + 'encoded dot' => ['%2e%2e/.env'], + 'encoded slash' => ['..%2f.env'], + 'backslash' => ['..\\.env'], + ]; + } + + /** + * `@dataProvider` forbiddenPathProvider + */ - public function testPathTraversalIsForbidden(): void + public function testPathTraversalIsForbidden(string $forbidden_path): void { $this->setTemporaryLink(); $path = URL::route('image', ['path' => 'c3/3d/c661c594a5a781cd44db06828783.png']); - $traversal_path = str_replace('c3/3d/c661c594a5a781cd44db06828783.png', '../.env', $path); + $traversal_path = str_replace('c3/3d/c661c594a5a781cd44db06828783.png', $forbidden_path, $path); $response = $this->actingAs($this->userMayUpload1)->get($traversal_path); $this->assertStatus($response, 418); }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0e9b9482-aeb9-421c-a4f6-739f000e3ebc
📒 Files selected for processing (2)
app/Http/Controllers/SecurePathController.phptests/Feature_v2/SecureImageLinksTest.php
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
@luuhung1217 thank you for that one. :')
Summary by CodeRabbit
libssh2-1t64.version.md.