Skip to content

fix: handler auth - #77

Merged
Soap2G merged 6 commits into
vre-hub:mainfrom
btwshivam:fix/handler-auth
Sep 2, 2026
Merged

Soap2G merged 6 commits into
vre-hub:mainfrom
btwshivam:fix/handler-auth

Conversation

@Soap2G

@Soap2G Soap2G commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

None of the extension's 10 server handlers required authentication; tornado.web.authenticated was never imported or applied, so every endpoint was reachable by any caller who could reach the singleuser pod.

@Soap2G Soap2G left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @btwshivam
Thank you for these changes.
One quick comment, for the record: is_allowed_reana_server() does not resolve hostnames (resolving them here to check, then reconnecting, opens a DNS-rebinding TOCTOU).
This means a caller-supplied hostname that resolves to an internal address is not blocked unless REANA_ALLOWED_SERVER_HOSTS is set to an explicit allowlist.

Please have a look to the pipeline failing, and we can probably merge.

@btwshivam

Copy link
Copy Markdown
Contributor

Hi @btwshivam Thank you for these changes. One quick comment, for the record: is_allowed_reana_server() does not resolve hostnames (resolving them here to check, then reconnecting, opens a DNS-rebinding TOCTOU). This means a caller-supplied hostname that resolves to an internal address is not blocked unless REANA_ALLOWED_SERVER_HOSTS is set to an explicit allowlist.

Please have a look to the pipeline failing, and we can probably merge.

you're right, and it's deliberate. Resolving to check and then letting requests reconnect just re-resolves at connect time soo it doesn't actually help. allowlist (REANA_ALLOWED_SERVER_HOSTS) is the real control, and I've set it to reana-vre.cern.ch on the deployment side (vre-hub/vre#327). I also tightened the IP path here, since it missed a few cases: 0.0.0.0, multicast, and IPv4-mapped IPv6 like ::ffff:169.254.169.254

@btwshivam

Copy link
Copy Markdown
Contributor

have fixed the ci also

@codecov

codecov Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
reana_jupyterlab/handlers/connection.py 100.00% <100.00%> (+10.71%) ⬆️
reana_jupyterlab/handlers/files.py 100.00% <100.00%> (ø)
reana_jupyterlab/handlers/utils.py 100.00% <100.00%> (ø)
reana_jupyterlab/handlers/workflows.py 95.56% <100.00%> (+1.56%) ⬆️
reana_jupyterlab/tests/test_auth.py 100.00% <100.00%> (ø)
reana_jupyterlab/tests/test_connection.py 100.00% <100.00%> (ø)
reana_jupyterlab/tests/test_files.py 97.05% <ø> (ø)
reana_jupyterlab/tests/test_utils.py 100.00% <100.00%> (ø)
reana_jupyterlab/tests/test_workflows.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Soap2G

Soap2G commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@btwshivam Let's have a look also at the code coverage :)

@btwshivam

Copy link
Copy Markdown
Contributor

@btwshivam Let's have a look also at the code coverage :)

Thanks done !

@Soap2G
Soap2G merged commit 7c1c43c into vre-hub:main Sep 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants