Skip to content
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

XML serialization for VulnException incorrect due to extra whitespace #304

Closed
rezen opened this issue Oct 16, 2017 · 1 comment
Closed

Comments

@rezen
Copy link

rezen commented Oct 16, 2017

Retrying the request due to undefined method sub' for nil:NilClass. If you see this message please open an Issue on Github with the error. VulnException's cannot be created due to extra white space in key setting for XML serialization, when the scope is ALL_INSTANCES_IN_A_SPECIFIC_SITE.

Expected Behavior

When having the site-id set and scope set to ALL_INSTANCES_IN_A_SPECIFIC_SITE, the request should succeed - the request XML should serialize correctly.

Current Behavior

When scope for a VulnException set to ALL_INSTANCES_IN_A_SPECIFIC_SITE the site-id is passed to the request.

Example XML generated
<VulnerabilityExceptionCreateRequest reason='Acceptable Risk' scope='All Instances in a Specific Site' session-id='xxxxx site-id ='2' vuln-id='xxxxx'></VulnerabilityEx ceptionCreateRequest>

Possible Solution

Source of issue found here, pull request to follow
https://github.com/rapid7/nexpose-client/blob/master/lib/nexpose/vuln_exception.rb#L220

Steps to Reproduce (for bugs)

# ....
except =  Nexpose::VulnException.new(vuln_id, Nexpose::VulnException::Scope::ALL_INSTANCES_IN_A_SPECIFIC_SITE, Nexpose::VulnException::Reason::ACCEPTABLE_RISK )
except.site_id = 2
except.save(nsc)
# Retrying the request due to undefined method `sub' for nil:NilClass. If you see this message please open an Issue on Github with the error.

Your Environment

  • Nexpose gem version: 7.0.1
  • Ruby version: ruby 2.3.1p112
  • Operating System and version: Windows 10
@rezen rezen closed this as completed Oct 16, 2017
@rezen
Copy link
Author

rezen commented Oct 16, 2017

Invalid, not source of issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant