Skip to content

Fix uninitialized constant HTTP::CookieJar by correcting load order in http_cookie_jar.rb#21327

Merged
adfoster-r7 merged 1 commit into
rapid7:masterfrom
tair-m:master
Apr 20, 2026
Merged

Fix uninitialized constant HTTP::CookieJar by correcting load order in http_cookie_jar.rb#21327
adfoster-r7 merged 1 commit into
rapid7:masterfrom
tair-m:master

Conversation

@tair-m
Copy link
Copy Markdown
Contributor

@tair-m tair-m commented Apr 18, 2026

This PR fixes a critical load order issue in http_cookie_jar.rb that causes msfconsole to crash with uninitialized constant HTTP::CookieJar or CookieJar is not a class when loading HTTP-based modules on environments using Ruby 3.3.0+ (such as recent Kali Linux rolling updates).

The newer Zeitwerk autoloader strictly enforces load order. Previously, http_cookie_jar.rb required http/cookie_jar/hash_store before the base http/cookie classes were loaded into memory, causing a crash during module parsing.

This change simply reverses the require order of the http-cookie gem files to load the base classes before the dependent storage classes.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole on a system running Ruby 3.3.0+ (e.g., latest Kali Linux).
  • Run use exploit/unix/webapp/elfinder_php_connector_exiftran_cmd_injection (or any web module dependent on HttpClient).
  • Verify the module loads successfully without the [-] The supplied module name is ambiguous: uninitialized constant HTTP error.
  • Verify the info command works for the loaded module.

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Apr 18, 2026
@adfoster-r7 adfoster-r7 merged commit 9b985dc into rapid7:master Apr 20, 2026
49 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Apr 20, 2026
@adfoster-r7 adfoster-r7 added the rn-fix release notes fix label Apr 20, 2026
@adfoster-r7
Copy link
Copy Markdown
Contributor

Release Notes

Fixes a crash when loading HTTP modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-fix release notes fix

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants