Server Information Disclosure: Why Hiding Your Tech Stack Matters
Server headers and error pages reveal your web server and framework version to attackers. Learn how to minimize information disclosure.

Every HTTP response your server sends includes headers that can reveal what software you're running. The Server header, X-Powered-By header, and detailed error pages tell attackers exactly which versions of web servers, frameworks, and languages your site uses. This information helps them target known vulnerabilities specific to your stack.
What Information Gets Disclosed?
Server Header
The Server response header often reveals the web server name and version:
Server: Apache/2.4.52 (Ubuntu)
Server: nginx/1.22.1
Server: Microsoft-IIS/10.0
X-Powered-By Header
Frameworks and languages add this header automatically:
X-Powered-By: PHP/8.1.12
X-Powered-By: Express
X-Powered-By: ASP.NET
X-Powered-By: Next.js
Other Disclosure Vectors
- X-AspNet-Version: Reveals .NET framework version
- X-Generator: CMS name and version (WordPress, Drupal)
- Error pages: Default 404/500 pages reveal server type, version, and sometimes stack traces
- Response patterns: Header order, date formats, and behavior differences fingerprint the server
- HTML meta tags: <meta name="generator" content="WordPress 6.4">
Why This Is Dangerous
Information disclosure enables targeted attacks:
- CVE exploitation: Knowing the exact server version lets attackers search for specific CVEs and use pre-built exploits
- Attack surface mapping: Understanding your stack helps attackers choose the most effective attack vectors
- Automated scanning: Tools like Shodan index Server headers, making your version searchable across the internet
- Supply chain attacks: Knowledge of your framework and plugins reveals potential dependency vulnerabilities
How to Remove Information Disclosure
Nginx
# Hide server version
server_tokens off;
# Remove Server header entirely (requires headers-more module)
more_clear_headers Server;
Apache
# Minimize Server header
ServerTokens Prod
ServerSignature Off
# Remove X-Powered-By (PHP)
# In php.ini:
expose_php = Off
Express.js
// Remove X-Powered-By header
app.disable('x-powered-by');
// Or use Helmet
const helmet = require('helmet');
app.use(helmet.hidePoweredBy());
Next.js
// next.config.js
module.exports = {
poweredByHeader: false,
}
ASP.NET
<!-- web.config -->
<system.web>
<httpRuntime enableVersionHeader="false" />
</system.web>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
</system.webServer>
Custom Error Pages
Default error pages are a major information leak. Replace them with custom pages that reveal nothing about your stack:
- Create custom 404, 500, and 403 error pages
- Never display stack traces in production
- Use generic error messages without technology references
- Disable debug mode in production environments
The Security Through Obscurity Debate
Hiding server information is not a substitute for patching and proper security configuration. An attacker can still fingerprint your server through behavioral analysis. However, removing obvious version information:
- Raises the bar for casual automated attacks
- Prevents your server from being indexed in version-specific Shodan searches
- Demonstrates security awareness to auditors and compliance teams
- Follows the principle of least information — don't reveal what you don't have to
Server Information Disclosure Checklist
- Remove or minimize the Server response header
- Remove X-Powered-By header
- Disable version exposure in PHP (expose_php = Off)
- Remove X-AspNet-Version and X-Generator headers
- Replace default error pages with custom pages
- Disable debug/development mode in production
- Remove CMS generator meta tags from HTML
- Run a SecScanner scan to detect remaining information disclosure
While hiding your server version alone won't stop a determined attacker, it's an easy win that removes low-hanging fruit and demonstrates security best practices. Combined with regular patching, it significantly reduces your risk profile.
Related Articles
Check Your Website Security
Want to see how your website measures up? Run a free security scan with SecScanner to identify vulnerabilities and get actionable remediation guidance.
Scan Your Website Free