# x-powered-by

Rule `sonarjs/x-powered-by`. Web application technologies should not disclose version information

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1387 by reach, #688 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/x-powered-by` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-5689/) |

## Code examples

### Correct: the rule accepts this

```js
let express = require('express');

let app1 = express();  // Compliant
app1.disable("x-powered-by");

let helmet = require("helmet");
let app2 = express(); // Compliant
app2.use(helmet.hidePoweredBy());
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/x-powered-by": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/weak-ssl](https://lintradar.dev/rules/sonarjs/weak-ssl.md): Weak SSL/TLS protocols should not be used
- [sonarjs/xml-parser-xxe](https://lintradar.dev/rules/sonarjs/xml-parser-xxe.md): XML parsers should not be vulnerable to XXE attacks
- [sonarjs/void-use](https://lintradar.dev/rules/sonarjs/void-use.md): "void" should not be used
- [sonarjs/vitest-mock-at-module-scope](https://lintradar.dev/rules/sonarjs/vitest-mock-at-module-scope.md): Vi.mock should be declared at module scope
- [sonarjs/use-type-alias](https://lintradar.dev/rules/sonarjs/use-type-alias.md): Type aliases should be used
- [sonarjs/updated-loop-counter](https://lintradar.dev/rules/sonarjs/updated-loop-counter.md): Loop counters should not be assigned within the loop body

---

Web page: https://lintradar.dev/rules/sonarjs/x-powered-by. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
