Skip to content

security: Auth fails open when token owner can't be resolved #57

Description

@datasciencemonkey

Problem

In app.py, if app_owner can't be resolved (SDK unavailable, token invalid, network error), the auth check allows all access:

def check_authorization():
    if not app_owner:
        return True, None  # ← fails open

This means if the Databricks SDK fails to resolve the token owner at startup, the app runs with no authentication — anyone with the URL can access the terminal and all coding agents.

Expected behavior

Should fail closed: if the owner can't be determined, deny all access. Better to have a broken app than an open terminal with a PAT.

Fix

  • If app_owner is None and we're running on Databricks Apps (not local dev), return False
  • Allow the fail-open behavior only for local development (DATABRICKS_APP_PORT not set or similar)

Impact

Any user who can reach the app URL gets full terminal access with the PAT owner's credentials, including:

  • Databricks workspace access
  • AI Gateway / model serving
  • Unity Catalog data access
  • Shell execution

Activity

  1. datasciencemonkey commented on Mar 11, 2026

    @datasciencemonkey
    OwnerAuthor

    Fixed in PR #56 (commit d1ad4e2). Auth now fails closed on Databricks Apps when app_owner can't be resolved. Fail-open only allowed for local development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions