Skip to content

SameSite=none is added for incompatible clients when restrict_irule_events is disabled #10

@raZorTT

Description

@raZorTT

Hi team

I have noticed an issue using the SameSite iRule (v1.5) when I have ACCESS::restrict_irule_events disable configured and have the BIGIP configured as a SAML SP (although I suspect it will affect a wider range of APM cases). Despite the client being known as incompatible, the samesite=none is still being added.

I came across this when troubleshooting issues using iOS v12.5.x, which according to this known issue, will treat samesite=none as strict. When the client is redirected back to APM after authenticating with the IdP, the browser doesn't send the MRHSession cookie, so APM can't identify the existing session and denies the request.

The response from the initial request that hits the BIG-IP is fine

HTTP/1.0 302 Found
Server: BigIP
Connection: Close
Content-Length: 0
Location: /my.policy
Set-Cookie: LastMRH_Session=b4afa2ef; domain=mytest.xyz;path=/;secure
Set-Cookie: MRHSession=76e5ba2ee923caaa805a7024b4afa2ef; domain=mytest.xyz;path=/;secure

However, the response from /my.policy has the samesite=none added to the cookie

HTTP/1.1 200 OK
Server: BigIP
Content-Length: 5816
X-Frame-Options: DENY
Cache-Control: no-store
Set-Cookie: LastMRH_Session=b4afa2ef; domain=mytest.xyz;path=/;secure; samesite=none
Set-Cookie: MRHSession=9422a19a6fd9ac7aa764c3bbb4afa2ef; domain=mytest.xyz;path=/;secure; samesite=none

When restrict_irule_events is disabled, the internal APM events don't include a User-Agent header, which is normally fine. However, the SameSite iRule events are also triggered for each of those requests, and a blank user agent is passed into the checkSameSiteCompatible proc.

When the proc runs with a blank user agent it returns 1 by default because it no longer matches any of the incompatible agents.

# If the current user-agent didn't match any known incompatible browser list, assume it can handle SameSite=None 
return 1

As a result, the samesite_none_compatible variable is set to 1 and on the final HTTP_RESPONSE_RELEASE event, the samesite=none is added to the cookie.

I noticed that if you enable an incompatible client via the testing http_request event that's in the irule, it all works fine. Adding the header in that manner forces the incompatible UA to be inserted into the internal APM requests and the proc runs as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions