cffi 2.1.1
- Source
- https://github.com/python-cffi/cffi
- Tag scanned
v2.1.1- Compared with
v2.1.0(0 signals introduced since)- Files
- 201 scanned, 19 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 31 info
- Scan time
- 23.1 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 31 of 31 warn and critical signals; 31 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-14 18:09
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
=likely benign Copies C library symbols into the module globals by name.Reasoning
This is cffi's standard pattern for exposing C library symbols as module attributes by name. The names come from the library's own header, not untrusted input.
-
= =likely benign Assigns parsed curses constant names into module globals.Reasoning
Same cffi binding-setup idiom: key names parsed from the curses header are assigned into module globals. No external input or hidden execution is involved.
-
= =likely benign Sets ACS character constants on the module from the C library map.Reasoning
Populates ACS line-drawing constants from lib.acs_map into globals, a routine binding-generation pattern for a fixed C library.
-
=likely benign Aliases one curses constant name to another via globals.Reasoning
Aliases one module global to another by name, a benign reshuffling of constants generated from the C header.
-
=likely benign Reads a module global by computed name during constant aliasing.Reasoning
Reads a global by a computed key within the same constant-aliasing logic. No hidden payload or external input is involved.
-
=likely benign Imports a generated fastcsv extension module chosen by dialect name.Reasoning
Dynamic __import__ builds a module name from a fixed prefix and a dialect name. That is a cffi demo loading its own compiled extension, but the name is not validated, so it is worth a minor note.
-
= , = , #likely benign Imports the generated fastcsv extension after building its FFI.Reasoning
Same dynamic import of the generated _fastcsv_ extension after building the FFI from the dialect. Consistent with the demo's build flow.
-
# PKG_CONFIG_PATH = $(brew --prefix libffi)/lib/pkgconfig = =likely benign Queries brew for the libffi prefix during setup.Reasoning
Runs a fixed shell command to locate libffi for pkg-config during build setup. The command is a literal with no interpolated input.
-
; /* clear error condition */ funcptr = ; iflikely benign Resolves a function symbol from a dlopen handle by name.Reasoning
dlsym with a caller-supplied name is the normal FFI mechanism for resolving functions in a loaded library. It is the core purpose of the backend, not hidden behavior.
-
; /* clear error condition */ data = ; iflikely benign Resolves a global variable symbol from a loaded library.Reasoning
dlsym resolving a variable name in a loaded library is the expected behavior of cffi's dlopen support.
-
; /* clear error condition */ data = ; iflikely benign Resolves another variable symbol from a loaded library.Reasoning
Same expected dlsym lookup of a variable symbol in a dlopen'd library, with error handling around it.
-
handle = ; ;likely benign Opens a shared library at a caller-specified path.Reasoning
dlopen on a user-supplied path is the advertised purpose of ffi.dlopen, a library loader for FFI users. It is not covert.
-
; /* clear error condition */ address = ; iflikely benign Looks up a named symbol in an opened shared library.Reasoning
dlsym of a symbol name inside cdlopen's library-loading path is standard FFI functionality with error checks.
-
return =likely benign Test helper evals a constructed unicode literal string.Reasoning
eval on a repr-derived string is in a test helper that converts Python 2 unicode literal forms. The input is controlled by the test, so this is not an exploitable path.
-
=likely benign exec of compiled cffi-generated source into a globals dict.Reasoning
This is cffi's generator helper compiling and executing its own generated Python source in a namespace. Dynamic exec is the library's core mechanism, and the snippet shows no obfuscation or external payload.
-
# # =likely benign Syntax-check compile of cffi embedding init source.Reasoning
The compile call only checks generated embedding source for syntax (filename 'cffi_init'), and the result is stored as _embedding. This is a legitimate validation step in the cffi API.
-
=dismissed Builds a flags dict from fixed constant names via globals().Reasoning
Reading module flags by name from globals() over a fixed list of F_* constants is a plain, bounded lookup. Nothing here is attacker-controlled.
-
= =likely benign eval of internal flag expression in the recompiler.Reasoning
eval of self.flags with a restricted G_FLAGS namespace in cffi's code generator. The flags are internal integer-expression strings produced by the library, so this is routine.
-
+= # Python 2.6 compatibility =likely benign compile of build helper source in setuptools_ext.Reasoning
Compiles and execs the setuptools helper's own source (with a Python 2.6 compatibility comment) to load a build-time module. This is ordinary build tooling inside the cffi package.
-
=likely benign exec of the compiled build helper source.Reasoning
Same pattern as the preceding compile: executing the helper module's own source during the build. The snippet shows no decoding, network access, or external input.
-
= return # cannot import the package itself, give uplikely benign Dynamic import of cffi's extension package with ImportError fallback.Reasoning
Dynamic __import__ of self.ext_package, wrapped in an ImportError handler, is the standard way cffi locates its generated extension package. The name comes from the library's own configuration.
-
return = .. returnlikely benign Frame introspection to find the caller's directory for __pycache__.Reasoning
Reads the caller's filename via sys._getframe(2) to locate a __pycache__ directory. This is a common, benign path-resolution idiom.
-
= f =likely benign Test fixture invoking the MSVC compiler through the shell.Reasoning
This is a test fixture that builds a DLL with cl.exe via shell=True. The command interpolates a vcvarsall path and architecture from the test environment, not untrusted input. It is a shell call, but within a test harness.
-
=likely benign Test fixture compiling a unicode-named shared library via shell.Reasoning
Test fixture compiling a shared library with cc, using a name derived from the test's unicode filename. shell=True with interpolated test paths is poor hygiene, but the input is test-controlled and the code is benign.
-
assert == 0 assert == assert == assert ==likely benign Test evaluates a C integer literal to compare against a cffi enum value.Reasoning
eval is applied to a hidden_value string from the test after stripping U and L integer suffixes. It is a test-only computation of an expected constant, not runtime attacker input.
-
= # for _cffi_backend on pypy continuelikely benign Test-time dynamic import of listed cffi modules.Reasoning
Dynamic import of a list of module names in an integration test, with a __file__ check for PyPy. This is ordinary test scaffolding.
-
=likely benign Test helper shelling out to objdump on the cffi backend library to list dynamic symbols.Reasoning
os.popen is called with a command built from the cffi backend's __file__ path inside a test that runs objdump to inspect exported symbols. The interpolated value is a local module path, not attacker-controlled input, and the test is linux-only. This is ordinary test tooling.
-
likely benign Test module that execs a companion test script's source at import time.
Reasoning
This is a test that compiles and executes a dlopen test source file read from the repository. The exec is a standard pattern for running generated or companion test code, and the file is part of the project's own test suite. The flag is a generic AST match on exec, without evidence of hostile input.
-
likely benign compile() of a test fixture source string, paired with the exec above.
Reasoning
This is the compile call feeding the exec above. The source string s is a project test fixture, and the filename is a fixed literal. Same benign test-harness pattern as the paired exec finding.
-
assert == 0 assert == assert ==likely benign Test evaluating a C-literal integer string to compare against a compiled constant.Reasoning
eval is applied to a hidden_value string from the test, with 'U' and 'L' suffixes stripped so C integer literals become Python ints. This is a test computing an expected constant from C-style literals. The input is test-controlled, not external.
-
return =likely benign Test support helper using eval to build a unicode literal from repr output for Python 2/3 compatibility.Reasoning
eval is applied to a string built from repr() of a value with replacements to produce unicode escapes. This is a known idiom for constructing unicode literals in a Python 2/3 compatibility test helper. The input is a test-generated value, not untrusted data.
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.
&&