filelock 4.2.1
- Source
- https://github.com/tox-dev/py-filelock
- Tag scanned
4.2.1- Compared with
4.2.0(6 signals introduced since)- Files
- 95 scanned, 9 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 23 info
- Scan time
- 14.3 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 23 of 23 warn and critical signals; 23 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-18 09:41
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
info
warn→ info by reviewframe-introspectiontests/test_async_filelock.py:1524:5new in this releaselikely benign Test installs a profiler hook to exercise a singleton cache race.Reasoning
A test installs a profile hook to force a cache-path race in singleton creation and then restores it in finally. This is standard test instrumentation.
-
info
warn→ info by reviewframe-introspectiontests/test_async_filelock.py:1528:9new in this releaselikely benign Clears the test profiler hook in cleanup.Reasoning
Clearing the profile hook in a finally block is test cleanup.
-
likely benign Test installs a profiler hook to exercise a singleton cache race.
Reasoning
Same singleton race test instrumentation as the async variant, installing a profile hook and cleaning up afterwards.
-
returnlikely benign Clears the test profiler hook in cleanup.Reasoning
Resetting the profile hook in finally is test cleanup.
-
info
warn→ info by reviewframe-introspectiontests/test_read_write_unit.py:861:5new in this releasedellikely benign Test profiler hook used during lock close in a read/write unit test.Reasoning
A read/write lock unit test uses a profile hook to look up lock state while closing, then the test proceeds. This is ordinary test instrumentation.
-
info
warn→ info by reviewframe-introspectiontests/test_read_write_unit.py:865:9new in this releaselikely benign Clears the test profiler hook in cleanup.Reasoning
Clearing the profile hook in finally is test cleanup.
-
likely benign A compose healthcheck or command runs a copy, pip install, and tox invocation inside a shell.
Reasoning
A compose file embeds a bash command where the command name is an environment-variable expansion, but the rest is a plain copy, pip install, and tox run with ordinary arguments. The variable use appears to be a template placeholder rather than an obfuscated payload, though the dynamic command name is worth a note.
-
= = returnlikely benign Lazy attribute resolution in filelock's package init that caches looked-up objects in globals.Reasoning
This is a module-level __getattr__ pattern that resolves names lazily via getattr and caches them in globals(). It is a standard lazy-import idiom in Python libraries and does not indicate malicious intent.
-
return =likely benign Stores the current stack frame on the lock state during release.Reasoning
inspect.currentframe is used to record the releasing caller for reentrancy and debugging in a file-lock library. This is ordinary library bookkeeping.
-
= 0 = # Created once, so a directory that disappears while the acquisition waits fails it, not builds a secondlikely benign Records the acquiring frame on the lock context.Reasoning
Storing the current frame as the acquiring context in a file-lock acquire path is ordinary internal state tracking.
-
return False = =likely benign Walks the call stack to locate a target frame.Reasoning
Walking f_back from the current frame to find a caller frame is a common helper for locating the calling frame in a library.
-
: =likely benign Installs a temporary profile hook to probe interruption behavior and restores the previous profiler.Reasoning
This is a development task that probes whether a profiler hook can interrupt execution, using sys.setprofile with a try/finally restore. It is test-capability tooling in a project's tasks directory, not an attack.
-
returnlikely benign Restores the previous profiler in a finally block.Reasoning
The finally block restores the previous profile function, which is the expected cleanup for the temporary hook above.
-
likely benign Audit hook that re-applies the profile function within a capability probe.
Reasoning
An audit hook re-installs the profile function to keep it set during nested calls. This is an unusual but self-contained capability probe in a test-tooling file, with no network, exec, or exfiltration behavior.
-
return Falselikely benign Probes whether setting the profile function is allowed, returning False on RuntimeError.Reasoning
A capability check calls sys.setprofile with the current profile to see whether it is permitted, catching RuntimeError. This is probing code, not malicious.
-
: =likely benign Test profiler hook used to interrupt an operation during a lock test.Reasoning
A test installs a profile hook to interrupt an operation at specific frames, checking reentrancy behavior. This is standard test instrumentation.
-
return Falselikely benign Clears the test profiler hook in cleanup.Reasoning
Clearing the profile hook in finally is test cleanup.
-
assert is Nonelikely benign Installs a profile hook in a test to pause a thread at a chosen point while checking lease compromise state.Reasoning
The sys.setprofile call installs a profiler hook that pauses a thread during lease claim creation, a deterministic way to force a race in a concurrency test. The file is a test module for a lock library, and the hook is cleared in a finally block. This is test scaffolding, not malicious introspection.
-
: =likely benign Clears the profile hook after the compromise-check test runs.Reasoning
This is the matching cleanup of the setprofile hook in a finally block, restoring the default after the reader thread runs. Nothing here exfiltrates data or runs remote code. It is standard test teardown.
-
= . + 1likely benign Reads the current line number in a test to verify where a lifetime warning is reported.Reasoning
sys._getframe().f_lineno is used to record the source line where a lifetime warning should be emitted, so the test can assert the warning points at the correct caller line. This is a common technique for checking warnings.warn stacklevel behavior in a test, not evasion.
-
= = . + 1 = 10likely benign Captures the current line number so the test can check the lifetime-setter warning location.Reasoning
Same pattern as the other frame lookup: the test captures the line number before setting the lifetime attribute so it can assert the warning location. Benign test code.
-
= . + 1likely benign Records the expected warning line for the constructor entry-point test.Reasoning
Duplicate of the constructor-path warning-line capture in a parametrized test. It uses frame introspection only to compute an expected line number. Benign.
-
= = . + 1 = 10likely benign Records the expected warning line for the lifetime-attribute entry-point test.Reasoning
Duplicate of the attribute-setter warning-line capture in the same parametrized test. Frame introspection here only supports an assertion on the warning's source location. Benign.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&