Skip to content

fix(nginx): validate terminal request origins on 7.4 - #2830

Merged
tom mortensen (limetech) merged 1 commit into
masterfrom
fix/terminal-origin-74
Dec 4, 2026
Merged

tom mortensen (limetech) merged 1 commit into
masterfrom
fix/terminal-origin-74

Conversation

@SimonFair

@SimonFair SimonFair commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

The web terminal and log terminal now check the origin header when a client sends one.

Requests from the WebGUI origin and clients that omit the header keep their existing behavior. A different origin receives a 403 response.

Shell syntax and generated route checks passed. The change also merges cleanly with the open route changes for this release branch. Appliance QA remains pending.

OS-1087 (7.4.1)

Summary by CodeRabbit

  • Bug Fixes
    • Updated the web terminal and log terminal to accept requests without an Origin header or with an origin matching the current site. Requests from other origins now receive an HTTP 403 response.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The generated /webterminal and /logterminal proxy locations now allow requests with no Origin header or an exact match to $scheme://$http_host. They return HTTP 403 for other origins.

Changes

Terminal Origin Checks

Layer / File(s) Summary
Validate terminal request origins
etc/rc.d/rc.nginx
Both terminal proxy locations allow requests with no Origin header or an exact scheme-and-host match. They return HTTP 403 for other origins.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 5323a

Terminal requests carrying a foreign Origin header now receive 403. Requests with no Origin header or with a matching WebGUI origin keep working. No concrete merge-blocking issue was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix (validating terminal request origins) and the component (nginx), which matches the single change in etc/rc.d/rc.nginx: /webterminal and /logterminal locations now accept reques…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix (validating terminal request origins) and the component (nginx), which matches the single change in etc/rc.d/rc.nginx: /webterminal and /logterminal locations now accept requests with no Origin header or with an Origin equal to the scheme and host, and return 403 for other origins. The '7.4' reference points to the release branch and OS-1087 (7.4.1) noted in the objectives, so it is a version tag rather than a description of the change. The title is specific and related to the main change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the headers at the door,
No Origin? Hop right in across the floor.
A matching host may pass along the way,
Other origins meet a 403 today.
Two terminal paths now share this check,
The rabbit gives a pleased and careful peck.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3aaf52cf-830a-4a17-8f4b-8ac1f5887a18
Commits

Reviewing files that changed from the base of the PR and between b135287 and 5323ad3.

Files selected for processing: 1

  • etc/rc.d/rc.nginx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.11.10.1727
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2830/webgui-pr-2830.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
etc/rc.d/rc.nginx

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2830, or run:

plugin remove webgui-pr-2830

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@SimonFair
SimonFair marked this pull request as ready for review November 17, 2026 11:04
@unraid-bot Unraid Bot (unraid-bot) added QA Passed QA passed (auto-managed by notification-worker) 7.4.2 Approved for release 7.4.2 (auto-managed by notification-worker) labels Dec 2, 2026
@limetech
tom mortensen (limetech) merged commit 8e4eb4b into master Dec 4, 2026
@limetech
tom mortensen (limetech) deleted the fix/terminal-origin-74 branch December 4, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.4.2 Approved for release 7.4.2 (auto-managed by notification-worker) QA Passed QA passed (auto-managed by notification-worker)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants