Trust Payments Gateway For Woocommerce
An authentication bypass exists when the `new customer account()` function stores the raw return value of `wp create user()` into the `tp userid` post meta without first evaluating the `is wp error()` guard. If a username collision occurs, a `WP Error` object is stored. The `add customer details to thankyou page()` callback then reads this meta and casts it as an integer, which PHP coerces to `1`. This leads to the unconditional execution of `wp set current user(1)` and `wp set auth cookie(1)`, allowing an unauthenticated attacker to authenticate as the site administrator (user ID 1). To exploit this, the attacker must provide a `new username` parameter that matches an existing login during checkout and complete a paid order.