---
title: "WEB-NODE-003 Node.js Service Not Running in Production Mode"
canonical: https://openvapt.com/checks/WEB-NODE-003.html
html: https://openvapt.com/checks/WEB-NODE-003.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# WEB-NODE-003 Node.js Service Not Running in Production Mode

Checks whether Node.js services set NODE_ENV=production.

- Domain: Web Apps
- Severity: Low
- Control category: Secure Configuration
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`
- CIS Controls v8: 16.7
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-489, CWE-209
- OWASP Top 10 2021: A05:2021
- OWASP ASVS 4.0.3: 14.3.2
- NIST SP 800-53 Rev. 5: CM-6

## Why It Matters

Express and many other frameworks treat a missing NODE_ENV as development: error pages then include stack traces with file paths, and caching and other production safeguards are off.

## How It Detects

For long-running services whose ExecStart= runs node, npm, yarn, pnpm or pm2, reads Environment= and fails when NODE_ENV is missing or not production. Variables loaded with EnvironmentFile= are read only for NODE_ENV.

## How to Fix

Add Environment=NODE_ENV=production to the [Service] section (systemctl edit <unit>), run systemctl daemon-reload and restart the service.

## How to Verify

```
systemctl show -p Environment <unit>  includes NODE_ENV=production.
```

## Learn the Theory

- [P13 Application Servers: Tomcat, Node.js and Python](https://openvapt.com/academy/p13.md)

## References

- [Express documentation, Production best practices: performance and reliability](https://expressjs.com/en/advanced/best-practice-performance/)
- [OWASP Node.js Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/web/runtimes.go

Run it: `openvapt scan --only WEB-NODE-003`. Read it offline: `openvapt explain WEB-NODE-003`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/WEB-NODE-003.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
