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

1.5 KiB

id title challengeType forumTopicId dashedName
587d8247367417b2b2512c37 Nascondere informazioni potenzialmente pericolose usando helmet.hidePoweredBy() 2 301580 hide-potentially-dangerous-information-using-helmet-hidepoweredby

--description--

Come promemoria, questo progetto verrà costruito a partire dalla seguente bozza su Replit, o clonato da GitHub.

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

(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--

/**
  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.
*/