Skip to content

fix: Require a signed token for intra-server communication - #7095

Open
patelchaitany wants to merge 1 commit into
feast-dev:masterfrom
patelchaitany:fix/intra-comm-signed-token
Open

patelchaitany wants to merge 1 commit into
feast-dev:masterfrom
patelchaitany:fix/intra-comm-signed-token

Conversation

@patelchaitany

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

A Feast server trusted any token whose preferred_username (OIDC) or sub (Kubernetes) claim matched INTRA_COMMUNICATION_BASE64. The claim was read from an unverified decode, and the feast-feature-server Helm chart hardcoded the value to base64("intra-server-communication"). So anyone who could reach the server could send an unsigned token with that value and skip every RBAC check, in every project.

This PR fixes both halves:

  1. The token is signed. The client signs the intra-server token with HS256 using the shared secret, instead of alg=none. Both OidcTokenParser and KubernetesTokenParser verify that signature before trusting the token. An unsigned token, or one signed with another key, falls through to the normal auth path.
  2. The chart no longer ships the value. INTRA_COMMUNICATION_BASE64 now comes from an existing Secret named by intraCommunicationSecret.name. When that is empty (the default), the variable is not set and server-to-server calls are off.

The shared sign/verify code lives in a small new module, feast/permissions/auth/intra_comm.py, so the client and both parsers agree on the format.

⚠️ Upgrade note

  • Helm users who rely on server-to-server calls must create a Secret with a private random value (32+ bytes) and set intraCommunicationSecret.name. Every Feast server that calls another must use the same Secret.
  • An old client sends unsigned tokens, which a new server rejects. Upgrade both sides together.
  • The Feast operator does not set INTRA_COMMUNICATION_BASE64, so operator deployments are not affected.

Which issue(s) this PR fixes:

Fixes #6785

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Unit test: test_intra_comm_token_must_be_signed_with_shared_secret (OIDC and Kubernetes). A token from Feast's own client is trusted. The same claims unsigned, or signed with another key, are not. The test fails on master and passes here. pytest sdk/python/tests/unit/permissions: 331 passed.

Manual: against OidcTokenParser with INTRA_COMMUNICATION_BASE64 set to the old chart value, the forged alg=none token from the issue:

Before After
Forged unsigned token accepted, all permission checks skipped AuthenticationError

ruff, mypy and detect-secrets pass on the changed files. Helm was not installed locally, so the chart change was not rendered with helm template.

Servers trusted any token whose preferred_username (OIDC) or sub (Kubernetes)
claim matched INTRA_COMMUNICATION_BASE64, read from an unverified decode. The
Helm chart hardcoded that value, so anyone could forge an unsigned token and
skip every RBAC check.

The client now signs the token with HS256 using the shared secret, and both
token parsers verify that signature before trusting it. The Helm chart no
longer ships a fixed value: it reads it from a Secret named by
intraCommunicationSecret.name, and leaves server-to-server calls off when
that is not set.

Fixes feast-dev#6785

Signed-off-by: Chaitany Patel <[email protected]>
@patelchaitany
patelchaitany requested a review from a team as a code owner October 31, 2026 19:39
@codecov-commenter

codecov-commenter commented Oct 31, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.01%. Comparing base (1e5e90c) to head (e3c33cb).

Files with missing lines Patch % Lines
...rmissions/client/kubernetes_auth_client_manager.py 50.00% 1 Missing ⚠️
...sions/client/oidc_authentication_client_manager.py 50.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7095      +/-   ##
==========================================
+ Coverage   50.97%   51.01%   +0.03%     
==========================================
  Files         455      456       +1     
  Lines       56994    57011      +17     
  Branches     8321     8320       -1     
==========================================
+ Hits        29055    29084      +29     
+ Misses      25954    25942      -12     
  Partials     1985     1985              
Flag Coverage Δ
go-feature-server 30.58% <ø> (+0.20%) ⬆️
python-unit 52.47% <94.87%> (+0.02%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/permissions/auth/intra_comm.py 100.00% <100.00%> (ø)
.../feast/permissions/auth/kubernetes_token_parser.py 38.42% <100.00%> (+0.32%) ⬆️
...python/feast/permissions/auth/oidc_token_parser.py 76.11% <100.00%> (+2.78%) ⬆️
...client/intra_comm_authentication_client_manager.py 100.00% <100.00%> (ø)
...rmissions/client/kubernetes_auth_client_manager.py 30.95% <50.00%> (ø)
...sions/client/oidc_authentication_client_manager.py 83.49% <50.00%> (+0.16%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e5e90c...e3c33cb. Read the comment docs.

🚀 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.

This branch has not been deployed

No deployments
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.

Hardcoded intra-server-communication trust value in OidcTokenParser/KubernetesTokenParser allows full unauthenticated RBAC bypass

2 participants