Skip to content

Commit 5bee4a1

Browse files
committed
Add support for 3-parameter GHSA references with optional repo, fix 21 modules with correct repo-specific URLs
1 parent f098069 commit 5bee4a1

25 files changed

+47
-34
lines changed

docs/metasploit-framework.wiki/Module-Reference-Identifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ US-CERT-VU | kb.cert.org | ```['US-CERT-VU', '800113']```
1818
ZDI | zerodayinitiative.com | ```['ZDI', '10-123']```
1919
WPVDB | wpvulndb.com | ```['WPVDB', '7615']```
2020
PACKETSTORM | packetstormsecurity.com | ```['PACKETSTORM', '132721']```
21-
GHSA | github.com/advisories | ```['GHSA', 'xxxx-xxxx-xxxx']```
21+
GHSA | github.com/advisories or github.com/owner/repo/security/advisories | ```['GHSA', 'xxxx-xxxx-xxxx']``` or ```['GHSA', 'xxxx-xxxx-xxxx', 'owner/repo']```
2222
URL | anything | ```['URL', 'http://example.com/blog.php?id=123']```
2323
AKA (_deprecated_*) | anything | ~~`['AKA', 'shellshock']`~~
2424

lib/msf/core/module/module_info.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def notes
6464
# Register options with a specific owning class.
6565
#
6666
def info_fixups
67-
# Each reference should be an array consisting of two elements
67+
# Each reference should be an array consisting of two or three elements
6868
refs = module_info['References']
6969
if(refs and not refs.empty?)
7070
refs.each_index do |i|
71-
if !(refs[i].respond_to?('[]') and refs[i].length == 2)
71+
if !(refs[i].respond_to?('[]') and (refs[i].length == 2 || refs[i].length == 3))
7272
refs[i] = nil
7373
end
7474
end

lib/msf/core/module/reference.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ def self.from_s(str)
7777
#
7878
# Initializes a site reference from an array. ary[0] is the site and
7979
# ary[1] is the site context identifier, such as CVE.
80+
# ary[2] is optional and can be used for additional context (e.g., repo for GHSA)
8081
#
8182
def self.from_a(ary)
8283
return nil if (ary.length < 2)
8384

84-
self.new(ary[0], ary[1])
85+
self.new(ary[0], ary[1], ary[2])
8586
end
8687

8788
#
@@ -90,9 +91,10 @@ def self.from_a(ary)
9091
# * tools/module_reference.rb
9192
# * https://docs.metasploit.com/docs/development/developing-modules/module-metadata/module-reference-identifiers.html
9293
#
93-
def initialize(in_ctx_id = 'Unknown', in_ctx_val = '')
94+
def initialize(in_ctx_id = 'Unknown', in_ctx_val = '', in_ctx_repo = nil)
9495
self.ctx_id = in_ctx_id
9596
self.ctx_val = in_ctx_val
97+
self.ctx_repo = in_ctx_repo
9698

9799
if in_ctx_id == 'CVE'
98100
self.site = "https://nvd.nist.gov/vuln/detail/CVE-#{in_ctx_val}"
@@ -117,7 +119,12 @@ def initialize(in_ctx_id = 'Unknown', in_ctx_val = '')
117119
elsif in_ctx_id == 'GHSA'
118120
# Handle both formats: with or without GHSA- prefix
119121
ghsa_id = in_ctx_val.start_with?('GHSA-') ? in_ctx_val : "GHSA-#{in_ctx_val}"
120-
self.site = "https://github.com/advisories/#{ghsa_id}"
122+
# Use repo-specific URL if repo is provided, otherwise use global format
123+
if in_ctx_repo && !in_ctx_repo.empty?
124+
self.site = "https://github.com/#{in_ctx_repo}/security/advisories/#{ghsa_id}"
125+
else
126+
self.site = "https://github.com/advisories/#{ghsa_id}"
127+
end
121128
elsif in_ctx_id == 'URL'
122129
self.site = in_ctx_val.to_s
123130
elsif in_ctx_id == 'LOGO'
@@ -169,9 +176,13 @@ def from_s(str)
169176
# The context value of the reference, such as MS02-039
170177
#
171178
attr_reader :ctx_val
179+
#
180+
# The context repository for GHSA references (optional)
181+
#
182+
attr_reader :ctx_repo
172183

173184
protected
174185

175-
attr_writer :site, :ctx_id, :ctx_val
186+
attr_writer :site, :ctx_id, :ctx_val, :ctx_repo
176187

177188
end

modules/auxiliary/admin/http/pihole_domains_api_exec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(info = {})
2626
'SchneiderSec' # original PoC, discovery
2727
],
2828
'References' => [
29-
['GHSA', '5cm9-6p3m-v259'],
29+
['GHSA', '5cm9-6p3m-v259', 'pi-hole/AdminLTE'],
3030
['CVE', '2021-32706']
3131
],
3232
'Targets' => [

modules/auxiliary/gather/minio_bootstrap_verify_info_disc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(info = {})
2424
'RicterZ' # original PoC, analysis
2525
],
2626
'References' => [
27-
[ 'GHSA', '6xvq-wj2x-3h3q' ],
27+
['GHSA', '6xvq-wj2x-3h3q', 'minio/minio'],
2828
[ 'CVE', '2023-28432']
2929
],
3030
'Targets' => [

modules/auxiliary/gather/onedev_arbitrary_file_read.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def initialize(info = {})
2727
'License' => MSF_LICENSE,
2828
'References' => [
2929
['CVE', '2024-45309'],
30-
['GHSA', '7wg5-6864-v489']
30+
['GHSA', '7wg5-6864-v489', 'theonedev/onedev']
3131
],
3232
'DisclosureDate' => '2024-10-19',
3333
'Notes' => {

modules/auxiliary/scanner/http/icinga_static_library_file_directory_traversal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def initialize(info = {})
3838
'References' => [
3939
['EDB', '51329'],
4040
['URL', 'https://www.sonarsource.com/blog/path-traversal-vulnerabilities-in-icinga-web/'],
41-
['GHSA', '5p3f-rh28-8frw'],
41+
['GHSA', '5p3f-rh28-8frw', 'Icinga/icingaweb2'],
4242
['URL', 'https://github.com/Icinga/icingaweb2/commit/9931ed799650f5b8d5e1dc58ea3415a4cdc5773d'],
4343
['CVE', '2022-24716'],
4444
],

modules/auxiliary/scanner/misc/cups_browsed_info_disclosure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def initialize
2121
'License' => MSF_LICENSE,
2222
'References' => [
2323
['CVE', '2024-47176'],
24-
['GHSA', 'rj88-6mr5-rcw8'],
24+
['GHSA', 'rj88-6mr5-rcw8', 'OpenPrinting/cups-browsed'],
2525
['URL', 'https://www.evilsocket.net/2024/09/26/Attacking-UNIX-systems-via-CUPS-Part-I/' ],
2626
],
2727
'DefaultOptions' => { 'RPORT' => 631 },

modules/exploits/linux/http/cacti_unauthenticated_cmd_injection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def initialize(info = {})
5252
],
5353
'References' => [
5454
['CVE', '2022-46169'],
55-
['GHSA', '6p93-p743-35gf'], # disclosure and technical details
55+
['GHSA', '6p93-p743-35gf', 'Cacti/cacti'], # disclosure and technical details
5656
['URL', 'https://github.com/vulhub/vulhub/tree/master/cacti/CVE-2022-46169'], # vulhub vulnerable docker image and PoC
5757
['URL', 'https://www.sonarsource.com/blog/cacti-unauthenticated-remote-code-execution'] # analysis by Stefan Schiller
5858
],

modules/exploits/linux/http/lucee_admin_imgprocess_file_write.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(info = {})
2929
'References' => [
3030
['CVE', '2021-21307'],
3131
['URL', 'https://dev.lucee.org/t/lucee-vulnerability-alert-november-2020-cve-2021-21307/7643'],
32-
['GHSA', '2xvv-723c-8p7r'],
32+
['GHSA', '2xvv-723c-8p7r', 'lucee/lucee'],
3333
['URL', 'https://github.com/httpvoid/writeups/blob/main/Apple-RCE.md']
3434
],
3535
'DisclosureDate' => '2021-01-15', # rootxharsh and iamnoooob's writeup

0 commit comments

Comments
 (0)