Skip to content

Respect configured log facade level filters #1139

Closed

Description

@tnull

At main 1dea48a5ea06e5af2eabbf0633b32aee3338bd6c, Writer::LogFacadeWriter forwards records directly through log::logger().log(...). This bypasses the facade's runtime max_level() and compile-time STATIC_MAX_LEVEL gates.

An application using set_log_facade_logger() can set the global maximum to Error and still have an Info record delivered to a sink that relies on facade filtering. Lower-level records can contain transaction data or LNURL-auth URLs, so unexpected delivery can also affect privacy depending on the sink. This report does not establish disclosure of an unrevealed secret.

Apply the normal facade level checks before constructing and delivering the record, for both UniFFI configurations. Preserve the current level mapping, target/module, source line and structured context. Checking only the sink's enabled() method does not fix the missing global/static gates; implementations remain responsible for their own sink-specific filtering.

Test with an isolated logger and global maximum Error: an Info record must be suppressed while an Error record is delivered. Restore global state and coordinate all tests sharing it. Cover compile-time filtering and both UniFFI configurations as appropriate. Verify the regression fails before the production fix and passes afterward. No patch or test execution accompanies this report.

This finding was discovered by Project Loupe.

Activity

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