How to patch your Drupal 8 regarding SA-CORE-2018-004
Check if your site doesn't have SA-CORE-2018-002 security update
If not please follow this manual How to patch your Drupal 8 regarding SA-CORE-2018-002
All changes in here is based on original patch for Drupal 8.5.2