Fix reused Datastore option visibility mutations - #21153
Merged
cdelafuente-r7 merged 2 commits intoApr 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Thank you @Nayeraneru for this fix. I verified using the same workflow from the original issue and it fixes this issue. However, CI specs are failing now. the issue is that now we cannot compare two OptBase objects the same way since they are all different instances. This should be a simple fix and I believe that using #instance_values should solve this.
E.g.
expect(subject.options.instance_values).to eq(expected_options.instance_values)
Contributor
|
Thank you @Nayeraneru. Everything looks good now. I do believe more work needs to be done since the mutable constants for common options is not a good idea anyway. But, we will look into this separately. Example Output |
This PR Fixes #21091 to duplicate reused OptBase instances before applying per-container flags, preventing shared options like CHOST, CPORT, and Proxies from changing visibility across modules.
Verification
bundle exec rspec spec/lib/msf/core/option_container_spec.rbmsfconsoleuse exploit/qnx/qconn/qconn_execrun verbose=true rhost=127.0.0.1optionsadvanced