freeCodeCamp/curriculum/challenges/italian/09-information-security/information-security-with-h.../hide-potentially-dangerous-...

41 lines
1.5 KiB
Markdown
Raw Normal View History

---
id: 587d8247367417b2b2512c37
title: Nascondere informazioni potenzialmente pericolose usando helmet.hidePoweredBy()
challengeType: 2
forumTopicId: 301580
dashedName: hide-potentially-dangerous-information-using-helmet-hidepoweredby
---
# --description--
Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su <a href="https://replit.com/github/freeCodeCamp/boilerplate-infosec" target="_blank" rel="noopener noreferrer nofollow">Replit</a>, o clonato da <a href="https://github.com/freeCodeCamp/boilerplate-infosec/" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>.
Gli hacker possono sfruttare le vulnerabilità conosciute in Express/Node se vedono che il tuo sito è alimentato da Express. `X-Powered-By: Express` viene inviato in ogni richiesta proveniente da Express per impostazione predefinita. Usa il middleware `helmet.hidePoweredBy()` per rimuovere l'intestazione X-Powered-By.
# --hints--
Il middleware helmet.hidePoweredBy() deve essere montato correttamente
```js
(getUserInput) =>
$.get(getUserInput('url') + '/_api/app-info').then(
(data) => {
assert.include(data.appStack, 'hidePoweredBy');
assert.notEqual(data.headers['x-powered-by'], 'Express');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
# --solutions--
```js
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```