Repository navigation
fix(security): strip internal config from tenant endpoint for anonymous users [APP-15344] - #42001
Merged
Merged
Conversation
…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.
Contributor
WalkthroughOrganization 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. ChangesOrganization configuration filtering
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
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
vivek-appsmith
approved these changes
Jul 16, 2026
1 of 2 tasks
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes APP-15344: the unauthenticated
/api/v1/tenants/currentendpoint 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)licenseenvelope (replaced with minimal{plan: FREE})isSignupDisabled,emailVerificationEnabled,isStrongPasswordPolicyEnabledisAtomicPushAllowed,featuresWithPendingMigration,migrationStatuspricingPlan(Organization-level)Changes:
OrganizationConfigurationCE.stripFieldsForAnonymousUser()— strips CE config fieldsOrganizationServiceCEImpl.suppressFieldsForAnonymousUser()— checks security context, calls strip if anonymousOrganizationServiceCEImpl.stripOrganizationFieldsForAnonymousUser()— strips Organization-level fields (overridable by EE)Test Plan
getOrganizationConfig_AnonymousUser_StripsInternalConfiguration— verifies sensitive fields are nullgetOrganizationConfig_AnonymousUser_PreservesLoginPageFields— verifies login-page fields remaingetOrganizationConfig_AuthenticatedUser_ExposesFullConfiguration— no regression for authenticated users/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.AllSpec:
Wed, 15 Jul 2026 22:42:14 UTC
Summary by CodeRabbit