π‘οΈ Sentinel: [HIGH] Fix SSL verification configuration in stream context#600
π‘οΈ Sentinel: [HIGH] Fix SSL verification configuration in stream context#600
Conversation
The `verify_peer` option was mistakenly placed in the `http` array instead of the `ssl` array when configuring the stream context for POST requests to the reCAPTCHA service. This caused the option to be ignored by PHP. This commit moves `verify_peer` to the `ssl` context array to properly enforce SSL/TLS certificate validation. Tests have been updated to reflect the change. Co-authored-by: rowan-m <108052+rowan-m@users.noreply.github.com>
|
π 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. |
π¨ Severity: HIGH
π‘ Vulnerability: In
src/ReCaptcha/RequestMethod/Post.php, theverify_peerconfiguration option for the stream context was incorrectly placed within thehttparray instead of thesslarray. As a result, the option was ignored by PHP, potentially failing to explicitly enforce SSL certificate verification.π― Impact: An attacker in a Man-in-the-Middle (MitM) position could intercept the communication between the application and the reCAPTCHA service if the server's PHP configuration or environment didn't already default to verifying peers (PHP < 5.6 or overridden defaults).
π§ Fix: Moved the
verify_peeroption from thehttpcontext array to thesslcontext array where it is correctly interpreted by PHP'sstream_context_create.β Verification: The unit test in
tests/ReCaptcha/RequestMethod/PostTest.phphas been updated to check forverify_peerin thesslarray instead of thehttparray, and the tests pass.PR created automatically by Jules for task 2305671160518156015 started by @rowan-m