filelock 4.1.1
- Source
- https://github.com/tox-dev/py-filelock
- Tag scanned
4.1.1- Compared with
4.1.0(1 signals introduced since)- Files
- 92 scanned, 9 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 2 warn · 14 info
- Scan time
- 15.4 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 16 of 16 warn and critical signals; 14 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-14 18:16
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
likely benign Embedded bash in a compose file that copies the repo to HOME and runs tox.
Reasoning
The snippet is a CI-style bash block in a compose file: cp a repo, pip install, then exec tox. The flagged variable is an escaped $$HOME, which compose renders as a plain $HOME, and the command names shown are literal. The flag looks like a scanner artifact, though a variable command name is worth a glance.
-
suspicious An audit hook re-applies the current profile function, keeping the probe hook installed.
Reasoning
Inside an audit hook, setprofile is re-applied to the current profile. This is unusual and worth reviewing because it keeps a profile hook alive. In context it reads as a capability probe checking whether profile hooks persist, but the re-arming via addaudithook is the odd part.
-
return =likely benign Records the caller frame when a lock is being released.Reasoning
inspect.currentframe is stored on the lock state to record the releasing caller for logging and reentrancy tracking. This is a standard debugging aid in a file-locking library.
-
= 0 =likely benign Records the caller frame when a lock acquisition begins.Reasoning
The acquiring caller frame is stored on the context for diagnostics during lock acquisition. This is routine in a locking library and has no network, exec, or exfiltration behavior.
-
return False = =likely benign Walks the call stack to find a specific caller frame.Reasoning
The code walks the f_back chain to locate an enclosing frame, which is a normal way to find a caller in library code. Nothing in the snippet is harmful.
-
: =likely benign Installs a temporary profile hook that injects an interrupt, then restores the previous profile.Reasoning
In a tasks/ helper, sys.setprofile installs an interrupt-injecting profile function around a context, restoring the previous profile afterwards. This fits a test harness for interrupt safety. The try/finally restore is consistent with test tooling, not persistence.
-
returnlikely benign Restores the previous profile function after the interrupt probe.Reasoning
This is the finally block restoring the previous profile function after the probe. It is cleanup for the temporary interrupt hook and carries no malicious signal.
-
return Falselikely benign Probe that tests whether setting the profile function raises RuntimeError.Reasoning
This is a probe that checks whether setprofile can be set and returns False on RuntimeError. It appears to test whether the interpreter supports the hook in the current context. Like the neighbouring finding, it's test tooling, but the audit-hook interplay merits a look.
-
: =likely benign Test installs a profile hook to inject an interrupt during lock release.Reasoning
In a test, a profile function is installed to interrupt at a chosen point during lock release, then removed in a finally block. This is a standard way to test interrupt-safety in a locking library.
-
return Falselikely benign Clears the test's profile hook in a finally block.Reasoning
This finally block clears the profile function after the test. It is test cleanup with no malicious intent.
-
assert is Nonelikely benign Test installs a profile hook to pause claim creation for a race-condition check.Reasoning
A test installs a profile hook to pause during claim creation so a concurrent reader can observe state. This is a deterministic concurrency test and does not indicate malicious behaviour.
-
: =likely benign Removes the test's profile hook after the race check.Reasoning
This finally block removes the test's profile hook. It is cleanup in a concurrency test.
-
= . + 1likely benign Test reads the current line number via sys._getframe to assert a warning location.Reasoning
sys._getframe().f_lineno is used in a test to capture the expected warning line number. This is a common testing technique with no security relevance.
-
= = . + 1 = 10likely benign Test code uses sys._getframe().f_lineno to record the line where a lifetime warning is expected to be emitted.Reasoning
sys._getframe() is used in a test to capture the current line number so the test can assert that a deprecation/soft lifetime warning points at the correct source line. This is a legitimate testing technique for verifying warning locations, not obfuscation or malicious behavior.
-
= . + 1likely benign Test captures the expected warning line number via sys._getframe() before a constructor call that triggers a lifetime warning.Reasoning
Same pattern as the other finding: a test records the expected warning line via sys._getframe().f_lineno before calling the constructor with lifetime=10, to verify warnings.warn stacklevel behavior. Benign test scaffolding.
-
= = . + 1 = 10likely benign Test records the expected line of a lock.lifetime assignment via sys._getframe() to validate the emitted warning location.Reasoning
Identical pattern in the attribute-assignment branch: sys._getframe() records the line of the upcoming lock.lifetime assignment so the test can check the warning location. Legitimate test technique with no malicious indicators.
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.
&&