Skip to content

fix(security): strip internal config from tenant endpoint for anonymous users [APP-15344] - #42001

Merged
subrata71 merged 1 commit into
releasefrom
fix/APP-15344-tenant-info-disclosure
Jul 16, 2026
Merged

subrata71 merged 1 commit into
releasefrom
fix/APP-15344-tenant-info-disclosure

Conversation

@subrata71

@subrata71 subrata71 commented Jul 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes APP-15344: the unauthenticated /api/v1/tenants/current endpoint was returning internal configuration fields (Google Maps API key, license details, migration status, feature flags) to anonymous callers.

This is the CE portion of the fix. The EE superset PR is appsmith-ee#9305 (all server tests passing).

Approach: Service-layer filtering strips post-login-only fields when the current user is anonymous, following the same pattern as APP-14994 (PR #41598). Only fields required by the login/signup page are preserved (branding, auth method flags, instance name, third-party auth list). Authenticated users receive the full unmodified response.

CE fields stripped for anonymous users:

  • googleMapsKey (plaintext API key)
  • Full license envelope (replaced with minimal {plan: FREE})
  • isSignupDisabled, emailVerificationEnabled, isStrongPasswordPolicyEnabled
  • isAtomicPushAllowed, featuresWithPendingMigration, migrationStatus
  • pricingPlan (Organization-level)

Changes:

  1. OrganizationConfigurationCE.stripFieldsForAnonymousUser() — strips CE config fields
  2. OrganizationServiceCEImpl.suppressFieldsForAnonymousUser() — checks security context, calls strip if anonymous
  3. OrganizationServiceCEImpl.stripOrganizationFieldsForAnonymousUser() — strips Organization-level fields (overridable by EE)

Test Plan

  • getOrganizationConfig_AnonymousUser_StripsInternalConfiguration — verifies sensitive fields are null
  • getOrganizationConfig_AnonymousUser_PreservesLoginPageFields — verifies login-page fields remain
  • getOrganizationConfig_AuthenticatedUser_ExposesFullConfiguration — no regression for authenticated users
  • Existing APP-14994 tests pass (instanceId/adminEmailDomainHash stripping)

/ok-to-test tags="@tag.All"

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/29452470909
Commit: 151a92e
Cypress dashboard.
Tags: @tag.All
Spec:


Wed, 15 Jul 2026 22:42:14 UTC

Summary by CodeRabbit

  • Security
    • Anonymous users now receive only minimal organization configuration and license details.
    • Sensitive settings, pricing information, and privilege-related fields are hidden from unauthenticated access.
  • Bug Fixes
    • Authenticated users continue to receive complete organization configuration details, including updated settings.

…us users [APP-15344]

The /api/v1/tenants/current endpoint is unauthenticated (needed for the
login page) but was returning internal configuration fields like Google
Maps API keys, license details, migration status, and feature flags to
anonymous callers.

Add service-layer filtering that strips post-login-only fields when the
current user is anonymous, preserving only what the login/signup page
needs (branding, auth method flags, instance name, third-party auth
list). Authenticated users continue to receive the full response.
@subrata71
subrata71 requested a review from a team as a code owner July 15, 2026 21:35
@linear-code

linear-code Bot commented Jul 15, 2026

Copy link
Copy Markdown

APP-15344

@subrata71 subrata71 added ok-to-test Required label for CI Security Issues related to information security within the product labels Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Organization configuration responses now sanitize sensitive fields for anonymous users, retain minimal FREE license data, and preserve full updated configuration for authenticated users. Tests cover both visibility paths and login-page fields.

Changes

Organization configuration filtering

Layer / File(s) Summary
Anonymous sanitization flow
app/server/appsmith-server/src/main/java/com/appsmith/server/domains/ce/OrganizationConfigurationCE.java, app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/OrganizationServiceCEImpl.java
Adds anonymous-field stripping, applies it during configuration retrieval, resets migration status and license data, and clears the organization pricing plan.
Configuration visibility validation
app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/OrganizationServiceCETest.java
Verifies stripped anonymous responses, retained login-page fields, and full configuration visibility for authenticated users.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OrganizationServiceCEImpl
  participant SecurityContext
  participant OrganizationConfigurationCE

  Client->>OrganizationServiceCEImpl: Request organization configuration
  OrganizationServiceCEImpl->>SecurityContext: Read current principal
  SecurityContext-->>OrganizationServiceCEImpl: Anonymous or authenticated principal
  alt Anonymous principal
    OrganizationServiceCEImpl->>OrganizationConfigurationCE: Strip sensitive fields
    OrganizationConfigurationCE-->>OrganizationServiceCEImpl: Minimal FREE license configuration
  else Authenticated principal
    OrganizationServiceCEImpl-->>Client: Full organization configuration
  end
  OrganizationServiceCEImpl-->>Client: Return organization configuration
Loading

Poem

Hidden fields fade from view,
A FREE license shines anew.
Logged-in settings travel whole,
Tests guard each access role.
Clean responses reach the shore.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly matches the main security fix: stripping internal tenant config from anonymous users.
Description check ✅ Passed The description includes issue context, approach, tests, and automation details, but it omits the required Communication section checkbox.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/APP-15344-tenant-info-disclosure

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

Comment @coderabbitai help to get the list of available commands.

@subrata71
subrata71 merged commit c670438 into release Jul 16, 2026
90 of 93 checks passed
@subrata71
subrata71 deleted the fix/APP-15344-tenant-info-disclosure branch July 16, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI Security Issues related to information security within the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants