• L
    hyperv: Escape WQL queries · 5ae2d9c2
    Ladi Prosek 提交于
    The code was vulnerable to SQL injection. Likely not a security issue due to
    WMI SQL and other constraints but still lame. For example:
    
      virsh # dominfo \"
      error: failed to get domain '"'
      error: internal error: SOAP fault during enumeration: code 's:Sender', subcode
      'n:CannotProcessFilter', reason 'The data source could not process the filter.
      The filter might be missing or it might be invalid. Change the filter and try
      the request again.  ', detail 'The WS-Management service cannot process the
      request. The WQL query is invalid. '
    
    This commit fixes the Hyper-V driver by escaping all WMI SQL string parameters.
    
    The same command with the fix:
    
      virsh # dominfo \"
      error: failed to get domain '"'
      error: Domain not found: No domain with name "
    Signed-off-by: NLadi Prosek <lprosek@redhat.com>
    5ae2d9c2
virbuffer.c 22.7 KB