Repository navigation
Conversation
- Passed the connection address to the application by default - Added NGINX_TRUSTED_PROXIES to read X-Forwarded-For from trusted proxies - Documented that $real_ip and $http_x_forwarded_for can be spoofed
There was a problem hiding this comment.
🔇 Additional comments: 2
images/openwisp_nginx/Dockerfile: 1
139-140: LGTM!images/common/init_command.sh-61-65: 1
61-65: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Add a comment before the validation and real-IP block.
The repository guidelines ask for a comment in shell scripts that explains opaque code. Add a short comment before this block. It must explain three points.
set -fstops glob expansion of proxy entries. The warning covers the legacy spoofable values. The directives trustX-Forwarded-Foronly from listed proxies.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
d0d205de-6de4-4319-bec5-fd96d35f582a
📒 Files selected for processing: 4
docs/user/settings.rstimages/common/init_command.shimages/openwisp_nginx/Dockerfileimages/openwisp_nginx/nginx.template.conf
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
⏰ Context from checks skipped due to timeout: 4
- GitHub Check: auto-assign-issue / run-bot
- GitHub Check: CI Build
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (python)
🧰 Additional context used
📚 Code guidelines: 1
AGENTS.md — auto-discovered
📓 Path-based instructions: 4
Verify that documentation remains consistent with the implemented behavior and does not reference deprecated or removed functionality.
⚙️ CodeRabbit configuration file
Files:
docs/user/settings.rst
Flag potential security vulnerabilities Flag obvious performance regressions, such as heavy loops, repeated I/O, or unoptimized queries Flag unused or redundant code Flag outdated or incorrect comments/docstrings Ensure new code handles err...
⚙️ CodeRabbit configuration file
Files:
images/openwisp_nginx/Dockerfileimages/openwisp_nginx/nginx.template.confdocs/user/settings.rstimages/common/init_command.sh
Source excerpt: Be careful with shell scripts, Docker layers, permissions, entrypoints, health checks, and generated configuration.
📄 CodeRabbit inference engine (AGENTS.md)
Files:
images/common/init_command.sh
Source excerpt: Use `README.rst` and `docs/` for setup, deployment, and usage.
📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/user/settings.rst
🪛 Checkov (3.3.20)
images/openwisp_nginx/Dockerfile
[low] 1-155: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[low] 1-155: Ensure that a user for the container has been created
(CKV_DOCKER_3)
Checklist
Reference to Existing Issue
Related to https://github.com/openwisp/openwisp-radius/security/advisories/GHSA-hvmx-g7m2-vqx8
Description of Changes
Nginx passed the first value of the client-supplied
X-Forwarded-Forheader to the application asREMOTE_ADDR(NINGX_REAL_REMOTE_ADDR='$real_ip'), so any client could choose the IP address seen by OpenWISP, including the addresses allowed to use the FreeRADIUS API.NINGX_REAL_REMOTE_ADDRto$remote_addr, the address of the connection to nginx.NGINX_TRUSTED_PROXIES: when set, nginx reads the client IP address fromX-Forwarded-Foronly for requests coming from the listed reverse proxies (usingset_real_ip_from,real_ip_headerandreal_ip_recursive).NGINX_TRUSTED_PROXIESentry is validated as an IP address or network; invalid entries stop the container with an error.NINGX_REAL_REMOTE_ADDRis still set to$real_ipor$http_x_forwarded_for.NINGX_REAL_REMOTE_ADDRand documentedNGINX_TRUSTED_PROXIES.Upgrade note: deployments behind a load balancer or an ingress that relied on the previous default must set
NGINX_TRUSTED_PROXIESto the addresses of their proxies, otherwise the proxy address is used as the client IP address.Screenshot
N/A