Skip to content

Prevent DuckDB token disclosure - #3

Merged
hjosugi merged 1 commit into
mainfrom
agent/fix-issue-2-token-leak
Jul 10, 2026
Merged

Prevent DuckDB token disclosure#3
hjosugi merged 1 commit into
mainfrom
agent/fix-issue-2-token-leak

Conversation

@hjosugi

@hjosugi hjosugi commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • read ICEBERG_TOKEN with DuckDB getenv() instead of embedding its value in generated SQL
  • update bash, zsh, and PowerShell setup guidance
  • bump the project to v1.0.1 and verify all version declarations agree
  • reject release tags that do not match VERSION

Root cause

The SQL generator interpolated Settings.token into a CREATE SECRET statement. Redirecting the documented command therefore wrote the R2 API token to disk, and entering equivalent SQL directly could expose it through DuckDB CLI history.

DuckDB 1.3 added expression support in CREATE SECRET; this project requires DuckDB 1.4+, so getenv('ICEBERG_TOKEN') is available.

Security impact

Generated SQL and release examples no longer contain the configured R2 token. The credential exists only in the DuckDB process environment and in DuckDB's temporary in-memory secret.

Validation

  • pytest: 8 passed
  • ruff check .: passed
  • generated SQL contains getenv('ICEBERG_TOKEN') and not a sentinel token
  • v1.0.1 release ZIP built successfully
  • git diff --check: passed

Closes #2

@hjosugi
hjosugi marked this pull request as ready for review July 10, 2026 13:34
@hjosugi
hjosugi merged commit 87da7f0 into main Jul 10, 2026
1 check passed
@hjosugi
hjosugi deleted the agent/fix-issue-2-token-leak branch July 10, 2026 13:37
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.

Avoid embedding R2 tokens in generated DuckDB SQL

1 participant