Visitar URL original
Encryption reader should reject key metadata without file_length · Issue #4011 · apache/iceberg-python · GitHub
Skip to content

Encryption reader should reject key metadata without file_length #4011

Description

@xanderbailey

The AGS1 block layout has to be derived from the trusted file_length in StandardKeyMetadata rather than a filesystem stat, otherwise an attacker can drop trailing blocks and every remaining block still authenticates. The reader should fail when file_length is missing, or when it disagrees with the bytes that are actually readable, matching iceberg-rust after apache/iceberg-rust#3236.

Part of #3222

Activity

  1. anbv29 commented on Sep 24, 2026

    @anbv29

    Hi! I’d like to understand the encryption-reader invariant, add a failing test for missing file_length, and propose a safe validation fix. Could a maintainer confirm the intended error behavior?

  2. xanderbailey commented on Sep 24, 2026

    @xanderbailey
    ContributorAuthor

    I’ll try and make this explicit in the coming PRs as we progress with the encryption work

  3. anbv29 commented on Sep 24, 2026

    @anbv29

    Hi! I’d be happy to help with this. Would you welcome a contribution that adds regression tests for missing or inconsistent file_length metadata, followed by the reader validation fix? If so, could you point me to the relevant reader code or any in-progress PR that I should coordinate with?

  4. xanderbailey commented on Sep 24, 2026

    @xanderbailey
    ContributorAuthor

    We don’t have the encryption reader yet, this is more of a tracking issue to make sure we don’t forget this specific issue rather than it being an active bug. Once the linked PR merges I’ll start working on the readers and writers for streaming encryption and we should be able to close this one! Happy to tag you in those PRs as they go up!

  5. anbv29 commented on Sep 24, 2026

    @anbv29

    That sounds great, please tag me when the reader/writer PRs are up. I’d be glad to review the validation path and help add the regression tests once the relevant code is available. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions