filelock 4.1.2
- Source
- https://github.com/tox-dev/py-filelock
- Tag scanned
4.1.2- Compared with
4.1.1(0 signals introduced since)- Files
- 92 scanned, 9 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 16 info
- Scan time
- 11.8 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 16 of 16 warn and critical signals; 16 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-16 09:58
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
likely benign A compose.yaml embedded bash snippet copies the repo into $HOME, installs it, and runs tox tests.
Reasoning
The flagged command is a shell pipeline inside a compose file that copies the repo, runs pip install, and runs tox. The `$$` is compose escaping for a shell variable, not a dynamic command name. Nothing here fetches remote code or hides a payload, though a reviewer should confirm the env overrides and the copy destination are intended.
-
return =likely benign Stores the current stack frame on release state for lock bookkeeping and logging.Reasoning
filelock uses inspect.currentframe() to record which frame is releasing the lock for diagnostics and reentrancy tracking. This is a standard, legitimate use in a locking library.
-
= 0 =likely benign Records the acquiring call frame on the lock context during acquire.Reasoning
Recording the acquiring frame in the lock context supports reentrancy and debug logging in filelock. There is no network, exec, or data exfiltration in the snippet.
-
return False = =likely benign Walks the call stack to find a caller frame matching a given frame.Reasoning
Walking f_back from currentframe to locate a target frame is a common caller-detection technique used for lock ownership or logging. It is read-only introspection.
-
: =likely benign Temporarily installs a profiling hook to inject an interrupt during a probe, then restores the old profile.Reasoning
This appears to be a test-harness helper that installs a temporary profile hook to inject an interrupt at a precise point and restores the previous profile in a finally block. That fits testing interrupt safety in a locking library. The hook only raises during controlled probes.
-
returnlikely benign Restores the previous profile function after the interrupt probe.Reasoning
This is the restore step in the finally block of the same probe, reinstating the previously saved profile function. It is cleanup, not an attack.
-
likely benign An audit hook re-applies the current profile function as part of a capability probe.
Reasoning
Re-installing the profile hook from an audit hook is unusual and could be a persistence-style pattern. In this file, though, it looks like a capability probe that checks whether profile hooks survive reinstall, which fits the surrounding interrupt-testing logic. No exec, network, or file write is shown.
-
return Falselikely benign Feature-detects whether setting the profile function is permitted at runtime.Reasoning
This is a try/except around setting the profile to test whether the runtime allows it, returning False on RuntimeError. It is a feature-detection check with no malicious behavior visible.
-
: =likely benign Test sets a profile hook to simulate an interrupt during lock release.Reasoning
Within a test, a profile hook injects an interrupt during lock.release() to verify the lock handles KeyboardInterrupt. The try/finally restore is typical of such tests.
-
return Falselikely benign Clears the profile hook after an interrupt-injection test.Reasoning
This resets the profile hook to None in a finally block after the interrupt test. It is standard test cleanup.
-
assert is Nonelikely benign Test installs a profile hook to pause claim creation for a concurrency check.Reasoning
The test installs a profile hook to pause during claim creation so a concurrent reader can observe intermediate state. This is a race-condition test pattern in a lock library.
-
: =likely benign Clears the profile hook after the lease concurrency test.Reasoning
This clears the profile hook in a finally block after the concurrency test. It is cleanup code with no risk.
-
= . + 1likely benign Reads the current line number to assert where a lifetime warning is emitted.Reasoning
sys._getframe().f_lineno is used to compute the expected warning line number in a test assertion. This is a common testing technique with no security impact.
-
= = . + 1 = 10likely benign Captures the current line number to verify a lifetime warning location.Reasoning
Same pattern as the other lifetime-warning test: the line number is captured to check warning location. Benign test code.
-
= . + 1likely benign Captures the current line number to verify a lifetime warning location.Reasoning
This is a repeat of the warning-line capture in a parametrized test. It is benign.
-
= = . + 1 = 10likely benign Captures the current line number to verify a lifetime warning location.Reasoning
Another line-number capture for warning assertions in the same test file. 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.
&&