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

1.3 KiB

id title challengeType forumTopicId dashedName
587d8247367417b2b2512c37 Hide Potentially Dangerous Information Using helmet.hidePoweredBy() 2 301580 hide-potentially-dangerous-information-using-helmet-hidepoweredby

--description--

As a reminder, this project is being built upon the following starter project on Replit, or cloned from GitHub.

Hackers can exploit known vulnerabilities in Express/Node if they see that your site is powered by Express. X-Powered-By: Express is sent in every request coming from Express by default. Use the helmet.hidePoweredBy() middleware to remove the X-Powered-By header.

--hints--

helmet.hidePoweredBy() middleware should be mounted correctly

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