diff --git a/plugins/woocommerce/src/StoreApi/Schemas/V1/AbstractAddressSchema.php b/plugins/woocommerce/src/StoreApi/Schemas/V1/AbstractAddressSchema.php index 4c3a5b21d4a..81ce3b99201 100644 --- a/plugins/woocommerce/src/StoreApi/Schemas/V1/AbstractAddressSchema.php +++ b/plugins/woocommerce/src/StoreApi/Schemas/V1/AbstractAddressSchema.php @@ -123,6 +123,8 @@ abstract class AbstractAddressSchema extends AbstractSchema { array_keys( $address ), function( $carry, $key ) use ( $address, $validation_util, $field_schema ) { if ( ! isset( $field_schema[ $key ] ) ) { + // Sanitize text field since we have no info about what it *should* be. Sanitizing it is safer than leaving it alone. + $carry[ $key ] = sanitize_text_field( $address[ $key ] ); return $carry; } switch ( $key ) {