Skip to content

SEC-147 | lBock sensitive file paths in FileClient.upload_file()#824

Merged
Aryamanz29 merged 5 commits intomainfrom
SEC-147
Mar 6, 2026
Merged

SEC-147 | lBock sensitive file paths in FileClient.upload_file()#824
Aryamanz29 merged 5 commits intomainfrom
SEC-147

Conversation

@Aryamanz29
Copy link
Copy Markdown
Member

@Aryamanz29 Aryamanz29 commented Mar 6, 2026

✨ Description

https://linear.app/atlan-epd/issue/SEC-147/vdp-report-arbitrary-file-read-in-fileclient-via-upload-file-in


🧩 Type of change

Select all that apply:

  • 🚀 New feature (non-breaking change that adds functionality)
  • 🐛 Bug fix (non-breaking change that fixes an issue) — please include tests! Refer testing-toolkit 🧪
  • 🔄 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧹 Maintenance (chores, cleanup, minor improvements)
  • 💥 Breaking change (fix or feature that may break existing functionality)
  • 📦 Dependency upgrade/downgrade
  • 📚 Documentation updates

✅ How has this been tested? (e.g. screenshots, logs, workflow links)

Describe how the change was tested. Include:

  • Steps to reproduce
  • Any relevant screenshots, logs, or links to successful workflow runs
  • Details on environment/setup if applicable

📋 Checklist

  • My code follows the project’s style guidelines
  • I’ve performed a self-review of my code
  • I’ve added comments in tricky or complex areas
  • I’ve updated the documentation as needed
  • There are no new warnings from my changes
  • I’ve added tests to cover my changes
  • All new and existing tests pass locally

Aryamanz29 and others added 4 commits March 6, 2026 14:07
Add a check for '..' components in the file path passed to
FileUpload.validate_file_path, raising a new INVALID_UPLOAD_FILE_PATH_TRAVERSAL
error (ATLAN-PYTHON-400-077) if detected. Also use Path.resolve() to
normalize the path before opening, preventing directory traversal attacks.

Closes SEC-147

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend validate_file_path to reject:
- System directories: /etc/, /proc/, /sys/, /dev/, /root/, macOS equivalents
- Credential directories: .aws, .ssh, .gnupg anywhere in the resolved path
- Environment/secret files: .env, .env.local, .env.production, etc.

Raises new INVALID_UPLOAD_FILE_PATH_SENSITIVE error (ATLAN-PYTHON-400-078)
for all sensitive path matches, in addition to the existing traversal
check (ATLAN-PYTHON-400-077) for '..' components.

Closes SEC-147

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Users can now extend the upload path blocklist without modifying the SDK:
  PYATLAN_SENSITIVE_SYSTEM_PREFIXES  – additional path prefixes (e.g. /vault/,/secrets/)
  PYATLAN_SENSITIVE_DIR_NAMES        – additional hidden dir names (e.g. .vault,.myconfig)
  PYATLAN_SENSITIVE_FILE_PREFIXES    – additional file name prefixes (e.g. .credentials)

Each env var accepts a comma-separated list merged with the built-in defaults at call time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…E_BLOCKED_PATHS

Replace three separate env vars (PYATLAN_SENSITIVE_SYSTEM_PREFIXES,
PYATLAN_SENSITIVE_DIR_NAMES, PYATLAN_SENSITIVE_FILE_PREFIXES) with a single
PYATLAN_UPLOAD_FILE_BLOCKED_PATHS that accepts comma-separated path patterns
matched as substrings against the full resolved file path. Also update the
error message from "Access to sensitive" to "Access to blocked".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Aryamanz29 Aryamanz29 self-assigned this Mar 6, 2026
@Aryamanz29 Aryamanz29 added change Pyatlan change pull request breaking-change labels Mar 6, 2026
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@Aryamanz29 Aryamanz29 merged commit de441ba into main Mar 6, 2026
8 of 9 checks passed
@Aryamanz29 Aryamanz29 deleted the SEC-147 branch March 6, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change change Pyatlan change pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant