Summary:
X-Frame-Options ALLOW-FROM https://wordpresssite/my-account/ supported by several browsers,
Steps To Reproduce:
- Create a new HTML file.
- Put
<iframe src="https://wordpresssite/my-account/"0"></iframe>
in the file. - Save the file.
- Open document in browser.
Impact:
Attacker may trick user, sending them malicious link then user open it clicked some image and their account unconsciously has been deactivated
Solution:
To fix the vulnerability by adding “frame-ancestors ‘self’;” to the CSP (Content-Security-Policy) header with Nginx, you can add the following line inside your Nginx server block:
add_header Content-Security-Policy "frame-ancestors 'self';";
This will set the frame-ancestors
directive of the Content-Security-Policy
header to 'self'
, which means that only your own domain is allowed to embed your page using <frame>
, <iframe>
, <object>
, <embed>
, or <applet>
FIX:
Content-Security-Policy: frame-ancestors ‘self’ is better, because it checks all frame ancestors. You should implement a CSP header to avoid these sorts of attacks.
You’re welcome!
FRENCH
Résumé:
X-Frame-Options ALLOW-FROM https://wordpresssite/my-account/ pris en charge par plusieurs navigateurs.
Étapes pour reproduire:
- Créez un nouveau fichier HTML.
- Ajoutez
<iframe src="https://wordpresssite/my-account/"0"></iframe>
dans le fichier. - Enregistrez le fichier.
- Ouvrez le document dans un navigateur.
Impact:
Un attaquant peut tromper l’utilisateur en lui envoyant un lien malveillant. L’utilisateur l’ouvre, clique sur une image et son compte est inconsciemment désactivé.
Solution:
Pour corriger la vulnérabilité en ajoutant “frame-ancestors ‘self’;” à l’en-tête CSP (Content-Security-Policy) avec Nginx, vous pouvez ajouter la ligne suivante dans votre bloc de serveur Nginx:
add_header Content-Security-Policy "frame-ancestors 'self';";
Cela définira la directive frame-ancestors
de l’en-tête Content-Security-Policy
sur 'self'
, ce qui signifie que seul votre propre domaine est autorisé à intégrer votre page à l’aide de <frame>
, <iframe>
, <object>
, <embed>
ou <applet>
.
Correction:
Content-Security-Policy: frame-ancestors ‘self’ est mieux, car il vérifie tous les ancêtres de frame. Vous devriez mettre en place un en-tête CSP pour éviter ce genre d’attaques.
De rien!