---
title: "WEB-APP-005 Rails Production Does Not Force HTTPS"
canonical: https://openvapt.com/checks/WEB-APP-005.html
html: https://openvapt.com/checks/WEB-APP-005.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-APP-005 Rails Production Does Not Force HTTPS

Checks config/environments/production.rb for config.force_ssl = true.

- Domain: Web Apps
- Severity: Medium
- Control category: Web Application Security
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N`
- CIS Controls v8: 16.7
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-319, CWE-614
- OWASP Top 10 2021: A02:2021, A05:2021
- OWASP ASVS 4.0.3: 9.1.1, 3.4.1
- OWASP WSTG v4.2: WSTG-CRYP-03
- NIST SP 800-53 Rev. 5: SC-8, CM-6

## Why It Matters

force_ssl redirects plain HTTP to HTTPS, marks cookies Secure and sends Strict-Transport-Security. Without it a session cookie can travel over HTTP once and be read on the network, even when the site also works over HTTPS.

## How It Detects

Finds config/environments/production.rb in the project folders and fails when config.force_ssl is false or absent (comments removed). An assume_ssl-only setup still fails because cookies are not marked Secure.

## How to Fix

Set config.force_ssl = true in config/environments/production.rb (and config.assume_ssl = true behind a TLS-terminating proxy), then restart the application.

## How to Verify

```
grep -n force_ssl config/environments/production.rb  shows true, and curl -I http://<site>/ returns a 301 to https.
```

## Learn the Theory

- [A6 Application Framework and CMS Configuration](https://openvapt.com/academy/a6.md)

## References

- [Ruby on Rails Guides, Configuring Rails Applications](https://guides.rubyonrails.org/configuring.html)
- [Ruby on Rails Guides, Securing Rails Applications](https://guides.rubyonrails.org/security.html)

## Source Code

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

Run it: `openvapt scan --only WEB-APP-005`. Read it offline: `openvapt explain WEB-APP-005`.

---

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-APP-005.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
