Before version 4.8.2, WordPress mishandled % characters and additional placeholder values in $wpdb->prepare, and thus did not properly address the possibility of plugins and themes enabling SQL injection attacks.
https://www.debian.org/security/2017/dsa-3997
https://wordpress.org/news/2017/09/wordpress-4-8-2-security-and-maintenance-release/
https://github.com/WordPress/WordPress/commit/fc930d3daed1c3acef010d04acc2c5de93cd18ec
https://github.com/WordPress/WordPress/commit/70b21279098fc973eae803693c0705a548128e48
https://core.trac.wordpress.org/changeset/41496
https://core.trac.wordpress.org/changeset/41470