Security: Fix bundler-audit vulnerabilities#18
Closed
polographer wants to merge 1 commit intotrunkfrom
Closed
Conversation
This commit updates vulnerable gems identified by bundler-audit. See PR description for detailed analysis of changes and affected components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
================================================================================
SECURITY VULNERABILITY REMEDIATION REPORT
Generated: March 25, 2026
All vulnerabilities have been successfully resolved.
================================================================================
================================================================================
VERSIONS
Old Version: 2.18.0
New Version: 2.19.3
SECURITY ISSUES
CVE: CVE-2026-33210
GHSA: GHSA-3m6g-2423-7cp3
Severity: Unknown
Title: Ruby JSON has a format string injection vulnerability
URL: GHSA-3m6g-2423-7cp3
DESCRIPTION
The json gem had a format string injection vulnerability that could potentially
allow attackers to inject malicious format strings during JSON parsing operations.
FILES/MODULES USING THIS GEM
DIRECT USAGE:
/app/controllers/api/v1/documents_controller.rb (line 113)
/app/domain/cartafact/operations/validate_resource_identity_signature.rb (line 46)
Test Files:
Lines 40, 62, 67, 81, 134, 208, 337, 380
Lines 95, 116, 162
INDIRECT USAGE (via Rails framework):
/app/controllers/application_controller.rb (lines 16, 19, 22, 26)
/app/controllers/api/v1/documents_controller.rb (lines 16, 18, 32, 44, 46, 74, 76, 126)
/app/serializers/document_serializer.rb (lines 4-37)
/config/initializers/wrap_parameters.rb (line 10)
POTENTIAL IMPACT AREAS
CRITICAL - Affects core functionality:
✓ API Request/Response Handling - All document CRUD operations
✓ Authentication & Authorization - Identity signature validation
✓ Document Serialization - Converting document models to JSON API format
✓ Request Parameter Parsing - Document metadata from multipart requests
REVIEW PRIORITY: HIGH
The json gem is used extensively throughout the application for API operations
and authentication. Both direct parsing operations and all API response rendering
could have been vulnerable. Verify that API endpoints handle malformed JSON
correctly and that authentication flows reject invalid identity signatures.
================================================================================
2. LOOFAH GEM
VERSIONS
Old Version: 2.25.0
New Version: 2.25.1
SECURITY ISSUES
GHSA: GHSA-46fp-8f5p-pf2m
Severity: Unknown
Title: Improper detection of disallowed URIs by Loofah
allowed_uri?URL: GHSA-46fp-8f5p-pf2m
DESCRIPTION
Loofah had an issue with improper detection of disallowed URIs in the
allowed_uri? method, which could allow malicious URIs to bypass sanitization.
FILES/MODULES USING THIS GEM
NO DIRECT USAGE FOUND
INDIRECT USAGE (via Rails framework):
Via rails-html-sanitizer (Rails Framework Dependency)
HTML Sanitization in Mailer Views:
Rails Security Layer:
POTENTIAL IMPACT AREAS
LOW - Minimal direct impact (API-only application):
✓ HTML Sanitization in Email Templates - /app/views/layouts/mailer.html.erb
✓ Rails Security Layer - XSS protection for any HTML content
✓ Development/Test Helpers - Used by rails-dom-testing in controller specs
REVIEW PRIORITY: LOW
This is primarily an API application with minimal HTML rendering. Loofah is
used indirectly through Rails for HTML sanitization. The main exposure point
would be email templates. Verify that email views do not render user-supplied
HTML content, or if they do, that the sanitization is working correctly.
================================================================================
3. NOKOGIRI GEM
VERSIONS
Old Version: 1.19.0
New Version: 1.19.2
SECURITY ISSUES
GHSA: GHSA-wx95-c6cv-8532
Severity: Medium
Title: Nokogiri does not check the return value from xmlC14NExecute
URL: GHSA-wx95-c6cv-8532
DESCRIPTION
Nokogiri failed to check the return value from xmlC14NExecute, which could
lead to undefined behavior or security issues during XML canonicalization
operations.
FILES/MODULES USING THIS GEM
NO DIRECT USAGE FOUND
INDIRECT USAGE (via Rails framework and other gems):
Via Rails Framework (Critical Dependency):
Via loofah:
Via rails-dom-testing:
AFFECTED AREAS:
HTTP Request/Response Parsing:
Test Suite:
Email Template Processing:
POTENTIAL IMPACT AREAS
MEDIUM - Indirect but widespread usage:
✓ HTTP Request/Response Parsing - ActionPack XML/HTML parameter parsing
✓ Test Suite Support - Response parsing and validation in RSpec tests
✓ Rails HTML Sanitization Backend - Powers loofah's parsing capabilities
✓ Email Template Processing - HTML email generation
REVIEW PRIORITY: MEDIUM
While not directly used in application code, nokogiri is a critical dependency
for Rails HTTP processing and HTML sanitization. If the application accepts
XML requests or processes XML in any way, this could have been exploitable.
Verify that API endpoints properly validate Content-Type and reject malformed
XML/HTML input. Test email generation to ensure HTML templates render correctly.
================================================================================
4. RACK GEM
VERSIONS
Old Version: 3.2.4
New Version: 3.2.5
SECURITY ISSUES
CVE: CVE-2026-22860
GHSA: GHSA-mxw3-3hh2-x2mh
Severity: High
Title: Rack has a Directory Traversal via Rack::Directory
URL: GHSA-mxw3-3hh2-x2mh
CVE: CVE-2026-25500
GHSA: GHSA-whrj-4476-wvmp
Severity: Medium
Title: Stored XSS in Rack::Directory via javascript: filenames rendered into anchor href
URL: GHSA-whrj-4476-wvmp
DESCRIPTION
Two vulnerabilities were found in Rack:
directories via Rack::Directory middleware.
clickable links, enabling XSS attacks.
FILES/MODULES USING THIS GEM
DIRECT USAGE:
/config/initializers/cors.rb (line 10)
Test Files:
INDIRECT USAGE (EXTENSIVE - Core Foundation):
Web Server:
Rails Framework (Core Dependency):
All Controllers:
/app/controllers/application_controller.rb
/app/controllers/api/v1/documents_controller.rb
File Operations:
POTENTIAL IMPACT AREAS
CRITICAL - Rack is the foundational HTTP layer:
✓ HTTP Server Foundation - config.ru, Puma web server, all HTTP handling
✓ Middleware Stack - Rack::Cors for CORS, Rails middleware chain
✓ API Controllers - All 5 controller actions (index, show, create, download, copy)
✓ Request/Response Handling - params, request, response, headers access
✓ File Streaming - Document download with chunked transfer encoding
✓ Session & Authentication - JWT token extraction, signature validation
✓ Test Infrastructure - File upload testing, request/response simulation
REVIEW PRIORITY: CRITICAL
Rack is the absolute foundation of the application's HTTP layer. Every single
HTTP request and response goes through Rack. While Rack::Directory is not
explicitly used in this application, the entire request/response cycle was
potentially vulnerable.
SPECIFIC AREAS TO TEST:
================================================================================
TESTING RECOMMENDATIONS
HIGH PRIORITY TESTS:
Document Download Endpoint
Document Upload/Create
Authentication Flow
API Endpoints with JSON Parsing
MEDIUM PRIORITY TESTS:
CORS Configuration
Email Templates
API Response Rendering
================================================================================
DEPENDENCY SUMMARY
Gem Dependency Tree:
rails (7.2.3)
├── actionpack
│ ├── rack (>= 2.2.4, < 3.3) ✓ UPDATED
│ ├── nokogiri (>= 1.8.5) ✓ UPDATED
│ └── rails-html-sanitizer (
> 1.6)> 2.21) ✓ UPDATED│ ├── loofah (
│ └── nokogiri ✓ UPDATED
├── actionview
│ └── rails-html-sanitizer ✓
├── actionmailer
│ └── rails-dom-testing
│ └── nokogiri ✓ UPDATED
└── actiontext
└── nokogiri ✓ UPDATED
puma (~> 6.0)
└── nio4r (Rack-based server)
rack-cors
└── rack (>= 3.0.14) ✓ UPDATED
fast_jsonapi
└── activesupport (JSON serialization)
rubocop
└── json (~> 2.3) ✓ UPDATED
Critical Usage Patterns:
• json: Explicit parsing in 2 places, implicit everywhere via Rails JSON rendering
• loofah: Entirely indirect, provides HTML sanitization security layer
• nokogiri: Entirely indirect, provides XML/HTML parsing for Rails and loofah
• rack: Foundational - 1 explicit use (CORS), hundreds of implicit uses (entire HTTP layer)
================================================================================
CONCLUSION
All four gems have been successfully updated and all security vulnerabilities
have been resolved. The updates are backward-compatible and should not break
existing functionality, but thorough testing is recommended due to the critical
nature of these dependencies.
Focus testing efforts on:
Next Steps:
================================================================================