filelock 4.2.4
- Source
- https://github.com/tox-dev/py-filelock
- Tag scanned
4.2.4- Compared with
4.2.3(0 signals introduced since)- Files
- 95 scanned, 9 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 23 info
- Scan time
- 17.6 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-20 11:14
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
likely benign A compose service that copies the repo to a work directory and runs tox tests on Python 3.14.
Reasoning
The snippet is a tox CI/test setup in a compose file: copy the repo, pip install, run tox with a Python version override. The flagged `$$` is Compose escaping for a shell variable ($HOME), not a dynamic command name. The command itself (cp, pip, tox) is ordinary build tooling, with no download, decode, or pipe-to-shell pattern.
-
= = returnlikely benign Lazy attribute resolution in the filelock package that caches looked-up names in module globals.Reasoning
This is a lazy module `__getattr__` pattern that resolves names such as AsyncFileLock and caches them into globals. It is a standard, well-understood way to implement lazy exports in a library, and the names come from the package's own classes.
-
return =likely benign Records the current frame on the lock state during release for logging purposes.Reasoning
The lock stores the current frame in state.releasing so debug logging can report the caller. This is diagnostic bookkeeping in a file-locking library, not a sign of malicious introspection.
-
= 0 = # Created once, so a directory that disappears while the acquisition waits fails it, not builds a secondlikely benign Records the current frame as the acquiring context during lock acquisition.Reasoning
Stores the current frame as the acquiring context so the acquisition logic can track its caller. This is ordinary internal state handling in a locking library.
-
return False = =likely benign Walks the call stack via currentframe and f_back to locate a specific frame.Reasoning
Walks the f_back chain to find a frame in the call stack, likely to detect whether a lock is held by a caller. This is a routine stack walk for reentrancy or ownership logic, with no network, exec, or hidden payload.
-
: =likely benign A probe that installs a temporary profile hook to test interrupt handling, restoring the previous hook afterward.Reasoning
This is a development task script that probes whether sys.setprofile can interrupt code, which matters for KeyboardInterrupt safety in the lock. It saves and restores the previous profiler, and it has no exfiltration or persistence behavior.
-
returnlikely benign Restores the previous profile hook in a finally block after a capability probe.Reasoning
This is the restore step in a finally block that resets the profiler set earlier. It is paired cleanup for the probe above.
-
likely benign Re-sets the profile hook from within an audit hook as part of a capability probe.
Reasoning
Inside an audit hook used for a capability test, the code re-applies the current profile hook to check whether re-entrant setprofile calls are handled. This is a test of interpreter behavior, not a stealthy hook that intercepts user data.
-
return Falselikely benign Checks whether setprofile is usable here, returning False on RuntimeError.Reasoning
A probe for whether sys.setprofile can be called in the current context, with RuntimeError caught to return False. It is a capability check with no malicious side effects.
-
likely benign Test-only profile hook that exercises singleton cache behavior during AsyncFileLock construction.
Reasoning
A test installs a profile hook to force a cache-related race in AsyncFileLock singleton creation, then clears it. This is concurrency test instrumentation in a locking library's test suite.
-
likely benign Clears the profile hook in a finally block after an async lock test.
Reasoning
Clears the test's profile hook in a finally block after the race test, which is standard test cleanup.
-
likely benign Test-only profile hook that exercises FileLock singleton cache behavior.
Reasoning
Same pattern as the async test: a test-only profile hook forces a singleton cache race while constructing FileLock. It is test instrumentation with no external effects.
-
returnlikely benign Clears the profile hook after a FileLock singleton test.Reasoning
Clears the test profile hook in a finally block. This is standard cleanup for a test.
-
: =likely benign Test profile hook that injects interrupts to check lock robustness.Reasoning
A test installs an interrupt-injecting profile hook to verify that the lock handles KeyboardInterrupt during operations. This is a robustness test in a locking library.
-
return Falselikely benign Clears the interrupt profile hook after a robustness test.Reasoning
Clears the interrupt-injecting profile hook in a finally block, which is standard test cleanup.
-
dellikely benign Test profile hook that inspects lock lookups while a lock is closing.Reasoning
A test sets a profile hook that looks up locks during close, to check reentrancy in the read/write lock. This is targeted concurrency testing in a locking library.
-
likely benign Clears the profile hook after a read/write lock unit test.
Reasoning
Clears the test profile hook in a finally block, which is standard test cleanup.
-
assert is Nonelikely benign Test code installs a profile hook to inject a pause while checking lease compromise state under concurrency.Reasoning
sys.setprofile is used in a test to pause a reader thread at a chosen point inside claim creation, so the test can check the compromise state during a race. Test-harness instrumentation like this is a legitimate pattern, and the snippet shows no exfiltration or hidden execution.
-
: =likely benign Test code clears the profile hook it installed earlier, in a finally block.Reasoning
The matching sys.setprofile(None) in the finally block removes the test's profile hook after the reader runs. This is cleanup for the same concurrency test and is not malicious.
-
= . + 1likely benign Test records its own line number with sys._getframe to verify warning location.Reasoning
sys._getframe().f_lineno is used to record the current line so the test can assert that a lifetime warning points at the correct source line. This is a common test technique and does not touch anything sensitive.
-
= = . + 1 = 10likely benign Test uses sys._getframe to compute the expected warning line number.Reasoning
Same pattern as the other findings: the frame's line number is captured to compute the expected warning line in a test assertion. No dynamic execution or evasion is involved.
-
= . + 1likely benign Test reads the current frame line number to check the lifetime warning location.Reasoning
This is a repeated test case that captures the current line via sys._getframe to assert the warning location for the constructor entry point. It is benign test scaffolding.
-
= = . + 1 = 10likely benign Test captures its own line number via sys._getframe for warning-location assertions.Reasoning
Same benign test pattern: sys._getframe().f_lineno supplies the expected line for an assertion on a lifetime warning. Nothing in the snippet indicates obfuscation or malicious intent.
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.
&&