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
- 25.4 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 31 of 31 warn and critical signals; 31 demoted to info.
- Disclude version
- 4.1.0
- Scanned (UTC)
- 2026-10-21 20:26
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
=likely benign Helper that exposes ncurses library symbols as module-level names via globals().Reasoning
Copies curses library symbols into module globals by name, a common binding pattern for a C-binding wrapper. The name comes from the library's own symbol list, not untrusted input.
-
= =likely benign Loop that exports parsed curses key constants into module globals.Reasoning
Assigns parsed constant names into globals() while setting up the curses binding. This is a standard dynamic-export pattern in cffi-generated wrapper code.
-
= =likely benign Populates ACS line-drawing constants in the curses demo module via globals().Reasoning
Maps ACS character names to library values through globals(). It is internal binding setup with no external input or network activity.
-
=likely benign Copies an existing global constant to another name in the curses demo.Reasoning
Aliases one global name to another already defined in the module. This is ordinary wrapper setup code.
-
=likely benign Reads an existing module global to assign to another name in the curses demo.Reasoning
Same globals() aliasing expression as the adjacent finding, reporting the read side. It is benign module setup.
-
=likely benign Dynamic import of a per-dialect cffi-generated fastcsv extension module.Reasoning
Imports a generated extension module whose name is a fixed prefix plus the dialect name. The import is wrapped in a fallback that builds the module on demand. The dialect is a developer-chosen identifier, so this is a plugin-loading pattern rather than a dropper, though the non-literal argument is worth noting.
-
= , = , #likely benign Second __import__ of the generated fastcsv dialect module after building it.Reasoning
Retry import of the same generated module after the fallback builds it. The surrounding code is ordinary build-on-demand logic for a demo.
-
# PKG_CONFIG_PATH = $(brew --prefix libffi)/lib/pkgconfig = =likely benign Build-time call to Homebrew to find the libffi installation prefix.Reasoning
Runs a fixed literal command, brew --prefix libffi, to locate the libffi pkg-config path during macOS build setup. Nothing from the environment is interpolated into the command.
-
; /* clear error condition */ funcptr = ; iflikely benign Looks up a function symbol by name in a dynamically loaded library for cffi.Reasoning
dlsym with a caller-supplied symbol name is the core purpose of cffi's ffi.dlopen-based symbol lookup, and the code checks for NULL and clears errors correctly.
-
; /* clear error condition */ data = ; iflikely benign Resolves a named data symbol from a dynamically loaded library.Reasoning
dlsym for a named variable is the expected cffi mechanism for accessing library globals. It is not hidden or obfuscated.
-
; /* clear error condition */ data = ; iflikely benign Second dlsym call resolving a named variable from a loaded library.Reasoning
Same variable-symbol lookup pattern as the neighboring finding, with standard error handling. This is expected FFI functionality.
-
handle = ; ;likely benign Opens a shared library at a caller-specified path for cffi.Reasoning
dlopen with a path supplied by the user is the designed behavior of cffi's dlopen. The path is handled and freed properly, so it is not a hidden loader.
-
; /* clear error condition */ address = ; iflikely benign Symbol lookup in cffi's cdlopen implementation.Reasoning
dlsym of a caller-supplied symbol in the cdlopen helper is the normal foreign-function interface mechanism, with NULL checking and dlerror handling.
-
return =likely benign Test helper that evaluates a repr-derived unicode literal to exercise escape handling.Reasoning
Eval rebuilds a unicode literal from repr output inside a test helper to check unicode escape handling. Input is a test value, not attacker-controlled data, so this is test scaffolding.
-
=likely benign Executes cffi-generated Python source during code generation.Reasoning
Compiles and execs generated source at build or codegen time, which is how cffi builds its modules. The source comes from the project's own code generator.
-
# # =likely benign Compiles the generated embedding initialization source in cffi's API.Reasoning
Compiles embedding init source produced by cffi's embedding API. It only checks syntax and stores the source, with no execution of untrusted content.
-
=likely benign Collects cffi opcode flag constants into a dictionary through globals() lookups.Reasoning
Builds a flag dictionary from a fixed list of module-level constant names via globals(). This is a plain constants-lookup idiom with no hidden behavior.
-
= =likely benign eval of a flags expression inside cffi's recompiler when rendering field expressions.Reasoning
eval runs over self.flags with a fixed G_FLAGS namespace while generating Python expressions for cffi's own declarations. This is internal code-generation logic, not attacker-controlled input.
-
+= # Python 2.6 compatibility =likely benign compile and exec of build-script source inside cffi's setuptools extension loader.Reasoning
The source is read from a generated or build-time file and compiled and exec'd into a module namespace. This is the standard way setuptools helpers load cffi build scripts. The surrounding code shows no network fetch or encoded payload.
-
=likely benign exec of compiled build-script code within cffi's setuptools extension.Reasoning
This is the exec half of the same compile-and-run pattern for loading a Python file into a namespace. Context shows it is a build helper, not a dropper.
-
= return # cannot import the package itself, give uplikely benign Dynamic import of cffi's own generated extension package in the verifier.Reasoning
__import__ loads the package cffi itself generated (self.ext_package), and the ImportError branch simply gives up. Dynamic import of a known local extension module is expected here.
-
return = .. returnlikely benign Caller-frame lookup to compute a __pycache__ path for generated modules.Reasoning
sys._getframe(2) is used to find the caller's file location so a __pycache__ directory can be placed next to it. This is a known idiom and does not hide behavior.
-
= f =likely benign Test helper that shells out to MSVC to build a test DLL.Reasoning
This is a Windows test fixture that runs the MSVC compiler via shell=True. The command is built from the vcvarsall path and architecture, and it compiles a local test C file. It is test scaffolding, not an attack.
-
=likely benign Test helper that shells out to cc to build a test shared library.Reasoning
The shell command compiles a local test C source into a shared library. The only interpolated value is a test-provided encoded filename, so the risk is limited to the test environment.
-
assert == 0 assert == assert == assert ==likely benign eval of a test constant to check enum value handling.Reasoning
eval runs a hidden_value string from a C-level test with 'U' and 'L' suffixes stripped. This is a fixed constant check for enum values in a test file.
-
= # for _cffi_backend on pypy continuelikely benign Dynamic import of a fixed list of cffi modules in an integration test.Reasoning
__import__ iterates over a fixed list of cffi module names to check their presence in the test suite. This is a standard test pattern.
-
=likely benign Test that inspects the cffi backend's exported symbols with objdump.Reasoning
os.popen runs objdump on the cffi backend's own __file__ path to check exported symbols. It is a Linux-only test with no external input.
-
likely benign Module-level exec of test source compiled with unicode literals.
Reasoning
A module-level exec of compiled source is unusual, but the snippet fits a unicode-literals test that runs a bundled test script. The source comes from the test file itself, not from an external or obfuscated source. Some residual doubt remains because the origin of s is not shown.
-
likely benign Module-level compile of the test_dlopen source for unicode-literal testing.
Reasoning
This is the compile half of the same module-level exec. It runs test source named test_dlopen.py, which matches the test's purpose.
-
assert == 0 assert == assert ==likely benign eval of a test constant to validate enum sizes in a verify test.Reasoning
This is the same enum-value eval in the cffi1 verify test, applied to a fixed hidden_value constant with suffixes removed. It is a test assertion.
-
return =likely benign Test-support helper that uses eval to create a Python 2/3 compatible unicode literal.Reasoning
eval builds a unicode literal from repr() output to emulate u'' literals on older Pythons. The input is a fixed test helper value, so the constructed string has no hostile source.
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.
&&