Skip to content

WordPressVIPMinimum.Variables.ServerVariables.UserControlledHeaders wrong & incomplete #477

Description

@kkmuffme
  1. I get 1) WordPressVIPMinimum.Variables.ServerVariables.UserControlledHeaders even when it's perfectly fine sanitized:

$user_ip = filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP );

or with wp only functions (though I'm not sure if it really is properly sanitized then)

sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )

What is the correct way of validating this this sniff expects?

  1. this error doesn't make much sense, as it's limited to 3 headers. But there is an arbitrary number of HTTP headers the client could send which would not trigger this error but may be used.
    E.g. when using cloudflare there's also the CF_IPCOUNTRY,... headers which would also need to be added to the check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions