-
Notifications
You must be signed in to change notification settings - Fork 30
Add a dependency on the uri gem to use version 1.0.4 or higher. #215
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
Conversation
Summary of ChangesHello @Umekawa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This PR updates the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a security-focused dependency update to address a vulnerability in the uri gem. The change requires uri gem version 1.0.4 or higher to mitigate CVE-2025-61594, which involves URI credential leakage that bypassed previous fixes.
- Added minimum version constraint for the uri gem dependency
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a security vulnerability by updating the uri
gem dependency, which is a crucial change. I've added one suggestion to improve the long-term stability of the dependency management. Thank you for your contribution!
spec.add_dependency "qiita_marker", "~> 0.23.9" | ||
spec.add_dependency "rouge", "~> 4.2" | ||
spec.add_dependency "sanitize" | ||
spec.add_dependency "uri", ">= 1.0.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better dependency management and to prevent potential future breakages, it's recommended to use a pessimistic version constraint.
While >= 1.0.4
correctly resolves the security vulnerability, it allows any future version of the uri
gem, including major versions with breaking changes (e.g., 2.0.0
).
Using ~> 1.0.4
(which is equivalent to >= 1.0.4
and < 1.1.0
) will ensure you get security patches within the 1.0.x
series while protecting against breaking changes in future minor or major releases. This is also consistent with other versioned dependencies in this file like qiita_marker
and rouge
.
This approach enhances the stability for consumers of this gem.
spec.add_dependency "uri", "~> 1.0.4"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's a library, I don't think there's a strong need to pessimistic version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✍️
I performed the following verification.
After running bundle install
, I confirmed that the installation was successful using bundle list | grep uri
, and then proceeded with the validation.
Running existing tests
All tests passed.
# Run all tests to verify that existing functionality is not broken
bundle exec rspec
~~~
Finished in 1.28 seconds (files took 9.58 seconds to load)
595 examples, 0 failures
Manual testing of URI processing functionality
Executed with:
bundle exec ruby test_uri_functionality.rb
#!/usr/bin/env ruby
require_relative 'lib/qiita-markdown'
# Test for ExternalLink filter
processor = Qiita::Markdown::Processor.new(hostname: "example.com")
test_cases = [
"http://external.com/test",
"https://example.com/internal",
"[link](http://external.com/path?param=value)",
"[internal link](https://example.com/internal/path)",
]
puts "=== URI processing test ==="
test_cases.each do |markdown|
result = processor.call(markdown)
puts "Input: #{markdown}"
puts "Output: #{result[:output]}"
puts "---"
end
# Test for iframe/script embedding functionality
puts "\n=== Embed functionality test ==="
embed_tests = [
'<iframe src="https://www.youtube.com/embed/example"></iframe>',
'<script src="https://example.com/script.js"></script>',
'<iframe src="malicious-site.com/bad-content"></iframe>',
]
embed_tests.each do |markdown|
result = processor.call(markdown)
puts "Input: #{markdown}"
puts "Output: #{result[:output]}"
puts "---"
end
puts "\n=== URI gem version ==="
puts "URI gem version: #{Gem.loaded_specs['uri']&.version || 'Not found'}"
✍️
ref: https://www.ruby-lang.org/en/news/2025/10/07/uri-cve-2025-61594/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that action is required for the security vulnerability (#215 (comment)), and also performed verification (#215 (review)).
LGTM!
What
Why
Ref