-
Notifications
You must be signed in to change notification settings - Fork 1
🔒 [security fix] Fix unchecked URL encoding fallback in HTTPClient #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔒 [security fix] Fix unchecked URL encoding fallback in HTTPClient #16
Conversation
This commit addresses a security vulnerability in `HTTPClient::urlEncode` where the function would fallback to returning the unencoded input string if libcurl was not initialized or if `curl_easy_escape` failed. Such behavior could lead to URL injection or broken URLs when processing special characters. Changes: - Implemented an RFC 3986-compliant manual URL encoding fallback. - Ensured the fallback is used whenever libcurl is unavailable or fails. - Explicitly included `<cstdio>` for `snprintf` usage. - Added debug logging for failure cases. Verified the fallback logic with a standalone test suite covering various special characters and edge cases. Co-authored-by: segin <[email protected]>
|
👋 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ctions
- Updated actions/upload-artifact@v3 to v4
- Updated actions/cache@v3 to v4
- Updated actions/setup-python@v4 to v5
- Updated actions/github-script@v6 to v7
- Added github_token: ${{ secrets.GITHUB_TOKEN }} to anthropics/claude-code-action
to fix OIDC token exchange failures when the GitHub App is not installed.
This should resolve the CI failures related to deprecated actions and
missing repository permissions for Claude Code.
Co-authored-by: segin <[email protected]>
- Removed `libvorbisfile-dev` from `.github/workflows/c-cpp.yml` as it is not available on Ubuntu 24.04 and its functionality is covered by `libvorbis-dev`. - Updated permissions in `.github/workflows/claude-code-review.yml` and `.github/workflows/claude.yml` to `write` for `pull-requests` and `issues` to allow the actions to post comments. This should resolve the remaining CI failures. Co-authored-by: segin <[email protected]>
|
Claude finished @segin's task —— View job Security Fix Code ReviewI'll review this security fix for the HTTPClient URL encoding vulnerability. Here's my review plan: Todo List:
🔒 Security AnalysisVulnerability Assessment: EXCELLENT FIX ✅The original
Security Implementation Review✅ Strong Points:
🐛 Code Quality ReviewImplementation: VERY GOOD ✅Strengths:
Minor Improvement Opportunities:
⚡ Performance AnalysisPerformance: GOOD ✅Efficient Aspects:
Impact Assessment:
🧪 Test Coverage AssessmentCoverage: NEEDS IMPROVEMENT
|
- Added `libcurl4-openssl-dev` and `libssl-dev` to all build-related workflows. - Unified dependencies in `threading-safety.yml` and switched to SDL 1.2 for consistency. - Expanded permissions in `claude-code-review.yml` and `claude.yml` to include `contents: write`, `checks: write`, and `statuses: write` to ensure the actions have sufficient access for PR commenting. This should resolve the dependency failures in the main build and permission issues in Claude actions. Co-authored-by: segin <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
- Implemented RFC 3986-compliant manual URL encoding fallback in `HTTPClient::urlEncode`.
- Added a 1MB input size limit to `urlEncode` to prevent excessive memory allocation, as recommended in code review.
- Fixed CI failures by:
- Updating all deprecated GitHub Actions to their latest versions (v4/v5/v7).
- Adding missing dependencies `libcurl4-openssl-dev`, `libssl-dev`, and `autoconf-archive` to all workflows.
- Unified system dependencies in `threading-safety.yml` and switched to SDL 1.2 for consistency with the main build.
- Elevated workflow permissions to `write` to allow Claude actions to post comments on PRs.
This comprehensive set of changes ensures both the security of the
application and the reliability of the CI/CD pipeline.
Co-authored-by: segin <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This commit fixes a security vulnerability in `HTTPClient::urlEncode` and stabilizes the CI environment. Security fixes: - Implemented a robust RFC 3986-compliant percent-encoding fallback in `HTTPClient::urlEncode` to prevent URL injection when libcurl fails. - Added a 1MB input size limit to `urlEncode` to prevent excessive memory allocation. - Explicitly included `<cstdio>` for `snprintf` usage. CI infrastructure fixes: - Updated all deprecated GitHub Actions to their latest versions (v4/v5/v7). - Added missing dependencies `libcurl4-openssl-dev`, `libssl-dev`, and `autoconf-archive` to resolve build failures. - Unified dependencies across all workflows for consistency. - Elevated workflow permissions to allow automated actions to post PR comments. Note: Recent CI failures in the `claude-review` job are due to an external "Credit balance is too low" error from the Anthropic API provider and are not related to the code changes. Co-authored-by: segin <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This commit fixes a security vulnerability in `HTTPClient::urlEncode` and stabilizes the CI environment. Security fixes: - Implemented a robust RFC 3986-compliant percent-encoding fallback in `HTTPClient::urlEncode` to prevent URL injection when libcurl fails. - Added a 1MB input size limit to `urlEncode` to prevent excessive memory allocation. - Explicitly included `<cstdio>` for `snprintf` usage. CI infrastructure fixes: - Updated all deprecated GitHub Actions to their latest versions (v4/v5/v7). - Added missing dependencies `libcurl4-openssl-dev`, `libssl-dev`, and `autoconf-archive` to resolve build failures. - Unified dependencies across all workflows for consistency. - Elevated workflow permissions to allow automated actions to post PR comments. Note: Recent CI failures in the `claude-review` job are due to an external "Credit balance is too low" error from the Anthropic API provider and are not related to the code changes. Co-authored-by: segin <[email protected]>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
🎯 What: Fixed a security vulnerability in
⚠️ Risk: Potential URL injection or broken URL structure if input containing characters like
HTTPClient::urlEncodethat returned unencoded input on failure.&,=, or?was returned unencoded.🛡️ Solution: Implemented a robust manual RFC 3986-compliant percent-encoding fallback that is used if libcurl is uninitialized or if
curl_easy_escapefails. This ensures that the output ofurlEncodeis always safely encoded.PR created automatically by Jules for task 15096492925585671045 started by @segin